Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def luminanceCheck(pict1,pict2):
- #@param:
- # pict1, pict2: picture;
- # return: bool;
- allPix1 = getPixels(pict1)
- allPix2 = getPixels(pict2)
- for i in allPix1:
- a = False
- x1 = getX(i)
- y1 = getY(i)
- p1 = getPixel(pict1,x1,y1)
- for j in allPix2:
- x2 = getX(j)
- y2 = getY(j)
- p2 = getPixel(pict2,x2,y2)
- if lumCheck(p1,p2):
- a = True
- return a
- if not a:
- return False
- def lumCheck(pix1,pix2):
- #@param:
- # pix1, pix2: pixel;
- # return: bool;
- if luminance(pix1) == luminance(pix2):
- return True
- else:
- return False
- def luminance(pix):
- #@param:
- # pix: pixel
- # return: int, luminance;
- r = getRed(pix)
- g = getGreen(pix)
- b = getBlue(pix)
- luminance = (r+g+b)
- return (luminance)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement