enhancing display of image

3 ビュー (過去 30 日間)
try analyst
try analyst 2016 年 7 月 10 日
移動済み: DGM 2023 年 5 月 7 日
Dear All, I have a very simple question for gray scale image. I want to display an image from 8 bit to 16 bit.

回答 (1 件)

Image Analyst
Image Analyst 2016 年 7 月 10 日
The contrast in the image does not change when you change the number of bits. Contrast is defined by ratios of dark and brightest values.
imshow() maps the full display range of the class of the image. So if you have a uint8 image with a range of 0-40 then displaying it with imshow(img) will show it in a display range of 0-255. If the image is uint16, then it will show it with a display range of 0-65535. Either way it will look dark - darkest with the uint16 class.
Now if you took the uint8 image and multiplied it by 256 then it would go from 0-10240 but would still look dark. There's no increase in contrast despite casting to uint16 and multiplying by 256.
To have the actual image range get mapped to the display range of the display, you need to use [] in imshow
imshow(img, []);
Now it will map 40 to 255 and the uint8 will look brighter. Or if it's a uint16 image, it will map 40 to 65535 and will also be brighter. It will look the same no matter if you multiplied by 256 or not, so the image with 10240 gray levels will look the same as the uint16 image with 40 gray levels and the uint8 image with 40 gray levels.
  1 件のコメント
try analyst
try analyst 2016 年 7 月 15 日
移動済み: DGM 2023 年 5 月 7 日
Yes absolutely right.

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by