Recoginizing boxes from connected rectangles.