C++/OpenCV:Error: Assertion failed ((unsigned)i0 < (unsigned)(size.p[0] * size.p[1]))

Error: Assertion failed ((unsigned)i0 < (unsigned)(size.p[0] * size.p[1])) in cv::Mat::at, file d:\opencv\build\include\opencv2\core\mat.inl.hpp, line 1150 

C++/OpenCV:Error: Assertion failed ((unsigned)i0 < (unsigned)(size.p[0] * size.p[1]))_第1张图片

 OpenCV中这种错误基本都是访问像素时指针越界造成的

解决办法:

1、检查指针下标是否正确

2、row和col是否写反了

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