DESCRIPTION:This creates a 1-D array through gaussian with given sigma. The number of elements in the array is returned in 'nvec', and a pointer to the array is returned in 'gvec'. The array will have an odd number of elements, with the peak value in the center element, and will be symmetric around the center, like so:
Note that the elements of the 1-D vector are equal to the square roots of the diagonal elements of the equivalent 2-D matrix.
RETURN VALUES:
Function : * int atGaussVectorMake(const double sigma, * int *nvec, * float **gvec); * Description : * Create 1-D array through gaussian with given sigma. The number of * elements in the array is returned in 'nvec', and a pointer to the * array is returned in 'gvec'. The array will have an odd number of * elements, with the peak value in the center element, and will be * symmetric around the center, like so: * 0.05 0.15 0.40 1.0 0.40 0.15 0.05 * Note that the elements of the 1-D vector are equal to the square * roots of the diagonal elements of the equivalent 2-D matrix. * Return value : * SH_SUCCESS if we can allocate and form the new gaussian array * SH_GENERIC_ERROR if we can't allocate * Functions called from here : * None. * SIGNATURE: int atGaussVectorMake(const double sigma, int *nvec, float **gvec)
DESCRIPTION:
Given an input region (type FL32), an output region (type FL32), a temporary region (type FL32), and a 1-D gaussian, this convoloves the input region with the gaussian in both directions and places the output in the output region.
The idea is that we want to convolve a region with a two-dimensional gaussian, which is symmetric and has equal widths in both directions. The given vector must be a 1-D slice through the peak of the gaussian. xs We assume:
Thus, the 1-D slice should have an odd number of elements, with the peak value in the center element, and equal values on either side, like so:
RETURN VALUES:
SIGNATURE: /***************************************************************************** * Given an input REGION (type FL32), an output REGION (type FL32), * a temporary REGION (also type FL32), * and a 1-D gaussian (vector plus number of elements), * convolve the input REGION with the gaussian * in both directions (by rows and by cols). Place the output in the * output REGION. * * The idea is that we want to convolve a REGION with a two-dimensional * gaussian, which is symmetric and has equal widths in both dimensions. * The given vector must be a 1-D slice through the peak of the gaussian. * We assume: * * 1. the gaussian vector has an odd number of elements * 3. the gaussian has the same width in both directions * 4. the gaussian is symmetric about the peak value * * Thus, the 1-D slice should have an odd number of elements, with * the peak value in the center element, and equal values on either * side, like so: * * 0.05 0.15 0.45 1.0 0.45 0.15 0.05 * * Return SH_SUCCESS if all goes well, or SH_GENERIC_ERROR if not. */ #define MAXELEM 300 /* gaussian vector must have fewer elements */ int atRegConvolveWithGaussian(REGION *input, REGION *temp, REGION *output, int nelem, float *gvec)