Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 328
Hamza Yerlikaya Avatar asked Feb 19 '11 23:02

Hamza Yerlikaya


People also ask

What algorithm does OpenCV use for face recognition?

Various face detection algorithms are there but the Viola-Jones Algorithm is the oldest method that is also used today. Face detection is generally the first step towards many face-related applications like face recognition or face verification. But, face detection has very useful applications.

How can you do feature detection in OpenCV?

Feature detection is the process of checking the important features of the image in this case features of the image can be edges, corners, ridges, and blobs in the images. In OpenCV, there are a number of methods to detect the features of the image and each technique has its own perks and flaws.

Can OpenCV be used for object detection?

With the help of the OpenCV library, we can easily process the images as well as videos to identify the objects, faces or even handwriting of a human present in the file. We will only focus to object detection from images using OpenCV in this tutorial.

What is OpenCV template matching?

Template Matching is a method for searching and finding the location of a template image in a larger image. OpenCV comes with a function cv. matchTemplate() for this purpose.


1 Answers

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/

like image 51
macarthy Avatar answered Oct 12 '22 00:10

macarthy