gpt4 book ai didi

c++ - haar 创建示例解析错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:11:35 24 4
gpt4 key购买 nike

我正在通过“opencv_createsamples.exe”在 opencv 2.1 中创建示例,但我在第 1 行遇到解析错误。

文件 positives.txt 包含:

c:\haar\Positives\PosImg_0.jpg 1 175,120,275,240
c:\haar\Positives\PosImg_1.jpg 1 175,120,275,240
c:\haar\Positives\PosImg_10.jpg 1 175,120,275,240
...(--and so on )

我在cmd中做的是:

c:\Haar>C:\OpenCV2.1\bin\opencv_createsamples.exe  -info positives.txt -vec Posi
tivesMany.vec -num 15 -w 24 -h 24 PAUSE
Info file name: positives.txt
Img file name: (NULL)
Vec file name: PositivesMany.vec
BG file name: (NULL)
Num: 15
BG color: 0
BG threshold: 80
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: 24
Height: 24
Create training samples from images collection...
positives.txt(1) : parse errorDone. Created 0 samples

所有的信息文件路径都是正确的。

最佳答案

我有同样的问题,在我的例子中,我通过将 -num 参数传递给 opencv_createsamples 来解决它,该参数与描述文件中描述的图像样本总数完全相同。我想通过一个次要数字也可以。

请注意,省略 -num 参数也会产生解析错误,即使当您想要准确处理所描述的所有样本时,它显然是一个冗余参数。

关于c++ - haar 创建示例解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7279514/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com