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

조회 수: 4 (최근 30일)
ARUN SAI
ARUN SAI 2013년 5월 21일
이동: DGM 2023년 12월 29일
matlab code to make a background of color image mandi.tif which is in matlab , with uniform background?

답변 (1개)

Image Analyst
Image Analyst 2013년 5월 21일
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
ARUN SAI
ARUN SAI 2013년 5월 22일
이동: DGM 2023년 12월 29일
no i want code for color image with uniform background and add noise ie, white spot
Image Analyst
Image Analyst 2013년 5월 22일
I don't understand what your "Answer" meant.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by