Need help with training cascade classifier
I have annotated all of my positive images and put it into a file called "info.txt", I only want to use my own positive examples and don't want to generate artificial examples. I have tried using the following command (-num 389, the number 389 is the total positive images that I'm currently having)
opencv_createsamples -vec faces.vec -num 389 -info info.txt -w 24 -h 24
But it returned with an error, saying https://pastebin.com/FKArU9vX I have tried searching everywhere but hasn't found a solution yet.
please put your error msgs into your question, not on an external bin (where it will expire)
(ssize.width > 0 && ssize.height > 0)
means, your src img was empty, it probably was not read correctly.try to put absolute file paths into your info.txt
You mean like this? https://imgur.com/a/M96hMip
Here's my info.txt file https://pastebin.com/jpyUXm5Q Okay, I will include the error message on my thread the next time.
^^ yea, those are relative filenames. again, try to use an absolute one, like:
/complete/path/to/positive_images/12.jpg
. (same for the negatives in the next step !)and, ofc, try to check, if all of those images really exist in that place ..
Yup. You're right. Some of the images are missing. Do I need to add the -bg parameter like this too? opencv_createsamples -vec faces.vec -bg negatives.txt -num 389 -info info.txt -w 24 -h 24
https://docs.opencv.org/master/dc/d88...
no, background files are only needed here, if you only have a single positive image. (again, NOT the rcommended way)
but you will need the file with the background images in the next, train_cascade step.