SyMBac icon indicating copy to clipboard operation
SyMBac copied to clipboard

Resizing Masks

Open kmpape opened this issue 1 year ago • 1 comments

I observed that after resizing, some masks that were not touching before do touch. I think that this happens on the following line:

https://github.com/georgeoshardo/SyMBac/blob/9513c2cb4dced2f9ae64591627185b9baae79e5f/SyMBac/renderer.py#L403

Is that correct? There are functions to resize and prevent touching, e.g., function resize_mask from delta.imgops.

kmpape avatar Aug 08 '24 14:08 kmpape

Yes it's possible that masks could touch after a resize, especially depending on how the connectivity is defined, and because I assume you're using binary masks because of DeLTA?. If you want to avoid it with a quick fix, I recommend generating data with labelled masks (which are allowed to touch) and then iterating through each mask and doing morphological erosion on them one by one, then convert to binary, and re-label, with an assertion that there are the same number of masks as before.

On Thu, 8 Aug 2024, 15:27 kmpape, @.***> wrote:

I observed that after resizing, some masks that were not touching before do touch. I think that this happens on the following line:

https://github.com/georgeoshardo/SyMBac/blob/9513c2cb4dced2f9ae64591627185b9baae79e5f/SyMBac/renderer.py#L403

Is that correct? There are functions to resize and prevent touching, e.g., function resize_mask from delta.imgops.

— Reply to this email directly, view it on GitHub https://github.com/georgeoshardo/SyMBac/issues/48, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFKIX2QDLYXAYTHULFPVYDZQN535AVCNFSM6AAAAABMGTUMMOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ2TKOJVGM4DGNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

georgeoshardo avatar Aug 08 '24 20:08 georgeoshardo