IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20139


Ignore:
Timestamp:
Oct 13, 2008, 6:16:12 PM (18 years ago)
Author:
Paul Price
Message:

Fixing problems from convolution in-place.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmFootprintArrayGrow.c

    r20138 r20139  
    33 * @author RHL, Princeton & IfA; EAM, IfA
    44 *
    5  * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2008-10-14 04:09:05 $
     5 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2008-10-14 04:16:12 $
    77 * Copyright 2006 Institute for Astronomy, University of Hawaii
    88 */
     
    4444    // Use a separable convolution: should be faster
    4545    idImage = (psImage*)psBinaryOp(idImage, idImage, "MIN", psScalarAlloc(1, PS_TYPE_S32));
    46     psImage *grownIdImage = psImageCopy(NULL, idImage, PS_TYPE_MASK);
    47     if (!psImageConvolveMask(idImage, grownIdImage, 0x01, 0x01, -r, r, -r, r)) {
     46    psImage *idImageMask = psImageCopy(NULL, idImage, PS_TYPE_MASK); // Image with 1 = object
     47    psFree(idImage);
     48    psImage *grownIdImage = psImageConvolveMask(NULL, grownIdImage, 0x01, 0x01, -r, r, -r, r); // Grown mask
     49    if (!grownIdImage) {
    4850        psError(PS_ERR_UNKNOWN, false, "Unable to grow mask.");
    4951        psFree(grownIdImage);
     
    5153        return NULL;
    5254    }
    53     psFree(grownIdImage);
    54     grownIdImage = idImage;
     55    psFree(idImage);
    5556#else
    5657    if (r <= 0) {
Note: See TracChangeset for help on using the changeset viewer.