import cv2 import numpy as np import copy ''' 包含多个区域的最小外接矩形''' image = cv2.imread('./label.png') B, G, R = cv2.split(image) ret, thresh = cv2.threshold(G, 128, 255, cv2.THRESH_BINARY) print(thresh.shape) # 单通道复制为三通道 ...代替所有的:: 3 增加后的通道数 2 轴 GGG = np.repeat(G[...,np.newaxis], 3, 2) print(GGG.sha