07 2021 档案

摘要:from PIL import Imagedef makeSketch(img, threshold): w,h = img.size#图像转换为灰度模式 img = img.convert('L')#获取灰度矩阵 pix = img.load() for x in range(w-1): for 阅读全文
posted @ 2021-07-30 11:57 一蓑烟雨任平生生 阅读(47) 评论(0) 推荐(0) 编辑
摘要:from PIL import Image#导入你喜欢的图片img = Image.open("E:/image/1.png")w,h = img.size[0]//3,img.size[1]//3#白色边的像素为10,你也可以设置为自己想要的像素gap=10newImg = Image.new(" 阅读全文
posted @ 2021-07-30 11:44 一蓑烟雨任平生生 阅读(94) 评论(0) 推荐(0) 编辑
摘要:from PIL import Imagefrom PIL import ImageFilterimg = Image.open("E:/image/1.png")print(img.format,img.mode)# #图片逆时针翻转90°# newImg = img.rotate(90,expa 阅读全文
posted @ 2021-07-30 11:24 一蓑烟雨任平生生 阅读(160) 评论(0) 推荐(0) 编辑
摘要:1.缩放图片 from PIL import Imageimg = Image.open("E:\\image\\1.png")w,h = img.sizenewSize = (w//2,h//2)newImg = img.resize(newSize)newImg.save("E:\\image1 阅读全文
posted @ 2021-07-30 11:11 一蓑烟雨任平生生 阅读(172) 评论(0) 推荐(0) 编辑
摘要:#必须有相同数量的频道 #水平叠加 imgHor = np.hstack((img,img))#垂直叠加 imgVer = np.vstack((img,img)) #实现不同频道的叠加函数 def stackImages(scale,imgArray): rows = len(imgArray) 阅读全文
posted @ 2021-07-29 12:51 一蓑烟雨任平生生 阅读(113) 评论(0) 推荐(0) 编辑
摘要:#灰度图像 imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #模糊图像 imgBlur = cv2.GaussianBlur(imgGray,(7,7),0) #canny边缘检测器 imgCanny = cv2.Canny(img,150,200) # 阅读全文
posted @ 2021-07-29 12:25 一蓑烟雨任平生生 阅读(56) 评论(0) 推荐(0) 编辑
摘要:enum VideoCaptureProperties { CAP_PROP_POS_MSEC =0, //!< Current position of the video file in milliseconds. CAP_PROP_POS_FRAMES =1, //!< 0-based inde 阅读全文
posted @ 2021-07-29 11:35 一蓑烟雨任平生生 阅读(452) 评论(0) 推荐(0) 编辑
摘要:1.导入cv2库 import cv2 2.读取图像 img = cv2.imread("xxxxx") 3.显示图片 cv2.imshow("output",img) 第一个参数是一个窗口名称(也就是我们对话框的名称),它是一个字符串类型。第二个参数是我们的图像。您可以创建任意数量的窗口,但必须使 阅读全文
posted @ 2021-07-29 11:33 一蓑烟雨任平生生 阅读(157) 评论(0) 推荐(0) 编辑
摘要:1.导入python库 import openpyxl import datatime 2.在内存创建一个excel文档 book=openpyxl.Workbook() 3.取第0个工作表 sheet = book.active 4.工作表取名sample1 sheet.title = "samp 阅读全文
posted @ 2021-07-29 10:55 一蓑烟雨任平生生 阅读(317) 评论(0) 推荐(0) 编辑
摘要:************************************************************ 通过python处理excel ************************************************************ 1.导入python库 阅读全文
posted @ 2021-07-29 10:21 一蓑烟雨任平生生 阅读(394) 评论(0) 推荐(0) 编辑
摘要:import requestsimport reimport timeimport asyncioimport pyppeteer as pyp#为page添加反反爬手段async def antiAntiCrawler(page): await page.setUserAgent('Mozilla 阅读全文
posted @ 2021-07-26 12:47 一蓑烟雨任平生生 阅读(380) 评论(0) 推荐(0) 编辑
摘要:import reimport requestsimport asyncioimport pyppeteer as pypdef getHtml(url): async def asGetHtml(url): browser = await pyp.launch(headless=False) pa 阅读全文
posted @ 2021-07-26 10:48 一蓑烟雨任平生生 阅读(248) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示