IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24837


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

Location:
trunk/ppMerge/src
Files:
2 edited

Legend:

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

    r24821 r24837  
    170170    psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-xsmooth", 0, "Number of smoothing regions in x", 0);
    171171    psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-ysmooth", 0, "Number of smoothing regions in y", 0);
     172    psMetadataAddBool(arguments, PS_LIST_TAIL, "-fringe-smooth", 0, "Smooth output image", false);
     173    psMetadataAddF32(arguments, PS_LIST_TAIL, "-fringe-smooth-sigma", 0, "Size of smoothing Gaussian", NAN);
    172174
    173175    /** CTEMASK construction parameters */
     
    329331    VALUE_ARG_RECIPE_INT("-fringe-xsmooth", "FRINGE.XSMOOTH", S32, 0);
    330332    VALUE_ARG_RECIPE_INT("-fringe-ysmooth", "FRINGE.YSMOOTH", S32, 0);
     333    VALUE_ARG_RECIPE_BOOL("-fringe-smooth", "FRINGE.SMOOTH");
     334    VALUE_ARG_RECIPE_FLOAT("-fringe-smooth-sigma", "FRINGE.SMOOTH.SIGMA", F32);
    331335
    332336    /** CTEMASK construction parameters */
  • 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.