- Timestamp:
- Aug 11, 2009, 3:54:00 PM (17 years ago)
- Location:
- branches/czw_branch/cleanup
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psModules/src/imcombine/pmSubtractionAnalysis.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/cleanup
- Property svn:mergeinfo changed
/trunk merged: 24940-24950,24953-24971,24973-24977,24986-24989,24993-25017,25019,25021,25023-25024,25026,25029-25031,25036-25049
- Property svn:mergeinfo changed
-
branches/czw_branch/cleanup/psModules/src/imcombine/pmSubtractionAnalysis.c
r23780 r25051 129 129 130 130 131 // Set the variance factors132 float vf1 = 1.0, vf2 = 1.0; // Variance factors for each image133 switch (kernels->mode) {134 case PM_SUBTRACTION_MODE_1:135 vf1 = pmSubtractionVarianceFactor(kernels, 0.5, 0.5, false);136 break;137 case PM_SUBTRACTION_MODE_2:138 vf2 = pmSubtractionVarianceFactor(kernels, 0.5, 0.5, false);139 break;140 case PM_SUBTRACTION_MODE_DUAL:141 vf1 = pmSubtractionVarianceFactor(kernels, 0.5, 0.5, false);142 vf2 = pmSubtractionVarianceFactor(kernels, 0.5, 0.5, true);143 break;144 default:145 psAbort("Invalid subtraction mode: %x", kernels->mode);146 }147 148 // Weight by the area149 if (region) {150 float norm = (region->x1 - region->x0 + 1) * (region->y1 - region->y0 + 1) / (numCols * numRows);151 vf1 *= norm;152 vf2 *= norm;153 }154 155 // Update the variance factor156 #define UPDATE_VARFACTOR(VF, ANALYSIS) { \157 psMetadataItem *vfItem = psMetadataLookup(analysis, ANALYSIS); \158 if (vfItem) { \159 psAssert(vfItem->type == PS_TYPE_F32, "Should be the type we said."); \160 vfItem->data.F32 += VF; \161 } else { \162 psMetadataAddF32(analysis, PS_LIST_TAIL, ANALYSIS, 0, "Variance factor weighted by the area", VF); \163 } \164 }165 166 UPDATE_VARFACTOR(vf1, PM_SUBTRACTION_ANALYSIS_VARFACTOR_1);167 UPDATE_VARFACTOR(vf2, PM_SUBTRACTION_ANALYSIS_VARFACTOR_2);168 169 131 // Kernel shape 170 132 {
Note:
See TracChangeset
for help on using the changeset viewer.
