2021
09-17
09-17
Python一些基本的图像操作和处理总结
一、Python图像处理PIL库1.1转换图像格式#PIL(PythonImagingLibrary)fromPILimportImageplt.rcParams['font.sans-serif']=['SimHei']#读取的是图像,cv.imread读取的是array,Image.open()显示的图像是RGBpil_im=Image.open('pic/kobe_mamba.jpg')subplot(121),plt.title('原图'),axis('off')imshow(pil_im)pil_im_gray=pil_im.convert('L')subplot(122),plt.title('灰度图'),xticks(x,()),yticks(y,())imshow(pil_im_...
继续阅读 >