IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17331


Ignore:
Timestamp:
Apr 4, 2008, 4:56:18 PM (18 years ago)
Author:
Paul Price
Message:

Adding in-place mask convolution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/imageops/tap_psImageConvolve2.c

    r17330 r17331  
    88#define KERNEL_SIZE 3
    99#define TOL 1.0e-6
    10 #define MASK_INITIAL 0x0f
    11 #define MASK_FINAL   0xf0
     10#define MASK_INITIAL 0x08
     11#define MASK_FINAL   0x80
    1212
    1313
     
    9898int main(int argc, char *argv[])
    9999{
    100     plan_tests(15);
     100    plan_tests(20);
    101101
    102102    diag("psImageConvolve tests");
     
    171171    }
    172172
     173    {
     174        // In-place FFT mask convolution: 5 tests
     175        psMemId id = psMemGetId();
     176
     177        psImage *mask = generateMask();
     178
     179        bool result = psImageConvolveMaskFFT(mask, mask, MASK_INITIAL, MASK_FINAL, -KERNEL_SIZE, KERNEL_SIZE,
     180                                             -KERNEL_SIZE, KERNEL_SIZE, 0.5);
     181        ok(result, "convolution result");
     182        skip_start(!result, 3, "convolution failed");
     183        ok(mask->type.type == PS_TYPE_MASK, "output type");
     184        ok(mask->numCols == IMAGE_SIZE && mask->numRows == IMAGE_SIZE, "output size %dx%d",
     185           mask->numCols, mask->numRows);
     186        ok(checkConvolvedMask(mask), "convolved mask correct");
     187        skip_end();
     188
     189        psFree(mask);
     190
     191        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     192    }
     193
    173194
    174195    return exit_status();
Note: See TracChangeset for help on using the changeset viewer.