Search in sources :

Example 11 with Rectangle2D_I32

use of georegression.struct.shapes.Rectangle2D_I32 in project BoofCV by lessthanoptimal.

the class TestTldHelperFunctions method convertRegion_F64_I32.

@Test
public void convertRegion_F64_I32() {
    Rectangle2D_F64 a = new Rectangle2D_F64();
    Rectangle2D_I32 b = new Rectangle2D_I32();
    a.set(10, 12, 10.8, 60.9);
    TldHelperFunctions.convertRegion(a, b);
    assertEquals(10, b.x0);
    assertEquals(12, b.y0);
    assertEquals(11, b.x1);
    assertEquals(61, b.y1);
}
Also used : Rectangle2D_F64(georegression.struct.shapes.Rectangle2D_F64) Rectangle2D_I32(georegression.struct.shapes.Rectangle2D_I32) Test(org.junit.Test)

Example 12 with Rectangle2D_I32

use of georegression.struct.shapes.Rectangle2D_I32 in project BoofCV by lessthanoptimal.

the class TestDetectPolygonBinaryGrayRefine method simpleDetection.

@Test
public void simpleDetection() {
    rectangles.add(new Rectangle2D_I32(30, 30, 60, 60));
    rectangles.add(new Rectangle2D_I32(90, 30, 120, 60));
    for (Class type : imageTypes) {
        simpleDetection(type, 1.5, 0.1);
    }
}
Also used : Rectangle2D_I32(georegression.struct.shapes.Rectangle2D_I32) Test(org.junit.Test)

Example 13 with Rectangle2D_I32

use of georegression.struct.shapes.Rectangle2D_I32 in project BoofCV by lessthanoptimal.

the class TestDetectPolygonBinaryGrayRefine method usingSetLensDistortion.

@Test
public void usingSetLensDistortion() {
    rectangles.add(new Rectangle2D_I32(30, 30, 60, 60));
    rectangles.add(new Rectangle2D_I32(90, 30, 120, 60));
    rectangles.add(new Rectangle2D_I32(30, 90, 60, 120));
    rectangles.add(new Rectangle2D_I32(90, 90, 120, 120));
    transform.set(0.8, 0, 0, 0.8, 1, 2);
    transform = transform.invert(null);
    for (Class imageType : imageTypes) {
        checkDetected_LensDistortion(imageType, 0.5);
    }
}
Also used : Rectangle2D_I32(georegression.struct.shapes.Rectangle2D_I32) Test(org.junit.Test)

Example 14 with Rectangle2D_I32

use of georegression.struct.shapes.Rectangle2D_I32 in project BoofCV by lessthanoptimal.

the class TestDetectPolygonFromContour method usingSetLensDistortion.

/**
 * See if it uses the provided lens distortion transforms correctly.  The distortion applied
 * is actually the affine transform instead of lens distortion.  It should find the original
 * rectangles.
 */
@Test
public void usingSetLensDistortion() {
    rectangles.add(new Rectangle2D_I32(30, 30, 60, 60));
    rectangles.add(new Rectangle2D_I32(90, 30, 120, 60));
    rectangles.add(new Rectangle2D_I32(30, 90, 60, 120));
    rectangles.add(new Rectangle2D_I32(90, 90, 120, 120));
    transform.set(0.8, 0, 0, 0.8, 1, 2);
    transform = transform.invert(null);
    for (Class imageType : imageTypes) {
        checkDetected_LensDistortion(imageType, 0.5);
    }
}
Also used : Rectangle2D_I32(georegression.struct.shapes.Rectangle2D_I32) Test(org.junit.Test)

Example 15 with Rectangle2D_I32

use of georegression.struct.shapes.Rectangle2D_I32 in project BoofCV by lessthanoptimal.

the class TestDetectPolygonFromContour method rejectLowContract.

/**
 * Make sure it rejects shapes with low contract
 */
@Test
public void rejectLowContract() {
    rectangles.add(new Rectangle2D_I32(30, 30, 60, 60));
    black = white - 2;
    for (Class imageType : imageTypes) {
        renderDistortedRectangles(true, imageType);
        DetectPolygonFromContour alg = createDetector(imageType, 3, 5);
        alg.process(image, binary);
        assertEquals(0, alg.getFound().size);
    }
}
Also used : Rectangle2D_I32(georegression.struct.shapes.Rectangle2D_I32) Test(org.junit.Test)

Aggregations

Rectangle2D_I32 (georegression.struct.shapes.Rectangle2D_I32)20 Test (org.junit.Test)17 Polygon2D_F64 (georegression.struct.shapes.Polygon2D_F64)6 Affine2D_F64 (georegression.struct.affine.Affine2D_F64)3 Rectangle2D_F64 (georegression.struct.shapes.Rectangle2D_F64)3 Se2_F64 (georegression.struct.se.Se2_F64)2 FDistort (boofcv.abst.distort.FDistort)1 ListDisplayPanel (boofcv.gui.ListDisplayPanel)1 PointIndex_I32 (boofcv.struct.PointIndex_I32)1 Polygon2D_I32 (georegression.struct.shapes.Polygon2D_I32)1 Term (nars.term.Term)1