Search in sources :

Example 6 with InterleavedU8

use of boofcv.struct.image.InterleavedU8 in project BoofCV by lessthanoptimal.

the class TestConvolveNormalizedNaive_IL method vertical.

/**
 * Check it against one specific type to see if the core algorithm is correct
 */
@Test
public void vertical() {
    Kernel1D_S32 kernel = new Kernel1D_S32(new int[] { 1, 2, 3, 4, 5, 6 }, 6, 4);
    InterleavedU8 input = new InterleavedU8(width, height, numBands);
    ImageMiscOps.fillUniform(input, rand, 0, 50);
    InterleavedU8 output = new InterleavedU8(width, height, numBands);
    ConvolveNormalizedNaive_IL.vertical(kernel, input, output);
    for (int y = 0; y < output.height; y++) {
        for (int x = 0; x < output.width; x++) {
            for (int band = 0; band < numBands; band++) {
                int expected = vertical(x, y, band, kernel, input);
                int found = output.getBand(x, y, band);
                assertEquals(x + "  " + y, expected, found);
            }
        }
    }
}
Also used : Kernel1D_S32(boofcv.struct.convolve.Kernel1D_S32) InterleavedU8(boofcv.struct.image.InterleavedU8) Test(org.junit.Test)

Aggregations

InterleavedU8 (boofcv.struct.image.InterleavedU8)6 Test (org.junit.Test)6 Kernel1D_S32 (boofcv.struct.convolve.Kernel1D_S32)3 Kernel2D_S32 (boofcv.struct.convolve.Kernel2D_S32)1 InterleavedU16 (boofcv.struct.image.InterleavedU16)1