According to documentation, imshow will work like this
What if my Matrix contain negative value in 32-bit floating point. How it will treat it?
The key bits of Open_CV source are
#define CV_8S 1
#define CV_32S 4
#define CV_32F 5
double scale = src_depth <= CV_8S ? 1 : src_depth <= CV_32S ? 1./256 : 255;
double shift = src_depth == CV_8S || src_depth == CV_16S ? 128 : 0;
dst[x] = saturate_cast<DT>(src[x]*scale + shift);
Ultimately imshow creates a CV_8 Mat before displaying it, so saturate_cast, when DT is uchar, clamps the argument to 0 and 255.
For floating point depth == CV_32F:
That means for CV_32F
Now to answer you question:
What if my Matrix contain negative value in 32-bit floating point. How it will treat it?
The negative values will be displayed as if they are 0.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.