Search in sources :

Example 51 with GrayS16

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

the class TestGradientSobel_Outer method process_I8_sub_naive.

@Test
public void process_I8_sub_naive() {
    for (int offY = 0; offY < 3; offY++) {
        for (int offX = 0; offX < 3; offX++) {
            int w = width + offX;
            int h = height + offY;
            GrayU8 img = new GrayU8(w, h);
            ImageMiscOps.fillUniform(img, new Random(0xfeed), 0, 100);
            GrayS16 derivX = new GrayS16(w, h);
            GrayS16 derivY = new GrayS16(w, h);
            BoofTesting.checkSubImage(this, "process_I8_sub_naive", true, img, derivX, derivY);
        }
    }
}
Also used : Random(java.util.Random) GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8) Test(org.junit.Test)

Example 52 with GrayS16

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

the class TestGradientSobel_Outer method process_I8_sub_naive.

public void process_I8_sub_naive(GrayU8 img, GrayS16 derivX, GrayS16 derivY) {
    GrayS16 derivX2 = new GrayS16(derivX.width, derivX.height);
    GrayS16 derivY2 = new GrayS16(derivX.width, derivX.height);
    GradientSobel_Naive.process(img, derivX2, derivY2);
    GradientSobel_Outer.process_I8_sub(img, derivX, derivY);
    BoofTesting.assertEquals(derivX2, derivX, 0);
    BoofTesting.assertEquals(derivY2, derivY, 0);
}
Also used : GrayS16(boofcv.struct.image.GrayS16)

Example 53 with GrayS16

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

the class TestGradientThree_Standard method compareToConvolve_I8_S16.

@Test
public void compareToConvolve_I8_S16() throws NoSuchMethodException {
    CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
    validator.setTarget(GradientThree_Standard.class.getMethod("process", GrayU8.class, GrayS16.class, GrayS16.class));
    validator.setKernel(0, GradientThree.kernelDeriv_I32, true);
    validator.setKernel(1, GradientThree.kernelDeriv_I32, false);
    GrayU8 input = new GrayU8(width, height);
    ImageMiscOps.fillUniform(input, rand, 0, 10);
    GrayS16 derivX = new GrayS16(width, height);
    GrayS16 derivY = new GrayS16(width, height);
    validator.compare(false, input, derivX, derivY);
}
Also used : CompareDerivativeToConvolution(boofcv.alg.filter.derivative.CompareDerivativeToConvolution) GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8) Test(org.junit.Test)

Example 54 with GrayS16

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

the class TestGradientTwo0_Standard method compareToConvolve_I8.

@Test
public void compareToConvolve_I8() throws NoSuchMethodException {
    CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
    validator.setTarget(GradientTwo0_Standard.class.getMethod("process", GrayU8.class, GrayS16.class, GrayS16.class));
    validator.setKernel(0, GradientTwo0.kernelDeriv_I32, true);
    validator.setKernel(1, GradientTwo0.kernelDeriv_I32, false);
    GrayU8 input = new GrayU8(width, height);
    ImageMiscOps.fillUniform(input, rand, 0, 10);
    GrayS16 derivX = new GrayS16(width, height);
    GrayS16 derivY = new GrayS16(width, height);
    validator.compare(false, input, derivX, derivY);
}
Also used : CompareDerivativeToConvolution(boofcv.alg.filter.derivative.CompareDerivativeToConvolution) GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8) Test(org.junit.Test)

Example 55 with GrayS16

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

the class TestGradientSobel_UnrolledOuter method process_I8_naive.

/**
 * See if the same results are returned by ImageByte2D equivalent
 */
@Test
public void process_I8_naive() {
    for (int offY = 0; offY < 3; offY++) {
        for (int offX = 0; offX < 3; offX++) {
            int w = width + offX;
            int h = height + offY;
            GrayU8 img = new GrayU8(w, h);
            ImageMiscOps.fillUniform(img, new Random(0xfeed), 0, 100);
            GrayS16 derivX = new GrayS16(w, h);
            GrayS16 derivY = new GrayS16(w, h);
            GrayS16 derivX2 = new GrayS16(w, h);
            GrayS16 derivY2 = new GrayS16(w, h);
            GradientSobel_Naive.process(img, derivX2, derivY2);
            GradientSobel_UnrolledOuter.process_I8(img, derivX, derivY);
            BoofTesting.assertEquals(derivX2, derivX, 0);
            BoofTesting.assertEquals(derivY2, derivY, 0);
        }
    }
}
Also used : Random(java.util.Random) GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8) Test(org.junit.Test)

Aggregations

GrayS16 (boofcv.struct.image.GrayS16)63 GrayU8 (boofcv.struct.image.GrayU8)45 Test (org.junit.Test)39 ImageBorder_S32 (boofcv.core.image.border.ImageBorder_S32)15 GrayF32 (boofcv.struct.image.GrayF32)13 Random (java.util.Random)8 CompareDerivativeToConvolution (boofcv.alg.filter.derivative.CompareDerivativeToConvolution)7 BorderIndex1D_Extend (boofcv.core.image.border.BorderIndex1D_Extend)4 ImageBorder1D_S32 (boofcv.core.image.border.ImageBorder1D_S32)4 ImageGray (boofcv.struct.image.ImageGray)4 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)3 BufferedImage (java.awt.image.BufferedImage)3 WrapDisparitySadRect (boofcv.abst.feature.disparity.WrapDisparitySadRect)2 DisparitySelect (boofcv.alg.feature.disparity.DisparitySelect)2 ImageBorder_F32 (boofcv.core.image.border.ImageBorder_F32)2 ListDisplayPanel (boofcv.gui.ListDisplayPanel)2 Kernel1D_S32 (boofcv.struct.convolve.Kernel1D_S32)2 FDistort (boofcv.abst.distort.FDistort)1 DetectLineSegmentsGridRansac (boofcv.abst.feature.detect.line.DetectLineSegmentsGridRansac)1 EdgeContour (boofcv.alg.feature.detect.edge.EdgeContour)1