#6 主机玩家 极验和网易的滑块验证,利用python的pillow模块的ImageChops.difference差值算法就能解决,提取出全图片和缺口图片。
另外,模拟变加速也不是很难
def get_tracks(self, distance, seconds, ease_func):
distance += 20
tracks = [0]
offsets = [0]
for t in np.arange(0.0, seconds, 0.1):
ease = ease_func
offset = round(ease(t / seconds) * distance)
tracks.append(offset - offsets[-1])
offsets.append(offset)
tracks.extend([-3, -2, -3, -2, -2, -2, -2, -1, -0, -1, -1, -1])
return tracks
def ease_out_quart(self, x):
return 1 - pow(1 - x, 4)
利用指数函数的性质就能模拟变加速。