Guest User


a guest
Sep 3rd, 2018
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def f(A, B, d):
  2. for x in range(0, getWidth(A)):
  3. for x in range(0, getWidth(B)):
  4. if g(A, B, x, d):
  5. return true
  6. return false
  8. def g(A,B,k, d):
  9. for y in range(0, getHeight(B)):
  10. for y in range(0, getHeight(A)):
  11. p=getPixel(A, k, y)
  12. q=getPixel(B, k, y)
  13. s=getPixel(B, k, y+1)
  14. if distance(makeColor(getRed(p),getGreen(p),getBlue(p)), makeColor(getRed(q),getGreen(q),getBlue(q)))<=d and distance(makeColor(getRed(p),getGreen(p),getBlue(p)), makeColor(getRed(s),getGreen(s),getBlue(s)))<=d:
  15. return true
  16. return false
RAW Paste Data