Computer Vision – Object counting.

This module tells us the number of objects in an image, there are some restrictions to consider, the first is that the image ideally has a white background, if it does not have this property it can use the different modules to transform the image with white background.

The main idea is based on working the image to the point where different algorithms can be applied depending on the case of each image. In our example that we give, it is simpler because the background is white and we are only counting coins that are kept in mind. the image, these are the objects to consider for the final count.

Depending on each image, it must be processed with more filters that can be used in this extension. The simple example of counting an image with coins is shown

below.

IMPORTANT NOTE: Always handle files with a .PNG extension and format since these retain greater definition and sharpness of the image. This point is essential since a frequent mistake is handling other formats such as .JPG where the image loses quality, clarity and information.

Consider the suggested steps.

Consider that your image should be processed to the degree where only by applying the Sobel algorithm the contours are well defined. We must arrive at an image where, after applying different filters, we can apply a transform to a binary-text file as indicated below.

.

The algorithm will only work when the contours of each object in the binary-text file are well defined.

IMPORTANT NOTE: Always handle files with a .PNG extension and format since these retain greater definition and sharpness of the image. This point is essential since a frequent mistake is handling other formats such as .JPG where the image loses quality, clarity and information. .