![]() |
ImFusion C++ SDK 4.4.0
|
#include <ImFusion/Vision/HandEyeCalibrationAlgorithm.h>
Performs hand-eye calibration between two tracking sequences. More...
Performs hand-eye calibration between two tracking sequences.
A typical use case is to calibrate a camera mounted on a robot end effector (EyeInHand) or a camera mounted on a tripod (EyeOnBase) to the robot coordinate system by the use of a calibration target.
Public Types | |
| enum | CalibrationMethod { TsaiLenz = 0 , GlobalMLSL = 1 } |
| Method to be used for calibration. More... | |
| enum | StreamInfo { CalibToCam , CamToCalib , HandToBase , BaseToHand } |
| Information about the transformation direction of the tracking sequences. | |
| enum class | CalibrationType { EyeInHand , EyeOnBase } |
| Public Types inherited from ImFusion::Algorithm | |
| enum | Status { Unknown = -1 , Success = 0 , Error = 1 , InvalidInput , IncompleteInput , OutOfMemoryHost , OutOfMemoryGPU , UnsupportedGPU , UnknownAction , AbortedByUser , User = 1000 } |
| Status codes. More... | |
Public Member Functions | |
| HandEyeCalibrationAlgorithm (TrackingSequence &ts1, TrackingSequence &ts2) | |
| Construct hand-eye calibration from two tracking sequences. | |
| void | compute () override |
| Execute the algorithm. | |
| OwningDataList | takeOutput () override |
| Return any new Data that was created by the Algorithm during the last call to compute(). | |
| mat4 | movingToHand () const |
| Returns the transformation between the moving and the hand coordinate systems, where the moving object is the one rigidly attached to the (robot) hand, being either the camera (in the case of EyeInHand calibration) or the calibration object (in the case of EyeOnBase calibration). | |
| mat4 | fixedToBase () const |
| Returns the transformation between the fixed coordinate system and the base coordinate system, where the fixed coordinate system is the one of the object positioned in a fixed location in the scene, being either the calibration object (in the case of EyeInHand calibration) or the camera (in the case of EyeOnBase calibration). | |
| std::vector< vec2i > | finalPairs () const |
| Returns the pairs of indices of the samples from the first and second tracking sequences that were used for calibration. | |
| void | setCalibrationOptimizer (CalibrationOptimizer *fcn) |
| Set an optimizer, to be used during the non-linear refinement phase. | |
| const TrackingSequence * | tsMovingToFixed () const |
| First tracking sequence as it was passed to alignment with non-corresponding samples removed, either CamToCalib (when EyeInHand) or CalibToCam (when EyeOnBase), with applied registration (Fixed to Base). | |
| const TrackingSequence * | tsHandToBase () const |
| Second tracking sequence as it was passed to alignment with non-corresponding samples removed with applied calibration (Moving to Hand). | |
| std::map< int, int > | usedToInputSamplesMap () const |
| Mapping from the samples of the tracking stream generated by ImFusion::HandEyeCalibrationAlgorithm::tsMovingToFixed() and ImFusion::HandEyeCalibrationAlgorithm::tsHandToBase() to the samples of the input tracking streams. | |
| Public Member Functions inherited from ImFusion::Algorithm | |
| Algorithm () | |
| Default constructor will registers a single "compute" action that calls compute() and returns status(). | |
| virtual void | setProgress (Progress *progress) |
| Sets a Progress interface the algorithm can use to notify observers about its computing progress. | |
| Progress * | progress () const |
| Returns the progress interface if set. | |
| virtual int | status () const |
| Indicates the status of the last call to compute(). | |
| virtual bool | survivesDataDeletion (const Data *) const |
| Indicates whether the algorithm can handle (partial) deletion of the specified data, by default this checks whether the data is in the input list. | |
| const FactoryInfo & | factoryInfo () const |
| Returns the record describing how this Algorithm was instantiated by the AlgorithmFactory. | |
| void | setFactoryInfo (const FactoryInfo &value) |
| Sets the record describing how this Algorithm was instantiated by the AlgorithmFactory. | |
| Status | runAction (const std::string &id) |
| Run the action with name id if it exists. | |
| const std::vector< Action > & | actions () |
| Get a mapping from Action id to Action as registered in this algorithm. | |
| Public Member Functions inherited from ImFusion::Configurable | |
| virtual void | configure (const Properties *p) |
| Configure this object instance by de-serializing the given Properties. | |
| virtual void | configuration (Properties *p) const |
| Serialize the current object configuration into the given Properties object. | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Static Public Member Functions | |
| static bool | createCompatible (const DataList &data, Algorithm **a=nullptr) |
| Static Public Member Functions inherited from ImFusion::Algorithm | |
| static bool | createCompatible (const DataList &data, Algorithm **a=nullptr) |
| Factory function to check algorithm compatibility with input data and optionally instantiate it. | |
Public Attributes | |
| Parameter< CalibrationType > | p_calibrationType |
| Calibration type, either EyeInHand or EyeOnBase. | |
| Parameter< StreamInfo > | p_si1 |
| Direction of the transformation of the first tracking sequence. | |
| Parameter< StreamInfo > | p_si2 |
| Direction of the transformation of the second tracking sequence. | |
| Parameter< CalibrationMethod > | p_method = {"method", CalibrationMethod::TsaiLenz, this} |
| Calibration method to be used. | |
| Parameter< bool > | p_resetMatricesBeforeComputing |
| Reset the matrices of the input streams before starting the computation. | |
| Parameter< double > | p_minRelativeAngleSampleSelection |
| Minimum angle in degrees between current sample and a previously selected sample for the current sample to be selected. | |
| Parameter< double > | p_minRelativeTranslationSampleSelection |
| Minimum trnaslation between current sample and a previously selected sample for the current sample to be selected. | |
| Parameter< double > | p_minRelativeAngle |
| Minimum angle in degrees between pose pairs selected for optimization. | |
| Parameter< double > | p_poseInlierThreshold = {"poseInlierThreshold", 5, this} |
| Inlier threshold for pose pair errors. | |
| Parameter< bool > | p_useRansac |
| Use RANSAC scheme: select 3 random pairs of poses and compute the calibration, repeat number of iterations and select the best result. | |
| Parameter< int > | p_ransacIterations = {"ransacIterations", 1000, this} |
| Number of RANSAC iterations. | |
| Parameter< bool > | p_refineNonLinear = {"refineNonLinear", false, this} |
| Refine Tsai-Lenz output using the non-linear optimizer. | |
| Public Attributes inherited from ImFusion::Algorithm | |
| Signal | signalOutputChanged |
| Signal should be emitted by Algorithms when their output/result has changed. | |
| Signal | signalParametersChanged |
| Signal should be emitted by Algorithms when their parameter configuration has changed. | |
| Public Attributes inherited from ImFusion::Configurable | |
| Signal | signalParametersChanged |
| Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Additional Inherited Members | |
| Protected Member Functions inherited from ImFusion::Algorithm | |
| void | loadDefaults () |
| void | registerAction (const std::string &id, const std::string &guiName, const std::function< Algorithm::Status(void)> &action) |
| Register an action to be run via runAction. | |
| template<typename D> | |
| void | registerAction (const std::string &id, const std::string &guiName, Algorithm::Status(D::*action)(void)) |
| Template version of runAction that can be used with a pointer to a member function. | |
| void | registerAction (const Action &action) |
| Register an action. | |
| Protected Attributes inherited from ImFusion::Algorithm | |
| std::string | m_name |
| Algorithm name. | |
| Progress * | m_progress = nullptr |
| Non-owing pointer to a progress interface. May be a nullptr. | |
| FactoryInfo | m_factoryInfo = {} |
| Record describing how this algorithm was instantiated by the AlgorithmFactory. | |
| int | m_status = Status::Unknown |
| Algorithm status after last call to compute(). | |
| std::vector< Action > | m_actions |
| Map of key given by the id of the action, of the available actions of this algorithm. | |
| Protected Attributes inherited from ImFusion::Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
strong |
| ImFusion::HandEyeCalibrationAlgorithm::HandEyeCalibrationAlgorithm | ( | TrackingSequence & | ts1, |
| TrackingSequence & | ts2 ) |
Construct hand-eye calibration from two tracking sequences.
Position-wise correspondence between the tracking sequences is assumed. Timestamps are NOT used for matching.
|
overridevirtual |
Execute the algorithm.
Implements ImFusion::Algorithm.
|
overridevirtual |
Return any new Data that was created by the Algorithm during the last call to compute().
The default implementation will return an empty list.
Reimplemented from ImFusion::Algorithm.
|
inline |
Set an optimizer, to be used during the non-linear refinement phase.
If not set, a default pose optimizer will be used minimizing the HregInv * m_Hg[i] * Hcg * m_Hc[i]
| Parameter<CalibrationType> ImFusion::HandEyeCalibrationAlgorithm::p_calibrationType |
Calibration type, either EyeInHand or EyeOnBase.
| Parameter<StreamInfo> ImFusion::HandEyeCalibrationAlgorithm::p_si1 |
Direction of the transformation of the first tracking sequence.
| Parameter<StreamInfo> ImFusion::HandEyeCalibrationAlgorithm::p_si2 |
Direction of the transformation of the second tracking sequence.
| Parameter<bool> ImFusion::HandEyeCalibrationAlgorithm::p_resetMatricesBeforeComputing |
Reset the matrices of the input streams before starting the computation.
| Parameter<double> ImFusion::HandEyeCalibrationAlgorithm::p_minRelativeAngleSampleSelection |
Minimum angle in degrees between current sample and a previously selected sample for the current sample to be selected.
| Parameter<double> ImFusion::HandEyeCalibrationAlgorithm::p_minRelativeTranslationSampleSelection |
Minimum trnaslation between current sample and a previously selected sample for the current sample to be selected.
| Parameter<double> ImFusion::HandEyeCalibrationAlgorithm::p_minRelativeAngle |
Minimum angle in degrees between pose pairs selected for optimization.
| Parameter<bool> ImFusion::HandEyeCalibrationAlgorithm::p_useRansac |
Use RANSAC scheme: select 3 random pairs of poses and compute the calibration, repeat number of iterations and select the best result.