distance tranform with rotation almost there