Search in sources :

Example 1 with MarkerShape

use of boofcv.abst.fiducial.calib.ConfigECoCheckMarkers.MarkerShape in project BoofCV by lessthanoptimal.

the class ECoCheck_to_FiducialDetector method getControl3D.

@Override
protected List<Point2D3D> getControl3D(int which) {
    Objects.requireNonNull(pixelToNorm);
    ECoCheckFound found = foundIndexToFound(which);
    MarkerShape marker = markerShapes.get(found.markerID);
    points2D3D.resetResize(found.corners.size);
    ECoCheckUtils utils = detector.getUtils();
    // length of the longest side on the marker
    double markerLength = Math.max(marker.getWidth(), marker.getHeight());
    for (int i = 0; i < found.corners.size; i++) {
        PointIndex2D_F64 corner = found.corners.get(i);
        Point2D3D p23 = points2D3D.get(i);
        utils.cornerToMarker3D(found.markerID, corner.index, p23.location);
        pixelToNorm.compute(corner.p.x, corner.p.y, p23.observation);
        // Convert the units
        p23.location.scale(markerLength);
    }
    return points2D3D.toList();
}
Also used : Point2D3D(boofcv.struct.geo.Point2D3D) MarkerShape(boofcv.abst.fiducial.calib.ConfigECoCheckMarkers.MarkerShape) ECoCheckUtils(boofcv.alg.fiducial.calib.ecocheck.ECoCheckUtils) PointIndex2D_F64(boofcv.struct.geo.PointIndex2D_F64) ECoCheckFound(boofcv.alg.fiducial.calib.ecocheck.ECoCheckFound)

Example 2 with MarkerShape

use of boofcv.abst.fiducial.calib.ConfigECoCheckMarkers.MarkerShape in project BoofCV by lessthanoptimal.

the class ECoCheck_to_FiducialDetector method getWidth.

@Override
public double getWidth(int which) {
    int markerID = foundIndexToFound(which).markerID;
    MarkerShape marker = markerShapes.get(markerID);
    return (marker.getWidth() + marker.getHeight()) / 2.0;
}
Also used : MarkerShape(boofcv.abst.fiducial.calib.ConfigECoCheckMarkers.MarkerShape)

Aggregations

MarkerShape (boofcv.abst.fiducial.calib.ConfigECoCheckMarkers.MarkerShape)2 ECoCheckFound (boofcv.alg.fiducial.calib.ecocheck.ECoCheckFound)1 ECoCheckUtils (boofcv.alg.fiducial.calib.ecocheck.ECoCheckUtils)1 Point2D3D (boofcv.struct.geo.Point2D3D)1 PointIndex2D_F64 (boofcv.struct.geo.PointIndex2D_F64)1