Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

traincascade error - _cascadeDirName or _bgfileName or _vecFileName is NULL

Hi,

I am trying to train a cascade classifier with opencv_traincascade, but I keep getting the error:

_cascadeDirName or _bgfileName or _vecFileName is NULL

The specific command I am using is:

./opencv_traincascade vec ~/Documents/Kaggle/whale_faces.vec -data ~/Documents/Kaggle/cascadetrain -bg ~/Documents/Kaggle/negatives/bg.txt -numPos 10 -numNeg 50

And I get the error:

``` OpenCV Error: Bad argument (_cascadeDirName or _bgfileName or _vecFileName is NULL) in train, file /tmp/opencv20150810-26088-1150u2z/opencv-2.4.12/apps/traincascade/cascadeclassifier.cpp, line 146 libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /tmp/opencv20150810-26088-1150u2z/opencv-2.4.12/apps/traincascade/cascadeclassifier.cpp:146: error: (-5) _cascadeDirName or _bgfileName or _vecFileName is NULL in function train

Abort trap: 6 ```

All of the folders and files are valid. I am able to view the vec file with opencv_createsamples.

Does anyone know how I might fix this error? Thanks for the help.

Kevin