Class SceneStructureMetric

  • All Implemented Interfaces:
    SceneStructure

    public class SceneStructureMetric
    extends SceneStructureCommon
    Specifies a metric (calibrated) scene for optimizing using BundleAdjustment. It specifies the relationships between cameras, views, and points. A camera projects a 3D point onto the image plane. Examples of specific models include pinhole and fisheye. A view is a set of observed features from a specific camera image. Views have an associated camera and specify the pose of the camera when the scene was viewed. Points describe the scene's 3D structure. Points belonging to the general scene and rigid objects have two different sets of ID's.
    • Constructor Detail

      • SceneStructureMetric

        public SceneStructureMetric​(boolean homogenous)
        Configure bundle adjustment
        Parameters:
        homogenous - if true then homogeneous coordinates are used
    • Method Detail

      • initialize

        public void initialize​(int totalCameras,
                               int totalViews,
                               int totalPoints)
        Call this function first. Specifies number of each type of data which is available.
        Parameters:
        totalCameras - Number of cameras
        totalViews - Number of views
        totalPoints - Number of points
      • initialize

        public void initialize​(int totalCameras,
                               int totalViews,
                               int totalPoints,
                               int totalRigid)
        Call this function first. Specifies number of each type of data which is available.
        Parameters:
        totalCameras - Number of cameras
        totalViews - Number of views
        totalPoints - Number of points
        totalRigid - Number of rigid objects
      • assignIDsToRigidPoints

        public void assignIDsToRigidPoints()
        Assigns an ID to all rigid points. This function does not need to be called by the user as it will be called by the residual function if needed
      • hasRigid

        public boolean hasRigid()
        Returns true if the scene contains rigid objects
      • setView

        public void setView​(int which,
                            boolean fixed,
                            georegression.struct.se.Se3_F64 worldToView)
        Specifies the spacial transform for a view.
        Parameters:
        which - Which view is being specified/
        fixed - If these parameters are fixed or not
        worldToView - The transform from world to view reference frames. Internal copy is saved.
      • setRigid

        public void setRigid​(int which,
                             boolean fixed,
                             georegression.struct.se.Se3_F64 worldToObject,
                             int totalPoints)
        Declares the data structure for a rigid object. Location of points are set by accessing the object directly. Rigid objects are useful in known scenes with calibration targets.
        Parameters:
        which - Index of rigid object
        fixed - If the pose is known or not
        worldToObject - Initial estimated location of rigid object
        totalPoints - Total number of points attached to this rigid object
      • connectViewToCamera

        public void connectViewToCamera​(int viewIndex,
                                        int cameraIndex)
        Specifies that the view uses the specified camera
        Parameters:
        viewIndex - index of view
        cameraIndex - index of camera
      • getUnknownCameraCount

        public int getUnknownCameraCount()
        Returns the number of cameras with parameters that are not fixed
        Returns:
        non-fixed camera count
      • getUnknownViewCount

        public int getUnknownViewCount()
        Returns the number of view with parameters that are not fixed
        Returns:
        non-fixed view count
      • getUnknownRigidCount

        public int getUnknownRigidCount()
        Returns the number of view with parameters that are not fixed
        Returns:
        non-fixed view count
      • getTotalRigidPoints

        public int getTotalRigidPoints()
        Returns total number of points associated with rigid objects.
      • getParameterCount

        public int getParameterCount()
        Returns the total number of parameters which will be optimised
        Returns:
        number of parameters