Misc. algorithms useful for computer vision