问题
I'm trying to run create samples on Ubuntu 16.04 with OpenCV, and I keep coming across this error when it runs. I have about 1960 negative images that I'm trying to generate sample images from. What i'm running in the terminal is:
opencv_createsamples -img pipe1.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 5 -maxyangle 5 -maxzangle 5 -num 1950
and and abbreviated output is:
Open background image: neg/930.jpg
Open background image: neg/11.jpg
Open background image: neg/332.jpg
Open background image: neg/141.jpg
Invalid background description file.
What I don't get is it seems to be able to parse the file correctly and find the images...but it keeps saying the description file is incorrect...
回答1:
Here is my solution: use full path.
This problem can be caused by a few things:
1) an image is missing thus failed to be opened.
2) the path is incorrect. you need to verify the path you give if the path to an image.
来源:https://stackoverflow.com/questions/40290024/opencv-createsamples-invalid-background-description-file