Changeset 797 for trunk/psLib/src/image/psImageStats.c
- Timestamp:
- May 27, 2004, 4:45:31 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/image/psImageStats.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/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
Note:
See TracChangeset
for help on using the changeset viewer.
