matlab code to make a background of color image a uniform background?

3 views (last 30 days)
matlab code to make a background of color image mandi.tif which is in matlab , with uniform background?

Answers (1)

Image Analyst
Image Analyst on 21 May 2013
Use imfreehand() to identify the foreground and background. You'll have a binary image that specifies this. Then just assign the color to the background.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Now call imfreehand and create binary image of background.
% Assign background color to background.
redChannel(backgroundImage) = desiredRedValueOfBackground;
greendChannel(backgroundImage) = desiredGreenValueOfBackground;
blueChannel(backgroundImage) = desiredBlueValueOfBackground;
newRGBImage = cat(3, redChannel, greenChannel, blueChannel);
imshow(newRGBImage);
  4 Comments
ARUN SAI
ARUN SAI on 22 May 2013
Moved: DGM on 29 Dec 2023
no i want code for color image with uniform background and add noise ie, white spot

Sign in to comment.

Categories

Find more on Images 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!