bounding_box_size = (det[:, 2] - det[:, 0]) * (det[:, 3] - det[:, 1])
img_center = img_size / 2
offsets = np.vstack([(det[:, 0] + det[:, 2]) / 2 - img_center[1], (det[:, 1] + det[:, 3]) / 2 - img_center[0]])
offset_dist_squared = np.sum(np.power(offsets, 2.0), 0)
index = np.argmax(bounding_box_size - offset_dist_squared * 2.0)
det = det[index, :]
det = np.squeeze(det)
bb = np.zeros(4, dtype=np.int32)
#print(det[0], det[1], det[2], det[3])
bb[0] = np.maximum(det[0] - args.margin / 2, 0) # ??????
bb[1] = np.maximum(det[1] - args.margin / 2, 0) # ????
bb[2] = np.minimum(det[2] + args.margin / 2, img_size[1])
bb[3] = np.minimum(det[3] + args.margin / 2, img_size[0])
index = np.argmax(bounding_box_size - offset_dist_squared * 2.0) what means?
答案 0 :(得分:0)
用边框填充边框吗?