MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / ComputeFramesTrajectory

Method ComputeFramesTrajectory

src/CVStabilization.cpp:187–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187std::vector<CamTrajectory> CVStabilization::ComputeFramesTrajectory(){
188
189 // Accumulated frame to frame transform
190 double a = 0;
191 double x = 0;
192 double y = 0;
193
194 vector <CamTrajectory> trajectory; // trajectory at all frames
195
196 // Compute global camera trajectory. First frame is the origin
197 for(size_t i=0; i < prev_to_cur_transform.size(); i++) {
198 x += prev_to_cur_transform[i].dx;
199 y += prev_to_cur_transform[i].dy;
200 a += prev_to_cur_transform[i].da;
201
202 // Save trajectory data to vector
203 trajectory.push_back(CamTrajectory(x,y,a));
204 }
205 return trajectory;
206}
207
208std::map<size_t,CamTrajectory> CVStabilization::SmoothTrajectory(std::vector <CamTrajectory> &trajectory){
209

Callers

nothing calls this directly

Calls 1

CamTrajectoryClass · 0.85

Tested by

no test coverage detected