构建代码:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import cv2
def get_three_box(img_shape):
# 横向三座信号灯
if img_shape[0] > 2*img_shape[1]:
a = (img_shape[1], img_shape[0]) # 横向尺寸, 纵向尺寸
circle_point = (int(a[0]/2),int(a[1]/2))
x_inch = int(a[0]*0.45)
y_inch = int(a[1]*0.14)
dy = int(a[1]*0.015)
box_middle = (circle_point[0]-x_inch, circle_point[