Azzera filtri
Azzera filtri

How can I complete one of these two rectangles? I want to use it as mask for RGB image.

2 visualizzazioni (ultimi 30 giorni)

Risposta accettata

Image Analyst
Image Analyst il 10 Nov 2014
Use bwconvhull();
% Get convex hull of mask.
mask = bwconvhull(mask);
% Mask the image using bsxfun() function
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, class(rgbImage)));
You can use ~mask in the cast() if you want the inverse of the mask.

Più risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by