IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21406


Ignore:
Timestamp:
Feb 6, 2009, 3:54:40 PM (17 years ago)
Author:
Paul Price
Message:

Covariance matrix carries the scaling of the variance map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/psModules/src/imcombine/pmSubtraction.c

    r21303 r21406  
    4848
    4949    // Take the square of the normal kernel
    50     double sumNormal = 0.0, sumVariance = 0.0; // Sum of the normal and variance kernels
     50    double sumVariance = 0.0;           // Sum of the variance kernel
    5151    for (int v = yMin; v <= yMax; v++) {
    5252        for (int u = xMin; u <= xMax; u++) {
    53             float value = normalKernel->kernel[v][u]; // Value of interest
    54             float value2 = PS_SQR(value); // Value squared
    55             sumNormal += value;
     53            float value2 = PS_SQR(normalKernel->kernel[v][u]); // Value squared
    5654            sumVariance += value2;
    5755            out->kernel[v][u] = value2;
     
    5957    }
    6058
    61     // Normalise so that the sum of the variance kernel is the square of the sum of the normal kernel
    62     // This is required to keep the relative scaling between the image and the variance map
    63     psBinaryOp(out->image, out->image, "*", psScalarAlloc(PS_SQR(sumNormal) / sumVariance, PS_TYPE_F32));
     59    psBinaryOp(out->image, out->image, "*", psScalarAlloc(1.0 / sumVariance, PS_TYPE_F32));
    6460
    6561    return out;
Note: See TracChangeset for help on using the changeset viewer.