Skip to content

Instantly share code, notes, and snippets.

@walidvb
Created February 5, 2013 15:55
Show Gist options
  • Save walidvb/4715336 to your computer and use it in GitHub Desktop.
Save walidvb/4715336 to your computer and use it in GitHub Desktop.
for(int i = 0; i < w; i+=chan)
{
for(int j = 0; j < h; j+=chan)
{
uchar v = srcImg.pixelAt(i, j) > 127 ? 255 : 0;
if(d){cout << v << endl; d = !d;}
dstImg.pixelWrite(v, i, j);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment