发布网友 发布时间:2022-04-23 16:40
共1个回答
热心网友 时间:2022-05-27 07:05
摘要截图以及图片处理 img = pyautogui.screenshot(region=[0,0,592,1040]) # x,y,w,h img.save('1/answer.jpg')## 2图片灰度处理 def access_pixels(image): height, width, channels = image.shape print("width:%s,height:%s,channels:%s" % (width, height, channels)) for row in range(height): for list in range(width): for c in range(channels): pv = image[row, list, c] image[row, list, c] = 255 - pv # cv.imshow("AfterDeal", image)src = cv.imread('1/answer.jpg') # cv.imshow('OriginalImage', src) # 获取当前系统以运行的周期数 t1 = cv.getTickCount() # 运行函数 access_pixels(src) # 再次获取当前系统以运行的周期数 t2 = cv.getTickCount() # 计时周期数差值除以每秒周期数,获得处理时间 print("time cost:%s s" % ((t2 - t1) / cv.getTickFrequency())) cv.imwrite('2/answer.jpg',src) ## 3图片放大10倍咨询记录 · 回答于2021-12-08词达人自动答题输入序号您好,我这边正在为您查询,请稍等片刻,我这边马上回复您~[开心]你好很高兴为您解答[开心]1.申请某度api具体方法参考我之前的博客2.fiddler配置参考我这个博客3.可以去下方链接看效果https://www.bilibili.com/video/BV1AQ4y1T7qx/词达人利用python自动答题截图以及图片处理 img = pyautogui.screenshot(region=[0,0,592,1040]) # x,y,w,h img.save('1/answer.jpg')## 2图片灰度处理 def access_pixels(image): height, width, channels = image.shape print("width:%s,height:%s,channels:%s" % (width, height, channels)) for row in range(height): for list in range(width): for c in range(channels): pv = image[row, list, c] image[row, list, c] = 255 - pv # cv.imshow("AfterDeal", image)src = cv.imread('1/answer.jpg') # cv.imshow('OriginalImage', src) # 获取当前系统以运行的周期数 t1 = cv.getTickCount() # 运行函数 access_pixels(src) # 再次获取当前系统以运行的周期数 t2 = cv.getTickCount() # 计时周期数差值除以每秒周期数,获得处理时间 print("time cost:%s s" % ((t2 - t1) / cv.getTickFrequency())) cv.imwrite('2/answer.jpg',src) ## 3图片放大10倍希望以上回答对您有所帮助~ 如果您对我的回答满意的话,欢迎下次光临咨询[爱你]