Converting grayscale image to indexed
Afficher commentaires plus anciens
I have a grayscale image with 3 random values signified by integers 91, 123, 255. When I use gray2ind(I, 3) I get only 2 indices: 1 and 2. But when I use gray2ind(I, 2) I get 0 and 1 as expected. How come? I would expect gray2ind(I, 3) to give me 0, 1 and 2.
I do have a colormap array which I am planning to later use, which has 3 individual colors, such that after I would properly convert this to 0, 1 and 2 indices I'd just do imshow(gray2ind(I, 3), colors).
Thanks
Réponse acceptée
Plus de réponses (1)
Micha
le 19 Août 2018
0 votes
Catégories
En savoir plus sur Red dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

