Hi,
I am trying to display BGR/RGB image of 3 channels. Each channel size is 16 bits.
I tried following code snippet and it shows blank image without any pixel value. But if I change “CV_16UC3” to “CV_8UC3”, it works.
Am I missing something here? #include #include #include #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp>
using namespace std;
Thank you, Berek, for quick reply. Basically, I am seeing issue with any pixel value I specify, and I am not seeing an image for CV_16CU3. I mean blank window appears and when I move mouse cursor, it doesn’t show even co-ordinates. I changed the pixel value as you suggested to 1 << 16 = 65535 and still see the issue.
Now I am seeing image for white or black. I see issue, sometimes image window appears but does not show x, y co-ordinates on bottom bar of the image when I move mouse cursor on the image. As you suggested, let me try installing QT backend for opencv again.
// I am creating image for 10 bpc, Meaning Red 10 bits, Green 10 bits and Blue 10 bits.
// WHITE image #include #include #include #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp>
using namespace std;
int main()
{
int width = 640, height = 480;
// Creating white image
cv::Mat src(height, width, CV_16UC3, cv::Scalar(1023, 1023, 1023)); // for 10 bpc
cv::imshow(“image1 16UC3”, src);
cv::waitKey(0);
return 0;
}
It is not showing white image exactly. Same I see with 12 bits, 14 bits. But for 16 bits it shows correctly.
am I missing something here?
Also not displaying X, Y co-ordinates at bottom bar of the imshow() window.