- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/psModules
- Property svn:mergeinfo deleted
-
branches/pap/psModules/src/imcombine/pmSubtractionKernels.c
r20421 r25027 145 145 146 146 // Calculate moments 147 double sum = 0.0; // Sum of kernel component, for normalisation148 147 double moment = 0.0; // Moment, for penalty 149 148 for (int v = -size, y = 0; v <= size; v++, y++) { 150 149 for (int u = -size, x = 0; u <= size; u++, x++) { 151 150 double value = xKernel->data.F32[x] * yKernel->data.F32[y]; // Value of kernel 152 sum += value;153 151 moment += value * (PS_SQR(u) + PS_SQR(v)); 154 152 } … … 163 161 } 164 162 } 165 sum = 1.0 / s um;163 sum = 1.0 / sqrt(sum); 166 164 psBinaryOp(xKernel, xKernel, "*", psScalarAlloc(sum, PS_TYPE_F32)); 167 165 psBinaryOp(yKernel, yKernel, "*", psScalarAlloc(sum, PS_TYPE_F32)); 168 moment *= sum;166 moment *= PS_SQR(sum); 169 167 } 170 168
Note:
See TracChangeset
for help on using the changeset viewer.
