MCPcopy Index your code
hub / github.com/wistbean/learn_python3_spider / get_distance

Function get_distance

fuck_bilibili_captcha.py:61–79  ·  view source on GitHub ↗
(bg_Image, fullbg_Image)

Source from the content-addressed store, hash-verified

59
60
61def get_distance(bg_Image, fullbg_Image):
62
63 # 阈值
64 threshold = 200
65
66 print(bg_Image.size[0])
67 print(bg_Image.size[1])
68
69
70 for i in range(60, bg_Image.size[0]):
71 for j in range(bg_Image.size[1]):
72 bg_pix = bg_Image.getpixel((i, j))
73 fullbg_pix = fullbg_Image.getpixel((i, j))
74 r = abs(bg_pix[0] - fullbg_pix[0])
75 g = abs(bg_pix[1] - fullbg_pix[1])
76 b = abs(bg_pix[2] - fullbg_pix[2])
77
78 if r + g + b > threshold:
79 return i
80
81
82

Callers 1

recognize_codeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected