Originally published externally
This entry links to the full piece on dev.to.
I spent 2.5 hours debugging an infinite loop in this algorithm, caused by an edge case (center point of structuring element is excluded). I'd missed a single but crucial requirement by misreading the notation…