How to convert specific pixel value to pseudocolor?
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 25 Nov. 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
am 26 Nov. 2012
Akzeptierte Antwort
Weitere Antworten (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')
Kategorien
Mehr zu Modify Image Colors finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
