You completely did not say that at the beginning.
In any case, use a Sobel filter to get the Gx and Gy values.
The direction you want to find should be stored as a CVector2( X, Y ).
Create a new CVector2( Gx, Gy ) and normalize it.
The magnitude in the direction CVector2( X, Y ) is:
CVector2( X, Y ) DOT CVector2( Gx, Gy ).
Done and done.
Edited by L. Spiro, 20 February 2013 - 11:01 PM.
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums