Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Probably because you're asking for 3 uchar values. Look at the lines with .at<Vec3b>. The type between the < and > is the type it returns. In as grayscale image, the type is uchar, but you're asking for a vector of 3 uchar. Try replacing the Vec3b with uchar.

https://docs.opencv.org/4.1.0/d3/d63/classcv_1_1Mat.html#aa5d20fc86d41d59e4d71ae93daee9726