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