Need some explanation regarding the co-ordinates of images for haarTraining

asked 2015-11-19 23:50:49 -0600

Bhavik gravatar image

We are creating .vec file of positive images through opencv_createsamples.exe where we are inputting the positive images within the -info command through .dat file, we are specifying co-ordinates for each of the images within the .dat file. Kindly elaborate on what those co-ordinates are and what is the purpose of putting them into .dat file?

According to my understanding the upper left corner is the 0,0 co-ordinate of the image. The data we put in the .dat file is like: image_path/image_name.jpg 1 250 180 350 200 here the 1 denotes the number of cropping we want to do from a single image 250 is the x co-ordinate value to the right side of 0,0 180 is the y co-ordinate value downwards to 0,0 350 denoted the width of the image 200 denotes the height of the image

Please let me know whether its correct or not and explain the same. Thanks in advance

edit retag flag offensive close merge delete

Comments

1

IMHO it is correct, but you can read this for better understanding

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-11-20 02:17:31 -0600 )edit

Are there any possible way to set those co-ordinates automatically.For training the classifier,we require huge number of images,and manually setting the co-ordinated of each image is time consuming process.Please provide a solution to ease the pain

Bhavik gravatar imageBhavik ( 2015-11-21 00:28:35 -0600 )edit

Somewhere you should insert them manually, so if you already have them somewhere, just d a small application that reads that file and write the file you need

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-11-23 03:52:53 -0600 )edit
1

If you want to go with automatic model training than there is NO WAY of avoiding manual annotations of the objects you want to train. It is a known problem. There are academic solutions like online learning and unsupervised segmentation to try to define interesting regions in the image, but they are far from failsafe. Thus you should first decide if you are up to collecting data, else stay away from machine learning :) That being said, could you please use the search button of this forum? You have tons of questions that have been answered multiple times before.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-23 08:33:04 -0600 )edit