Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
OpenCV创建样本失败_Opencv_Computer Vision - Fatal编程技术网

OpenCV创建样本失败

OpenCV创建样本失败,opencv,computer-vision,Opencv,Computer Vision,我有567张正片图像,在我的positives.txt文件中使用以下格式引用(假设每张图像只有一个对象): 当我跑的时候 opencv_createsamples -info ../data/positives.txt -num 567 -w 256 -h 256 -vec training.vec 我收到以下错误 Unable to open image: ../data//Users/jkarimi91/Documents/Projects/kaggle/right_whale_recog

我有567张正片图像,在我的
positives.txt
文件中使用以下格式引用(假设每张图像只有一个对象):

当我跑的时候

opencv_createsamples -info ../data/positives.txt -num 567 -w 256 -h 256 -vec training.vec
我收到以下错误

Unable to open image: ../data//Users/jkarimi91/Documents/Projects/kaggle/right_whale_recognition/data/imgs/train/whale_00195/w_2753.jpg
OpenCV Error: Unknown error code -9 () in cvSetImageROI, file /Users/jhelmus/anaconda/conda-bld/work/opencv-2.4.8/modules/core/src/array.cpp, line 3000
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/jhelmus/anaconda/conda-bld/work/opencv-2.4.8/modules/core/src/array.cpp:3000: error: (-9)  in function cvSetImageROI

Abort trap: 6

这是什么原因造成的?

结果是我没有正确格式化txt文件;其格式应如下所示(假设每个图像仅包含一个对象):

path num\u对象x y宽度高度

Unable to open image: ../data//Users/jkarimi91/Documents/Projects/kaggle/right_whale_recognition/data/imgs/train/whale_00195/w_2753.jpg
OpenCV Error: Unknown error code -9 () in cvSetImageROI, file /Users/jhelmus/anaconda/conda-bld/work/opencv-2.4.8/modules/core/src/array.cpp, line 3000
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/jhelmus/anaconda/conda-bld/work/opencv-2.4.8/modules/core/src/array.cpp:3000: error: (-9)  in function cvSetImageROI

Abort trap: 6