Changeset 797 for trunk/psLib/src/imageops
- Timestamp:
- May 27, 2004, 4:45:31 PM (22 years ago)
- Location:
- trunk/psLib/src/imageops
- Files:
-
- 2 edited
-
psImageStats.c (modified) (1 diff)
-
psImageStats.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageStats.c
r796 r797 15 15 #include "psImage.h" 16 16 #include "psFunctions.h" 17 18 17 #include "float.h" 19 18 #include <math.h> 19 20 20 /// 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); 21 psStats *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 *****************************************************************************/ 47 psHistogram *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); 41 68 } 42 69 -
trunk/psLib/src/imageops/psImageStats.h
r767 r797 7 7 8 8 /// This routine must determine the various statistics for the image. 9 psStats * 10 psImageGetStats(const psImage *input,///< image (or subimage) to calculate stats11 psStats *stats ///< defines statistics to be calculated & target12 );9 psStats *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 13 13 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 image18 );14 15 psHistogram *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 19 19 20 20 /// Fit a 2-D polynomial surface to an image.
Note:
See TracChangeset
for help on using the changeset viewer.
