Tuesday, July 21, 2015

Computer Vision and Chocolate Packaging

A video camera has been installed at a known height above a production line of chocolates.

There are only 3 types of chocolates;

  • Heart Shape
  • Round Shape
  • Square Shape


By determining the type of chocolates, robotic arm can pick it up and place the chocolate in the relevant position in the chocolate box.

So here we are going to implement a computer vision system to solve this packaging problem. But before moving on, let's see a real environment of chocolate packaging.



Okay!! To recognize the shape of the chocolate in the production line we are using contours.
Here is what our camera has captured. After taking all the chocolates in this current tray, belt is move forward to capture the next set.



So our first step should be prepare our image suitable to find the contours. To do that we do the following steps.


  1. Load the image.
  2. Convert to Gray-scale
  3. Detect Edges (use Canny Operator)

Grey-Scale Image






Edge Detected Image


Now our image is ready for finding the contours. By using these contour points, we can easily find the polygons which covered by these contours. By identifying the center of the polygon, we can easily move our robotic arm to attach the chocolate into its arm.



Next thing is to identify the type of the chocolate.
There are only three types and each type have its specific attributes.

Polygons of the Shapes


For example square has only four sides. So the polygon which covered by the square shape has only four sides. If we reduce the smoothness in the circular polygon, it will have a specific number of sides. In our case we reduce into 8 sides. As heart shape is not a convex object, polygon obtain for it would not be the same everytime. Anyway it would not be a much problem, because we can take all the shapes apart from the circle and square as heart shape.


Detected Shapes

At the end we can obtain our log report as this.


No comments:

Post a Comment