问题描述
我正在尝试按照文档“https://docs.opencv.org/3.4/dc/d88/tutorial_traincascade.html”中的说明训练 haar 级联,我的训练中有 3100 个文件和 9500 个 +ve 样本当我尝试使用 ubuntu 20 中的 3.4.x OpenCV 版本中的创建示例 OpenCV 应用程序生成二进制文件时的数据集如果 num 参数大于 950,我会收到错误。错误在下面共享 -
$ opencv_createsamples -info pos2.txt -w 25 -h 25 -num 951 -vec pos4.vec
Info file name: pos2.txt
Img file name: (NULL)
Vec file name: pos4.vec
BG file name: (NULL)
Num: 951
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: 25
Height: 25
Max Scale: -1
RNG Seed: 12345
Create training samples from images collection...
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(3.4.13-dev) /home/suman/sandBox/opencv/3xcv/opencv/modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion Failed) !ssize.empty() in function 'resize'
Aborted (core dumped)
$ opencv_createsamples -info pos2.txt -w 25 -h 25 -num 949 -vec pos4.vec
Info file name: pos2.txt
Img file name: (NULL)
Vec file name: pos4.vec
BG file name: (NULL)
Num: 949
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: 25
Height: 25
Max Scale: -1
RNG Seed: 12345
Create training samples from images collection...
Done. Created 949 samples
对可以使用的样本数量或内存限制有什么限制吗?
我用于训练的图像大小为 2.6k,分辨率为 176*132 灰度。
欢迎任何指点和帮助,提前致谢。
下面我附上了一张示例图片以供参考 -
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)