IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 3, 2008, 2:36:02 PM (18 years ago)
Author:
Paul Price
Message:

Fixed bug: wasn't initialising target image.

File:
1 edited

Legend:

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

    r19345 r19349  
    1919    PM_STACK_MASK_BAD      = 0x01,      // Bad pixel
    2020    PM_STACK_MASK_CONVOLVE = 0x02,      // Touching a bad pixel
     21    PM_STACK_MASK_ALL      = 0xff,      // All mask bits
    2122} pmStackMask;
    2223
     
    144145    }
    145146
    146     psImage *mask = psPixelsToMask(NULL, in, psRegionSet(0, numCols - 1, 0, numRows - 1), 0x01); // Mask
     147    psImage *mask = psPixelsToMask(NULL, in, psRegionSet(0, numCols - 1, 0, numRows - 1), 1); // Mask
    147148    psImage *image = psImageCopy(NULL, mask, PS_TYPE_F32); // Floating-point version, so we can convolve
    148149    psFree(mask);
     
    233234    psImage *source = psPixelsToMask(NULL, bad, psRegionSet(0, numCols - 1, 0, numRows - 1),
    234235                                     PM_STACK_MASK_BAD); // Mask image to grow
    235     psImage *target = psImageRecycle(convolved, numCols, numRows, PS_TYPE_U8); // Grown image
     236    psImage *target = psImageRecycle(convolved, numCols, numRows, PS_TYPE_MASK); // Grown image
     237    psImageInit(target, 0);
    236238    if (threaded) {
    237239        psMutexInit(source);
     
    276278                    psFree(job);
    277279                } else if (!stackRejectGrow(target, source, kernels, numCols, numRows,
    278                                               i, xSubMax, j, ySubMax, poorFrac)) {
     280                                            i, xSubMax, j, ySubMax, poorFrac)) {
    279281                    psError(PS_ERR_UNKNOWN, false, "Unable to grow bad pixels.");
    280282                    psFree(source);
     
    297299    }
    298300    psFree(source);
    299     bad = psPixelsFromMask(bad, target, 0xff);
     301    bad = psPixelsFromMask(bad, target, PM_STACK_MASK_ALL);
    300302
    301303    return bad;
Note: See TracChangeset for help on using the changeset viewer.