How to convert specific pixel value to pseudocolor?
Mostrar comentarios más antiguos
I have a uint8 image. If i want to convert all pixel with value smaller than 40 to red color. How can i do? Whould you please give me some hints.
2 comentarios
Walter Roberson
el 25 de Nov. de 2012
Is the uint8 image RGB or pseudocolor?
Is the desired output RGB or pseudocolor?
When you say "with value smaller than 40", are you referring to intensity in a particular colorplane, or are you referring to brightness, or are you referring to a pseudocolor map index (which is arbitrary and has no inherent meaning) ?
wang1031 yang
el 26 de Nov. de 2012
Respuesta aceptada
Más respuestas (1)
IPT imoverlay is convenient here, and it will work fine for either I/RGB inputs. While imoverlay() wasn't available at the time, alternatives are not complicated either.
% read an image
inpict = imread('cameraman.tif');
% create a mask
mask = inpict<40;
% apply the mask
outpict = imoverlay(inpict,mask,[1 0 0]);
% that's it.
imshow(outpict,'border','tight')
Categorías
Más información sobre Modify Image Colors en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
