src/kernel.c
l_int32
makeGaussianKernelSep(l_int32    halfheight,
                      l_int32    halfwidth,
                      l_float32  stdev,
                      l_float32  max,
                      L_KERNEL **pkelx,
                      L_KERNEL **pkely)
{
    PROCNAME("makeGaussianKernelSep");

    if (!pkelx || !pkely)
        return ERROR_INT("&kelx and &kely not defined", procName, 1);

    *pkelx = makeGaussianKernel(0, halfwidth, stdev, max);
    *pkely = makeGaussianKernel(halfheight, 0, stdev, 1.0);
    return 0;
}
/*!
 *  makeGaussianKernelSep()
 *
 *      Input:  halfheight, halfwidth (sx = 2 * halfwidth + 1, etc)
 *              stdev (standard deviation)
 *              max (value at (cx,cy))
 *              &kelx (<return> x part of kernel)
 *              &kely (<return> y part of kernel)
 *      Return: 0 if OK, 1 on error
 *
 *  Notes:
 *      (1) See makeGaussianKernel() for description of input parameters.
 *      (2) These kernels are constructed so that the result of both
 *          normalized and un-normalized convolution will be the same
 *          as when convolving with pixConvolve() using the full kernel.
 *      (3) The trick for the un-normalized convolution is to have the
 *          product of the two kernel elemets at (cx,cy) be equal to max,
 *          not max**2.  That's why the max for kely is 1.0.  If instead
 *          we use sqrt(max) for both, the results are slightly less
 *          accurate, when compared to using the full kernel in
 *          makeGaussianKernel().
 */


(1) See makeGaussianKernel() for description of input parameters.
(2) These kernels are constructed so that the result of both
normalized and un-normalized convolution will be the same
as when convolving with pixConvolve() using the full kernel.
(3) The trick for the un-normalized convolution is to have the
product of the two kernel elemets at (cx,cy) be equal to max,
not max**2.  That's why the max for kely is 1.0.  If instead
we use sqrt(max) for both, the results are slightly less
accurate, when compared to using the full kernel in
makeGaussianKernel().
( 1 ) See makeGaussianKernel () for description of input parameters . ( 2 ) These kernels are constructed so that the result of both normalized and un - normalized convolution will be the same as when convolving with pixConvolve () using the full kernel . ( 3 ) The trick for the un - normalized convolution is to have the product of the two kernel elemets at ( cx cy ) be equal to max not max ** 2 . That ' s why the max for kely is 1 . 0 . If instead we use sqrt ( max ) for both the results are slightly less accurate when compared to using the full kernel in makeGaussianKernel () .
l_int32
makeGaussianKernelSep(l_int32    halfheight,
                      l_int32    halfwidth,
                      l_float32  stdev,
                      l_float32  max,
                      L_KERNEL **pkelx,
                      L_KERNEL **pkely)
{
    PROCNAME("makeGaussianKernelSep");
    if (!pkelx || !pkely)
        return ERROR_INT("&kelx and &kely not defined", procName, 1);
    *pkelx = makeGaussianKernel(0, halfwidth, stdev, max);
    *pkely = makeGaussianKernel(halfheight, 0, stdev, 1.0);
    return 0;
}
l_int32 makeGaussianKernelSep ( l_int32 halfheight , l_int32 halfwidth , l_float32 stdev , l_float32 max , L_KERNEL * * pkelx , L_KERNEL * * pkely ) { PROCNAME ( " " ) ; if ( ! pkelx || ! pkely ) return ERROR_INT ( " " , procName , 1 ) ; * pkelx = makeGaussianKernel ( 0 , halfwidth , stdev , max ) ; * pkely = makeGaussianKernel ( halfheight , 0 , stdev , 1.0 ) ; return 0 ; }
makeGaussianKernelSep()
      Input:  halfheight, halfwidth (sx = 2 * halfwidth + 1, etc)
              stdev (standard deviation)
              max (value at (cx,cy))
              &kelx (<return> x part of kernel)
              &kely (<return> y part of kernel)
      Return: 0 if OK, 1 on error
makeGaussianKernelSep () Input : halfheight halfwidth ( sx = 2 * halfwidth + 1 etc ) stdev ( standard deviation ) max ( value at ( cx cy )) &kelx ( <return > x part of kernel ) &kely ( <return > y part of kernel ) Return : 0 if OK 1 on error