IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2007, 9:02:55 AM (19 years ago)
Author:
Paul Price
Message:

Need to normalise sum of kernel components to unity in order to preserve photometric scaling.

File:
1 edited

Legend:

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

    r14360 r14420  
    44 *  @author GLG, MHPCC
    55 *
    6  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-07-21 04:30:57 $
     6 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2007-08-07 19:02:55 $
    88 *
    99 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    124124            int vStart = (KERNELS)->v->data.S32[i]; \
    125125            int vStop = (KERNELS)->vStop->data.S32[i]; \
     126            /* Normalising sum of kernel component to unity */ \
     127            value /= FUNC((uStop - uStart) * (vStop - vStart)); \
    126128            for (int v = vStart; v <= vStop; v++) { \
    127129                for (int u = uStart; u <= uStop; u++) { \
     
    180182              psVector *poly = preCalc->data[2]; /* Polynomial values */ \
    181183              int num = uCoords->n;     /* Number of pixels */ \
     184              value /= weightFunc(num); /* Normalising sum of kernel component to unity */ \
    182185              for (int j = 0; j < num; j++) { \
    183186                  int u = uCoords->data.S32[j], v = vCoords->data.S32[j]; /* Kernel coordinates */ \
     
    248251              int vStart = kernels->v->data.S32[i];
    249252              int vStop = kernels->vStop->data.S32[i];
     253
     254              // Normalising sum of kernel component to unity
     255              value /= weightFunc((uStop - uStart) * (vStop - vStart));
     256
    250257              for (int v = vStart; v <= vStop; v++) {
    251258                  for (int u = uStart; u <= uStop; u++) {
     
    304311              psVector *poly = preCalc->data[2]; // Polynomial values
    305312              int num = uCoords->n;     // Number of pixels
    306 
     313              value /= weightFunc(num); // Normalising sum of kernel component to unity
    307314              for (int j = 0; j < num; j++) {
    308315                  int u = uCoords->data.S32[j], v = vCoords->data.S32[j]; // Kernel coordinates
     
    362369              }
    363370          }
     371          sum /= (uStop - uStart) * (vStop - vStart); // Normalising sum of kernel component to unity
    364372          if (kernels->spatialOrder > 0 && index != kernels->subIndex) {
    365373              // The (0,0) element is subtracted from most kernels to preserve photometric scaling
     
    424432              sum += image->data.F32[y + v][x + u] * poly->data.F32[j];
    425433          }
     434          sum /= (double)num;           // Normalising sum of kernel component to unity
    426435          // The (0,0) kernel is subtracted from other kernels to preserve photometric scaling
    427436          return polyValue * sum - image->data.F32[0][0];
Note: See TracChangeset for help on using the changeset viewer.