IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 20, 2008, 3:27:33 PM (18 years ago)
Author:
Paul Price
Message:

Dual convolution seems to be working. Removed division by 'weight' when generating equation --- seems to bias the fits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080617/psModules/src/imcombine/pmSubtractionEquation.c

    r18239 r18248  
    3030    for (int y = - footprint; y <= footprint; y++) {
    3131        for (int x = - footprint; x <= footprint; x++) {
    32             sum += image1->kernel[y][x] * image2->kernel[y][x] / weight->kernel[y][x];
     32            sum += image1->kernel[y][x] * image2->kernel[y][x] / 1.0; // weight->kernel[y][x];
    3333        }
    3434    }
     
    194194            for (int y = - footprint; y <= footprint; y++) {
    195195                for (int x = - footprint; x <= footprint; x++) {
    196                     sumC += conv->kernel[y][x] / weight->kernel[y][x];
     196                    sumC += conv->kernel[y][x] / 1.0; // weight->kernel[y][x];
    197197                }
    198198            }
     
    217217        for (int y = - footprint; y <= footprint; y++) {
    218218            for (int x = - footprint; x <= footprint; x++) {
    219                 double invNoise2 = 1.0 / weight->kernel[y][x];
     219                double invNoise2 = 1.0 / 1.0; // weight->kernel[y][x];
    220220                double value = input->kernel[y][x] * invNoise2;
    221221                sumI += value;
     
    276276        for (int y = - footprint; y <= footprint; y++) {
    277277            for (int x = - footprint; x <= footprint; x++) {
    278                     sumTC += target->kernel[y][x] * conv->kernel[y][x] / weight->kernel[y][x];
     278                sumTC += target->kernel[y][x] * conv->kernel[y][x] / 1.0; // weight->kernel[y][x];
    279279            }
    280280        }
     
    296296        for (int y = - footprint; y <= footprint; y++) {
    297297            for (int x = - footprint; x <= footprint; x++) {
    298                 float value = target->kernel[y][x] / weight->kernel[y][x];
     298                float value = target->kernel[y][x] / 1.0; // weight->kernel[y][x];
    299299                sumIT += value * input->kernel[y][x];
    300300                sumT += value;
     
    365365        for (int y = - footprint; y <= footprint; y++) {
    366366            for (int x = - footprint; x <= footprint; x++) {
    367                 sumC += conv->kernel[y][x] / weight->kernel[y][x];
     367                sumC += conv->kernel[y][x] / 1.0; // weight->kernel[y][x];
    368368            }
    369369        }
     
    384384
    385385// Add in penalty term to least-squares vector
    386 static bool calculatePenalty(int numPixels, // Number of pixels; for normalisation
    387                              psVector *vector, // Vector to which to add in penalty term
     386static bool calculatePenalty(psVector *vector, // Vector to which to add in penalty term
    388387                             const pmSubtractionKernels *kernels // Kernel parameters
    389388    )
     
    393392    }
    394393
    395     float penalty = numPixels * kernels->penalty; // Penalty value
    396394    psVector *penalties = kernels->penalties; // Penalties for each kernel component
    397395    int spatialOrder = kernels->spatialOrder; // Order of spatial variations
     
    400398        for (int yOrder = 0, index = i; yOrder <= spatialOrder; yOrder++) {
    401399            for (int xOrder = 0; xOrder <= spatialOrder - yOrder; xOrder++, index += numKernels) {
    402                 vector->data.F64[index] -= penalty * penalties->data.F32[i];
     400                vector->data.F64[index] -= penalties->data.F32[i];
    403401            }
    404402        }
     
    711709            }
    712710        }
    713         calculatePenalty(numStamps * PS_SQR(2 * stamps->footprint + 1), sumVector, kernels);
     711        calculatePenalty(sumVector, kernels);
    714712
    715713        psVector *permutation = NULL;       // Permutation vector, required for LU decomposition
     
    758756            }
    759757        }
    760         calculatePenalty(numStamps * PS_SQR(2 * stamps->footprint + 1), sumVector1, kernels);
    761         calculatePenalty(numStamps * PS_SQR(2 * stamps->footprint + 1), sumVector2, kernels);
     758        calculatePenalty(sumVector1, kernels);
     759        calculatePenalty(sumVector2, kernels);
    762760
    763761#if 0
     
    812810        psImage *F = (psImage*)psBinaryOp(NULL, CtBiC, "-", A);
    813811        assert(F->numRows == numParams && F->numCols == numParams);
    814         float det = NAN;
     812        float det = 0.0;
    815813        psImage *Fi = psMatrixInvert(NULL, F, &det);
    816814        assert(Fi->numRows == numParams && Fi->numCols == numParams);
Note: See TracChangeset for help on using the changeset viewer.