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);
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations