opencv_createsamples: Invalid background description file?

喜欢而已 提交于 2019-12-24 07:51:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!