![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python PIL 图像学习
学习Python,PIL的笔记
一头秀发的假程序猿
国内某大学研究生,搞搞电路,搞搞单片机、无人机、智能车,搞搞嵌入式Linux,搞搞Python,搞搞图像处理,搞搞机器学习。。
展开
-
Python图像处理-1.pil读取图像,显示图像
from PIL import Imageimport matplotlib.pyplot as pltpil_im1 = Image.open('pic1.png')pil_im2 = Image.open('pic1.png').convert('L')plt.figure("girlfriend1")plt.imshow(pil_im1)plt.figure("gir...原创 2020-01-15 20:48:21 · 1822 阅读 · 0 评论 -
Python图像处理-2.pil读取图像,显示图像,创建缩略图
from PIL import Imageimport matplotlib.pyplot as pltpil_im1 = Image.open('pic1.png')pil_im2 = Image.open('pic1.png').convert('L')plt.figure("girlfriend1")plt.imshow(pil_im1)pil_im1.thumbnail(...原创 2020-01-16 10:01:18 · 874 阅读 · 0 评论 -
Python图像处理-3.pil裁剪、旋转粘贴图片
from PIL import Imageimport matplotlib.pyplot as pltpil_im1 = Image.open('pic1.png')plt.figure("girlfriend1")plt.imshow(pil_im1)box = (100,100,400,400)region = pil_im1.crop(box)#cut from the...原创 2020-01-16 10:16:34 · 944 阅读 · 0 评论 -
Python图像处理-4.pil调整图片尺寸和旋转角度
from PIL import Imageimport matplotlib.pyplot as pltpil_im1 = Image.open('pic1.png')plt.figure("girlfriend1")plt.imshow(pil_im1)out = pil_im1.resize((128,128))plt.figure("girlfriend2")plt.i...原创 2020-01-16 10:27:47 · 1742 阅读 · 0 评论 -
Python图像处理-5.pil打开图片,并且在图片中绘制点和线
from PIL import Imagefrom pylab import *#读取图像到数组中im = array(Image.open('pic1.png'))#绘制图像imshow(im)#定义四个点x =[100,100,400,400]y =[200,500,200,500]# 使用红色星状物标记绘制点plot(x,y,'r*')#绘制前两个点的线...原创 2020-01-16 11:02:03 · 8418 阅读 · 0 评论 -
Python图像处理-6.pil绘制图像轮廓和直方图
from PIL import Imagefrom pylab import *pil_im1 = Image.open('pic1.png')pil_im1 = pil_im1.rotate(180)#读取图像数据到数组中im = array(pil_im1.convert('L'))#新建一个图像figure()#不使用颜色信息gray()#在原来图形的基础上的做还是...原创 2020-01-16 13:46:34 · 1958 阅读 · 0 评论 -
Python图像处理-7.pil ginput 交互式标注,标注点过的点坐标
from PIL import Imagefrom pylab import *im = array(Image.open('pic1.png'))imshow(im)print('Please click 3 point')x = ginput(3)print('you clicked:',x)show()原创 2020-01-16 14:06:15 · 1829 阅读 · 3 评论