OpenCV createsamples - 无效的背景描述文件 [英] OpenCV createsamples - invalid background description file

查看:23
本文介绍了OpenCV createsamples - 无效的背景描述文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 OPENCV_ROOT 文件夹中并在 Win-x64 中运行以下命令:

I'm in my OPENCV_ROOT folder and running the following command in Win-x64:

opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 
maxzangle 0.5 -maxidev 40 -w 80 -h 40 
-img ABSOLUTE_PATH_TO_POSITIVE_IMAGES_FOLDERcar.jpg 
-bg ABSOLUTE_PATH_TO_PROJECT
egatives.txt
-vec ABSOLUTE_PATH_TO_SAMPLES_FOLDERcar.jpg.vec 
-num 125

我的 negatives.txt 看起来像这样:

My negatives.txt looks like this:

negative_imagescity01_02.jpg
negative_imagescity01_04.jpg
negative_imagescity01_05.jpg
negative_imagescity01_06.jpg
negative_imagescity01_07.jpg

这是我的输出:

Info file name: (NULL)
Img file name: ABSOLUTE_PATH_TO_POSITIVE_IMAGES_FOLDERcar.jpg
Vec file name: ABSOLUTE_PATH_TO_SAMPLES_FOLDERcar.jpg.vec
BG  file name: ABSOLUTE_PATH_TO_PROJECT
egatives.txt
Num: 125
BG color: 0
BG threshold: 0
Invert: FALSE
Max intensity deviation: 40
Max x angle: 1.1
Max y angle: 1.1
Max z angle: 0.5
Show samples: FALSE
Width: 80
Height: 40
Create training samples from single image applying distortions...
Invalid background description file.

我的底片收集文件 (negatives.txt) 有哪些无效之处?我尝试使用绝对路径和相对路径列出其中的文件.我正在关注 这个教程.

What's invalid about my negatives collection file (negatives.txt)? I tried listing the files within it both with absolute paths and with relative paths. I'm following this tutorial.

推荐答案

问题解决了!问题只是我在 Notepad++ 中编写了集合文件名,一切看起来都很好.但是当我碰巧在记事本中打开同一个文件时,我注意到每个图像文件名后面都没有换行符!当我添加换行符并运行命令时,创建的示例没有错误!

Problem solved! The issue was simply that I had written the collection file names in Notepad++, and it all seemed fine. But when I happened to open the same file in notepad, I noticed there were no newlines after each image filename! When I added the newlines, and ran the command, the samples got created without errors!

这篇关于OpenCV createsamples - 无效的背景描述文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆