MCPcopy Index your code
hub / github.com/Jack-Cherish/python-spider / is_pixel_equal

Method is_pixel_equal

geetest.py:192–208  ·  view source on GitHub ↗

判断两个像素是否相同 :param image1: 图片1 :param image2: 图片2 :param x: 位置x :param y: 位置y :return: 像素是否相同

(self, img1, img2, x, y)

Source from the content-addressed store, hash-verified

190 return new_im
191
192 def is_pixel_equal(self, img1, img2, x, y):
193 """
194 判断两个像素是否相同
195 :param image1: 图片1
196 :param image2: 图片2
197 :param x: 位置x
198 :param y: 位置y
199 :return: 像素是否相同
200 """
201 # 取两个图片的像素点
202 pix1 = img1.load()[x, y]
203 pix2 = img2.load()[x, y]
204 threshold = 60
205 if (abs(pix1[0] - pix2[0] < threshold) and abs(pix1[1] - pix2[1] < threshold) and abs(pix1[2] - pix2[2] < threshold)):
206 return True
207 else:
208 return False
209
210 def get_gap(self, img1, img2):
211 """

Callers 1

get_gapMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected