本文整理了Java中boofcv.alg.geo.calibration.Zhang99IntrinsicParam
类的一些代码示例,展示了Zhang99IntrinsicParam
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zhang99IntrinsicParam
类的具体详情如下:
包路径:boofcv.alg.geo.calibration.Zhang99IntrinsicParam
类名称:Zhang99IntrinsicParam
[英]Interface that specifies how to optimize a intrinsic camera model
[中]接口,指定如何优化内部相机模型
代码示例来源:origin: org.boofcv/boofcv-calibration
public int convertToParam( double param[] ) {
int index = intrinsic.convertToParam(param);
for( View v : views ) {
param[index++] = v.rotation.unitAxisRotation.x*v.rotation.theta;
param[index++] = v.rotation.unitAxisRotation.y*v.rotation.theta;
param[index++] = v.rotation.unitAxisRotation.z*v.rotation.theta;
param[index++] = v.T.x;
param[index++] = v.T.y;
param[index++] = v.T.z;
}
return index;
}
代码示例来源:origin: org.boofcv/boofcv-calibration
public Zhang99AllParam createLike() {
return new Zhang99AllParam(intrinsic.createLike(),views.length);
}
代码示例来源:origin: org.boofcv/boofcv-calibration
public int numParameters() {
return intrinsic.numParameters()+ (3+3)*views.length;
}
代码示例来源:origin: org.boofcv/boofcv-swing
@Override
public void setCalibration(Zhang99AllParam found) {
CameraPinholeRadial intrinsic = (CameraPinholeRadial)found.getIntrinsic().getCameraModel();
String textX = String.format("%5.1f",intrinsic.cx);
String textY = String.format("%5.1f", intrinsic.cy);
代码示例来源:origin: org.boofcv/boofcv-calibration
public int setFromParam( double param[] ) {
int index = intrinsic.setFromParam(param);
for( View v : views ) {
v.rotation.setParamVector(param[index++],param[index++],param[index++]);
v.T.x = param[index++];
v.T.y = param[index++];
v.T.z = param[index++];
}
return index;
}
代码示例来源:origin: org.boofcv/boofcv-calibration
public Zhang99AllParam copy() {
Zhang99AllParam ret = createLike();
ret.intrinsic.setTo(intrinsic);
for( int i = 0; i < views.length; i++ ) {
View a = views[i];
View b = ret.views[i];
b.rotation.unitAxisRotation.set(a.rotation.unitAxisRotation);
b.rotation.theta = a.rotation.theta;
b.T.set(a.T);
}
return ret;
}
代码示例来源:origin: org.boofcv/boofcv-calibration
/**
* 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;
}
}
代码示例来源:origin: org.boofcv/boofcv-calibration
public void process(Zhang99AllParam param , double []residuals ) {
int index = 0;
for( int indexView = 0; indexView < param.views.length; indexView++ ) {
Zhang99AllParam.View v = param.views[indexView];
ConvertRotation3D_F64.rodriguesToMatrix(v.rotation,se.getR());
se.T = v.T;
CalibrationObservation viewSet = observations.get(indexView);
for( int i = 0; i < viewSet.size(); i++ ) {
int gridIndex = viewSet.get(i).index;
Point2D_F64 obs = viewSet.get(i);
// Put the point in the camera's reference frame
SePointOps_F64.transform(se,grid.get(gridIndex), cameraPt);
param.getIntrinsic().project(cameraPt,pixelPt);
residuals[index++] = pixelPt.x-obs.x;
residuals[index++] = pixelPt.y-obs.y;
}
}
}
}
代码示例来源:origin: org.boofcv/boofcv-calibration
/**
* Configures calibration process.
*
* @param layout Layout of calibration points on the target
* @param intrinsicParam
*/
public CalibrationPlanarGridZhang99(List<Point2D_F64> layout, Zhang99IntrinsicParam intrinsicParam)
{
this.layout = layout;
computeHomography = new Zhang99ComputeTargetHomography(layout);
computeK = new Zhang99CalibrationMatrixFromHomographies(intrinsicParam.assumeZeroSkew);
computeRadial = new RadialDistortionEstimateLinear(layout,intrinsicParam.getNumberOfRadial());
optimized = new Zhang99AllParam(intrinsicParam,0);
initial = optimized.createLike();
}
代码示例来源:origin: org.boofcv/boofcv-calibration
initial.createLike(), grid,observations);
Zhang99OptimizationJacobian jacobian = initial.getIntrinsic().createJacobian(observations,grid);
代码示例来源:origin: org.boofcv/boofcv-swing
@Override
public void setCalibration(Zhang99AllParam found) {
CameraUniversalOmni intrinsic = (CameraUniversalOmni)found.getIntrinsic().getCameraModel();
String textX = String.format("%5.1f",intrinsic.cx);
String textY = String.format("%5.1f", intrinsic.cy);
代码示例来源:origin: org.boofcv/boofcv-calibration
/**
* After calibration points have been found this invokes the Zhang99 algorithm to
* estimate calibration parameters. Error statistics are also computed.
*/
public <T extends CameraModel>T process() {
if( zhang99 == null )
throw new IllegalArgumentException("Please call configure first.");
if( !zhang99.process(observations) ) {
throw new RuntimeException("Zhang99 algorithm failed!");
}
foundZhang = zhang99.getOptimized();
errors = computeErrors(observations, foundZhang,layout);
foundIntrinsic = foundZhang.getIntrinsic().getCameraModel();
foundIntrinsic.width = imageWidth;
foundIntrinsic.height = imageHeight;
return (T)foundIntrinsic;
}
内容来源于网络,如有侵权,请联系作者删除!