How Do I remove the green background and replace with white (255)?
7 views (last 30 days)
Show older comments
Hello, I want to remove the green background from this image and replace it with white. I got so far as extracting all three color channels.
0 Comments
Answers (1)
Image Analyst
on 9 Mar 2014
See my color segmentation demos http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Then get a mask for the "green" pixels and replace
% Make masked pixels white
redChannel(mask) = 255;
greenChannel(mask) = 255;
blueChannel(mask) = 255;
% Recombine separate color channels into a single, true color RGB image.
rgbImage = cat(3, redChannel, greenChannel, blueChannel);
0 Comments
See Also
Categories
Find more on Modify Image Colors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!