IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2007, 7:54:08 AM (19 years ago)
Author:
eugene
Message:

working on new masking api

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071212/psModules/src/detrend/pmMaskBadPixels.c

    r14935 r15808  
    8181
    8282psImage *pmMaskFlagSuspectPixels(psImage *out, const pmReadout *readout, float rej,
    83                                  psMaskType maskVal, float frac, psRandom *rng)
     83                                 psMaskType maskVal, float median, float stdev)
    8484{
    8585    PS_ASSERT_PTR_NON_NULL(readout, NULL);
     
    103103    psImage *mask = readout->mask;      // Corresponding mask
    104104
    105     if (rng) {
    106         psMemIncrRefCounter(rng);
    107     } else {
    108         rng = psRandomAlloc(PS_RANDOM_TAUS, 0);
    109     }
    110 
    111     // XXX note that this now will accept any of several stats options
    112     psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
    113     stats->nSubsample = frac * image->numCols * image->numRows;
    114     if (!psImageBackground(stats, NULL, image, mask, maskVal, rng) ||
    115             !isfinite(stats->robustMedian) || !isfinite(stats->robustUQ) || !isfinite(stats->robustLQ)) {
    116         psError(PS_ERR_UNKNOWN, false, "Unable to measure image statistics.\n");
    117         psFree(stats);
    118         psFree(rng);
    119         return NULL;
    120     }
    121     psFree(rng);
    122 
    123     float median = stats->robustMedian; // Median value
    124     float stdev = stats->robustStdev; // Estimate of the standard deviation
    125     psFree(stats);
    126 
    127105    if (!out) {
    128106        out = psImageAlloc(image->numCols, image->numRows, PS_TYPE_S32);
Note: See TracChangeset for help on using the changeset viewer.