protected float gradient ( int x , int y ) { float dx = getIntensity ( x + 1 , y ) - getIntensity ( x - 1 , y ) ; float dy = getIntensity ( x , y + 1 ) - getIntensity ( x , y - 1 ) ; return dx * dx + dy * dy ; }
Computes the gradient at the specified pixel