Matlab's bwmorph(X, 'endpoints')
provides the endpoints of a skeleton for the given binary image X
.
For example-
1 0 0 0 1 0 0 0
0 1 0 0 becomes 0 0 0 0
0 0 1 0 0 0 1 0
0 0 0 0 0 0 0 0
I am converting my codes to Python and looking for a equivalent function in Python. My specific interest is to get endpoints of line segments in the binary image as shown in the figure.