Line detection algorithms