![]() |
ImFusion SDK 4.3
|
#include <RGBD/Include/ImFusion/RGBD/RGBDReconstructionAlgorithm.h>
Algorithm for surface reconstruction from RGB-D data streams. More...
Inheritance diagram for RGBDReconstructionAlgorithm:Algorithm for surface reconstruction from RGB-D data streams.
This class performs volumetric surface reconstruction using one or more RGB-D streams. It supports live sensor input and playback, pose tracking, relocalization, and keyframe management. The reconstruction process is highly configurable, supporting frame selection, buffering, integration, and synchronization.
Usage:
compute() or start() to begin reconstruction.takeOutput() to retrieve results such as meshes or point clouds.addListener() for frame-level callbacks.Important aspects:
Example:
Classes | |
| struct | Keyframe |
| Keyframe structure containing depth, color, and camera data. More... | |
Public Member Functions | |
| RGBDReconstructionAlgorithm (const std::vector< RGBDStream * > &streams) | |
| bool | initialized () const |
| Returns whether the algorithm has been initialized. | |
| std::vector< RGBDStream * > | streams () const |
| Returns the list of active streams used for reconstruction. | |
| std::vector< RGBDStream * > | inputStreams () const |
| Returns the input streams provided to the algorithm. | |
| void | setRelocalization (std::unique_ptr< Relocalization > reloc) |
| Sets a custom relocalization instance. Must be called before starting reconstruction. | |
| Relocalization * | relocalization () const |
| Returns the current relocalization instance. | |
| bool | start () |
| Starts the reconstruction process. | |
| void | stop (bool aborted=false) |
| Stops the reconstruction process. | |
| void | compute () override |
| Calls start(). | |
| OwningDataList | takeOutput () override |
| Returns the output data list containing reconstruction results. | |
| std::unique_ptr< Mesh > | getMesh () |
| Returns a mesh of the reconstructed surface. Ownership is transferred to the caller. | |
| SurfaceReconstructionData * | surfaceReconstructionData () const |
| Returns the reconstruction data object. | |
| SurfaceReconstruction * | surfaceReconstruction () const |
| Returns the surface reconstruction instance. | |
| bool | isReconstructing () const |
| Returns true if reconstruction is currently running. | |
| bool | trackingState (int idx) const |
| Returns the tracking state for the specified sensor index. | |
| void | setForceFirstFramePerSensor (bool force) |
| Forces the first frame per sensor to be used for reconstruction. | |
| bool | forceFirstFramePerSensor () const |
| void | setUseFramePose (bool use) |
| Sets whether to use the frame pose for reconstruction. | |
| bool | useFramePose () const |
| void | setUseFramePoseAsHint (bool use) |
| Sets whether to use the frame pose as a hint for tracking. | |
| bool | useFramePoseAsHint () const |
| void | setUseStableFrameHint (bool use) |
| Sets whether to use stable frame hints for tracking. | |
| bool | useStableFrameHint () const |
| void | setUseRelocalization (bool use) |
| Sets whether to use relocalization during reconstruction. | |
| bool | userRelocalization () const |
| void | setSyncLasers (bool sync) |
| Enables or disables laser synchronization for multi-sensor setups. | |
| bool | syncLasers () const |
| void | setSyncLaserWaitTime (int waitTimeMs) |
| Sets the wait time (ms) for laser synchronization. | |
| int | syncLaserWaitTime () const |
| void | configure (const Properties *p) override |
| Configures the algorithm from a Properties object. | |
| void | configuration (Properties *p) const override |
| Serializes the algorithm configuration to a Properties object. | |
| void | addListener (RGBDReconstructionCallback *listener) |
| Registers a callback listener for frame events. | |
| void | removeListener (const RGBDReconstructionCallback *listener) |
| Removes a previously registered callback listener. | |
| void | cleanup () |
| Cleans up internal resources and state. | |
| void | setReconstructAllFrames (bool v) |
| Forces reconstruction of all received frames (default for playback). | |
| void | setReconstructAllBufferedFrames (bool v) |
| Forces reconstruction of all buffered frames after stop() is called. | |
| void | setMaxFrameBufferSize (int frames) |
| Sets the maximum number of frames to buffer in memory. | |
| void | setSkipEverySecondFrame (bool v) |
| Skips every second frame for performance optimization. | |
| void | setIntegrateFrames (bool integrate, int sensorId) |
| Sets whether to integrate frames into the reconstruction for a given sensor. | |
| std::unique_ptr< TrackingSequence > | trackingSequence (int sensor) const |
| Returns a copy of the tracking sequence for the specified sensor. | |
| TrackingStream * | liveTrackingStream () const |
| Returns the live tracking stream, if available. | |
| PointCloud * | livePointCloud () const |
| Returns the live point cloud, if available. | |
| TrackingSequence * | liveTrackingSequence () const |
| Returns the live tracking sequence, if available. | |
| std::vector< Keyframe > | keyframes () |
| Returns the list of keyframes used in reconstruction. | |
| void | setKeyframeRotationDifference (double v) |
| Sets the minimum rotation difference (degrees) for keyframe selection. | |
| double | keyframeRotationDifference () const |
| void | setKeyframeTranslationDifference (double v) |
| Sets the minimum translation difference (mm) for keyframe selection. | |
| double | keyframeTranslationDifference () const |
Public Member Functions inherited from 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 Configurable | |
| 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 Member Functions inherited from SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (SignalReceiver rhs) |
| Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs. | |
| virtual | ~SignalReceiver () |
| Virtual destructor disconnects from all connected signals. | |
Static Public Member Functions | |
| static bool | createCompatible (const DataList &data, Algorithm **a=0) |
| Factory method for compatibility checking and creation. | |
Static Public Member Functions inherited from 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 | |
| Signal | signalReconstructionStarted |
| Signal emitted when reconstruction starts. | |
| Signal< bool > | signalReconstructionStopped |
| Signal emitted when reconstruction stops. | |
| Signal | signalUpdateDisplay |
| Signal emitted when display should be updated. | |
Public Attributes inherited from 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 Configurable | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Additional Inherited Members | |
Public Types inherited from Algorithm | |
| enum | Status { Unknown = -1 , Success = 0 , Error = 1 , InvalidInput , IncompleteInput , OutOfMemoryHost , OutOfMemoryGPU , UnsupportedGPU , UnknownAction , AbortedByUser , User = 1000 } |
| Status codes. More... | |
Protected Member Functions inherited from 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 Member Functions inherited from SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
Protected Attributes inherited from 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 Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
overridevirtual |
Returns the output data list containing reconstruction results.
Reimplemented from Algorithm.
|
overridevirtual |
Configures the algorithm from a Properties object.
Reimplemented from Configurable.
|
overridevirtual |
Serializes the algorithm configuration to a Properties object.
Reimplemented from Configurable.