Jump to content

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

Line 20: Line 20:
* The Reset method that updates the stabilization algorithm parameters.
* The Reset method that updates the stabilization algorithm parameters.


Additionally, the algorithm can be included into the static builder method of the interface.
Additionally, the algorithm can be included in the static builder method of the interface.


=== Add the Constructor Method ===
=== Add the Constructor Method ===


This method should take a shared pointer to the corresponding stabilization parameters instance and returns the instance. Since this parameter is also derived, it is necessary to dynamically cast it to validate the type.
This method should take a shared pointer to the corresponding stabilization parameters instance and return it. Since this parameter is also derived, casting it to validate the type dynamically is necessary.


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


=== Define the Apply Method ===
=== Define the Apply Method ===
This method needs to receive a input vector of quaterion-timestamp value pairs as the first parameter. The quaternions must be in double format and the timestamps need to be 64 bit unsigned integer in microsecond units. The second parameter corresponds to the framerate of the video stream to correct and its generally required by stabilization algorithms.  
This method must receive an input vector of quaternion-timestamp value pairs as the first parameter. The quaternions must be in double format, and the timestamps need to be 64-bit unsigned integers in microsecond units. The second parameter corresponds to the framerate of the video stream to correct, and it is generally required by stabilization algorithms.  
 
{{Review|Add more details about the vector: 0: previous, 1: current, 2: future. Try to be as complete as possible. Remember that this is for other people to create their own algorithms and it must be as complete as possible|LLEON}}


Moreover, the element with index 1 of the resulting quaternion vector must correspond to the current frame orientation; this is because the overloaded declaration of the Apply method which returns just the desired quaternion instead of the complete vector.
Moreover, the element with index 1 of the resulting quaternion vector must correspond to the current frame orientation; this is because the overloaded declaration of the Apply method which returns just the desired quaternion instead of the complete vector.
1,654

edits

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