I am trying to rewrite the value for a pixel in a Mat-type grayscale image. I've tried:
1) imgGrayComp.at<uchar>(5, 4) = 0; 2) imgGrayComp.ptr(4)[5] = 0; 3) imgGrayComp.at<vec3b>(5, 4) = 0;
But it gives me this instead:
OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file c:\opencv\build\include\opencv2\core\mat.hpp, line 537