Borrar filtros
Borrar filtros

Active contours image segmentation

2 visualizaciones (últimos 30 días)
scorpio 09
scorpio 09 el 30 de Abr. de 2014
Comentada: Image Analyst el 2 de Feb. de 2021
using active contours i segmented a area in an image shown below
now how to extract the segmented area??

Respuestas (1)

Image Analyst
Image Analyst el 30 de Abr. de 2014
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 comentarios
Bin Qi
Bin Qi el 2 de Feb. de 2021
Editada: Bin Qi el 2 de Feb. de 2021
I have the same question. How to extract the masked part from the origional image?
----> stupid me, use matrix multiplication.
Image Analyst
Image Analyst el 2 de Feb. de 2021
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.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by