Class UtilLepetitEPnP


  • public class UtilLepetitEPnP
    extends java.lang.Object
    Various utility functions for PnPLepetitEPnP.
    • Constructor Summary

      Constructors 
      Constructor Description
      UtilLepetitEPnP()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void computeCameraControl​(double[] beta, java.util.List<georegression.struct.point.Point3D_F64>[] nullPts, org.ddogleg.struct.FastQueue<georegression.struct.point.Point3D_F64> cameraPts, int numControl)
      Computes the camera control points as weighted sum of null points.
      static void constraintMatrix3x3​(org.ejml.data.DMatrixRMaj L_3x6, org.ejml.data.DMatrixRMaj L_6x3)
      Extracts the linear constraint matrix for planar case 2 from the full 4x6 constraint matrix.
      static void constraintMatrix3x3a​(org.ejml.data.DMatrixRMaj L_3x6, org.ejml.data.DMatrixRMaj L_3x3)
      Extracts the linear constraint matrix for case 1 from the full 6x10 constraint matrix.
      static void constraintMatrix3x6​(org.ejml.data.DMatrixRMaj L, org.ejml.data.DMatrixRMaj y, org.ddogleg.struct.FastQueue<georegression.struct.point.Point3D_F64> controlWorldPts, java.util.List<georegression.struct.point.Point3D_F64>[] nullPts)
      Linear constraint matrix for case 4 in the planar case
      static void constraintMatrix6x10​(org.ejml.data.DMatrixRMaj L, org.ejml.data.DMatrixRMaj y, org.ddogleg.struct.FastQueue<georegression.struct.point.Point3D_F64> controlWorldPts, java.util.List<georegression.struct.point.Point3D_F64>[] nullPts)
      Linear constraint matrix used in case 4 in the general case
      static void constraintMatrix6x3​(org.ejml.data.DMatrixRMaj L_6x10, org.ejml.data.DMatrixRMaj L_6x3)
      Extracts the linear constraint matrix for case 2 from the full 6x10 constraint matrix.
      static void constraintMatrix6x4​(org.ejml.data.DMatrixRMaj L_6x10, org.ejml.data.DMatrixRMaj L_6x4)
      Extracts the linear constraint matrix for case 1 from the full 6x10 constraint matrix.
      static void constraintMatrix6x6​(org.ejml.data.DMatrixRMaj L_6x10, org.ejml.data.DMatrixRMaj L_6x6)
      Extracts the linear constraint matrix for case 3 from the full 6x10 constraint matrix.
      static void jacobian_Control3​(org.ejml.data.DMatrixRMaj L_full, double[] beta, org.ejml.data.DMatrixRMaj A)
      Computes the Jacobian given 3 control points.
      static void jacobian_Control4​(org.ejml.data.DMatrixRMaj L_full, double[] beta, org.ejml.data.DMatrixRMaj A)
      Computes the Jacobian given 4 control points.
      static void residuals_Control3​(org.ejml.data.DMatrixRMaj L_full, org.ejml.data.DMatrixRMaj y, double[] beta, double[] r)
      Computes the residuals (difference between observed and predicted given 3 control points.
      static void residuals_Control4​(org.ejml.data.DMatrixRMaj L_full, org.ejml.data.DMatrixRMaj y, double[] beta, double[] r)
      Computes the residuals (difference between observed and predicted) given 4 control points.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UtilLepetitEPnP

        public UtilLepetitEPnP()
    • Method Detail

      • computeCameraControl

        public static void computeCameraControl​(double[] beta,
                                                java.util.List<georegression.struct.point.Point3D_F64>[] nullPts,
                                                org.ddogleg.struct.FastQueue<georegression.struct.point.Point3D_F64> cameraPts,
                                                int numControl)
        Computes the camera control points as weighted sum of null points.
        Parameters:
        beta - Beta values which describe the weights of null points
        nullPts - Null points that the camera point is a weighted sum of
        cameraPts - The output
      • constraintMatrix6x4

        public static void constraintMatrix6x4​(org.ejml.data.DMatrixRMaj L_6x10,
                                               org.ejml.data.DMatrixRMaj L_6x4)
        Extracts the linear constraint matrix for case 1 from the full 6x10 constraint matrix.
      • constraintMatrix6x3

        public static void constraintMatrix6x3​(org.ejml.data.DMatrixRMaj L_6x10,
                                               org.ejml.data.DMatrixRMaj L_6x3)
        Extracts the linear constraint matrix for case 2 from the full 6x10 constraint matrix.
      • constraintMatrix6x6

        public static void constraintMatrix6x6​(org.ejml.data.DMatrixRMaj L_6x10,
                                               org.ejml.data.DMatrixRMaj L_6x6)
        Extracts the linear constraint matrix for case 3 from the full 6x10 constraint matrix.
      • constraintMatrix6x10

        public static void constraintMatrix6x10​(org.ejml.data.DMatrixRMaj L,
                                                org.ejml.data.DMatrixRMaj y,
                                                org.ddogleg.struct.FastQueue<georegression.struct.point.Point3D_F64> controlWorldPts,
                                                java.util.List<georegression.struct.point.Point3D_F64>[] nullPts)
        Linear constraint matrix used in case 4 in the general case
        Parameters:
        L - Constraint matrix
        y - Vector containing distance between world control points
        controlWorldPts - List of world control points
        nullPts - Null points
      • constraintMatrix3x3a

        public static void constraintMatrix3x3a​(org.ejml.data.DMatrixRMaj L_3x6,
                                                org.ejml.data.DMatrixRMaj L_3x3)
        Extracts the linear constraint matrix for case 1 from the full 6x10 constraint matrix.
      • constraintMatrix3x3

        public static void constraintMatrix3x3​(org.ejml.data.DMatrixRMaj L_3x6,
                                               org.ejml.data.DMatrixRMaj L_6x3)
        Extracts the linear constraint matrix for planar case 2 from the full 4x6 constraint matrix.
      • constraintMatrix3x6

        public static void constraintMatrix3x6​(org.ejml.data.DMatrixRMaj L,
                                               org.ejml.data.DMatrixRMaj y,
                                               org.ddogleg.struct.FastQueue<georegression.struct.point.Point3D_F64> controlWorldPts,
                                               java.util.List<georegression.struct.point.Point3D_F64>[] nullPts)
        Linear constraint matrix for case 4 in the planar case
        Parameters:
        L - Constraint matrix
        y - Vector containing distance between world control points
        controlWorldPts - List of world control points
        nullPts - Null points
      • residuals_Control4

        public static void residuals_Control4​(org.ejml.data.DMatrixRMaj L_full,
                                              org.ejml.data.DMatrixRMaj y,
                                              double[] beta,
                                              double[] r)
        Computes the residuals (difference between observed and predicted) given 4 control points.
      • residuals_Control3

        public static void residuals_Control3​(org.ejml.data.DMatrixRMaj L_full,
                                              org.ejml.data.DMatrixRMaj y,
                                              double[] beta,
                                              double[] r)
        Computes the residuals (difference between observed and predicted given 3 control points.
      • jacobian_Control4

        public static void jacobian_Control4​(org.ejml.data.DMatrixRMaj L_full,
                                             double[] beta,
                                             org.ejml.data.DMatrixRMaj A)
        Computes the Jacobian given 4 control points.
      • jacobian_Control3

        public static void jacobian_Control3​(org.ejml.data.DMatrixRMaj L_full,
                                             double[] beta,
                                             org.ejml.data.DMatrixRMaj A)
        Computes the Jacobian given 3 control points.