Replacing pixel value a another colour
53 views (last 30 days)
Show older comments
I have a image in that suppose i want to change the pixel colour ,how i can do it.assume i have peppers image,in that if i want to replace a pixel value say 5 by yellow colour or some other colour,please tell how to proceed
Image Analyst on 6 Dec 2012
5 in which color channel and which color space? In general it's
rgbImage(row, column, 1) = 255;
rgbImage(row, column, 2) = 255;
rgbImage(row, column, 3) = 0;
for yellow (though I suspect you knew this already). If you have a mask (a binary image of where the 5's occur), it's somewhat different.
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!