IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2009, 11:30:52 PM (17 years ago)
Author:
Paul Price
Message:

Reworked dual convolution equation setup. Fixing up debugging (output of individual kernel basis functions). Not working yet --- the corresponding k1 and k2 terms appear anti-correllated: when k1_i is strongly positive, k2_i is strongly negative.

File:
1 edited

Legend:

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

    r25833 r25834  
    964964}
    965965
    966 #if 0
     966#if 1
    967967psArray *pmSubtractionKernelSolutions(const pmSubtractionKernels *kernels, float x, float y, bool wantDual)
    968968{
     
    972972    PS_ASSERT_FLOAT_WITHIN_RANGE(y, -1.0, 1.0, NULL);
    973973
    974     psArray *images = psArrayAlloc(kernels->solution1->n - 1); // Images of each kernel to return
    975     psVector *fakeSolution = psVectorAlloc(kernels->solution1->n, PS_TYPE_F64); // Fake solution vector
    976     psVectorInit(fakeSolution, 0.0);
    977 
    978     for (int i = 0; i < kernels->solution1->n - 1; i++) {
    979         fakeSolution->data.F64[i] = kernels->solution1->data.F64[i];
     974    psVector *solution = wantDual ? kernels->solution2 : kernels->solution1; // Solution of interest
     975    psVector *backup = psVectorCopy(NULL, solution, PS_TYPE_F64);  // Backup version
     976
     977    int num = wantDual ? solution->n - 1 : solution->n; // Number of kernel basis functions
     978
     979    psArray *images = psArrayAlloc(num); // Images of each kernel to return
     980    psVectorInit(solution, 0.0);
     981
     982    for (int i = 0; i < num; i++) {
     983        solution->data.F64[i] = backup->data.F64[i];
    980984        images->data[i] = pmSubtractionKernelImage(kernels, x, y, wantDual);
    981         fakeSolution->data.F64[i] = 0.0;
    982     }
    983 
    984     psFree(fakeSolution);
     985        solution->data.F64[i] = 0.0;
     986    }
     987    psVectorCopy(solution, backup, PS_TYPE_F64);
     988    psFree(backup);
    985989
    986990    return images;
Note: See TracChangeset for help on using the changeset viewer.