Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2017-02-08 04:36:09 -0600

Nbb gravatar image

How to display Vec3b single ?

I have a cv::Mat color and to print the color I use cout << color.at<cv::vec3b>(row,col); It gives me [100,100,100].

but when I use cout << color.at<cv::vec3b>(row,col)[0] I get weird characters.

How to display Vec3b single ?

I have a cv::Mat color and to print the color I use cout << color.at<cv::vec3b>(row,col); It gives me [100,100,100].

but when I use cout << color.at<cv::vec3b>(row,col)[0] I get weird characters.

Seems like this works

uint8_t r = color.at<cv::Vec3b>(row,col)[0]
cout << unsigned(r);