You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
369 B
Python
16 lines
369 B
Python
|
|
|
|
def cut_img_bbox(img,bbox):
|
|
|
|
# blist = bbox.tolist()
|
|
|
|
x_min = bbox[0]
|
|
y_min = bbox[1]
|
|
x_max = bbox[2]
|
|
y_max = bbox[3]
|
|
|
|
obj_img = img[int(y_min):int(y_max), int(x_min):int(x_max)] #cv2裁剪出目标框中的图片
|
|
#保存图片
|
|
# cut_images = obj_img_path + '\\' + '%s_%s'%(img_name, count) + '.jpg'
|
|
|
|
return obj_img |