title: Pattern Recognition using OpenCV
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Also while googling I came across this,</p>
  
  <p><a href="http://wiki.elphel.com/index.php?title=OpenCV_Tennis_balls_recognizing_tutorial&amp;redirect=no" rel="noreferrer">http://wiki.elphel.com/index.php?title=OpenCV_Tennis_balls_recognizing_tutorial&amp;redirect=no</a></p>
  
  <p>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.</p>
  
  <p>My question is, is there anything in OpenCV that would allow me to detect the marker?</p>
  
  <p>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?</p>