我正在遵循本教程https://pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/,其目标是构建鳄鱼探测器。 当使用以下方法创建样本时:
opencv_createsamples -img 1.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950
我遇到了著名的细分错误:
Create test samples from single image applying distortions...
Segmentation fault (core dumped)
这是我在终端中的完整输出:
Info file name: info/info.lst
Img file name: 1.jpg
Vec file name: (NULL)
BG file name: bg.txt
Num: 1950
BG color: 0
BG threshold: 80
Invert: FALSE
Max intensity deviation: 40
Max x angle: 0.5
Max y angle: 0.5
Max z angle: 0.5
Show samples: FALSE
Width: 24
Height: 24
Max Scale: -1
Create test samples from single image applying distortions...
Segmentation fault (core dumped)
我已经尝试用https://github.com/opencv/opencv/tree/master/apps/createsamples更新我的create_sample文件夹 但仍然存在细分错误。
我的作品:
opencv_workspace
|_ info(folder)
|_ neg(folder)
|_ images.jpg
|_opencv(folder)
|_1.jpg
|_bg.txt
希望我能说清楚! 谢谢:D