OpenCV无效的背景描述文件 [英] OpenCV Invalid background description file
问题描述
当我尝试使用以下命令:opencv_createsamples -img image.jpg -bg bg.txt -info /info/info.lst -pngoutput info -num 2600
时,它告诉我:无效的背景描述文件.
When I try using this Command: opencv_createsamples -img image.jpg -bg bg.txt -info /info/info.lst -pngoutput info -num 2600
it tells me: Invalid background description file.
我现在尝试:
./neg/1.jpg
./net/2.jpg
没有用.
./neg/1.jpg
./neg/2.jpg
效果不好.
neg/1.jpg
neg/2.jpg
同样的问题
neg/1.jpg
neg/2.jpg
也无法正常工作. 有任何想法吗??我真的需要帮助 谢谢 弗里茨·弗茨
Also not working. Any ideas?? I really need help. Thanks FritzFurtz
推荐答案
我遇到了同样的问题,并尝试了许多不同的方法(在bg.txt中添加完整路径名,转换为UTF-8,...)-导致出现略有不同的外观错误-但仍然没有成功.我正在关注教程-我正在准备所有Windows笔记本电脑上的文件&然后将它们推送到ubuntu服务器.
I had the same problem and tried many different things (adding full path names in the bg.txt, convert to UTF-8,...) - which resulted in getting slightly different looking errors - but still, no success. I am following this tutorial - and I am preparing all the files on my windows laptop & then pushing them to a ubuntu server.
然后我读到它可能是由于行尾的差异(CLRF和LF)引起的,并检查了我的文件(在ubuntu服务器上):
Then I read it might be caused by difference in line ending (CLRF and LF) and checked my file (on the ubuntu server):
$ file bg.txt
bg.txt: UTF-8 Unicode (with BOM) text, with CRLF line terminators
我从dos2unix转换了文件:
I converted the file from dos2unix:
$ sudo apt install dos2unix
$ dos2unix bg.txt
dos2unix: converting file bg.txt to Unix format ...
$ file bg.txt
bg.txt: ASCII text
现在,opencv_createsamples命令起作用了.
And now the opencv_createsamples command worked.
这篇关于OpenCV无效的背景描述文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!