コード例 #1
0
  /**
   * After calibration points have been found this invokes the Zhang99 algorithm to estimate
   * calibration parameters. Error statistics are also computed.
   */
  public IntrinsicParameters 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, detector.getLayout());

    foundIntrinsic = foundZhang.convertToIntrinsic();
    foundIntrinsic.width = widthImg;
    foundIntrinsic.height = heightImg;

    return foundIntrinsic;
  }
 private void setDefaultIntrinsicParameter(int height, int width, double fovYinRadian) {
   double f = height / 2.0 / Math.tan(fovYinRadian / 2.0);
   intrinsicParameters = new IntrinsicParameters();
   intrinsicParameters.width = width;
   intrinsicParameters.height = height;
   intrinsicParameters.cx = width / 2;
   intrinsicParameters.cy = height / 2;
   intrinsicParameters.fx = f;
   intrinsicParameters.fy = f;
 }