OpenCV createsamples dependencies

asked 2013-10-28 01:43:24 -0500

Samjakar gravatar image

updated 2013-10-28 02:53:40 -0500

Hi, I have been going through various forums and have not come across a definitive solution for this question. I am in the process of recognizing static text / Images in various backgrounds. Since the only kind of variation that this will take is the rotation and scaling and blurriness. So, It is not as complex as detecting a face or such generic item. But, here comes my Dilemma.

1) HOW TO CREATE SAMPLES (Partly already answered by Steve)? When training for such images, Should I use one good image and use createsample to help me create multiple images ( with auto distortions and scalings)? Or should I physically take hundreds of such images and create training on them. If I Choose those images manually, then Should I also choose images of various scales manually as create samples will not perform auto distortion if I choose the "-i" parameter. Part of this question is already answered by Steve for another question of mine. The only part I am not clear is if I use images with SOME rotations (say 1 - 15degree angles) and create an XML with this data and when I analyze my output images, will the process be able to detect images that has been rotated by say 40degrees?

2) DEPENDENCY ON THE QUALITY OF THE IMAGE USED FOR TRAINING So far I have been using large images with the image of my interest in it. I then mark the ROI on all the image files into a text file (using object_marker) and then use it in my create samples. I create about 200 such positive images using the command opencv_createsamples -info walker.txt -vec walkerw50h15_1.vec -w 50 -h 15 -num 230 I then use the VEC file for my ttraining and such. My question is, Would it matter if I choose an image from a HD sample video or just any BMP file would do? Does that really matter at all?

3) DEPENDENCY ON THE QUALITY OF THE INPUT VIDEO Say, I train my machine using train cascade by using my own sample images (without applying any distortions by opencv), Will the resultant XML file be good for ANY quality of the video? - HD (16:9) or SD (4:3)? Is there a dependency at all?

The reason I ask these questions is that I have trained on numerous images and the analysis varies from video to video. I am not getting a consistency. So, am trying to understand the variables.

edit retag flag offensive close merge delete