How to convert specific pixel value to pseudocolor?
이전 댓글 표시
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
Walter Roberson
2012년 11월 25일
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
2012년 11월 26일
채택된 답변
추가 답변 (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')
카테고리
도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
