Skip to content

Instantly share code, notes, and snippets.

@sinc
Created February 27, 2012 17:23
Show Gist options
  • Save sinc/1925626 to your computer and use it in GitHub Desktop.
Save sinc/1925626 to your computer and use it in GitHub Desktop.
Gradient
ret_corners[num_corners].dIx = (p[pixel[4]] - p[pixel[12]]) +
(p[pixel[3]] + p[pixel[5]] - p[pixel[11]] - p[pixel[13]])*0.924f +
(p[pixel[2]] + p[pixel[6]] - p[pixel[10]] - p[pixel[14]])*0.707f +
((p[pixel[1]] + p[pixel[7]] - p[pixel[9]] - p[pixel[15]])*0.383f);
ret_corners[num_corners].dIy = (p[pixel[0]] - p[pixel[8]]) +
(p[pixel[1]] + p[pixel[15]] - p[pixel[7]] - p[pixel[9]])*0.924f +
(p[pixel[2]] + p[pixel[14]] - p[pixel[6]] - p[pixel[10]])*0.707f +
((p[pixel[3]] + p[pixel[13]] - p[pixel[5]] - p[pixel[11]])*0.383f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment