IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25044


Ignore:
Timestamp:
Aug 10, 2009, 5:01:28 PM (17 years ago)
Author:
Paul Price
Message:

Don't care about variance factors any more --- the covariance matrix takes care of this.

File:
1 edited

Legend:

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

    r23780 r25044  
    129129
    130130
    131     // Set the variance factors
    132     float vf1 = 1.0, vf2 = 1.0;         // Variance factors for each image
    133     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 area
    149     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 factor
    156 #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 
    169131    // Kernel shape
    170132    {
Note: See TracChangeset for help on using the changeset viewer.