Pattern Recognition Using OpenCV

I am trying to detect a pattern on an object on a green field, consisting of three colors (two pink markers on the sides and blue in the middle), arranged like a traffic light.

At first I tried to convert the images from the webcam to the hsv color space and highlight the color with cvInRangeS, but this became problematic as the light changes in the room during the day when I either get false positives or lose track of objects.

Then I tried SURF by changing find_obj.cpp, the problem is that opencv can only detect 2 surfing points on my marker, which is not enough to find it from the code that I think I need at least 4, I tried playing with surf params, but that hasn’t changed anything.

While googling I came across this,

http://wiki.elphel.com/index.php?title=OpenCV_Tennis_balls_recognizing_tutorial&redirect=no

which says that I can also use machine learning to select a range of colors that interests me, but I could not find any information on how to do this.

My question is: is there anything in OpenCV that would allow me to detect the marker?

EDIT: Another question about trying to train the hara, my background will always be the same colored surface using the same marker for the object, can I train a classifier with 20 positive 20 negative images or do I still need thousands of images to recognize it?

+7
source share
1 answer

I would advise you check out Sherwin’s blob detection tutorial using colors
http://www.shervinemami.info/blobs.html

EDIT

Try retinex at night to improve results.

http://www.ipol.im/pub/algo/lmps_retinex_poisson_equation/

+4
source

All Articles