python opencv提取图片中的矩形区域

python opencv提取图片中的矩形区域

 

s_x, s_y,e_x,e_y = int(xyxy[0]), int(xyxy[1]), int(xyxy[2]), int(xyxy[3])
index_rect_obj = im0[s_y:e_y,s_x:e_x]
cv2.imshow(str(detect_obj_count),index_rect_obj)

 

######################

posted @ 2022-05-04 15:37  西北逍遥  阅读(1064)  评论(0编辑  收藏  举报