OpenCV Error: Assertion failed

OpenCV越界问题:
OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols &&
 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in cv::Mat::Mat(const cv::Mat&, const cv::Rect&),
 file C:/build/2_4_PackSlave-win32-vc11-shared/opencv/modules/core/src/matrix.cpp, line 323
出现问题的原因是:    
   图像的ROI区域超过了图像的尺寸,即 roi.x + roi.width > m.cols  && roi.y + roi.height > m.rows


你可能感兴趣的:(C++)