RGBDCalibrationAlgorithm estimates intrinsic and extrinsic calibration parameters for RGB-D camera systems.
The algorithm is designed to calibrate IR, depth, and color sensors using chessboard patterns and marker planes. It supports flexible input configurations and provides access to calibration results for downstream processing.
The class does not take ownership of the input image sets; their lifetime is not managed by the algorithm. The caller must ensure that the image sets remain valid for the entire time the algorithm is used. Calibration results are stored in the RGBDCalibration struct and can be queried or set externally.
Typical usage:
calib.compute();
if (calib.calibration(result))
{
}
RGBDCalibrationAlgorithm(SharedImageSet *irImages, SharedImageSet *depthImages, SharedImageSet *colorImages=nullptr)
Constructs the calibration algorithm with IR, depth, and optionally color image sets.
SharedImageSet * depthImages() const
Returns the depth image set (ownership not transferred).
Definition RGBDCalibrationAlgorithm.h:86
SharedImageSet * irImages() const
Returns the IR image set (ownership not transferred).
Definition RGBDCalibrationAlgorithm.h:83
SharedImageSet * colorImages() const
Returns the color image set (ownership not transferred).
Definition RGBDCalibrationAlgorithm.h:89
Struct holding all calibration results for an RGBD sensor.
Definition RGBDCalibrationAlgorithm.h:102
Important aspects:
- Input image sets must remain valid for the lifetime of the algorithm.
- All images must be compatible in resolution and calibration.
- Not thread-safe.
- Error handling is via return codes; no exceptions are thrown.
- Depth corruption handling and undistortion can be configured.
- The algorithm is intended for use in RGBD sensor calibration pipelines.
- See also
- ImFusion::CameraCalibrationAlgorithm
|
| | RGBDCalibrationAlgorithm (SharedImageSet *irImages, SharedImageSet *depthImages, SharedImageSet *colorImages=nullptr) |
| | Constructs the calibration algorithm with IR, depth, and optionally color image sets.
|
| |
|
SharedImageSet * | irImages () const |
| | Returns the IR image set (ownership not transferred).
|
| |
|
SharedImageSet * | depthImages () const |
| | Returns the depth image set (ownership not transferred).
|
| |
|
SharedImageSet * | colorImages () const |
| | Returns the color image set (ownership not transferred).
|
| |
| void | compute () override |
| | Runs the calibration algorithm.
|
| |
|
CameraCalibrationAlgorithm * | irCalibration () |
| | Returns the calibration object for configuring standard chessboard calibration (IR sensor).
|
| |
|
CameraCalibrationAlgorithm * | colorCalibration () |
| | Returns the calibration object for configuring standard chessboard calibration (color sensor).
|
| |
| bool | calibration (RGBDCalibration &calib) const |
| | Returns the current calibration results.
|
| |
| void | setCalibration (const RGBDCalibration &calib) |
| | Sets the calibration results.
|
| |
|
void | clearCalibration () |
| | Clears the current calibration results.
|
| |
| void | setDropCorruptDepthData (bool drop) |
| | Enables or disables dropping of corrupt depth data.
|
| |
|
bool | dropCorruptDepthData () const |
| | Returns whether corrupt depth data is dropped.
|
| |
| void | setCorruptDepthRange (std::array< float, 2 > range) |
| | Sets the range for corrupt depth values (world units, usually in mm).
|
| |
|
std::array< float, 2 > | corruptDepthRange () const |
| | Returns the range for corrupt depth values (world units, usually in mm).
|
| |
| void | setIrDepthYShift (int shift) |
| | Sets the vertical shift for IR/depth image alignment (pixels).
|
| |
|
int | irDepthYShift () const |
| | Returns the vertical shift for IR/depth image alignment (pixels).
|
| |
| void | setUndistort (bool v) |
| | Enables or disables undistortion of images.
|
| |
|
bool | undistort () const |
| | Returns whether undistortion is enabled.
|
| |
| void | setDontCalibrate (bool v) |
| | Enables or disables calibration (for testing or debugging).
|
| |
|
bool | dontCalibrate () const |
| | Returns whether calibration is disabled.
|
| |
| bool | fittingError (std::vector< vec4 > &planes, std::vector< bool > &selection) const |
| | Computes the fitting error for marker planes.
|
| |
| OwningDataList | takeOutput () override |
| | Returns the output data list containing calibration results.
|
| |
| void | configure (const Properties *p) override |
| | Configures the algorithm from a properties object.
|
| |
| void | configuration (Properties *p) const override |
| | Writes the current configuration to a properties object.
|
| |
| | 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.
|
| |
| 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 bool | createCompatible (const DataList &data, Algorithm **a=0) |
| | Factory method for compatibility checking and creation.
|
| |
| static bool | getMarkerMask (TypedImage< float > *imgDepth, const std::vector< vec2 > &cornersImg, TypedImage< unsigned char > *mask) |
| | Creates a binary mask image with pixels inside the rectangle defined by given corners set to 1.
|
| |
| static bool | getMarkerPlane (TypedImage< float > *imgDepth, const mat3 &depthK, const std::vector< vec2 > &cornersImg, vec4 &plane, TypedImage< unsigned char > *mask=nullptr, double minInlierRatio=0.8) |
| | Fits a plane to a depth image using pixels inside a rectangle defined by given corners.
|
| |
| static bool | createCompatible (const DataList &data, Algorithm **a=nullptr) |
| | Factory function to check algorithm compatibility with input data and optionally instantiate it.
|
| |
|
| enum | Status {
Unknown = -1
, Success = 0
, Error = 1
, InvalidInput
,
IncompleteInput
, OutOfMemoryHost
, OutOfMemoryGPU
, UnsupportedGPU
,
UnknownAction
, AbortedByUser
, User = 1000
} |
| | Status codes. More...
|
| |
|
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.
|
| |
|
Signal | signalParametersChanged |
| | Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
|
| |
|
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.
|
| |
|
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.
|
| |
|
std::vector< Param > | m_params |
| | List of all registered Parameter and SubProperty instances.
|
| |