IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14922


Ignore:
Timestamp:
Sep 20, 2007, 1:52:52 PM (19 years ago)
Author:
eugene
Message:

adding ability to return the subsample used for the stats

Location:
trunk/psLib/src/imageops
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageBackground.c

    r12444 r14922  
    1818// XXX allow the user to choose the stats method?
    1919// (SAMPLE_MEAN, CLIPPED_MEAN, ROBUST_MEDIAN, FITTED_MEAN)
    20 bool psImageBackground(psStats *stats, const psImage *image, const psImage *mask, psMaskType maskValue, psRandom *rng)
     20bool psImageBackground(psStats *stats, psVector **sample, const psImage *image, const psImage *mask, psMaskType maskValue, psRandom *rng)
    2121{
    2222    PS_ASSERT_IMAGE_NON_NULL(image, NULL);
     
    115115    }
    116116
    117     psFree(values);
     117    if (sample != NULL) {
     118        *sample = values;
     119    } else {
     120        psFree(values);
     121    }
    118122    return true;
    119123}
  • trunk/psLib/src/imageops/psImageBackground.h

    r11248 r14922  
    55 *  @author EAM, IfA
    66 *
    7  *  $Revision: 1.4 $ $Name: not supported by cvs2svn $
    8  *  $Date: 2007-01-23 22:47:23 $
     7 *  $Revision: 1.5 $ $Name: not supported by cvs2svn $
     8 *  $Date: 2007-09-20 23:52:52 $
    99 *  Copyright 2004-2005 IfA, University of Hawaii
    1010 */
     
    2222// Get the background for an image
    2323bool psImageBackground(psStats *stats, // desired measurement and options
     24                       psVector **sample, // vector of data used for analysis
    2425                       const psImage *image, // Image for which to get the background
    2526                       const psImage *mask, // Mask image
     
    3031/// @}
    3132#endif // #ifndef PS_IMAGE_BACKGROUND_H
     33
     34/* the user may supply a psVector ** or NULL to sample.  if a vector is supplied,
     35   the user must free the resulting vector */
Note: See TracChangeset for help on using the changeset viewer.