学习目标:图像处理课程作业,基于阈值处理图片。 原图: 学习产出: import cv2 as cv import numpy as np #T分割照片为G1和G2,并计算其平均值 def threshold(img,T): rows = img.shape[0] columns = img.shape[1] G1=G2=0 g1=g2=0 for i in range(rows): for