# 基于request, re, pytesseract, PIL 开发的一键查分python。 # 需要输入学号和密码。 # 1.验证码图片识别处理 import pytesseract from PIL import Image def ca(filename: str) -> str: # Preprocess image for better OCR result. def clear_image(image: Image): def get_noise_color(image: Image): for y in range(1, image.size[1] - 1): # get the non-white colour at col 2 (r, g, b) = image.getpixel((2, y)) if r < 255 and g < 255 and b < 255: return r, g, b image = image.convert('RGB') width = image.size[0] height = image.size[1] noise_color = get_noise_color(image) for x in range(width): for y in range(height): # remove borders & interference colours rgb = image.getpixel((x, y)) if (x == 0 or y == 0 or x == width - 1 or y == height - 1
广东外语外贸大学教务系统一键查分
最新推荐文章于 2024-08-29 10:04:09 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)