Active contours image segmentation

using active contours i segmented a area in an image shown below
now how to extract the segmented area??

답변 (1개)

Image Analyst
Image Analyst 2014년 4월 30일

0 개 추천

activecontour() returns a binary image that is the segmentation. Now describe very exactly what you mean by "extract". Does that mean measure with regionprops()? Does that mean cropping to a new, smaller image with imcrop()? "Extract" is not a very specific term. What does it mean to you?

댓글 수: 4

scorpio 09
scorpio 09 2014년 5월 1일
for example below figure shows the active contour detected region..
now i want to extract that detected region as shown below
i used imcrop() but the result is not correct
Image Analyst
Image Analyst 2014년 5월 1일
Again, "activecontour() returns a binary image" so I don't understand why you're asking. It gives it to you!
Bin Qi
Bin Qi 2021년 2월 2일
편집: Bin Qi 2021년 2월 2일
I have the same question. How to extract the masked part from the origional image?
----> stupid me, use matrix multiplication.
If you want to mask the original image, no matter whether gray scale or RGB, you can use this code:
% Mask the image using bsxfun() function to multiply the mask by each channel individually.
% Works for gray scale as well as RGB Color images.
maskedImage = bsxfun(@times, rgbImage, cast(mask, 'like', rgbImage));
If you have a gray scale image, you can also multiply:
maskedImage = grayImage .* uint8(mask); % or uint16
or you can erase using logical coordinates:
maskedImage = grayImage; % Initialize
maskedImage(~mask) = 0; % Erase outside the mask.

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

질문:

2014년 4월 30일

댓글:

2021년 2월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by