Finding contours and lines