问题:
原因:
You are probably working outside of the image dimensions. Does any of the values you pass to the cvSetImageROI function lay outside the image boudaries?
图像的ROI区域超过了图像的尺寸,即roi.x + roi.width > m.cols && roi.y + roi.height > m.rows
解决:
当使用opencv训练分类器时,出现这个问题,请检查你训练的所有图片是你要求的尺寸,如果有一张图片尺寸小于你设定的尺寸,就会报这个错误。