How can i change the connectivity in regionprops from 8 to 4?

4 visualizzazioni (ultimi 30 giorni)
I want regionprops to divide the regions with connectivity 4 instead 8. With 8 it mix two region i want separated into one.

Risposta accettata

Walter Roberson
Walter Roberson il 12 Set 2019
regionprops() itself always uses 8 connectivity for 2D arrays.
The way you get around this is to use bwlabel() or bwconncomp() to do the labeling for you, telling them which connectivity you want, and then pass the result to regionprops as a labeled image instead of as a binary image.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by