Search in sources :

Example 16 with Quadrilateral_F64

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

the class GenericTrackerObjectRectangleChecks method reinitialize.

/**
 * See if it correctly reinitializes. Should produce identical results when given the same inputs after
 * being reinitialized.
 */
@Test
void reinitialize() {
    Quadrilateral_F64 where1 = new Quadrilateral_F64();
    TrackerObjectQuad<T> tracker = create(imageType);
    render(1, 0, 0);
    assertTrue(tracker.initialize(input, initRegion));
    render(1, 3, -3);
    assertTrue(tracker.process(input, where));
    render(1, 6, -6);
    assertTrue(tracker.process(input, where));
    render(1, 0, 0);
    assertTrue(tracker.initialize(input, initRegion));
    render(1, 3, -3);
    assertTrue(tracker.process(input, where1));
    render(1, 6, -6);
    assertTrue(tracker.process(input, where1));
    // Might not be a perfect match due to robust algorithm not being reset to their initial state
    checkSolution(where1.a.x, where1.a.y, where1.c.x, where1.c.y, 0.02);
}
Also used : Quadrilateral_F64(georegression.struct.shapes.Quadrilateral_F64) Test(org.junit.jupiter.api.Test)

Aggregations

Quadrilateral_F64 (georegression.struct.shapes.Quadrilateral_F64)16 GrayF32 (boofcv.struct.image.GrayF32)4 Point2D_F64 (georegression.struct.point.Point2D_F64)4 Test (org.junit.jupiter.api.Test)4 FDistort (boofcv.abst.distort.FDistort)2 MediaManager (boofcv.io.MediaManager)2 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)2 DefaultMediaManager (boofcv.io.wrapper.DefaultMediaManager)2 Polygon2D_I32 (georegression.struct.shapes.Polygon2D_I32)2 BufferedImage (java.awt.image.BufferedImage)2 ConfigPointDetector (boofcv.abst.feature.detect.interest.ConfigPointDetector)1 PlToGrayMotion2D (boofcv.abst.sfm.d2.PlToGrayMotion2D)1 TrackerObjectQuad (boofcv.abst.tracker.TrackerObjectQuad)1 LensDistortionNarrowFOV (boofcv.alg.distort.LensDistortionNarrowFOV)1 LensDistortionBrown (boofcv.alg.distort.brown.LensDistortionBrown)1 LensDistortionRadialTangential (boofcv.alg.distort.radtan.LensDistortionRadialTangential)1 FoundFiducial (boofcv.alg.fiducial.square.FoundFiducial)1 ConfigFiducialBinary (boofcv.factory.fiducial.ConfigFiducialBinary)1 ConfigPolygonDetector (boofcv.factory.shape.ConfigPolygonDetector)1 FactoryShapeDetector (boofcv.factory.shape.FactoryShapeDetector)1