|
OpenCV的函数imshow()在显示图像前,对数据作了怎样的预处理?
查阅函数imshow()的官方文档,发现有下面这段说明:
If the image is 8-bit unsigned, it is displayed as is.
If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the value range [0,255*256] is mapped to [0,255].
If the image is 32-bit floating-point, the pixel values are multiplied by 255. That is, the value range [0,1] is mapped to [0,255].
翻译如下:
- 如果图像数据的类型为8位无符号型,即CV_8U型,则不进行数据预处理。
- 如果图像数据的类型为16位无符号型(CV_16U)或者32位整型(CV_32S),则会把每个数除以256。
- 如果图像数据的类型为32位的符点型,即CV_32F型,则会把每个数乘上255,所以,如果数据范围为[0,1],则将会被映射到 [0,255]。
|
|