2020
10-04
10-04
用python按照图像灰度值统计并筛选图片的操作(PIL,shutil,os)
我就废话不多说了,大家还是直接看代码吧!importPIL.Imageimportnumpyimportosimportshutildefsum_right(path):img=PIL.Image.open(path)array=numpy.array(img)num=array.sum(axis=0)print(type(num))res_left=0res_right=0foriinrange(256,512):res_right+=num[i]print(res_right)if__name__=='__main__':dir2=r"C:\Users\Howsome\Desktop\tst"dir1=r"C:\Users\Howsome\Desktop\AB"nam...
继续阅读 >