OpenShot Library | libopenshot  0.3.3
Public Member Functions | Public Attributes | List of all members
CVStabilization Class Reference

This class stabilizes a video frame using optical flow. More...

#include <CVStabilization.h>

Public Member Functions

bool _LoadStabilizedData ()
 
void AddFrameDataToProto (pb_stabilize::Frame *pbFrameData, CamTrajectory &trajData, TransformParam &transData, size_t frame_number)
 Add frame stabilization data into protobuf message. More...
 
 CVStabilization (std::string processInfoJson, ProcessingController &processingController)
 Set default smoothing window value to compute stabilization. More...
 
CamTrajectory GetCamTrajectoryTrackedData (size_t frameId)
 
TransformParam GetTransformParamData (size_t frameId)
 
bool SaveStabilizedData ()
 
void SetJson (const std::string value)
 Load JSON string into this object. More...
 
void SetJsonValue (const Json::Value root)
 Load Json::Value into this object. More...
 
void stabilizeClip (openshot::Clip &video, size_t _start=0, size_t _end=0, bool process_interval=false)
 Process clip and store necessary stabilization data. More...
 

Public Attributes

std::map< size_t, CamTrajectorytrajectoryData
 
std::map< size_t, TransformParamtransformationData
 

Detailed Description

This class stabilizes a video frame using optical flow.

The relative motion between two consecutive frames is computed to obtain the global camera trajectory. The camera trajectory is then smoothed to reduce jittering.

Definition at line 75 of file CVStabilization.h.

Constructor & Destructor Documentation

◆ CVStabilization()

CVStabilization::CVStabilization ( std::string  processInfoJson,
ProcessingController processingController 
)

Set default smoothing window value to compute stabilization.

Definition at line 29 of file CVStabilization.cpp.

Member Function Documentation

◆ _LoadStabilizedData()

bool CVStabilization::_LoadStabilizedData ( )

Definition at line 374 of file CVStabilization.cpp.

◆ AddFrameDataToProto()

void CVStabilization::AddFrameDataToProto ( pb_stabilize::Frame *  pbFrameData,
CamTrajectory trajData,
TransformParam transData,
size_t  frame_number 
)

Add frame stabilization data into protobuf message.

Definition at line 298 of file CVStabilization.cpp.

Referenced by SaveStabilizedData().

◆ GetCamTrajectoryTrackedData()

CamTrajectory CVStabilization::GetCamTrajectoryTrackedData ( size_t  frameId)

Definition at line 326 of file CVStabilization.cpp.

◆ GetTransformParamData()

TransformParam CVStabilization::GetTransformParamData ( size_t  frameId)

Definition at line 314 of file CVStabilization.cpp.

◆ SaveStabilizedData()

bool CVStabilization::SaveStabilizedData ( )

Protobuf Save and Load methods Save stabilization data to protobuf file

Definition at line 268 of file CVStabilization.cpp.

◆ SetJson()

void CVStabilization::SetJson ( const std::string  value)

Load JSON string into this object.

Definition at line 339 of file CVStabilization.cpp.

Referenced by CVStabilization().

◆ SetJsonValue()

void CVStabilization::SetJsonValue ( const Json::Value  root)

Load Json::Value into this object.

Definition at line 356 of file CVStabilization.cpp.

Referenced by SetJson().

◆ stabilizeClip()

void CVStabilization::stabilizeClip ( openshot::Clip video,
size_t  _start = 0,
size_t  _end = 0,
bool  process_interval = false 
)

Process clip and store necessary stabilization data.

Definition at line 37 of file CVStabilization.cpp.

Member Data Documentation

◆ trajectoryData

std::map<size_t,CamTrajectory> CVStabilization::trajectoryData

◆ transformationData

std::map<size_t,TransformParam> CVStabilization::transformationData

The documentation for this class was generated from the following files: