IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2008, 2:19:42 PM (18 years ago)
Author:
Paul Price
Message:

Adding trace statements. Bug resulted in zero pixels rejected when
the grow radius was zero (no grown image was produced); fixed by
adding explicit case.

File:
1 edited

Legend:

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

    r19482 r20420  
    3838                                                              xMin + size + 1, yMin + size + 1); // Polynomial
    3939    int box = p_pmSubtractionBadRadius(NULL, kernels, polyValues, false, poorFrac); // Radius of bad box
     40    psTrace("psModules.imcombine", 10, "Growing by %d", box);
    4041    psFree(polyValues);
    4142
     
    6970        }
    7071        psFree(convolved);
    71     }
     72    } else {
     73        // Just copy over
     74        int numBytes = (xMax - xMin) * PSELEMTYPE_SIZEOF(PS_TYPE_MASK); // Number of bytes to copy
     75        for (int yTarget = yMin; yTarget < yMax; yTarget++) {
     76            memcpy(&target->data.PS_TYPE_MASK_DATA[yTarget][xMin],
     77                   &source->data.PS_TYPE_MASK_DATA[yTarget][xMin], numBytes);
     78        }
     79    }
     80
    7281    return true;
    7382}
     
    230239        }
    231240    }
     241    psTrace("psModules.imcombine", 7, "Found %ld bad pixels", bad->n);
    232242
    233243    // Now, grow the mask to include everything that touches a bad pixel in the convolution
     
    274284                        psFree(source);
    275285                        psFree(target);
    276                         return false;
     286                        return NULL;
    277287                    }
    278288                    psFree(job);
     
    307317    psFree(source);
    308318    bad = psPixelsFromMask(bad, target, PM_STACK_MASK_ALL);
     319    psTrace("psModules.imcombine", 7, "Total %ld bad pixels", bad->n);
    309320
    310321    return bad;
Note: See TracChangeset for help on using the changeset viewer.