Moore boundary tracing algorithm This algorithm is coded in Jupyter Notebook. Matlab bwboundary function works on the same algorithm. It traces outer contours only.
achyut-srivastava/Moores-boundary-tracing-algorithm-python
Moore boundary tracing algorithm
Jupyter Notebook