채택된 답변

Image Analyst
Image Analyst 2021년 10월 12일

0 개 추천

Convert to HSV color space and take where the saturation > 0
hsvImage = rgb2hsv(rgbImage);
mask = hsvImage(:, :, 2) > 0;
% Mask the image using bsxfun() function to multiply the mask by each channel individually. Works for gray scale as well as RGB Color images.
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, 'like', rgbImage));
%maskedRgbImage = pagemtimes(rgbImage, cast(mask, 'like', rgbImage)); % R2020b and later.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

2021년 10월 12일

댓글:

2021년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by