IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 7, 2004, 8:03:26 PM (22 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageStats.c

    r1448 r1719  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-10 01:55:34 $
     12*  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-09-08 06:02:47 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    185185psPolynomial1D* *p_psCreateChebyshevPolys(int maxChebyPoly)
    186186{
    187     psPolynomial1D* *chebPolys = NULL;
     187    psPolynomial1D **chebPolys = NULL;
    188188    int i = 0;
    189189    int j = 0;
    190190
    191     chebPolys = (psPolynomial1D* *) psAlloc(maxChebyPoly * sizeof(psPolynomial1D* ));
     191    chebPolys = (psPolynomial1D **) psAlloc(maxChebyPoly * sizeof(psPolynomial1D *));
    192192    for (i = 0; i < maxChebyPoly; i++) {
    193         chebPolys[i] = psPolynomial1DAlloc(i + 1);
     193        chebPolys[i] = psPolynomial1DAlloc(i + 1, PS_POLYNOMIAL_ORD);
    194194    }
    195195
     
    333333    int i = 0;
    334334    int j = 0;
    335     float **sums = NULL;
     335    //    float **sums = NULL;
    336336    psPolynomial1D* *chebPolys = NULL;
    337337    int maxChebyPoly = 0;
     
    340340    float polySum = 0.0;
    341341
    342     // Create the sums[][] data structure.  This
    343     // will hold the LHS of
    344     // equation
    345     // 29 in the ADD: sums[k][l] = SUM {
    346     // image(x,y) * Tk(x) * Tl(y) }
    347     sums = (float **)psAlloc(coeffs->nX * sizeof(float *));
    348     for (i = 0; i < coeffs->nX; i++) {
    349         sums[i] = (float *)psAlloc(coeffs->nY * sizeof(float));
    350     }
    351     for (i = 0; i < coeffs->nX; i++) {
    352         for (j = 0; j < coeffs->nY; j++) {
    353             sums[i][j] = 0.0;
    354         }
    355     }
     342    // Create the sums[][] data structure.  This will hold the LHS of
     343    // equation 29 in the ADD:
     344    //         sums[k][l] = SUM { image(x,y) * Tk(x) * Tl(y) }
     345    //
     346    //    sums = (float **)psAlloc(coeffs->nX * sizeof(float *));
     347    //    for (i = 0; i < coeffs->nX; i++) {
     348    //        sums[i] = (float *)psAlloc(coeffs->nY * sizeof(float));
     349    //    }
     350    //    for (i = 0; i < coeffs->nX; i++) {
     351    //        for (j = 0; j < coeffs->nY; j++) {
     352    //            sums[i][j] = 0.0;
     353    //        }
     354    //    }
    356355
    357356    // We scale the pixel positions to values
     
    375374                for (j = 0; j < coeffs->nY; j++) {
    376375                    polySum +=
    377                         psPolynomial1DEval
    378                         (rScalingFactors[x],
    379                          chebPolys[i]) *
    380                         psPolynomial1DEval(cScalingFactors[y], chebPolys[j]) * coeffs->coeff[i][j];
     376                        psPolynomial1DEval(rScalingFactors[x], chebPolys[i]) *
     377                        psPolynomial1DEval(cScalingFactors[y], chebPolys[j]) *
     378                        coeffs->coeff[i][j];
    381379
    382380                }
     
    394392
    395393    // Free some data
    396     for (i = 0; i < coeffs->nX; i++) {
    397         psFree(sums[i]);
    398     }
    399     psFree(sums);
     394    //    for (i = 0; i < coeffs->nX; i++) {
     395    //        psFree(sums[i]);
     396    //    }
     397    //    psFree(sums);
    400398    psFree(cScalingFactors);
    401399    psFree(rScalingFactors);
Note: See TracChangeset for help on using the changeset viewer.