IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 4, 2009, 10:24:33 AM (17 years ago)
Author:
Paul Price
Message:

Calculate covariance matrix for output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/pswarp/src/pswarpTransformTile.c

    r21235 r21282  
    88    psFree(args->interp);
    99    psFree(args->region);
     10    psFree(args->covariance);
    1011    return;
    1112}
     
    3031    args->yMin = PS_MAX_S32;
    3132    args->yMax = PS_MIN_S32;
     33    args->covariance = NULL;
    3234
    3335    return args;
     
    104106    }
    105107
     108    if (goodPixels > 0) {
     109        float xOut = 0.5 * (xMin + xMax), yOut = 0.5 * (yMin + yMax); // Position of interest on output
     110        double xIn, yIn;                // Position of interest on input
     111        pswarpMapApply(&xIn, &yIn, map, xOut + 0.5, yOut + 0.5);
     112        // XXX Why are we subtracting the *output* col0,row0 from the *input* coordinates?
     113        // I expect these are zero, so that it makes no difference, but it's distracting.
     114        xIn -= outCol0;
     115        yIn -= outRow0;
     116        psKernel *kernel = psImageInterpolationKernel(xIn, yIn, args->interp->mode); // Interpolation kernel
     117        args->covariance = psImageCovarianceCalculate(kernel, args->output->covariance);
     118        psFree(kernel);
     119    }
     120
    106121    args->goodPixels = goodPixels;
    107122    args->xMin = xMin;
Note: See TracChangeset for help on using the changeset viewer.