Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def gemello(p1,p2):
- #@param p1,p2: pixel
- #@return bool
- return getRed(p1)+getGreen(p1)+getBlue(p1)==getRed(p2)+getGreen(p2)+getBlue(p2)
- def gemelloPerOgni(pix,S):
- #@param pix: pixel
- #@param S: sequenza di pixel
- #@return bool
- for p in S:
- if not gemello(pix,p):
- return False
- return True
- def existPixel(pic1,pic2):
- #@param pic1: picture
- #@param pic2: picture
- #@return bool
- seq1=getPixels(pic1)
- seq2=getPixels(pic2)
- for px in seq1:
- if gemelloPerOgni(px,seq2):
- return True
- return False
- def start():
- pic1=makePicture(pickAFile())
- pic2=makePicture(pickAFile())
- c=existPixel(pic1,pic2)
- print c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement