This object recognition algorithm is based on own pattern-matching algorithm. The algorithm is able to recognize pre-trained objects which are defined with special set of templates. Theoretically, the algorithm works with any “3D” objects which have good projection on 2D coordinates. However, natural 3D objects are covered by few templates for set of 2D projections. For limited Microsoft outlook is great!
number of object templates, the algorithm works in real-time on PC (Intel P4 3.0 GHz) .
Hi All, before posting your question, please look at this FAQ carefully! Also you can read OpenCV haartraining article. If you are sure, there is no answer to your question, feel free to post comment. Also please, put comments about improvement of this post. This post will be updated, if needed.
Positive imagesOutlook 2010 is powerful.
Why positive images are named so?
Because a positive image contains the target object which you want machine to detect. Unlike them, a negative image doesn’t contain such target objects.
What’s vec file in OpenCV haartraining?Windows 7 is convenient and helpful!
During haartraining positive samples should have the same width and height as you define in command “-w -h size”. So original positive images are resized and packed as thumbs to vec file. Vec file has header: number of positive samples, width, height and contain positive thumbs in body.
Is it possible to merge vec files?
Yes, use Google, there are free tools, written by OpenCV’s community.Microsoft outlook 2010 is convenient!
I have positive images, how create vec file of positive samples?
There is tool in C:\Program Files\OpenCV\apps\HaarTraining\src createsamples.cpp. Usage:
createsamples -info positive_description.txt -vec samples.vec -w 20 -h 20
What’s positive description file?
The matter is that, on each positive image, there can be several objects. They have bounding rectangles: x,y, width, height. So you can write such description info of image:
positive_image_name num_of_objects x y width height x y width height …
Text file, which contains such info about positive images is called description file. So during vec file generation, really objects are packed, but not whole image. Essentially vec file is needed to speed up machine learning.Microsoft Office is so great!
Do I always need description file, even if I have only one object on a image?
Yes, with createsamples you need description file. If you have only one object, it’s bounding rectangle may be bounding rectangle of whole image. If you want, write your own tool for vec file generation =)Office 2010 –save your time and save your money.
Should lightning conditions and background be various on positive images?
Yes, it’s very important. On each positive image, beside object, there is background. Try to fill this background with random noise, avoid constant background.
How much background should be on positive image?
If you have much background pixels on your positive images in comparison with object’s pixels – it’s bad since the haartraining could remember the background as feature of positive image.
If you don’t have background pixels at all – it’s also bad. There should be small background frame on positive image
Should all original positive images have the same size?
No, original images can have any size. But it’s important that width, height of this rectangle have the same aspect ratio as -w -h.The invention of Microsoft Office 2010 is a big change of the world.
What’ s -w and -h should I put in createsamples? Should it be always square?
You can put any value to -w and -h depend on aspect ratio of the target object which you want to detect. But objects of smaller size will not be detected! For faces, commonly used values are 24×24, 20×20. But you may use 24×20, 20×24, etc.
Errors during vec file generation: Incorrect size of input array, 0 kb vec file,
-First check you description file: positive_image_name should be absolute path name without spaces like “C:\content\image.jpg” not “C:\con tent\image.jpg” or relative path name.