title: How do I create my own haar cascade and apply it?
body: <p>I am interested in creating my own haar cascade xml file, for use with python, to detect a certain logo (let's say it's the apple logo).</p>
  
  <p>I have tried following the instructions at 
  <a href="http://docs.opencv.org/trunk/doc/user_guide/ug_traincascade.html">http://docs.opencv.org/trunk/doc/user_guide/ug_traincascade.html</a>
  and 
  <a href="http://note.sonots.com/SciSoftware/haartraining.html">http://note.sonots.com/SciSoftware/haartraining.html</a></p>
  
  <p>Problem is, although I get a valid functioning cascade file, it does not detect anything.
  specifically, when I try to detect the object inside the original image used to create it, it is not detected even then.</p>
  
  <p>I already tried resizing the image, or simply putting it in a larger context by inserting it in a picture.</p>
  
  <p>what am I doing wrong?</p>
  
  <p>at shell, I run:</p>
  
  <pre><code>opencv_createsamples -img original.jpg -bg negatives.dat -vec samples_set.vec  -w 48 -h 48
  
  opencv_traincascade -bg negatives.dat -data mycascade -vec samples_set.vec -w 48 -h 48
  </code></pre>
  
  <p>which seems to work fine, creating a cascade file.
  Then, in python:</p>
  
  <pre><code>import cv2
  cascade2 = cv2.CascadeClassifier('mycascade.xml')
  cv2Image = cv2.imread('original.jpg')
  cascade2.detectMultiScale(cv2Image)
  </code></pre>
  
  <p>and the detection comes up empty. I did try to test with a "standard" xml that comes with python and it works, so something is wrong with mine.</p>