IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4035


Ignore:
Timestamp:
May 25, 2005, 1:08:33 PM (21 years ago)
Author:
gusciora
Message:

Compile bugs in the initial version of pmImageSubtract.c were fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmImageSubtract.c

    r4033 r4035  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-05-25 23:00:05 $
     7 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-05-25 23:08:33 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    395395XXX: Modify loop so that terms higher than spatialOrder are not computed.
    396396 ******************************************************************************/
    397 static psImage GenSpatialOrder(psS32 spatialOrder,
    398                                psF32 x,
    399                                psF32 y)
     397static psImage *GenSpatialOrder(psS32 spatialOrder,
     398                                psF32 x,
     399                                psF32 y)
    400400{
    401401    psImage *polyValues = psImageAlloc(spatialOrder+1, spatialOrder+1, PS_TYPE_F64);
     
    407407        for (psS32 j = 0; j < spatialOrder + 1; j++) {
    408408            polyValues->data.F64[i][j] = ySum;
    409             ySum*= imageY;
    410         }
    411         xSum*= imageX;
     409            ySum*= y;
     410        }
     411        xSum*= x;
    412412    }
    413413
     
    458458
    459459    //
    460     // The [i][j]-th element of this structure will hold (x^i * y^j) for the stamp.
    461     //
    462     psImage *polyValues = psImageAlloc(spatialOrder+1, spatialOrder+1, PS_TYPE_F64);
    463 
    464     //
    465460    // We iterate over each stamp, allocate the matrix and vectors if
    466461    // necessary, and then calculate those matrix/vectors.
     
    698693XXX: Static structure for polyValues?
    699694 ******************************************************************************/
    700 statis psF32 *ConvolvePixelPois(const psImage *input,
    701                                 const psImage *mask,
    702                                 psU32 badStampMaskVal,
    703                                 const psVector *solution,
    704                                 const psSubtractionKernels *kernels
    705                                 psS32 col,
    706                                 psS32 row)
     695static psF32 ConvolvePixelPois(const psImage *input,
     696                               const psImage *mask,
     697                               psU32 badStampMaskVal,
     698                               const psVector *solution,
     699                               const psSubtractionKernels *kernels,
     700                               psS32 col,
     701                               psS32 row)
    707702{
    708703    psS32 nBF = kernels->u->n;
     
    711706    psF32 background = solution->data.F64[solution->n-1];
    712707    psS32 spatialOrder = kernels->p_spatialOrder;
     708    psF32 conv = background; // Initial convolved value
    713709
    714710    if ((mask == NULL) || !(mask->data.U8[row][col] & badStampMaskVal)) {
    715         psF32 conv = background; // Initial convolved value
    716711        psF32 imageX = (((psF32) col) - numColsHalf) / numColsHalf; // Normalised position
    717712        psF32 imageY = (((psF32) row) - numRowsHalf) / numRowsHalf; // Normalised position
     
    744739            }
    745740        }
    746     }
    747     psFree(polyValues);
     741        psFree(polyValues);
     742    }
    748743
    749744    return(conv);
     
    763758XXX: Static structure for polyValues?
    764759 ******************************************************************************/
    765 statis psF32 *ConvolvePixelIsis(const psImage *input,
    766                                 const psImage *mask,
    767                                 psU32 badStampMaskVal,
    768                                 const psVector *solution,
    769                                 const psSubtractionKernels *kernels
    770                                 psS32 col,
    771                                 psS32 row)
     760static psF32 ConvolvePixelIsis(const psImage *input,
     761                               const psImage *mask,
     762                               psU32 badStampMaskVal,
     763                               const psVector *solution,
     764                               const psSubtractionKernels *kernels,
     765                               psS32 col,
     766                               psS32 row)
    772767{
    773768    psS32 nBF = kernels->u->n;
     
    776771    psF32 background = solution->data.F64[solution->n-1];
    777772    psS32 spatialOrder = kernels->p_spatialOrder;
     773    psS32 kernelSize = kernels->p_size;
     774    psF32 conv = background; // Initial convolved value
    778775
    779776    if ((mask == NULL) || !(mask->data.U8[row][col] & badStampMaskVal)) {
    780         psF32 conv = background; // Initial convolved value
    781777        psF32 imageX = (((psF32) col) - numColsHalf) / numColsHalf; // Normalised position
    782778        psF32 imageY = (((psF32) row) - numRowsHalf) / numRowsHalf; // Normalised position
     
    805801
    806802                    conv += solution->data.F64[k] *
    807                             input->data.F32[yy+y][xx+x] *
     803                            input->data.F32[yy+row][xx+col] *
    808804                            preCalc->data.F32[yy-kernelSize][xx-kernelSize] *
    809805                            polyVal;
     
    811807            }
    812808        }
    813     }
    814     psFree(polyValues);
     809        psFree(polyValues);
     810    }
    815811
    816812    return(conv);
    817813}
    818 
    819 
    820 
    821 
    822 
    823814
    824815/*******************************************************************************
     
    11441135        // the psImage polyValues will hold (x^i * y^j) for the stamp.
    11451136        //
    1146         psImage *polyValues = GenSpatialOrder(psS32 spatialOrder, x, y);
     1137        psImage *polyValues = GenSpatialOrder(spatialOrder, x, y);
    11471138
    11481139        for (psS32 k = 0 ; k < nBF ; k++) {
Note: See TracChangeset for help on using the changeset viewer.