YAH*_*OOO 4 c++ xml opencv classification
我在opencv 2.1中通过"opencv_createsamples.exe"创建示例,但我在第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 )
Run Code Online (Sandbox Code Playgroud)
我在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
Run Code Online (Sandbox Code Playgroud)
所有信息文件路径都是正确的.
har*_*n78 10
我遇到了同样的问题,在我的情况下,我通过传递给opencv_createsamples -num参数来解决它,其中包含描述文件中描述的图像样本的总数.我想通过的一个小数字也可以.
请注意,省略-num参数也会产生解析错误,即使在您想要处理所描述的所有样本时,它显然也是一个冗余参数.