lqr_carver_set_gradient_function — set the gradient function for an LqrCarver object
#include <lqr.h>
void lqr_carver_set_gradient_function( | LqrCarver* carver, |
LqrGradFuncType gf_ind); |
Function lqr_carver_set_gradient_function is used
to set the function of the gradient which will be used by
the LqrCarver object pointed to by carver
in determining the relevance of a pixel (less relevant pixels being the ones which
tend to be crossed by the seams, and thus the ones affected by rescaling).
For each pixel, the gradient is computed for each direction as the difference
of the values of nighboring pixels, the value being computed as the average
over the colour channels multiplied by the alpha channel value (if present).
Possible values of the argument gs_ind are:
LQR_GF_XABSabsolute value of the gradient in the direction of the rescaling
LQR_GF_SUMABSsum of absolute values of the gradients in both directions
LQR_GF_NORMgradient norm
LQR_GF_NULLalways returns 0
The default value for newly created LqrCarver objects is LQR_GF_XABS.
The value LQR_GF_NULL can be used together with the function
lqr_carver_bias_add_area(3) ant the like to override completely the
automatic feature detection.