IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24293


Ignore:
Timestamp:
Jun 1, 2009, 4:15:53 PM (17 years ago)
Author:
Paul Price
Message:

Include variance in matrix equation.

File:
1 edited

Legend:

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

    r24093 r24293  
    1616
    1717//#define TESTING
     18
     19#define USE_VARIANCE                    // Include variance in equation?
    1820
    1921//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    3133    for (int y = - footprint; y <= footprint; y++) {
    3234        for (int x = - footprint; x <= footprint; x++) {
    33             sum += image1->kernel[y][x] * image2->kernel[y][x] / 1.0; // variance->kernel[y][x];
     35            double value = image1->kernel[y][x] * image2->kernel[y][x];
     36#ifdef USE_VARIANCE
     37            value /= variance->kernel[y][x];
     38#endif
     39            sum += value;
    3440        }
    3541    }
     
    195201            for (int y = - footprint; y <= footprint; y++) {
    196202                for (int x = - footprint; x <= footprint; x++) {
    197                     sumC += conv->kernel[y][x] / 1.0; // variance->kernel[y][x];
     203                    double value = conv->kernel[y][x];
     204#ifdef USE_VARIANCE
     205                    value /= variance->kernel[y][x];
     206#endif
     207                    sumC += value;
    198208                }
    199209            }
     
    218228        for (int y = - footprint; y <= footprint; y++) {
    219229            for (int x = - footprint; x <= footprint; x++) {
    220                 double invNoise2 = 1.0 / 1.0; // variance->kernel[y][x];
     230                double invNoise2 = 1.0;
     231#ifdef USE_VARIANCE
     232                invNoise2 /= variance->kernel[y][x];
     233#endif
    221234                double value = input->kernel[y][x] * invNoise2;
    222235                sumI += value;
     
    277290        for (int y = - footprint; y <= footprint; y++) {
    278291            for (int x = - footprint; x <= footprint; x++) {
    279                 sumTC += target->kernel[y][x] * conv->kernel[y][x] / 1.0; // variance->kernel[y][x];
     292                double value = target->kernel[y][x] * conv->kernel[y][x];
     293#ifdef USE_VARIANCE
     294                value /= variance->kernel[y][x];
     295#endif
     296                sumTC += value;
    280297            }
    281298        }
     
    297314        for (int y = - footprint; y <= footprint; y++) {
    298315            for (int x = - footprint; x <= footprint; x++) {
    299                 float value = target->kernel[y][x] / 1.0; // variance->kernel[y][x];
     316                double value = target->kernel[y][x];
     317#ifdef USE_VARIANCE
     318                value /= variance->kernel[y][x];
     319#endif
    300320                sumIT += value * input->kernel[y][x];
    301321                sumT += value;
     
    366386        for (int y = - footprint; y <= footprint; y++) {
    367387            for (int x = - footprint; x <= footprint; x++) {
    368                 sumC += conv->kernel[y][x] / 1.0; // variance->kernel[y][x];
     388                double value = conv->kernel[y][x];
     389#ifdef USE_VARIANCE
     390                value /= variance->kernel[y][x];
     391#endif
     392                sumC += value;
    369393            }
    370394        }
Note: See TracChangeset for help on using the changeset viewer.