opencv_traincascade.Unspecified error (No element name has been given)

asked 2014-06-14 06:45:56 -0600

fedor gravatar image

updated 2014-06-14 13:27:48 -0600

I'm trying to train my own cascade, but get the following error:

Unspecified error (No element name has been given) in cv::operator
 <<, file C:\builds\2_4_PackSlave-win64-vc11-shared\opencv\modules\core\include\
opencv2/core/operations.hpp, line 2910

I made ​​these steps:

  1. I cut 20 photos of the object so that they remained only the desired object
  2. Resize to 30x18
  3. Make objectSamples.dat file like this :

object(1).jpg 1 0 0 30 18

object(10).jpg 1 0 0 30 18

object(11).jpg 1 0 0 30 18

And negatives.dat like :

negatives\1.jpeg
negatives\10.jpg
negatives\11.jpg
size of pic ~ 500x500

4.Make vec file: opencv_createsamples -info objectSamples.dat -vec objectSamples.vec -w 30 -h 18 -num 20

5.Show samples ( my pictures are shown entirely) : opencv_createsamples -vec objectSamples.vec -w 30 -h 18

6.Try to train : opencv_traincascade -data Cascade -vec objectSamples.vec -bg negatives.dat -numPos 10 -numNeg 10 -numStages 2 -featureType HAAR -w 30 -h 18

But get an error:

image description

What am I doing wrong?

I read these articles and the answer, but I didn't understand, in what a problem:

  1. trouble-when-use-opencv_traincascadeexe

  2. haartraining tutorial

  3. docs.opencv traincascade


Increased the number of images to 1000 positive and 2000 negatives

opencv_traincascade -data Cascade -vec boobsSamples.vec -bg negativesBig/negatives.txt -numPos 400 -numNeg 1000 -numStages 2 -featureType HAAR -w 30 -h 18 -mode ALL

Geting the same error.

edit retag flag offensive close merge delete

Comments

1

I am pretty sure this would not be the mistake you could make....but just make sure that when you run opencv_traincascade function you create the cascade folder

Abhishek Kumar Annamraju gravatar imageAbhishek Kumar Annamraju ( 2014-06-15 01:02:50 -0600 )edit

Thanks for the answer, but the problem was in other.

Problem solved!

I copied the opencv_traincascade.exe to a folder of images. When I ordered the full path to the opencv_traincascade.exe in the library, the problem disappeared.

F:\OpenCV\opencv\build\x64\vc11\bin\opencv_traincascade -data Cascade -vec positives.vec -bg negativesBig/negatives.txt -numPos 400 -numNeg 1000 -numStages 2 -featureType HAAR -w 30 -h 18 -mode ALL

fedor gravatar imagefedor ( 2014-06-15 02:47:47 -0600 )edit