rst update: detected rectangles may be partially outside the image