While running Traincascade or Haartraining code , a error occurs

asked 2018-12-11 23:40:01 -0600

updated 2018-12-11 23:47:22 -0600

berak gravatar image

After creating a sample vec file , i like to train my haartraining using below code,

haartraining -data data -vec samples1.vec -bg negative.txt -numStages 10 -numPos 20 -numNeg 200 -w 50 -h 50 -mode ALL -precalcValBuffSize 1024 -precalcIdxBuffSize 1024

but error occurs as shown in image, can anyone help me to solve the issue...

image description

edit retag flag offensive close merge delete

Comments

can you please replace the screenshot with a TEXT version ? thank you.

berak gravatar imageberak ( 2018-12-11 23:44:19 -0600 )edit

please add the first few lines of your negative.txt to the question

berak gravatar imageberak ( 2018-12-11 23:49:24 -0600 )edit

my negative.text wil be like \negative_images\resized_hills_013.negative_images \negative_images\resized_hills_015.negative_images \negative_images\resized_hills_016.negative_images

Sudharsan_jgopi gravatar imageSudharsan_jgopi ( 2018-12-11 23:52:54 -0600 )edit
1

ERROR....

Unspecified error (Unable to read negative images) in function cvCreateTreeCascadeClassifier,..\src\cvhaartraining.cpp(2167)

Sudharsan_jgopi gravatar imageSudharsan_jgopi ( 2018-12-11 23:55:59 -0600 )edit

please use forward slashes (even on windows) and an absolute path for the filenames there

berak gravatar imageberak ( 2018-12-11 23:56:33 -0600 )edit

yeah , thanks , As you suggested I used forward slash and absolute path , eventhough i used to get same error.

C:/Users/Dass6/Desktop/temp/negative/negative_images/resized_hills_013.negative_images
C:/Users/Dass6/Desktop/temp/negative/negative_images/resized_hills_015.negative_images
C:/Users/Dass6/Desktop/temp/negative/negative_images/resized_hills_016.negative_images
Sudharsan_jgopi gravatar imageSudharsan_jgopi ( 2018-12-12 00:10:42 -0600 )edit

none of the above looks like a valid path to an image. what is "negative_images" ?

berak gravatar imageberak ( 2018-12-12 00:12:42 -0600 )edit

btw, "haartraining" is from outdated 2.4 ? and why the heck are you running this from an anaconda prompt ?

berak gravatar imageberak ( 2018-12-12 00:14:10 -0600 )edit

my image id of Bmp format , so at the end negative_images should be replaced with bmp

Sudharsan_jgopi gravatar imageSudharsan_jgopi ( 2018-12-12 00:15:43 -0600 )edit

so i want to run in cmd?? can you please suggest me train , I dont have opencv_traincasacde too

Sudharsan_jgopi gravatar imageSudharsan_jgopi ( 2018-12-12 00:17:39 -0600 )edit

IF there is a .bmp extension, that MUST go into the filename, too.

(imho, we found the main problem !)

berak gravatar imageberak ( 2018-12-12 00:19:20 -0600 )edit

C:/Users/Dass6/Desktop/temp/negative/negative_images/resized_hills_013.bmp C:/Users/Dass6/Desktop/temp/negative/negative_images/resized_hills_015.bmp C:/Users/Dass6/Desktop/temp/negative/negative_images/resized_hills_016.bmp

Sudharsan_jgopi gravatar imageSudharsan_jgopi ( 2018-12-12 00:26:15 -0600 )edit

I have changed as .bmp , but though I'm getting the same error , what should be replaced instead of "haartraining" ?

Sudharsan_jgopi gravatar imageSudharsan_jgopi ( 2018-12-12 00:28:14 -0600 )edit