A Feedback Based Algorithm for Line Detection