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.
2 | No.2 Revision |
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.
3 | No.3 Revision |
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.