I'm trying to write a script in python to detect and count objects inside an image, but I'm failing miserably.
It is the first time I get interested and try something by means of computer vision. I have tried using cv2 module (open cv) following the tutorials about Feature Matching and Template Matching present here. I have also tried with scikit-image but I cannot achieve a good result either. I have also thought about finding contours and then making 2d-curve matching.
Let me explain a little bit more the problem. I have a set of icons which are the ones composing an big image. The composition of this image or scene is done by a plain background or an transparent one, and a number of images from the iconset. These images from the iconset can undergo basically 3 basic transformations: scale, rotation and translation. They can also be overlapped.
An quick example by means of Android version icons.
The output of the desired script will be something like:
C -> 1
D -> 1
E -> 1
F -> 1
G -> 1
H -> 2
I -> 3
J -> 0
I'm going to try now with Dlib and see if I can achieve something with machine learning algorithms. I think that I'm trying to solve my problem by something much more complex that actually needed. Any advice on how to do it will be great, I'm also open to any library for python.
PS: sorry for not publishing here the images but I do not have enough reputation yet.