Skip to content

Instantly share code, notes, and snippets.

@pranavb-ca
Created April 25, 2018 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pranavb-ca/bda3d35c214b7f30d0620d061a2dc346 to your computer and use it in GitHub Desktop.
Save pranavb-ca/bda3d35c214b7f30d0620d061a2dc346 to your computer and use it in GitHub Desktop.
Replace Func with udpate stage
avg_box = sum(x, y)/25; //sum(x, y) is the sum of the pixels in a 5x5 neighborhood of (x, y).
calc(x, y) = (0);
calc(x, y) << 1) + (src_data(x+r.x, y+r.y) > avg_box(x, y));
output(x, y) = calc(x, y);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment