我想绕过一个内部有线条的验证码,我正在读取可以通过删除下面的算法线来完成,可以帮我输入删除线条。
def to_break():
img = Image.open('crop-img1.png')
img = image.convert("RGBA")
img.save("input-1.gif", "GIF")
pixdata = img.load()
for y in xrange(img.size[1]):
for x in xrange(img.size[0]):
if pixdata[x, y][0] < 400:
pixdata[enter image description here][1][x, y] = (0, 0, 0, 255)
for y in xrange(img.size[1]):
for x in xrange(img.size[0]):
if pixdata[x, y][2] < 600:
pixdata[x, y] = (0, 0, 0, 255)
for y in xrange(img.size[1]):
for x in xrange(img.size[0]):
if pixdata[x, y][3] > 0:
pixdata[x, y] = (255, 255, 255, 255)
img.save("dni-crop.jpg")
image = Image.open("dni-crop.jpg")
text = pytesseract.image_to_string(image)
captcha=text.replace(' ','').upper()
return captcha