I have written an buggy implementation. The idea is:
- find the corners of the contour
- add them to the particle
- do it again
- up to idempotence
but it fails ...
An issue for me is how to handle the "don't care" points (pixels) with ndimage hit or miss operator.
Regards
Jean-Patrick