Unabe to create samples using opencv_createsamples.exe
haar-classifier, opencv
Solution
How is opencv_createsamples.exe distinguishing image file names? It might be written not to check white characters in paths/file names. Try without spaces either in the paths and file names.
Problem
Im trying to train a haar cascade. For that as a test run, I'm taking 5 positive images (which have the image). I use a program called objectmarker.exe to mark the object in the image and store the coordinates as well as the height and width of the rectangle in a text file (positives.txt) Now when I try to create a .vec file using the the text file from command line, the program executes, but i get the following: positive(1).txt : parse errorDone. Created 0 samples The .vec file does get generated but if i try to view it, it opens a window and crashes. I use the following code ``` C:\Sahil\Major Project\Haartraining Stuff\Haartraining Stuff\STEPS\step 02>openc v_createsamples.exe -info positives.txt -num5 -vec vec5.vec -w 20 -h 20 Info file name: positives.txt Img file name: (NULL) Vec file name: vec5.vec BG file name: (NULL) Num: 1000 BG color: 0 BG threshold: 80 Invert: FALSE Max intensity deviation: 40 Max x angle: 1.1 Max y angle: 1.1 Max z angle: 0.5 Show samples: FALSE Width: 20 Height: 20 Create training samples from images collection... positives.txt(1) : parse errorDone. Created 0 samples ``` my postives.txt is in the following format ``` C:/Sahil/Major Project/Haartraining Stuff/Haartraining Stuff/STEPS/step 02/rawdata/00007 001 (3).bmp_0000_0065_0107_0107_0199.bmp 1 1 2 106 193 C:/Sahil/Major Project/Haartraining Stuff/Haartraining Stuff/STEPS/step 02/rawdata/00007 001 (4).bmp_0000_0065_0107_0107_0199.bmp 1 1 2 108 195 C:/Sahil/Major Project/Haartraining Stuff/Haartraining Stuff/STEPS/step 02/rawdata/00007 001.bmp_0000_0065_0107_0107_0199.bmp 1 2 5 110 195 C:/Sahil/Major Project/Haartraining Stuff/Haartraining Stuff/STEPS/step 02/rawdata/img1.bmp 1 4 4 103 190 C:/Sahil/Major Project/Haartraining Stuff/Haartraining Stuff/STEPS/step 02/rawdata/img2.bmp 1 3 5 118 217 ``` kindly suggest what i can do to correct this error. as i cannot proceed further