gpt4 book ai didi

boofcv.alg.geo.calibration.Zhang99CalibrationMatrixFromHomographies类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:38:32 27 4
gpt4 key购买 nike

本文整理了Java中boofcv.alg.geo.calibration.Zhang99CalibrationMatrixFromHomographies类的一些代码示例,展示了Zhang99CalibrationMatrixFromHomographies类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zhang99CalibrationMatrixFromHomographies类的具体详情如下:
包路径:boofcv.alg.geo.calibration.Zhang99CalibrationMatrixFromHomographies
类名称:Zhang99CalibrationMatrixFromHomographies

Zhang99CalibrationMatrixFromHomographies介绍

[英]Estimates camera calibration matrix from a set of homographies using linear algebra. Based upon the description found in [1], but has been modified to improve stability and flexibility. Two variants are implemented inside this class. One variant assumes that the skew is zero and requires two or more homographies and the other variant does not assume the skew is zero and requires three or more homographies. The calibration matrix structure is shown below.

Calibration matrix is defined as follows:
[ α c u0 ]
[ 0 β v0 ]
[ 0 0 1 ]
where 'c' is the camera's skew.

The zero skew variant is a modification of what was described in [1]. Instead of simply adding another row to force the skew to be zero that entire part of the equation has been omitted. The algorithm described in [1] was numerically unstable and did not produce meaningful results.

[1] Zhengyou Zhang, "Flexible Camera Calibration By Viewing a Plane From Unknown Orientations,", International Conference on Computer Vision (ICCV'99), Corfu, Greece, pages 666-673, September 1999.
[中]使用线性代数从一组同形图估计摄像机校准矩阵。基于[1]中的描述,但已进行修改以提高稳定性和灵活性。在这个类中实现了两个变体。一种变体假设歪斜为零,需要两个或多个同音字,另一种变体不假设歪斜为零,需要三个或多个同音字。校准矩阵结构如下所示。
校准矩阵定义如下:
[αc u0]
[0βv0]
[ 0 0 1 ]
其中“c”是相机的倾斜。
零偏差变量是对[1]中所述内容的修改。与简单地添加另一行以强制倾斜为零不同,方程式的整个部分都被省略了。[1]中描述的算法在数值上不稳定,没有产生有意义的结果。
[1] 张正友,“通过从未知方向观察飞机进行灵活的摄像机校准”,国际计算机视觉会议(ICCV'99),希腊科孚,第666-673页,1999年9月。

代码示例

代码示例来源:origin: org.boofcv/calibration

/**
 * Configures calibration process.
 *
 * @param layout Layout of calibration points on the target
 * @param assumeZeroSkew Should it assumed the camera has zero skew. Typically true.
 * @param numRadialParam Number of radial distortion parameters to consider.  Typically 0,1,2.
 * @param includeTangential Should it include tangential distortion?
 */
public CalibrationPlanarGridZhang99(List<Point2D_F64> layout,
                  boolean assumeZeroSkew,
                  int numRadialParam,
                  boolean includeTangential )
{
  this.layout = layout;
  computeHomography = new Zhang99ComputeTargetHomography(layout);
  computeK = new Zhang99CalibrationMatrixFromHomographies(assumeZeroSkew);
  computeRadial = new RadialDistortionEstimateLinear(layout,numRadialParam);
  optimized = new Zhang99ParamAll(assumeZeroSkew,numRadialParam,includeTangential);
}

代码示例来源:origin: org.boofcv/boofcv-calibration

/**
 * Given a set of homographies computed from a sequence of images that observe the same
 * plane it estimates the camera's calibration.
 *
 * @param homographies Homographies computed from observations of the calibration grid.
 */
public void process( List<DMatrixRMaj> homographies ) {
  if( assumeZeroSkew ) {
    if( homographies.size() < 2 )
      throw new IllegalArgumentException("At least two homographies are required");
  } else if( homographies.size() < 3 ) {
    throw new IllegalArgumentException("At least three homographies are required");
  }
  if( assumeZeroSkew ) {
    setupA_NoSkew(homographies);
    if( !solverNull.process(A,1,b) )
      throw new RuntimeException("SVD failed");
    computeParam_ZeroSkew();
  } else {
    setupA(homographies);
    if( !solverNull.process(A,1,b) )
      throw new RuntimeException("SVD failed");
    computeParam();
  }
  if(MatrixFeatures_DDRM.hasUncountable(K)) {
    throw new RuntimeException("Failed!");
  }
}

代码示例来源:origin: org.boofcv/calibration

/**
 * Find an initial estimate for calibration parameters using linear techniques.
 */
protected Zhang99ParamAll initialParam( List<CalibrationObservation> observations )
{
  status("Estimating Homographies");
  List<DenseMatrix64F> homographies = new ArrayList<>();
  List<Se3_F64> motions = new ArrayList<>();
  for( CalibrationObservation obs : observations ) {
    if( !computeHomography.computeHomography(obs) )
      return null;
    DenseMatrix64F H = computeHomography.getHomography();
    homographies.add(H);
  }
  status("Estimating Calibration Matrix");
  computeK.process(homographies);
  DenseMatrix64F K = computeK.getCalibrationMatrix();
  decomposeH.setCalibrationMatrix(K);
  for( DenseMatrix64F H : homographies ) {
    motions.add(decomposeH.decompose(H));
  }
  status("Estimating Radial Distortion");
  computeRadial.process(K, homographies, observations);
  double distort[] = computeRadial.getParameters();
  return convertIntoZhangParam(motions, K,optimized.assumeZeroSkew, distort,
      optimized.includeTangential);
}

代码示例来源:origin: org.boofcv/calibration

computeV(h1, h2, v12);
computeV(h1, h1, v11);
computeV(h2, h2, v22);

代码示例来源:origin: org.boofcv/calibration

computeV_NoSkew(h1, h2, v12);
computeV_NoSkew(h1, h1, v11);
computeV_NoSkew(h2, h2, v22);

代码示例来源:origin: org.boofcv/boofcv-calibration

/**
 * Find an initial estimate for calibration parameters using linear techniques.
 */
protected boolean linearEstimate(List<CalibrationObservation> observations , Zhang99AllParam param )
{
  status("Estimating Homographies");
  List<DMatrixRMaj> homographies = new ArrayList<>();
  List<Se3_F64> motions = new ArrayList<>();
  for( CalibrationObservation obs : observations ) {
    if( !computeHomography.computeHomography(obs) )
      return false;
    DMatrixRMaj H = computeHomography.getHomography();
    homographies.add(H);
  }
  status("Estimating Calibration Matrix");
  computeK.process(homographies);
  DMatrixRMaj K = computeK.getCalibrationMatrix();
  decomposeH.setCalibrationMatrix(K);
  for( DMatrixRMaj H : homographies ) {
    motions.add(decomposeH.decompose(H));
  }
  status("Estimating Radial Distortion");
  computeRadial.process(K, homographies, observations);
  double distort[] = computeRadial.getParameters();
  convertIntoZhangParam(motions, K,distort, param);
  return true;
}

代码示例来源:origin: org.boofcv/boofcv-calibration

computeV(h1, h2, v12);
computeV(h1, h1, v11);
computeV(h2, h2, v22);

代码示例来源:origin: org.boofcv/boofcv-calibration

computeV_NoSkew(h1, h2, v12);
computeV_NoSkew(h1, h1, v11);
computeV_NoSkew(h2, h2, v22);

代码示例来源:origin: org.boofcv/calibration

setupA_NoSkew(homographies);
  if( !svd.decompose(A) )
    throw new RuntimeException("SVD failed");
    SingularOps.nullVector(svd,true,b);
  computeParam_ZeroSkew();
} else {
  setupA(homographies);
  if( !svd.decompose(A) )
    throw new RuntimeException("SVD failed");
  SingularOps.nullVector(svd,true,b);
  computeParam();

代码示例来源: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();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com