I can't find any information about Data used for training Haar classifiers in OpenCV. I want to know what kind of, how many and how(manually or via program) these classifiers were generated.
You can find these classifier's xml files in ..OpenCV2.3.1\opencv\data\haarcascades.. directory. Thanks
this research paper contains the answer
Empirical Analysis of Detection Cascades of Boosted Classifiers for Rapid Object
Detection by Dr Rainer Lienhart
thanks guys for the help...
Related
I have an application that needs to detect the faces and eyes within a given image. I am using the following XML cascades classifiers with OpenCv.
haarcascade_frontalface_default.xml
haarcascade_eye_tree_eyeglasses.xml
I have scenarios where the detection was less accurate and felt enriching the classifier with more localized data might help. My plan is to use the existing classifier against a large dataset of photos, detect the faces in them crop them and export it all to a folder. After which I can use it to train a new classifier. Same can be done for eyes classifier.
However, I have two questions:
Can we improve an existing classifier instead of creating new?
Does the above approach have any potential issues?
I am trying to train an adaboost classifier using the openCV library, for visual pedestrian detection.
I've come across the notion that adaboost allows the selection of the most relevant features, meaning, if I harvest 50.000 features from images and then use them to train a classifier, in the end of the training process I would be able to select, for example, the best 2000 out of those 50.000.
Then, this would allow me to harvest only those 2000 during the actual process for the sake of speed.
Is this even true? Or am I falling in a misconception?
If true,, is it possible to be done using the openCV library?
Best regards
Yes, this is true. That's exactly what boosting is all about.
Please, check the OpenCV documentation about training a cascade of boosted classifiers.
I am trying to use the OpenCV's cascade classifier based on Histogram of Oriented Objects (HOGs) feature type -- such as the paper "Fast Human Detection Using a Cascade of Histograms of Oriented Gradients".
Searching in the web, I found that the Cascade Classificator of OpenCV only supports HAAR/LBP feature type (OpenCV Cascade Classification).
Is there a way to use HOGs with the OpenCV cascade classifier? What
do you suggest?
Is there a patch or another library that I can use?
Thanks in advance!
EDIT 1
I've kept my search, when I finally found in android-opencv that there is a trunk in Cascade Classifier which allows it to work with HOG features. But I don't know if it works...
Link: http://code.opencv.org/projects/opencv/repository/revisions/6853
EDIT 2
I have not tested the fork above because my problem has changed. But I found an interesting link which may be very useful in the future (when I come back to this problem).
This page contains the source code of the paper "Histograms of Oriented Gradients for
Human Detection". Also, more information. http://pascal.inrialpes.fr/soft/olt/
If you use OpenCV-Python, then you have the option of using some additional libraries, such as scikits.image, that have Histogram of Oriented Gradient built-ins.
I had to solve exactly this same problem a few months ago, and documented much of the work (including very basic Python implementations of HoG, plus GPU implementations of HoG using PyCUDA) at this project page. There is code available there. The GPU code should be reasonably easy to modify for use in C++.
It now seems to be available also in the non-python code. opencv_traincascade in 2.4.3 has a HOG featuretype option (which I did not try):
[-featureType <{HAAR(default), LBP, HOG}>]
Yes, you can use cv::CascadeClassifier with HOG features. To do this just load it with hogcascade_pedestrians.xml that you may find in opencv_src-dir/data/hogcascades.
The classifier works faster and its results are much better when it trained with hogcascade in compare with haarcascade...
I can't find any information about Data used for training Haar classifiers in OpenCV. I want to know what kind of, how many and how(manually or via program) these classifiers were generated.
You can find these classifier's xml files in ..OpenCV2.3.1\opencv\data\haarcascades.. directory. Thanks
this research paper contains the answer
Empirical Analysis of Detection Cascades of Boosted Classifiers for Rapid Object
Detection by Dr Rainer Lienhart
thanks guys for the help...
There doesn't seem to be any implementations of HOG training in openCV and little sources about how HOG training works. From what I gathered, HOG training can be done in real time. But what are the requirements of training? How does the training process actually work?
As with most computer vision algorithms, Google Scholar is your friend :) I would suggest reading a few papers on how it works. Here is one of the most referenced papers on HoG for you to start with.
Another tip when researching in computer vision is to note the authors of the papers you find interesting, and try to find their websites. They will tend to have an implementation of their algorithms as well as rules of thumb on how to use them. Also, look up the references that are sited in the paper about your algorithm. This can be very helpful in aquiring the background knowledge to truly understand how the algorithm works and why.
Your terminology is a bit mixed up. HOG is a feature descriptor. You can train a classifier using HOG, which can in turn be used for object detection. OpenCV includes a people detector that uses HOG features and an SVM classifier. It also includes CascadeClassifier, which can use HOG, and which is typically used for face detection.
There is a program in OpenCV called opencv_traincascade, which lets you train a cascade object detector, an which gives you the option to use HOG. There is a function in the Computer Vision System Toolbox for MATLAB called trainCascadeObjectDetector, which does the same thing.