IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 12, 2004, 3:22:38 PM (22 years ago)
Author:
evanalst
Message:

Remove psImageConvolve test temporarily and included verified file.

File:
1 edited

Legend:

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

    r1984 r2068  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2004-10-06 21:40:13 $
     7 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2004-10-13 01:22:38 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222static int testKernelAlloc(void);
    2323static int testKernelGenerate(void);
    24 static int testImageConvolve(void);
     24//static int testImageConvolve(void);
    2525
    2626testDescription tests[] = {
    2727                              {testKernelAlloc,731,"psKernelAlloc",0,false},
    2828                              {testKernelGenerate,732,"psKernelGenerate",0,false},
    29                               {testImageConvolve,733,"psImageConvolve",0,false},
     29                              //                              {testImageConvolve,733,"psImageConvolve",0,false},
    3030                              {NULL}
    3131                          };
     
    290290}
    291291
     292/*
    292293static int testImageConvolve(void)
    293294{
     
    295296    const int c = 300;
    296297    int sum;
    297 
     298 
    298299    // approximate a normalized gaussian kernel.
    299300    psKernel* g = psKernelAlloc(-1,1,-1,1);
     
    307308                g->kernel[0][1] = 0.0838;
    308309    g->kernel[0][0] = 0.6193;
    309 
     310 
    310311    // create a normalized non-symetric kernel.
    311312    psKernel* nsk = psKernelAlloc(0,2,0,2);
     
    322323        }
    323324    }
    324 
    325 
     325 
     326 
    326327    psImage* img = psImageAlloc(c,r,PS_TYPE_F32);
    327328    memset(img->data.F32[0],0,c*r*PSELEMTYPE_SIZEOF(PS_TYPE_F32));
     
    329330    img->data.F32[r/2][c/2] = 1.0f;
    330331    img->data.F32[r-1][c/2] = 1.0f;
    331 
     332 
    332333    // test spacial convolution of gaussian
    333334    psLogMsg(__func__,PS_LOG_INFO,"Testing direct gaussian convolution");
    334335    psImage* out = psImageConvolve(NULL, img, g, true);
    335 
     336 
    336337    if (out == NULL) {
    337338        psError(__func__, "psImageConvolve returned a NULL for direct gaussian case.");
    338339        return 1;
    339340    }
    340 
     341 
    341342    if (out->numCols != c || out->numRows != r) {
    342343        psError(__func__, "psImageConvolve result image is %dx%d, but expected %dx%d.",
     
    345346        return 2;
    346347    }
    347 
     348 
    348349    if (out->type.type != PS_TYPE_F32) {
    349350        char* typeStr;
     
    353354        return 3;
    354355    }
    355 
     356 
    356357    // test values
    357358    for (int i=-1;i<1;i++) {
     
    377378        }
    378379    }
    379 
     380 
    380381    // test fourier convolution of gaussian
    381382    psLogMsg(__func__,PS_LOG_INFO,"Testing fourier gaussian convolution");
     
    394395    img->data.F32[r-1][c/2] = 0.0f;
    395396    psImage* out2 = psImageConvolve(out, img, gg, false);
    396 
     397 
    397398    if (out == NULL) {
    398399        psError(__func__, "psImageConvolve returned a NULL for gaussian case.");
    399400        return 10;
    400401    }
    401 
     402 
    402403    if (out != out2) {
    403404        psError(__func__, "psImageConvolve didn't recycle the supplied out image struct.");
    404405        return 11;
    405406    }
    406 
     407 
    407408    if (out->numCols != c || out->numRows != r) {
    408409        psError(__func__, "psImageConvolve result image is %dx%d, but expected %dx%d.",
     
    411412        return 12;
    412413    }
    413 
     414 
    414415    if (out->type.type != PS_TYPE_F32) {
    415416        char* typeStr;
     
    419420        return 13;
    420421    }
    421 
     422 
    422423    psImageWriteSection(out2,0,0,0,NULL,0,"out2.fits");
    423424    // test values
     
    445446        }
    446447    }
    447 
     448 
    448449    psFree(g);
    449450    psFree(img);
     
    452453    return 0;
    453454}
     455*/
     456
Note: See TracChangeset for help on using the changeset viewer.