How to convert uint16 monochrome image to RGB image
2 views (last 30 days)
Show older comments
Hi,
I want to convert unit16 type monochrome image to RGB image. After searching online I did the following. Following commands work if the image is normal 8 bit, but not for 16 bit. It does the conversion, but I cant view the image using imshow command. Can someone help pls?
X = dicomread('C:\Users\...\Documents\HDR\DiCOM_Images\MR-MONO2-16-knee');
X=256x256 int16
gbImage = repmat(X,[1 1 3]);
gbImage=256x256x3 int16
imShow(gbImage, []); no image
2 Comments
Answers (1)
Image Analyst
on 14 Nov 2013
Try this:
X = mat2gray(X);
rgbImage = cat(3, X, X, X);
imshow(rgbImage); % No [] needed - it doesn't apply for RGB images.
2 Comments
Image Analyst
on 14 Nov 2013
Edited: Image Analyst
on 14 Nov 2013
MATLAB does not support 16 bit RGB images, I don't believe, at least not as far as for displaying them.
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!