Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi! For this purposes OpenCV has Vec classes. For example, you can access to pixel at (x,y) position like this:


// image is a Mat with CV_8UC3 type
Vec3b pixel = image.at<Vec3b>(x, y);

Also, you can use Mat_ instead of Mat to do this in a shorter way:


// image is a Mat_ with CV_8UC3 type
Vec3b pixel = image(x, y);