IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/psModules/src/imcombine/pmStackReject.c

    r27004 r27517  
    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
     
    101103
    102104    if (!pmSubtractionThreaded()) {
    103         pmSubtractionThreadsInit(NULL, NULL);
     105        pmSubtractionThreadsInit();
    104106    }
    105107
     
    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);
     
    222224    }
    223225    psTrace("psModules.imcombine", 7, "Found %ld bad pixels", bad->n);
    224 
    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),
     226    psFree(convolved);
     227
     228    return bad;
     229}
     230
     231
     232psPixels *pmStackRejectGrow(const psPixels *in, int numCols, int numRows, float poorFrac,
     233                            const psArray *subRegions, const psArray *subKernels)
     234{
     235    PS_ASSERT_PIXELS_NON_NULL(in, NULL);
     236    PS_ASSERT_ARRAY_NON_NULL(subRegions, NULL);
     237    PS_ASSERT_ARRAY_NON_NULL(subKernels, NULL);
     238    PS_ASSERT_ARRAYS_SIZE_EQUAL(subRegions, subKernels, NULL);
     239
     240    psImage *source = psPixelsToMask(NULL, in, psRegionSet(0, numCols - 1, 0, numRows - 1),
    227241                                     PM_STACK_MASK_BAD); // Mask image to grow
    228242
     
    243257    bool oldThreads = psImageConvolveSetThreads(false); // Old value of threading for psImageColvolve
    244258
    245     psImage *target = psImageRecycle(convolved, numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image
     259    psImage *target = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); // Grown image
    246260    psImageInit(target, 0);
    247261    for (int i = 0; i < subRegions->n; i++) {
     
    326340
    327341    psFree(source);
    328     bad = psPixelsFromMask(bad, target, PM_STACK_MASK_ALL);
     342    psPixels *bad = psPixelsFromMask(NULL, target, PM_STACK_MASK_ALL); // All bad pixels
     343    psFree(target);
    329344    psTrace("psModules.imcombine", 7, "Total %ld bad pixels", bad->n);
    330345
Note: See TracChangeset for help on using the changeset viewer.