Is masking,ROI and contour the same?

조회 수: 5 (최근 30일)
Muhammad Shoaib
Muhammad Shoaib 2015년 11월 29일
댓글: Image Analyst 2015년 11월 29일
i have studied these again and again but still i am confuse about this, are these three the same if not please explain to clear the concept.

채택된 답변

Image Analyst
Image Analyst 2015년 11월 29일
Masking and ROI are pretty similar. ROI is the pixels in the image that you're interested in analyzing. Those outside the ROI you want to ignore. One way to do this is by masking. In masking you create a mask, a binary image. You can then use that to set all pixels outside the ROI to black for example. Then you can process the whole image and perhaps your algorithm will ignore the black pixels, like if you just summed all the pixel gray levels for example. So somehow you can create a mask and ROI, for example by intensity thresholding to find all bright pixels,
mask = grayImage > 200;
then you can "mask" the image by using the mask as indexes to the gray level image,
maskedImage = grayImage; % Initialize
maskedImage(mask) = 0;
or by multiplying the mask by the gray level image.
% Mask the image using bsxfun() function
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, class(rgbImage)));
or
maskedImage = grayImage .* uint8(mask); % Or uint16 if grayImage is 16 bit
Masking is the operation of applying the binary mask to the gray scale image.
Contours are isolines of constant gray level, just like contours on topographic maps are lines of constant altitude. It doesn't necessarily have anything to do with ROIs or masking, though if you were to threshold at, say, 200 gray levels, the white blobs you get from that would have perimeters that are the same as the contours you'd get at 200 gray levels. But normally, just ignore contours and the contour() function as far as setting ROIs/masks goes.
  댓글 수: 2
Muhammad Shoaib
Muhammad Shoaib 2015년 11월 29일
Thanks Sir for the nice and brief explanation, i am doing a project on mri volumetric data segmentation and mask the roi by selection the values manually.
mriAdjust = mri;
mriAdjust(1:70,:) = 0;
mriAdjust(262:end,:) = 0;
mriAdjust(:,1:58,:) = 0;
mriAdjust(:,229:end,:) = 0;
how can i make adjustable roi using mouse, manually rows and columns selection is time consuming.
Image Analyst
Image Analyst 2015년 11월 29일
See attached masking demos.
You can also use rbbox() or imrect().

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by