<a id="easyimage-scalar-gradient"></a>

# Scalar Gradient

[`EasyImage::GradientScalar`](../../../doxygen_cpp/classeVision_1_1EasyImage.html#a8ee97dbb1f48f7051f771dccc421ebbe) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyImage.html#a851fb38312b0880b67db85b9406a2dfc) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyImage.html#ae116ab30a9a40b142bb4345d7c1d5364) computes the (scalar) gradient image derived from a given source image.

* The scalar value derived from the gradient depends on the preset lookup table image.
* The gradient of a grayscale image corresponds to a vector, the components of which are the partial derivatives of the gray-level signal in the horizontal and vertical direction. A vector can be characterized by a direction and a length, corresponding to the gradient orientation, and the gradient magnitude.

This function generates a gradient direction or gradient magnitude map (gray-level image) from a given gray-level image.

* For efficiency, a precomputed lookup table is used to define the desired transformation.
* The look-up table submitted as input must be initialized using [`EasyImage::ArgumentImage`](../../../doxygen_cpp/classeVision_1_1EasyImage.html#ad79c1d4b0ce344bab64ebbe1b30766d0) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyImage.html#aa3793f588323c6eb7d9e282e987c4ad8) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyImage.html#ae6fbb55044d6f05b94b8fdf71ca192db) or [`EasyImage::ModulusImage`](../../../doxygen_cpp/classeVision_1_1EasyImage.html#ab6b5fc2ca1a5cfa3654cec603e747522) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyImage.html#a5416cbcb609cea2a10b8c8be6af13b06) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyImage.html#a309d0a5e1107b71dc486cd2883f8cd08) once before calling [`EasyImage::GradientScalar`](../../../doxygen_cpp/classeVision_1_1EasyImage.html#a8ee97dbb1f48f7051f771dccc421ebbe) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyImage.html#a851fb38312b0880b67db85b9406a2dfc) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyImage.html#ae116ab30a9a40b142bb4345d7c1d5364).

<a id="easyimage-scalar-gradient-quick-links"></a>

## See Also

Easy to understand, ready to copy code snippets.

Detect edges using gradient magnitudes and hysteresis thresholding.
