I'm new to OpenCV and I'm trying to get the pixel value from a grayscale image.
#include<opencv2\opencv.hpp> #include<opencv2\highgui\highgui.hpp> #include<opencv2\core\core.hpp> #include<iostream> using namespace cv; int main() { VideoCapture cap(1); Mat image,gray_image; cap>>image; cvtColor(image,gray_image,CV_BGR2GRAY); std::cout<<"Value: "<<gray_image.at<uchar>(0,0); imshow("Window",gray_image); waitKey(0); return 0; } The pixel value is displayed as * or ~ etc. I think it is getting converted to ASCII value. How do I fix that?
Thank you.