IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 17, 2009, 1:14:17 PM (17 years ago)
Author:
eugene
Message:

add options to smooth output fringe image with Gaussian kernel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeLoop.c

    r24797 r24837  
    6565    int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); // Smoothing regions in x
    6666    int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); // Smoothing regions in y
     67    bool fringeSmooth = psMetadataLookupBool(NULL, arguments, "FRINGE.SMOOTH"); // Smooth the output image?
     68    float fringeSmoothSigma = psMetadataLookupF32(NULL, arguments, "FRINGE.SMOOTH.SIGMA"); // Smooth the output image?
    6769
    6870    // set the mask and mark bit values based on the named masks
     
    416418            // Put the new readout into the cell after the existing readouts.
    417419            if (type == PPMERGE_TYPE_FRINGE && outRO) {
    418                 pmFringeRegions *regions = pmFringeRegionsAlloc(fringeNum, fringeSize, fringeSize,
    419                                                                 fringeSmoothX, fringeSmoothY);
     420                if (fringeSmooth) {
     421                    if (outRO->mask) {
     422                        psImage *smoothed = psImageSmoothMask (NULL, outRO->image, outRO->mask, maskVal, fringeSmoothSigma, 3, 0.2);
     423                        psFree (outRO->image);
     424                        outRO->image = smoothed;
     425                    } else {
     426                        psImageSmooth (outRO->image, fringeSmoothSigma, 3);
     427                    }
     428                }
     429
     430                pmFringeRegions *regions = pmFringeRegionsAlloc(fringeNum, fringeSize, fringeSize, fringeSmoothX, fringeSmoothY);
    420431                pmFringeStats *fringe = pmFringeStatsMeasure(regions, outRO, maskVal);
    421432                psFree(regions);
     
    429440                fringes->data[0] = fringe;
    430441
    431                 pmFringesFormat(outCell, NULL, fringes);
     442                // XXX replaced this : pmFringesFormat(outCell, NULL, fringes);
     443                if (!psMetadataAdd(outCell->analysis, PS_LIST_TAIL, "FRINGE.MEASUREMENTS", PS_DATA_ARRAY, "Fringes", fringes)) {
     444                    psError(PS_ERR_UNKNOWN, false, "Unable to add fringe to analysis metadata\n");
     445                    goto ERROR;
     446                }
    432447                psFree(fringes);        // Drop reference
    433448            }
Note: See TracChangeset for help on using the changeset viewer.