Changeset 14824 for trunk/psModules/src/imcombine/pmSubtraction.c
- Timestamp:
- Sep 12, 2007, 10:21:41 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r14801 r14824 4 4 * @author GLG, MHPCC 5 5 * 6 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-09-1 0 20:10:05$6 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-09-12 20:21:41 $ 8 8 * 9 9 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii … … 86 86 87 87 // Take the square of the normal kernel 88 double sumNormal = 0.0, sumVariance = 0.0; // Sum of the normal and variance kernels 88 89 for (int v = yMin; v <= yMax; v++) { 89 90 for (int u = xMin; u <= xMax; u++) { 90 kernel->kernel[v][u] = PS_SQR(normalKernel->kernel[v][u]); 91 } 92 } 91 float value = normalKernel->kernel[v][u]; // Value of interest 92 float value2 = PS_SQR(value); // Value squared 93 sumNormal += value; 94 sumVariance += value2; 95 kernel->kernel[v][u] = value2; 96 } 97 } 98 99 // Normalise so that the sum of the variance kernel is the square of the sum of the normal kernel 100 // This is required to keep the relative scaling between the image and the weight map 101 psBinaryOp(kernel->image, kernel->image, "*", 102 psScalarAlloc(PS_SQR(sumNormal) / sumVariance, PS_TYPE_F32)); 93 103 94 104 return kernel;
Note:
See TracChangeset
for help on using the changeset viewer.
