Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV opencv_traincascade.exe Hangs on Ubuntu Server

Hi OpenCV Forum.

Im studying Haar Classifiers and im trying to run haartraining on my university server. But it hangs and crashes. Although on Windows, it runs fine.

Im using low quantity of positives and negatives just to test.

On Windows i downloaded the last version 3.0 RC1 , if im not mistaken, im sure its 3.+

Anyway, tonight i tried to let it running on the server and when i woke up the process was gone. No Cascades on folder or any log whatsoever.

Im pushing my repo on mercurial and if anyone could point me to the right direction i would appreciate.

I checked the version of opencv on the server and found this :

dpkg -l | grep opencv

ii libopencv-calib3d-dev
2.3.1-7 development files for libopencv-calib3d

ii libopencv-calib3d2.3
2.3.1-7 computer vision Camera Calibration library

ii libopencv-contrib-dev
2.3.1-7 development files for libopencv-contrib

ii libopencv-contrib2.3
2.3.1-7 computer vision contrib library

ii libopencv-core-dev
2.3.1-7 development files for libopencv-core

ii libopencv-core2.3
2.3.1-7 computer vision core library

ii libopencv-features2d-dev
2.3.1-7 development files for libopencv-features2d

ii libopencv-features2d2.3
2.3.1-7 computer vision Feature Detection and Descriptor Extraction library

ii libopencv-flann-dev
2.3.1-7 development files for libopencv-flann

ii libopencv-flann2.3
2.3.1-7 computer vision Clustering and Search in Multi-Dimensional spaces library

ii libopencv-gpu-dev
2.3.1-7 development files for libopencv-gpu

ii libopencv-gpu2.3
2.3.1-7 computer vision GPU Processing library

ii libopencv-highgui-dev
2.3.1-7 development files for libopencv-highgui

ii libopencv-highgui2.3
2.3.1-7 computer vision High-level GUI and Media I/O library

ii libopencv-imgproc-dev
2.3.1-7 development files for libopencv-imgproc

ii libopencv-imgproc2.3
2.3.1-7 computer vision Image Processing library

rc libopencv-legacy2.3
2.3.1-7 computer vision legacy library

ii libopencv-ml2.3
2.3.1-7 computer vision Machine Learning library

ii libopencv-objdetect2.3
2.3.1-7 computer vision Object Detection library

rc libopencv-video2.3
2.3.1-7 computer vision Video analysis library

  • To execute my haar, i cd to my folder location and i type :

opencv_traincascade -data cascades -vec vector\vector.vec -bg bg.txt -numPos 40 -numNeg 50 -numStages 10 -mode ALL -w 50 -h 50 -maxFalseAlarmRate 0.4 -precalcValBufSize 1024 -precalcIdxBufSize 1024

The bg.txt , i had to go into my ubuntu and open the file and save as linux compatible.Because windows txt is different. So that part is fixed.

The sample creation on windows, i did it like this : opencv_createsamples.exe -info positive/info.txt -vec vector/vector.vec -num 48 -w 50 -h 50

* Right now i will try to execute the command again on the Ubuntu Server and see if it shows anything else. But i doubt.

Would anyone confirm if the packages on the server is outdated? Because that might be the problem? Another thing that came to mind is that.. im using the opencv from the packages right? Would anyone link me a linux compiled traincascade.exe for me? so i can test?

Thanks a lot.

Link to mercurial with all files im using :

-- Yesterday when i kept changing some parameters it actually did the stage0 and locked on stage1 Then i deleted stage0 and it kept locking on stage1. Then i did it once more and this time i didnt delete stage0 and it now keeps hanging. For hours until it crashes on the server.

$ opencv_traincascade  -data cascades -vec vector.vec -bg negative/bg2Fixed.txt -numPos 35 -numNeg 50 -numStages 10  -mode ALL -w 50 -h 50 -maxFalseAlarmRate 0.4 -precalcValBufSize 1024 -precalcIdxBufSize 1024

PARAMETERS: cascadeDirName: cascades vecFileName: vector.vec bgFileName: negative/bg2Fixed.txt numPos: 35 numNeg: 50 numStages: 10 precalcValBufSize[Mb] : 1024 precalcIdxBufSize[Mb] : 1024 stageType: BOOST featureType: HAAR sampleWidth: 50 sampleHeight: 50 boostType: GAB minHitRate: 0.995 maxFalseAlarmRate: 0.4 weightTrimRate: 0.95 maxDepth: 1 maxWeakCount: 100 mode: ALL

Stage 0 is loaded

===== TRAINING 1-stage ===== <begin pos="" count="" :="" consumed="" 35="" :="" 35<="" p="">