Finds rectangles and contours