IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 27, 2004, 4:45:31 PM (22 years ago)
Author:
gusciora
Message:

More mods to get in sync with the latest SDRS.

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

Legend:

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

    r796 r797  
    1515#include "psImage.h"
    1616#include "psFunctions.h"
    17 
    1817#include "float.h"
    1918#include <math.h>
     19
    2020/// This routine must determine the various statistics for the image.
    21 psStats *
    22 
    23 psImageGetStats(const psImage *input,
    24                 psStats *stats)
    25 {
    26     psVector *junk=NULL;
    27     psStats *stats2= NULL;
    28 
    29     junk = psVectorAlloc(input->numRows * input->numCols, input->type.type);
    30     stats2 = psVectorStats(stats, junk, NULL, 0xffffffff);
    31     psVectorFree(junk);
    32 
    33     return(stats2);
    34 }
    35 
    36 psHistogram *
    37 psImageHistogram(psHistogram *hist,
    38                  const psImage *input)
    39 {
    40     return(hist);
     21psStats *psImageStats(psStats *stats,
     22                      psImage *in,
     23                      psImage *mask,
     24                      int maskVal)
     25{
     26    psVector *junkData=NULL;
     27    psVector *junkMask=NULL;
     28
     29    junkData = psVectorAlloc(in->numRows * in->numCols, in->type.type);
     30    junkMask = psVectorAlloc(mask->numRows * mask->numCols, mask->type.type);
     31
     32    // GUS: figure out mask types
     33    junkData->vec.f = (float *) in->data.F32;
     34    junkMask->vec.f = (float *) mask->data.F32;
     35    stats = psVectorStats(stats, junkData, junkMask, maskVal);
     36
     37    psVectorFree(junkData);
     38    psVectorFree(junkMask);
     39
     40    return(stats);
     41}
     42
     43/*****************************************************************************
     44    NOTE: We assume that the psHistogram structure out has already been
     45    allocated and initialized.
     46 *****************************************************************************/
     47psHistogram *psImageHistogram(psHistogram *out,
     48                              psImage *in,
     49                              psImage *mask,
     50                              int maskVal)
     51{
     52    psVector *junkData=NULL;
     53    psVector *junkMask=NULL;
     54
     55    junkData = psVectorAlloc(in->numRows * in->numCols, in->type.type);
     56    junkMask = psVectorAlloc(mask->numRows * mask->numCols, mask->type.type);
     57
     58    // GUS: figure out mask types
     59    junkData->vec.f = (float *) in->data.F32;
     60    junkMask->vec.f = (float *) mask->data.F32;
     61
     62    out = psHistogramVector(out, junkData, junkMask, maskVal);
     63
     64    psVectorFree(junkData);
     65    psVectorFree(junkMask);
     66
     67    return(out);
    4168}
    4269
  • trunk/psLib/src/imageops/psImageStats.h

    r767 r797  
    77
    88/// This routine must determine the various statistics for the image.
    9 psStats *
    10 psImageGetStats(const psImage *input,   ///< image (or subimage) to calculate stats
    11                 psStats *stats          ///< defines statistics to be calculated & target
    12                );
     9psStats *psImageStats(psStats *stats, ///< defines statistics to be calculated
     10                      psImage *in,    ///< image (or subimage) to calculate stats
     11                      psImage *mask,  ///< mask data for image (NULL ok)
     12                      int maskVal);   ///< mask Mask for mask
    1313
    14 /// Construct a histogram from an image (or subimage).
    15 psHistogram *
    16 psImageHistogram(psHistogram *hist,     ///< input histogram description & target
    17                  const psImage *input   ///< determine histogram of this image
    18                 );
     14
     15psHistogram *psImageHistogram(psHistogram *out,  ///< input histogram description & target
     16                              psImage *in,       ///< Image data to be histogramed.
     17                              psImage *mask,     ///< mask data for image (NULL ok)
     18                              int maskVal);      ///< mask Mask for mask
    1919
    2020/// Fit a 2-D polynomial surface to an image.
Note: See TracChangeset for help on using the changeset viewer.