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).
I have tried following the instructions at http://docs.opencv.org/trunk/doc/user_guide/ug_traincascade.html and http://note.sonots.com/SciSoftware/haartraining.html
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.
I already tried resizing the image, or simply putting it in a larger context by inserting it in a picture.
what am I doing wrong?
at shell, I run:
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
which seems to work fine, creating a cascade file. Then, in python:
import cv2
cascade2 = cv2.CascadeClassifier('mycascade.xml')
cv2Image = cv2.imread('original.jpg')
cascade2.detectMultiScale(cv2Image)
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.