IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 1, 2009, 5:45:42 PM (17 years ago)
Author:
Paul Price
Message:

Fixing normalisation: was normalising both x and y by the sum of the products.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionKernels.c

    r20421 r24295  
    145145
    146146                // Calculate moments
    147                 double sum = 0.0;       // Sum of kernel component, for normalisation
    148147                double moment = 0.0;    // Moment, for penalty
    149148                for (int v = -size, y = 0; v <= size; v++, y++) {
    150149                    for (int u = -size, x = 0; u <= size; u++, x++) {
    151150                        double value = xKernel->data.F32[x] * yKernel->data.F32[y]; // Value of kernel
    152                         sum += value;
    153151                        moment += value * (PS_SQR(u) + PS_SQR(v));
    154152                    }
     
    163161                        }
    164162                    }
    165                     sum = 1.0 / sum;
     163                    sum = 1.0 / sqrt(sum);
    166164                    psBinaryOp(xKernel, xKernel, "*", psScalarAlloc(sum, PS_TYPE_F32));
    167165                    psBinaryOp(yKernel, yKernel, "*", psScalarAlloc(sum, PS_TYPE_F32));
Note: See TracChangeset for help on using the changeset viewer.