IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 8, 2007, 12:59:04 PM (19 years ago)
Author:
eugene
Message:

accepting updates from HEAD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071023/psModules/src/imcombine/pmStackReject.c

    r14701 r15516  
    5252
    5353    // Convolve the image with the kernel --- we're basically applying a matched filter and then thresholding
    54     psImage *convolved = NULL;          // Convolved image
     54    pmReadout *convRO = pmReadoutAlloc(NULL); // Readout with convolved image
     55    pmReadout *inRO = pmReadoutAlloc(NULL); // Readout with input image
     56    inRO->image = image;
    5557    for (int i = 0; i < numRegions; i++) {
    5658        psRegion *region = regions->data[i]; // Region of interest
    5759        psVector *solution = solutions->data[i]; // Solution of interest
    58         if (!pmSubtractionConvolve(&convolved, NULL, NULL, image, NULL, NULL, 0,
    59                                    region, solution, kernels, true)) {
     60        if (!pmSubtractionConvolve(convRO, inRO, NULL, NULL, 0, region, solution, kernels,
     61                                   PM_SUBTRACTION_MODE_1, true)) {
    6062            psError(PS_ERR_UNKNOWN, false, "Unable to convolve mask image in region %d.", i);
    61             psFree(convolved);
    62             psFree(image);
     63            psFree(convRO);
     64            psFree(inRO);
    6365            return NULL;
    6466        }
     
    7375        if (!kernel) {
    7476            psError(PS_ERR_UNKNOWN, false, "Unable to generate kernel image.");
    75             psFree(convolved);
    76             psFree(image);
     77            psFree(convRO);
     78            psFree(inRO);
    7779            return NULL;
    7880        }
     
    8587        psFree(kernel);
    8688
    87         psImage *subConv = psImageSubset(convolved, *region); // Sub-image of convolved image
     89        psImage *subConv = psImageSubset(convRO->image, *region); // Sub-image of convolved image
    8890        psBinaryOp(subConv, subConv, "*", psScalarAlloc(1.0 / sum, PS_TYPE_F32));
    8991    }
    90     psFree(image);
     92    psFree(inRO);
     93    psImage *convolved = psMemIncrRefCounter(convRO->image);
     94    psFree(convRO);
    9195
    9296    // Threshold the convolved image
Note: See TracChangeset for help on using the changeset viewer.