how can i convert RGB image to indexed image without using toolbox?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
i want to convert rgb image to indexed image but without using toolbox, with colormap and impixel
0 Commenti
Risposte (2)
Image Analyst
il 14 Ott 2016
In the meantime, this works just fine for me:
rgbImage = imread('peppers.png');
subplot(2, 1, 1);
imshow(rgbImage); % Show original image
[indexedImage, map] = rgb2ind(rgbImage, 8);
subplot(2, 1, 2);
imshow(indexedImage, map); % Show posterized version
colorbar;
Since you forgot to share your code, can you run my code and verify that rgb2ind() still does not work for you? Then, since it works for me and I can't reproduce your system's behaviour, and does not work for you, you should call the Mathworks for tech support.
2 Commenti
Image Analyst
il 15 Ott 2016
You don't need to call both imagesc() and imshow(). Just call imshow(). And call colormap AFTER you call imshow().
And you don't need to call impixel() at all. If you want to see what the values are, just use impixelinfo().
Look at my code. Just do it like that, not the way you did it.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!