Ask Your Question
0

Opencv Haar trainig Error

asked 2015-08-28 03:48:13 -0600

Test gravatar image

Hi, I'm new of Opencv and i make a road signal detection and i wanna trainig the algorithm for detect this. I have follow this guide on youtube https://www.youtube.com/watch?v=KFC6j... but in the end they give me an error. this is the file traning.bat

opencv_traincascade.exe -data classifier -vec samples.vec -bg negativeNew.txt -numStages 10 -minHitRate 0.999 -maxFalseAllarmRate 0.5 -numPos 12 -numNeg 1 -w 20 -h 20 -mode ALL -precalcvalBuffSize 256 -precalcdxBufSize 256

And this is the error:

Image reader can not be created from -vec samples.vec and -bg negativeNew.txt.

What I know it would take many more pictures but this is a begin, just for try. Can someone help me with this error? Thanks.

edit retag flag offensive close merge delete

Comments

most probably you got the path wrong, it can't find either samples.vec or negativeNew.txt

(your ex. expects both files in the same folder, where you start your program

berak gravatar imageberak ( 2015-08-28 04:25:12 -0600 )edit

I control the file negativeNew.txt and the path it's correct, even files in the same folder.

Test gravatar imageTest ( 2015-08-28 04:55:39 -0600 )edit

I'd use full paths of both files just in case

LorenaGdL gravatar imageLorenaGdL ( 2015-08-28 05:00:20 -0600 )edit

Me too, the path in the file negativeNew (for ex C:\OpenCV\image\negative\nameOfImage.bmp) and the vec file contains only numbers. Can the image create problem? I take only a image with signal, (like this: http://www.smalteriaemiliana.it/wp-co... convert in bmp).

Test gravatar imageTest ( 2015-08-28 05:11:56 -0600 )edit
1

Nope, I was saying using full paths in the command line (i.e. ... -vec fullpath/samples.vec -bg fullpath/negative.txt). I've never used full paths inside the negative text file, and I think it will cause an error too. By the way, with so few positives and negatives, I hardly believe you will success in finishing the training (you will probably consume all your samples at same stage)

LorenaGdL gravatar imageLorenaGdL ( 2015-08-28 05:35:56 -0600 )edit

ah sorry, i add the path and it's the same: Image reader can not be created from -vec C:\OpenCV\samples.vec and -bg C:\OpenCV\negative.txt. You are right, it's only for understand how work and if it's work, i have try to decrease the num of stages to 10 by 1. The next step it's increase the num of positive and negative image!

Test gravatar imageTest ( 2015-08-28 05:56:35 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-09-01 04:02:05 -0600

Test gravatar image

I resolve this problem, i write the error name. Now it's work but when i run it the dos windows exit with error.

edit flag offensive delete link more

Comments

What error?

LorenaGdL gravatar imageLorenaGdL ( 2015-09-01 04:42:31 -0600 )edit

It does not by any error , windows tells me only that the program has stop working. Without any errors.

Test gravatar imageTest ( 2015-09-01 05:02:51 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-08-28 03:48:13 -0600

Seen: 327 times

Last updated: Sep 01 '15