ImFusion C++ SDK 4.5.0
ImFusion::CameraCalibrationDataComponent Class Reference

#include <ImFusion/Vision/CameraCalibrationDataComponent.h>

A data component storing mainly the intrinsic calibration of a pinhole camera Information such as image size, extrinsic poses and distortions are also stored Debug values like MRE and standard deviations estimated for intrinsic parameters, which are used for evaluating the calibration results during the calibration process are also saved here. More...

Inheritance diagram for ImFusion::CameraCalibrationDataComponent:

Detailed Description

A data component storing mainly the intrinsic calibration of a pinhole camera Information such as image size, extrinsic poses and distortions are also stored Debug values like MRE and standard deviations estimated for intrinsic parameters, which are used for evaluating the calibration results during the calibration process are also saved here.

Public Member Functions

 CameraCalibrationDataComponent ()=default
 Default constructor.
 CameraCalibrationDataComponent (const vec2i &size, const mat3 &k, const vec5 &dist)
 Constructor with image size, intrinsic matrix, distortion.
 CameraCalibrationDataComponent (const vec2i &size, const mat3 &k, const vec5 &dist, const mat4 &reg)
 Constructor with image size, intrinsic matrix, distortion, and extrinsic registration.
CameraCalibrationDataComponentoperator= (const CameraCalibrationDataComponent &other)=default
 Assignment operator.
bool operator== (const CameraCalibrationDataComponent &other) const
 Checks for exact equality of all parameters.
bool isApprox (const CameraCalibrationDataComponent &other, double precision=std::numeric_limits< double >::epsilon()) const
 Checks for approximate equality of all parameters within a given precision.
std::string id () const override
 Returns the component type identifier.
bool checkImageSizeAndCalibrationConsistency (const vec2i &size) const
 Checks if the physical image size and the size in this component are consistent.
bool adaptCalibrationToCropping (const vec4i &cropBox)
 Adapts the intrinsic calibration to a cropped image.
bool adaptCalibrationToPadding (const vec4i &padValues)
 Adapts the intrinsic calibration to a padded image.
bool adaptCalibrationToResizing (const vec2i &newSize)
 Adapts the intrinsic calibration to a resized image.
bool save (const Filesystem::Path &file)
 Saves the calibration to a file.
bool load (const Filesystem::Path &file)
 Loads the calibration from a file.
void configure (const Properties *p) override
 Configures the component from a Properties object.
bool valid () const
Public Member Functions inherited from ImFusion::DataComponent< CameraCalibrationDataComponent >
std::unique_ptr< DataComponentBase > clone () const override
 Creates a clone of this data component.
std::unique_ptr< Subclass > cloneDerived () const
bool assign (const DataComponentBase &other) override
 Assigns the content of other to this data component.
bool equals (const DataComponentBase &other) const override
 Compares this data component to other for equality.
Public Member Functions inherited from ImFusion::Configurable
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

Public Attributes

Parameter< vec2i > p_imageSize = {"imageSize", vec2i::Zero(), this}
Parameter< mat3 > p_K = {"K", mat3::Zero(), this}
Parameter< vec5 > p_distortion = {"distortion", vec5::Zero(), this}
Parameter< mat4 > p_camToWorldT = {"registration", mat4::Identity(), this}
Parameter< double > p_mre = {"mre", 0., this}
Parameter< vec4 > p_stdK = {"stdK", vec4::Zero(), this}
Parameter< vec5 > p_stdDistortion = {"stdDistortion", vec5::Zero(), this}
Parameter< std::stringp_serialNumber = {"serialNumber", "", this}
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::DataComponentBase
 DataComponentBase (const DataComponentBase &)=default
DataComponentBase & operator= (const DataComponentBase &other)=default
Protected Attributes inherited from ImFusion::Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.

Member Function Documentation

◆ id()

std::string ImFusion::CameraCalibrationDataComponent::id ( ) const
overridevirtual

Returns the component type identifier.

Implements ImFusion::DataComponentBase.

◆ checkImageSizeAndCalibrationConsistency()

bool ImFusion::CameraCalibrationDataComponent::checkImageSizeAndCalibrationConsistency ( const vec2i & size) const

Checks if the physical image size and the size in this component are consistent.

Parameters
sizeThe physical image size
Returns
true if the sizes are consistent, false otherwise

◆ adaptCalibrationToCropping()

bool ImFusion::CameraCalibrationDataComponent::adaptCalibrationToCropping ( const vec4i & cropBox)

Adapts the intrinsic calibration to a cropped image.

Parameters
cropBoxThe crop box in pixel in COCO format (upper left x, upper left y, width, height)
Returns
true if the calibration was adapted, false otherwise

◆ adaptCalibrationToPadding()

bool ImFusion::CameraCalibrationDataComponent::adaptCalibrationToPadding ( const vec4i & padValues)

Adapts the intrinsic calibration to a padded image.

Parameters
padValuesThe padding values (left, right, top, bottom)
Returns
true if the calibration was adapted, false otherwise

◆ adaptCalibrationToResizing()

bool ImFusion::CameraCalibrationDataComponent::adaptCalibrationToResizing ( const vec2i & newSize)

Adapts the intrinsic calibration to a resized image.

Note
Please make sure the previous image size was consistent with the calibration data. You can do this with checkImageSizeAndCalibrationConsistency prior to resizing the image. If not please make sure you update it throughout the pipeline.
Parameters
newSizeThe new image size
Returns
true if the calibration was adapted, false otherwise

◆ configure()

void ImFusion::CameraCalibrationDataComponent::configure ( const Properties * p)
overridevirtual

Configures the component from a Properties object.

Reimplemented from ImFusion::Configurable.


The documentation for this class was generated from the following file:
  • ImFusion/Vision/CameraCalibrationDataComponent.h
Search Tab / S to search, Esc to close