Azzera filtri
Azzera filtri

how to save the filled region to as an image

3 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Rik
Rik il 2 Feb 2018
Modificato: Rik il 2 Feb 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.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by