MATLAB: My Colored image gets read as a bw image #imageprocessing #image #colorImage Processing Toolbox pic=imread('C:\Users\Acer\Desktop\p.png'); imshow(pic) (this is how the image in my desktop looks) (this how the matlab reads it) Best Answer MATLAB is loading it as an indexed image: https://www.mathworks.com/help/images/image-types-in-the-toolbox.html#f14-17587. The following show how to display it properly[im, cm] = imread('image.png', 'png');imshow(im, 'Colormap', cm)If you also want an rgb image[im, cm] = imread('image.png', 'png');im_rgb = ind2rgb(im, cm);imshow(im_rgb) Related SolutionsMATLAB: Matlab imshow this gives an error with imsubstract because the images are not of the same size. MATLAB: Removing background by dividing Okay, got it:first I did not import the color profile (see this SO answer)[img, cm] = imread('son1.gif');img = ind2rgb(img, cm);Then, I had to scale the result to get in the representable range:imshow(uint8(imdivide(img_d, bg_d) * 100))which shows the correct output: Related QuestionOverlay binary image on RGB imageOpen an image in another imageRead and display RGB png/jpg imageImread and/or rgb2gray not working as expectedI’m trying to create a video using 96 images and I keep getting the error below.Gray2rgb conversion
Best Answer