1. 程式人生 > >OpenCV Error: Assertion failed

OpenCV Error: Assertion failed

OpenCV越界問題:
OpenCVError: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