Jump to content

RidgeRun Video Stabilization Library/API Reference/Adding Algorithms: Difference between revisions

Line 17: Line 17:
The RidgeRun Integrator Interface, known as IIntegrator, is an extensible class design to support various types of integrators. To add a new integrator to it, the user must implement a new integrator class that derives from the IIntegrator class. This class must implement the following methods:
The RidgeRun Integrator Interface, known as IIntegrator, is an extensible class design to support various types of integrators. To add a new integrator to it, the user must implement a new integrator class that derives from the IIntegrator class. This class must implement the following methods:
* Apply: applies the integrator algorithm to the entry orientation data.
* Apply: applies the integrator algorithm to the entry orientation data.
* Reset: sets the initial orientation and its initial time to a desired value.
* Reset: resets the initial orientation and its initial base on a desired value.




==== Defining the Apply method ====
==== Defining the Apply method ====
This method receives two parameters:  
This method receives two parameters:
* softengyro: This contains the result of integrating the initial orientation data, it contains a vector of orientation values represented as a Quaternion with their corresponding timestamps.
* softgyro: This parameter contains the result of integrating the initial orientation data. It includes a vector of orientation values represented as Quaternions with their corresponding timestamps.
* rawgyro: This parameter contains the data from sensors, could have data from gyroscope, accelerometer and magnetometer.
* rawgyro: This parameter contains raw sensor data, which may include measurements from the gyroscope, accelerometer, and magnetometer.


<syntaxhighlight lang=c++>
<syntaxhighlight lang=c++>
Line 38: Line 38:


==== Defining the Reset method ====
==== Defining the Reset method ====
This method receives an orientation value as parameter and a time value (in microseconds) as parameter and sets the IIntegrator initial orientation member and the initial time member.
This method receives an orientation value as parameter and a time value (in microseconds) as parameter and resets integration based on them.


<syntaxhighlight lang=c++>
<syntaxhighlight lang=c++>
Line 46: Line 46:


   /* Reset initial orientation and initial time logic */  
   /* Reset initial orientation and initial time logic */  
  this->initial_orient_ = /* logic result */;
  this->initial_time_ = /* logic result */;


   return ret;
   return ret;
102

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.