Borrar filtros
Borrar filtros

masking in RGB image

3 visualizaciones (últimos 30 días)
Aman
Aman el 10 de Oct. de 2012
i have a RGB image. I want to know the method to mask a particular area of that image. The area need to be selected by mouse cursor.

Respuestas (2)

Doug Hull
Doug Hull el 10 de Oct. de 2012

Image Analyst
Image Analyst el 10 de Oct. de 2012
Editada: Image Analyst el 10 de Oct. de 2012
Here's a demo:
% Have user freehand draw a mask in the image.
uiwait(msgbox('Draw a region with left button down. Double click inside to finish it'));
h = imfreehand();
vertices = wait(h);
% Create a binary mask
mask = createMask(h);
subplot(2,2,1);
imshow(mask, []);
% Mask the image.
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask,class(rgbImage)));
subplot(2,2,2);
imshow(maskedRgbImage);

Categorías

Más información sobre Author Block Masks en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by