def Draw_rect(img, X,Y,width=100,height=50): ptLeftTop = (X, Y) ptRightBottom = (X+width, Y+height) point_color = (0, 0, 255) thickness = 2 lineType = 8 img = cv2.rectangle(img, ptLeftTop, ptRightBottom, point_color, thickness, lineType) return img
def Rect_listP(img,List,W,H): for i in List: img = Draw_rect(img,i[0],i[1],W,H) return img
def List_M(X1, X2, Y, Num): Result = [] Inter = int((X2-X1)/Num) for i in range(Num): Result += [[X1+i*Inter,Y]] return Result
def Band_list(List,W,H): Result = [] for i in List: Result += [[i[0],i[1],W,H]] return Result
|