Changeset 1072 for trunk/psLib/test/image/tst_psImageStats02.c
- Timestamp:
- Jun 23, 2004, 11:41:15 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImageStats02.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageStats02.c
r1026 r1072 14 14 #include "psImage.h" 15 15 #include "psImageStats.h" 16 #include <float.h> 17 #include <math.h> 16 18 #define IMAGE_SIZE 3 17 19 #define CHEBY_X_DIM 3 18 20 #define CHEBY_Y_DIM 3 19 21 #define THRESHOLD 1.0 20 22 int main() 21 23 { … … 39 41 for (i=0;i<IMAGE_SIZE;i++) { 40 42 for (j=0;j<IMAGE_SIZE;j++) { 43 tmpImage->data.F32[i][j] = 4.0; 41 44 tmpImage->data.F32[i][j] = (float) (i + j); 42 tmpImage->data.F32[i][j] = 4.0;45 tmpImage->data.F32[i][j] = (float) (i + j) + (4.0 * (float) i); 43 46 outImage->data.F32[i][j] = 0.0; 44 47 } … … 53 56 54 57 my2DPoly = psImageFitPolynomial(tmpImage, my2DPoly); 58 for (i=0;i<CHEBY_X_DIM;i++) { 59 for (j=0;j<CHEBY_Y_DIM;j++) { 60 printf("Cheby Polynomial (%d, %d) coefficient is %f\n", i, j, my2DPoly->coeff[i][j]); 61 } 62 } 55 63 56 64 psMemCheckCorruption(1); … … 67 75 68 76 rc = psImageEvalPolynomial(outImage, my2DPoly); 69 // for (i=0;i<IMAGE_SIZE;i++) { 70 // for (j=0;j<IMAGE_SIZE;j++) { 71 // printf("pixel[%d][%d] is (%f, %f)\n", i, j, 72 // tmpImage->data.F32[i][j], 73 // outImage->data.F32[i][j]); 74 // } 75 // } 77 for (i=0;i<IMAGE_SIZE;i++) { 78 for (j=0;j<IMAGE_SIZE;j++) { 79 80 // printf("pixel[%d][%d] is (%f, %f)\n", i, j, 81 // tmpImage->data.F32[i][j], 82 // outImage->data.F32[i][j]); 83 if (fabs(outImage->data.F32[i][j] - tmpImage->data.F32[i][j]) > THRESHOLD) { 84 printf("Pixel (%d, %d) is %f, should be %f\n", i, j, 85 outImage->data.F32[i][j], 86 tmpImage->data.F32[i][j]); 87 } 88 89 } 90 } 76 91 77 92 psMemCheckCorruption(1);
Note:
See TracChangeset
for help on using the changeset viewer.
