Effacer les filtres
Effacer les filtres

how to save the filled region to as an image

3 vues (au cours des 30 derniers jours)
Elysi Cochin
Elysi Cochin le 2 Fév 2018
Modifié(e) : Rik le 2 Fév 2018
structBoundaries = bwboundaries(binaryImage);
xy = structBoundaries{i};
fill(xy(:,2),xy(:,1),'w');
how to save the filled region to as an image? when i do
im = fill(xy(:,2),xy(:,1),'w');
% im is a patch object
i want "im" as a double datatype or image datatype
i even used poly2mask, but only one region comes at a time, i need 2 regions out of 5 regions from structBoundaries to come in the mask

Réponse acceptée

Rik
Rik le 2 Fév 2018
Modifié(e) : Rik le 2 Fév 2018
You can create a binary mask in your desired resolution with this FEX submission. You can then use that mask to set the pixels in any color you like.
Edit:
If you have binary masks for one region at a time with poly2mask, you can just use the binary OR ('|') to merge multiple masks.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by