Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I cannot run opencv_traincascade.exe

This is the same question of mine for StackOverFlow.

I am making a cascade detecter with OpenCV. But opencv_traincascade.exe does not run. How can I fix this problem?

Bellow is the composition of the folder for using a making detecter. Desktop --cv ----cascade_detecter ----negative_image ------neg1.png ------neg2.png ------neg3.png ------(total: 265 data) ----positive_image ------pos1.png ------pos2.png ------pos3.png ------(total: 257 data) ----annotations.txt ----bg.txt ----opencv_annotation.exe ----opencv_createsamples.exe ----opencv_traincascade.exe ----opencv_world346.dll ----positive.vec

annotations.txt was made by opencv_annotation.exe and it is bellow. positive_image\pos1.png 1 578 245 160 91 positive_image\pos2.png 1 552 258 150 80 positive_image\pos3.png 1 489 286 172 68 (total: 257 data)

bg.txt is bellow. .\negative_image\neg1.png .\negative_image\neg2.png .\negative_image\neg3.png (total: 265 data)

I ran following command in the cv folder with PowerShell.

.\opencv_traincascade -data .\cascade_detecter\ -vec .\positive.vec -bg .\bg.txt -numPos 231 -numNeg 265 --featureType HAAR -mode ALL

Then, the application returned following error

```
POS count : consumed 231 : 231
Train dataset for temp stage can not be filled. Branch training terminated.
Cascade classifier can't be trained. Check the used training parameters.

```

I cannot run opencv_traincascade.exeopencv_traincascade.exe (Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters.)

This is the same question of mine for StackOverFlow.

I am making a cascade detecter with OpenCV. But opencv_traincascade.exe does not run. How can I fix this problem?

Bellow is the composition of the folder for using a making detecter. Desktop --cv ----cascade_detecter ----negative_image ------neg1.png ------neg2.png ------neg3.png ------(total: 265 data) ----positive_image ------pos1.png ------pos2.png ------pos3.png ------(total: 257 data) ----annotations.txt ----bg.txt ----opencv_annotation.exe ----opencv_createsamples.exe ----opencv_traincascade.exe ----opencv_world346.dll ----positive.vec

annotations.txt was made by opencv_annotation.exe and it is bellow. positive_image\pos1.png 1 578 245 160 91 positive_image\pos2.png 1 552 258 150 80 positive_image\pos3.png 1 489 286 172 68 (total: 257 data)

bg.txt is bellow. .\negative_image\neg1.png .\negative_image\neg2.png .\negative_image\neg3.png (total: 265 data)

I ran following command in the cv folder with PowerShell.

.\opencv_traincascade -data .\cascade_detecter\ -vec .\positive.vec -bg .\bg.txt -numPos 231 -numNeg 265 --featureType HAAR -mode ALL

Then, the application returned following error

```
POS count : consumed 231 : 231
231 Train dataset for temp stage can not be filled. Branch training terminated.
terminated. Cascade classifier can't be trained. Check the used training parameters.

```parameters.