Pizza maker

Used Algorithms :

Color Thresholding: If a green object is detected near the camera, the cursor moves according to the movement of the detected object. For this:

  1. Threshold the image using an upper and lower bound interval of the green color.
  2. Filter the image if necessary.
  3. Calculate the contours of the elements in the image and then retrieve the contour with the maximum area.
  4. Calculate the moments of the largest contour.
  5. Calculate the centroid of the contour from the moments.

Rectangle Detection using the Canny filter: If a nearby rectangle is detected, ingredients are spawned. For this:

  1. Extract the contours of the image using the Canny algorithm with a threshold of 170 and 200.
  2. Traverse the extracted contours, where each contour is approximated to a polygon.
  3. Check if the extracted shape corresponds to a rectangle (convexity and number of sides).
  4. Check if the extracted shape corresponds to a rectangle (convexity and number of sides).
  5. Draw the bounding box.
Link to source code