How Do I remove the green background and replace with white (255)?

7 views (last 30 days)
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.

Answers (1)

Image Analyst
Image Analyst on 9 Mar 2014
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);

Categories

Find more on Modify Image Colors 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!