Search in sources :

Example 1 with Se3_F64

use of georegression.struct.se.Se3_F64 in project BoofCV by lessthanoptimal.

the class DisparityPointCloudViewer method createWorldToCamera.

public Se3_F64 createWorldToCamera() {
    // pick an appropriate amount of motion for the scene
    double z = baseline * focalLengthX / (minDisparity + rangeDisparity);
    double adjust = baseline / 20.0;
    Vector3D_F64 rotPt = new Vector3D_F64(offsetX * adjust, offsetY * adjust, z * range);
    double radians = tiltAngle * Math.PI / 180.0;
    DMatrixRMaj R = ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, radians, 0, 0, null);
    Se3_F64 a = new Se3_F64(R, rotPt);
    return a;
}
Also used : Vector3D_F64(georegression.struct.point.Vector3D_F64) DMatrixRMaj(org.ejml.data.DMatrixRMaj) Se3_F64(georegression.struct.se.Se3_F64)

Example 2 with Se3_F64

use of georegression.struct.se.Se3_F64 in project BoofCV by lessthanoptimal.

the class PointCloudViewer method mouseDragged.

@Override
public synchronized void mouseDragged(MouseEvent e) {
    double rotX = 0;
    double rotY = 0;
    double rotZ = 0;
    rotY += (e.getX() - prevX) * 0.01;
    rotX += (prevY - e.getY()) * 0.01;
    Se3_F64 rotTran = new Se3_F64();
    ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, rotX, rotY, rotZ, rotTran.getR());
    Se3_F64 temp = worldToCamera.concat(rotTran, null);
    worldToCamera.set(temp);
    prevX = e.getX();
    prevY = e.getY();
    repaint();
}
Also used : Se3_F64(georegression.struct.se.Se3_F64)

Example 3 with Se3_F64

use of georegression.struct.se.Se3_F64 in project BoofCV by lessthanoptimal.

the class CalibrateStereoPlanar method process.

/**
 * Compute stereo calibration parameters
 *
 * @return Stereo calibration parameters
 */
public StereoParameters process() {
    // calibrate left and right cameras
    CameraPinholeRadial leftParam = calibrateMono(calibLeft, viewLeft);
    CameraPinholeRadial rightParam = calibrateMono(calibRight, viewRight);
    // fit motion from right to left
    Se3_F64 rightToLeft = computeRightToLeft();
    return new StereoParameters(leftParam, rightParam, rightToLeft);
}
Also used : CameraPinholeRadial(boofcv.struct.calib.CameraPinholeRadial) StereoParameters(boofcv.struct.calib.StereoParameters) Se3_F64(georegression.struct.se.Se3_F64)

Example 4 with Se3_F64

use of georegression.struct.se.Se3_F64 in project BoofCV by lessthanoptimal.

the class CalibrateStereoPlanar method calibrateMono.

/**
 * Compute intrinsic calibration for one of the cameras
 */
private CameraPinholeRadial calibrateMono(CalibrateMonoPlanar calib, List<Se3_F64> location) {
    CameraPinholeRadial intrinsic = calib.process();
    Zhang99AllParam zhangParam = calib.getZhangParam();
    for (Zhang99AllParam.View v : zhangParam.views) {
        Se3_F64 pose = new Se3_F64();
        ConvertRotation3D_F64.rodriguesToMatrix(v.rotation, pose.getR());
        pose.getT().set(v.T);
        location.add(pose);
    }
    return intrinsic;
}
Also used : CameraPinholeRadial(boofcv.struct.calib.CameraPinholeRadial) Zhang99AllParam(boofcv.alg.geo.calibration.Zhang99AllParam) Se3_F64(georegression.struct.se.Se3_F64)

Example 5 with Se3_F64

use of georegression.struct.se.Se3_F64 in project BoofCV by lessthanoptimal.

the class CalibrationPlanarGridZhang99 method convertIntoZhangParam.

/**
 * Converts results fond in the linear algorithms into {@link Zhang99AllParam}
 */
public void convertIntoZhangParam(List<Se3_F64> motions, DMatrixRMaj K, double[] distort, Zhang99AllParam param) {
    param.getIntrinsic().initialize(K, distort);
    param.setNumberOfViews(motions.size());
    for (int i = 0; i < param.views.length; i++) {
        Se3_F64 m = motions.get(i);
        Zhang99AllParam.View v = new Zhang99AllParam.View();
        v.T = m.getT();
        ConvertRotation3D_F64.matrixToRodrigues(m.getR(), v.rotation);
        param.views[i] = v;
    }
}
Also used : Se3_F64(georegression.struct.se.Se3_F64)

Aggregations

Se3_F64 (georegression.struct.se.Se3_F64)214 Test (org.junit.Test)83 Point3D_F64 (georegression.struct.point.Point3D_F64)74 Point2D_F64 (georegression.struct.point.Point2D_F64)68 DMatrixRMaj (org.ejml.data.DMatrixRMaj)52 Point2D3D (boofcv.struct.geo.Point2D3D)31 Vector3D_F64 (georegression.struct.point.Vector3D_F64)30 ArrayList (java.util.ArrayList)27 CameraPinholeRadial (boofcv.struct.calib.CameraPinholeRadial)26 GrayF32 (boofcv.struct.image.GrayF32)18 AssociatedPair (boofcv.struct.geo.AssociatedPair)17 StereoParameters (boofcv.struct.calib.StereoParameters)12 GrayU8 (boofcv.struct.image.GrayU8)10 BufferedImage (java.awt.image.BufferedImage)10 PointTrack (boofcv.abst.feature.tracker.PointTrack)9 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)9 Stereo2D3D (boofcv.struct.sfm.Stereo2D3D)9 ModelManagerSe3_F64 (georegression.fitting.se.ModelManagerSe3_F64)9 RectifyCalibrated (boofcv.alg.geo.rectify.RectifyCalibrated)8 LensDistortionNarrowFOV (boofcv.alg.distort.LensDistortionNarrowFOV)7