Class LinePlaneCorrespondencePinholeCameraRefiner

Direct Known Subclasses:
DecomposedLinePlaneCorrespondencePinholeCameraRefiner, NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner

public abstract class LinePlaneCorrespondencePinholeCameraRefiner extends PinholeCameraRefiner<Plane,Line2D>
Base class for a pinhole camera refiner using line/plane correspondences. Implementations of this class refine a pinhole camera by taking into account an initial estimation, inlier line/plane matches and their residuals. This class can be used to find a solution that minimizes error of inliers in LMSE terms. Typically, a refiner is used by a robust estimator, however it can also be useful in some other situations.
  • Field Details

    • residualTestPlane

      private final Plane residualTestPlane
      Plane to be reused when computing residuals.
  • Constructor Details

    • LinePlaneCorrespondencePinholeCameraRefiner

      protected LinePlaneCorrespondencePinholeCameraRefiner()
      Constructor.
    • LinePlaneCorrespondencePinholeCameraRefiner

      protected LinePlaneCorrespondencePinholeCameraRefiner(PinholeCamera initialEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers, List<Plane> samples1, List<Line2D> samples2, double refinementStandardDeviation)
      Constructor.
      Parameters:
      initialEstimation - initial estimation to be set.
      keepCovariance - true if covariance of estimation must be kept after refinement, false otherwise.
      inliers - set indicating which of the provided matches are inliers.
      residuals - residuals for matched samples.
      numInliers - number of inliers on initial estimation.
      samples1 - 1st set of paired samples.
      samples2 - 2nd set of paired samples.
      refinementStandardDeviation - standard deviation used for Levenberg-Marquardt fitting.
    • LinePlaneCorrespondencePinholeCameraRefiner

      protected LinePlaneCorrespondencePinholeCameraRefiner(PinholeCamera initialEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData, List<Plane> samples1, List<Line2D> samples2, double refinementStandardDeviation)
      Constructor.
      Parameters:
      initialEstimation - initial estimation to be set.
      keepCovariance - true if covariance of estimation must be kept after refinement, false otherwise.
      inliersData - inlier data, typically obtained from a robust estimator.
      samples1 - 1st set of paired samples.
      samples2 - 2nd set of paired samples.
      refinementStandardDeviation - standard deviation used for Levenberg-Marquardt fitting.
  • Method Details

    • residualPowell

      protected double residualPowell(PinholeCamera pinholeCamera, double[] params, double weight)
      Total residual to be used during Powell refinement. Refinement uses Powell algorithm to minimize a cost function consisting on the sum of squared projection residuals plus the suggestion residual for any suggested terms.
      Parameters:
      pinholeCamera - camera to be checked.
      params - camera parameters. In the following order: skewness, horizontal focal length, vertical focal length, horizontal principal point, vertical principal point, quaternion A, quaternion B, quaternion C, quaternion D, center x, center y, center z.
      weight - weight for suggestion residual.
      Returns:
      total residual during Powell refinement.
    • backprojectionResidual

      private double backprojectionResidual(PinholeCamera pinholeCamera)
      Computes total line back-projection residual for provided camera. This method computes the sum of the squared residuals for all inlier back-projected lines.
      Parameters:
      pinholeCamera - camera to compute residual for.
      Returns:
      total back-projection residual.
    • residualLevenbergMarquardt

      protected double residualLevenbergMarquardt(PinholeCamera pinholeCamera, Line2D line, Plane plane, double[] params, double weight)
      Computes total residual to be used during Levenberg/Marquard covariance estimation.
      Parameters:
      pinholeCamera - camera to estimate covariance for.
      line - 2D line to be back-projected with provided pinhole camera.
      plane - plane to be compared with back-projected line.
      params - camera parameters. In the following order: skewness, horizontal focal length, vertical focal length, horizontal principal point, vertical principal point, quaternion A, quaternion B, quaternion C, quaternion D, center x, center y, center z.
      weight - weight for suggestion residual.
      Returns:
      total residual.
    • singleBackprojectionResidual

      private double singleBackprojectionResidual(PinholeCamera pinholeCamera, Line2D line, Plane plane)
      Back-projection residual/error for a single line using provided camera.
      Parameters:
      pinholeCamera - camera ot be checked.
      line - line to be back-projected.
      plane - plane to check against.
      Returns:
      dot product distance between back-projected line and plane.