IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 23, 2004, 11:41:15 AM (22 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/image/tst_psImageStats02.c

    r1026 r1072  
    1414#include "psImage.h"
    1515#include "psImageStats.h"
     16#include <float.h>
     17#include <math.h>
    1618#define IMAGE_SIZE 3
    1719#define CHEBY_X_DIM 3
    1820#define CHEBY_Y_DIM 3
    19 
     21#define THRESHOLD 1.0
    2022int main()
    2123{
     
    3941    for (i=0;i<IMAGE_SIZE;i++) {
    4042        for (j=0;j<IMAGE_SIZE;j++) {
     43            tmpImage->data.F32[i][j] = 4.0;
    4144            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);
    4346            outImage->data.F32[i][j] = 0.0;
    4447        }
     
    5356
    5457    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    }
    5563
    5664    psMemCheckCorruption(1);
     
    6775
    6876    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    }
    7691
    7792    psMemCheckCorruption(1);
Note: See TracChangeset for help on using the changeset viewer.