Image Extraction From Another one

26 ビュー (過去 30 日間)
Rasho
Rasho 2021 年 10 月 12 日
コメント済み: Rasho 2021 年 10 月 12 日
Hello,
How can I get the color image from the color and gray image?
Thank you.

採用された回答

Image Analyst
Image Analyst 2021 年 10 月 12 日
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.
  1 件のコメント
Rasho
Rasho 2021 年 10 月 12 日
Thank you it work.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by