IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 18, 2010, 12:01:15 PM (16 years ago)
Author:
Paul Price
Message:

Reworking ppStack to not grow the rejected pixels for the unconvolved stack. Also working with convolved and unconvolved stacks separately, so they don't have to be in memory at the same time. This should reduce the memory usage of ppStack.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmStackReject.c

    r27307 r27319  
    1010#include "pmSubtractionThreads.h"
    1111#include "pmSubtractionKernels.h"
     12
     13#include "pmStackReject.h"
    1214
    1315#define PIXEL_LIST_BUFFER 100           // Number of pixels to add to list at a time
     
    115117
    116118
    117 psPixels *pmStackReject(const psPixels *in, int numCols, int numRows, float threshold, float poorFrac,
    118                         int stride, const psArray *subRegions, const psArray *subKernels)
     119psPixels *pmStackReject(const psPixels *in, int numCols, int numRows, float threshold, int stride,
     120                        const psArray *subRegions, const psArray *subKernels)
    119121{
    120122    PS_ASSERT_PIXELS_NON_NULL(in, NULL);
     
    223225    psTrace("psModules.imcombine", 7, "Found %ld bad pixels", bad->n);
    224226
    225     // Now, grow the mask to include everything that touches a bad pixel in the convolution
    226     psImage *source = psPixelsToMask(NULL, bad, psRegionSet(0, numCols - 1, 0, numRows - 1),
     227    return bad;
     228}
     229
     230
     231psPixels *pmStackRejectGrow(const psPixels *in, int numCols, int numRows, float poorFrac,
     232                            const psArray *subRegions, const psArray *subKernels)
     233{
     234    PS_ASSERT_PIXELS_NON_NULL(in, NULL);
     235    PS_ASSERT_ARRAY_NON_NULL(subRegions, NULL);
     236    PS_ASSERT_ARRAY_NON_NULL(subKernels, NULL);
     237    PS_ASSERT_ARRAYS_SIZE_EQUAL(subRegions, subKernels, NULL);
     238
     239    psImage *source = psPixelsToMask(NULL, in, psRegionSet(0, numCols - 1, 0, numRows - 1),
    227240                                     PM_STACK_MASK_BAD); // Mask image to grow
    228241
     
    243256    bool oldThreads = psImageConvolveSetThreads(false); // Old value of threading for psImageColvolve
    244257
    245     psImage *target = psImageRecycle(convolved, numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image
     258    psImage *target = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image
    246259    psImageInit(target, 0);
    247260    for (int i = 0; i < subRegions->n; i++) {
     
    326339
    327340    psFree(source);
    328     bad = psPixelsFromMask(bad, target, PM_STACK_MASK_ALL);
     341    psPixels *bad = psPixelsFromMask(NULL, target, PM_STACK_MASK_ALL); // All bad pixels
    329342    psFree(target);
    330343    psTrace("psModules.imcombine", 7, "Total %ld bad pixels", bad->n);
Note: See TracChangeset for help on using the changeset viewer.