Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If you're using Mat and image is gray

You can use : pixel value = image.at<unsigned char="">(cv::Point(x,y))) ;

if you're dealing with color images

channel1_value = image.at<vec3b>(cv::Point(x, y))[0] ; channel2_value = image.at<vec3b>(cv::Point(x, y))[1] ; channel3_value = image.at<vec3b>(cv::Point(x, y))[2] ;

Then pass your coordinates to Point(x,y).

Hope it helps.

If you're using Mat and image is gray

You can use : pixel value = image.at<unsigned char="">(cv::Point(x,y))) ;

if you're dealing with color images

channel1_value = image.at<vec3b>(cv::Point(x, y))[0] ; channel2_value = image.at<vec3b>(cv::Point(x, y))[1] ; channel3_value = image.at<vec3b>(cv::Point(x, y))[2] ;

Then pass your coordinates to Point(x,y).

Hope it helps.

If you're using Mat and image is gray

You can use : pixel value = image.at<unsigned char="">(cv::Point(x,y))) char="">(cv::Point(x,y)) ;

if you're dealing with color images

channel1_value = image.at<vec3b>(cv::Point(x, y))[0] ;

Then pass your coordinates to Point(x,y).

Hope it helps.