How do the function find "endpoints" and "branchpoints" work ?

I using Matlab R2012a and used to function find endpoints and branchpoints by bwmorph. Can anybody help me how to two function work to determine end or branch point ?

Answers (1)

The methods used by bwmorph() involve the use of lookup tables which describe which of all possible 3x3 neighborhoods will result in a particular pixel being set true.
For R2012a, I believe that most of this is done with applylut(), the tables themselves being in MLROOT/toolbox/images/images/private/
For newer versions, look in MLROOT/toolbox/images/images/+images/+internal/algbwmorph.m
The newer versions rely on bwlookup() and LUTs in the same directory, but the process is conceptually the same.
To understand what the lookup tables mean, look at the documentation for makelut()

Tags

Asked:

Duy
on 31 Jan 2015

Answered:

DGM
on 28 Apr 2021

Community Treasure Hunt

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

Start Hunting!