imglib / imglib2-roi

Regions of interest (ROIs) and labelings for ImgLib2
Other
8 stars 8 forks source link

Boundary of a region as a region #26

Closed tpietzsch closed 8 years ago

tpietzsch commented 8 years ago

Boundary<T extends BooleanType<T>> is an IterableRegion<T> of the boundary pixels of a source boolean RandomAccessibleInterval. A pixel is a boundary pixel if the corresponding source pixel is true (in the source region), and at least one of its neighbors is false (not in the source region). Neighbors are defined by 4-neighborhood or 8-neighborhood (or n-dimensional equivalent) according to the StructuringElement given in the constructor. Note, that a Boundary constructed with 4-neighborhood StructuringElement is 8-connected, and vice versa.

@dietzc Can you have a look? I think this might be useful for you guys as well. I think you use PointCollection created explicitly by some algorithm to compute and represent region boundaries?

dietzc commented 8 years ago

@tpietzsch we use the Moore Contour Tracing algorithm to get the boundary of an object (see: http://www.imageprocessingplace.com/downloads_V3/root_downloads/tutorials/contour_tracing_Abeer_George_Ghuneim/alg.html). It also gives you the order of the (outer-) boundary points. The order is useful for feature-extaction.

Concerning the PR: please find some minor comments inline. Looks great!

tpietzsch commented 8 years ago

So, does Moore Contour Tracing work in nD? How does it order boundary points then?