def crop_rectangle(img, pixel_rect):
# Note: Need to add 1 to end coordinates because pixel rectangle corners are
# inclusive.
cropped = img[pixel_rect.y1:pixel_rect.y2+1, pixel_rect.x1:pixel_rect.x2+1, :]
# cropped = img[pixel_rect.y1:pixel_rect.y2, pixel_rect.x1:pixel_rect.x2, :]
return cropped
# save_opencv_bounding_box_info :: String -> Map String gm.PixelRectangle
评论列表
文章目录