フィルターのクリア

How to mask a region in an image

7 ビュー (過去 30 日間)
vidya
vidya 2014 年 3 月 24 日
コメント済み: sangeetha N 2019 年 4 月 24 日
good day, I want to mask an image, my aim is detection of exudates so i want to remove optic disc from the image so that i can have only exudates detected here is my image
and this is my original image is

回答 (1 件)

Image Analyst
Image Analyst 2014 年 3 月 24 日
Look at these two snippets showing two ways, one channel by channel and another that does it all in one line:
% Mask image must be converted to the same integer type
% as the integer image we want to mask.
mask = cast(binaryImage, class(rgbImage));
% Multiply the mask by each color channel individually.
maskedRed = redChannel .* mask;
maskedGreen = greenChannel .* mask;
maskedBlue = blueChannel .* mask;
% Recombine separate masked color channels into a single, true color RGB image.
maskedRgbImage = cat(3, maskedRed, maskedGreen, maskedBlue);
% An alternate method to multiplication channel by channel.
% Mask the image using bsxfun() function
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, class(rgbImage)));
  1 件のコメント
sangeetha N
sangeetha N 2019 年 4 月 24 日
what do you mean by masking?
are structure element and mask same?

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

カテゴリ

Help Center および File ExchangeRecognition, Object Detection, and Semantic Segmentation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by