9
votes

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

At first I tried converting the images from the webcam to hsv color space and isolate the color using cvInRangeS but that became problematic as the light changes in the room during the day I either get false positives or lose track of objects.

Then I tried SURF by modifying find_obj.cpp, the problem with that was opencv can only detect 2 surf points on my marker which is not enough to locate it from the code it seems I need at least 4, I tried playing with surf params but that did not change anything.

Also while googling I came across this,

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

which says I can also use machine learning to pick the color range I am interested in but I could not find any info on how to do that.

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

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

1
Have you got a bunch of sample images somewhere, and some code?macarthy
Sample images are a must for questions like this indeed. It sounds like it's easy, but you'd need to see the images (including your failure cases) to say something.etarion

1 Answers

5
votes

I'd suggest you check out Shervin's tutorial on blob detection, using colors
http://www.shervinemami.info/blobs.html

EDIT

You night try retinex to help improve results

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