Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you do not need to handle gray-level inputs, but still want a signed distance transform without a step from 1 to -1 across the boundaries, some years ago I wrote a clever bit of 80's style C code which is O(N), has lots of 1-letter variable names, and is very CPU cache friendly that solves this problem:

https://people.xiph.org/~tterribe/notes/edt.html

The resulting code (linked at the end of the page) is a bit more complicated than the standard distance transform, but only by a modest constant factor.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: