For the mat which stores images, it is easy to show it using imshow
.But if the data type of the Mat is CV_32FC1, how can I display this mat ?
I tried imshow, but the display figure is totally white and when I zoom int, it is still totally blank, and I cannot see the float numbers in mat.
Is there anyone who knows how to show entire mat matrix ?
p.s.: thanks for replying. I will post some codes and figures to show more details: codes:
Mat mat1;
mat1 = Mat::ones(3,4,CV_32FC1);
mat1 = mat1 * 200;
imshow("test", mat1);
waitKey(0);
Mat dst;
normalize(mat1, dst, 0, 1, NORM_MINMAX);
imshow("test1", dst);
waitKey(0);
mat1.convertTo(dst, CV_8UC1);
imshow("test2", dst);
waitKey(0);
return 0;
output:
after I zoom in by 150%:
Then after I zoom in by 150%, we can see that 'test' is totally white and we cannot see its element values. 'test1' is totally black and we still cannot see its element values. But for 'test2', it is gray and we can see its element value which is 200.
Does this experiment mean that imshow()
can only show CV_8UC1
and we cannot show any other datatyes ?