IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 28, 2010, 5:32:15 PM (16 years ago)
Author:
Paul Price
Message:

Attempting to use a wide function for the normalisation component, rather than delta-function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/psModules/src/imcombine/pmSubtractionKernels.c

    r26686 r26717  
    1515
    1616#define RINGS_BUFFER 10                 // Buffer size for RINGS data
     17
     18#define NORM_WIDTH 7.5
    1719
    1820// Free function for pmSubtractionKernels
     
    3032    psFree(kernels->solution2);
    3133    psFree(kernels->sampleStamps);
     34    psFree(kernels->norm);
    3235}
    3336
     
    242245
    243246    if (zeroNull) {
    244         preCalc->kernel->kernel[0][0] -= 1.0;
     247        //        preCalc->kernel->kernel[0][0] -= 1.0;
     248        for (int v = -size; v <= size; v++) {
     249            for (int u = -size; u <= size; u++) {
     250                preCalc->kernel->kernel[v][u] -= kernels->norm->kernel[v][u];
     251            }
     252        }
    245253    }
    246254
     
    582590    kernels->fMinResMean  = NAN;
    583591    kernels->fMinResStdev = NAN;
     592
     593    kernels->norm = psKernelAlloc(-size, size, -size, size);
     594    double sumNorm = 0.0;
     595    float sigma = NORM_WIDTH / 2.35;
     596    for (int y = -size; y <= size; y++) {
     597        for (int x = -size; x <= size; x++) {
     598            float z = 0.5 * (PS_SQR(x) + PS_SQR(y)) / PS_SQR(sigma);
     599            sumNorm += kernels->norm->kernel[y][x] = expf(-z);
     600        }
     601    }
     602    for (int y = -size; y <= size; y++) {
     603        for (int x = -size; x <= size; x++) {
     604            kernels->norm->kernel[y][x] /= sumNorm;
     605        }
     606    }
    584607
    585608    return kernels;
Note: See TracChangeset for help on using the changeset viewer.