opencv_traincascade.Unspecified error (No element name has been given)
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:
- I cut 20 photos of the object so that they remained only the desired object
- Resize to 30x18
- 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:
What am I doing wrong?
I read these articles and the answer, but I didn't understand, in what a problem:
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.
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
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