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:
- Threshold the image using an upper and lower bound interval of the green color.
- Filter the image if necessary.
- Calculate the contours of the elements in the image and then retrieve the contour with the maximum area.
- Calculate the moments of the largest contour.
- 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:
- Extract the contours of the image using the Canny algorithm with a threshold of 170 and 200.
- Traverse the extracted contours, where each contour is approximated to a polygon.
- Check if the extracted shape corresponds to a rectangle (convexity and number of sides).
- Check if the extracted shape corresponds to a rectangle (convexity and number of sides).
- Draw the bounding box.
Link to source code