Pattern Recognition using OpenCV

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?


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/

链接地址: http://www.djcxy.com/p/50936.html

上一篇: asp.net mvc

下一篇: 使用OpenCV进行模式识别