matlab code to make a background of color image a uniform background?
4 ビュー (過去 30 日間)
古いコメントを表示
matlab code to make a background of color image mandi.tif which is in matlab , with uniform background?
0 件のコメント
回答 (1 件)
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!