Search in sources :

Example 86 with GrayU8

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

the class TestHessianThree method compareToConvolve_I8.

// @Test
// public void checkInputShape() {
// GenericDerivativeTests.checkImageDimensionValidation(new HessianThree(), 2);
// }
@Test
public void compareToConvolve_I8() throws NoSuchMethodException {
    CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
    validator.setTarget(HessianThree.class.getMethod("process", GrayU8.class, GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
    validator.setKernel(0, HessianThree.kernelXXYY_I32, true);
    validator.setKernel(1, HessianThree.kernelXXYY_I32, false);
    validator.setKernel(2, HessianThree.kernelCross_I32);
    GrayU8 input = new GrayU8(width, height);
    ImageMiscOps.fillUniform(input, rand, 0, 10);
    GrayS16 derivXX = new GrayS16(width, height);
    GrayS16 derivYY = new GrayS16(width, height);
    GrayS16 derivXY = new GrayS16(width, height);
    validator.compare(input, derivXX, derivYY, derivXY);
}
Also used : GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8) ImageBorder_S32(boofcv.core.image.border.ImageBorder_S32) Test(org.junit.Test)

Example 87 with GrayU8

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

the class TestGradientSobel_Naive method compareToKnown_I8.

/**
 * Compare the results to a hand computed value
 */
@Test
public void compareToKnown_I8() {
    GrayU8 img = new GrayU8(width, height);
    ImageMiscOps.fillUniform(img, rand, 0, 100);
    GrayS16 derivX = new GrayS16(width, height);
    GrayS16 derivY = new GrayS16(width, height);
    BoofTesting.checkSubImage(this, "compareToKnown_I8", true, img, derivX, derivY);
}
Also used : GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8) Test(org.junit.Test)

Example 88 with GrayU8

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

the class TestConvolveNormalizedStandardSparse method computeExpected.

private float computeExpected(GrayU8 image) {
    GrayU8 temp = new GrayU8(image.width, image.height);
    GrayU8 temp2 = new GrayU8(image.width, image.height);
    ConvolveImageNormalized.horizontal(kernelI32, image, temp);
    ConvolveImageNormalized.vertical(kernelI32, temp, temp2);
    return temp2.get(targetX, targetY);
}
Also used : GrayU8(boofcv.struct.image.GrayU8)

Example 89 with GrayU8

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

the class TestImageLineIntegral method isInside.

@Test
public void isInside() {
    GrayU8 img = new GrayU8(12, 14);
    alg.setImage(FactoryGImageGray.wrap(img));
    assertTrue(alg.isInside(0, 0));
    assertTrue(alg.isInside(12, 14));
    assertTrue(alg.isInside(12, 0));
    assertTrue(alg.isInside(0, 14));
    assertFalse(alg.isInside(-0.0001, 0));
    assertFalse(alg.isInside(0, -0.00001));
    assertFalse(alg.isInside(12.000001, 14));
    assertFalse(alg.isInside(12, 14.0001));
    assertFalse(alg.isInside(12.0001, 0));
    assertFalse(alg.isInside(0, 14.00001));
}
Also used : GrayU8(boofcv.struct.image.GrayU8) Test(org.junit.Test)

Example 90 with GrayU8

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

the class TestImageLineIntegral method across_SlopeZero.

/**
 * Test cases where the slope for x or y is zero across multiple pixels
 */
@Test
public void across_SlopeZero() {
    GrayU8 img = new GrayU8(10, 15);
    img.set(6, 6, 100);
    img.set(6, 7, 50);
    img.set(6, 8, 10);
    img.set(7, 6, 50);
    img.set(8, 6, 10);
    alg.setImage(FactoryGImageGray.wrap(img));
    checkSolution(6.5, 6, 6.5, 8, 150);
    checkSolution(6.5, 6, 6.5, 7.5, 125);
    checkSolution(6.5, 6.5, 6.5, 8, 100);
    checkSolution(6.5, 6.5, 6.5, 7.5, 75);
    checkSolution(6.5, 6, 6.5, 8.5, 155);
    checkSolution(6, 6.5, 8, 6.5, 150);
    checkSolution(6, 6.5, 7.5, 6.5, 125);
    checkSolution(6.5, 6.5, 8, 6.5, 100);
    checkSolution(6.5, 6.5, 7.5, 6.5, 75);
    checkSolution(6, 6.5, 8.5, 6.5, 155);
}
Also used : GrayU8(boofcv.struct.image.GrayU8) Test(org.junit.Test)

Aggregations

GrayU8 (boofcv.struct.image.GrayU8)417 Test (org.junit.Test)242 BufferedImage (java.awt.image.BufferedImage)53 GrayS32 (boofcv.struct.image.GrayS32)52 GrayF32 (boofcv.struct.image.GrayF32)49 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)48 GrayS16 (boofcv.struct.image.GrayS16)45 Planar (boofcv.struct.image.Planar)28 ArrayList (java.util.ArrayList)22 File (java.io.File)17 ListDisplayPanel (boofcv.gui.ListDisplayPanel)16 RectangleLength2D_I32 (georegression.struct.shapes.RectangleLength2D_I32)16 ImageGray (boofcv.struct.image.ImageGray)15 EllipseRotated_F64 (georegression.struct.curve.EllipseRotated_F64)15 Random (java.util.Random)14 Point2D_F64 (georegression.struct.point.Point2D_F64)11 ImageRectangle (boofcv.struct.ImageRectangle)10 GrayU16 (boofcv.struct.image.GrayU16)10 Se3_F64 (georegression.struct.se.Se3_F64)10 Point3D_F64 (georegression.struct.point.Point3D_F64)9