Changeset 16352 for trunk/psModules/src/imcombine/pmSubtraction.c
- Timestamp:
- Feb 6, 2008, 6:03:23 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r15976 r16352 4 4 * @author GLG, MHPCC 5 5 * 6 * @version $Revision: 1.7 6$ $Name: not supported by cvs2svn $7 * @date $Date: 2008-0 1-02 20:35:32$6 * @version $Revision: 1.77 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-02-07 04:03:23 $ 8 8 * 9 9 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii … … 50 50 51 51 // Take the square of the normal kernel 52 double sumNormal = 0.0, sumVariance = 0.0; // Sum of the normal and variance kernels53 52 for (int v = yMin; v <= yMax; v++) { 54 53 for (int u = xMin; u <= xMax; u++) { 55 float value = normalKernel->kernel[v][u]; // Value of interest 56 float value2 = PS_SQR(value); // Value squared 57 sumNormal += value; 58 sumVariance += value2; 59 out->kernel[v][u] = value2; 60 } 61 } 62 63 // Normalise so that the sum of the variance kernel is the square of the sum of the normal kernel 64 // This is required to keep the relative scaling between the image and the weight map 65 psBinaryOp(out->image, out->image, "*", psScalarAlloc(PS_SQR(sumNormal) / sumVariance, PS_TYPE_F32)); 54 out->kernel[v][u] = PS_SQR(normalKernel->kernel[v][u]); 55 } 56 } 66 57 67 58 return out;
Note:
See TracChangeset
for help on using the changeset viewer.
