Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
30b461a5
Commit
30b461a5
authored
Apr 06, 2012
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support of homography motion model into vidostab sample
parent
d9d47553
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
videostab.cpp
samples/cpp/videostab.cpp
+9
-5
No files found.
samples/cpp/videostab.cpp
View file @
30b461a5
...
@@ -65,7 +65,7 @@ void printHelp()
...
@@ -65,7 +65,7 @@ void printHelp()
cout
<<
"OpenCV video stabilizer.
\n
"
cout
<<
"OpenCV video stabilizer.
\n
"
"Usage: videostab <file_path> [arguments]
\n\n
"
"Usage: videostab <file_path> [arguments]
\n\n
"
"Arguments:
\n
"
"Arguments:
\n
"
" -m, --model=(transl|transl_and_scale|linear_sim|affine)
\n
"
" -m, --model=(transl|transl_and_scale|linear_sim|affine
|homography
)
\n
"
" Set motion model. The default is affine.
\n
"
" Set motion model. The default is affine.
\n
"
" --outlier-ratio=<float_number>
\n
"
" --outlier-ratio=<float_number>
\n
"
" Outliers ratio in motion estimation. The default is 0.5.
\n
"
" Outliers ratio in motion estimation. The default is 0.5.
\n
"
...
@@ -232,8 +232,6 @@ int main(int argc, const char **argv)
...
@@ -232,8 +232,6 @@ int main(int argc, const char **argv)
if
(
arg
(
"fps"
)
==
"auto"
)
outputFps
=
source
->
fps
();
else
outputFps
=
argd
(
"fps"
);
if
(
arg
(
"fps"
)
==
"auto"
)
outputFps
=
source
->
fps
();
else
outputFps
=
argd
(
"fps"
);
stabilizer
->
setFrameSource
(
source
);
stabilizer
->
setFrameSource
(
source
);
if
(
arg
(
"load-motions"
)
==
"no"
)
{
PyrLkRobustMotionEstimator
*
est
=
0
;
PyrLkRobustMotionEstimator
*
est
=
0
;
if
(
arg
(
"model"
)
==
"transl"
)
if
(
arg
(
"model"
)
==
"transl"
)
est
=
new
PyrLkRobustMotionEstimator
(
TRANSLATION
);
est
=
new
PyrLkRobustMotionEstimator
(
TRANSLATION
);
...
@@ -243,6 +241,8 @@ int main(int argc, const char **argv)
...
@@ -243,6 +241,8 @@ int main(int argc, const char **argv)
est
=
new
PyrLkRobustMotionEstimator
(
LINEAR_SIMILARITY
);
est
=
new
PyrLkRobustMotionEstimator
(
LINEAR_SIMILARITY
);
else
if
(
arg
(
"model"
)
==
"affine"
)
else
if
(
arg
(
"model"
)
==
"affine"
)
est
=
new
PyrLkRobustMotionEstimator
(
AFFINE
);
est
=
new
PyrLkRobustMotionEstimator
(
AFFINE
);
else
if
(
arg
(
"model"
)
==
"homography"
)
est
=
new
PyrLkRobustMotionEstimator
(
HOMOGRAPHY
);
else
else
{
{
delete
est
;
delete
est
;
...
@@ -253,9 +253,13 @@ int main(int argc, const char **argv)
...
@@ -253,9 +253,13 @@ int main(int argc, const char **argv)
est
->
setRansacParams
(
ransac
);
est
->
setRansacParams
(
ransac
);
est
->
setMinInlierRatio
(
argf
(
"min-inlier-ratio"
));
est
->
setMinInlierRatio
(
argf
(
"min-inlier-ratio"
));
stabilizer
->
setMotionEstimator
(
est
);
stabilizer
->
setMotionEstimator
(
est
);
}
else
if
(
arg
(
"load-motions"
)
!=
"no"
)
{
MotionModel
model
=
stabilizer
->
motionEstimator
()
->
motionModel
();
stabilizer
->
setMotionEstimator
(
new
FromFileMotionReader
(
arg
(
"load-motions"
)));
stabilizer
->
setMotionEstimator
(
new
FromFileMotionReader
(
arg
(
"load-motions"
)));
stabilizer
->
motionEstimator
()
->
setMotionModel
(
model
);
}
if
(
arg
(
"save-motions"
)
!=
"no"
)
if
(
arg
(
"save-motions"
)
!=
"no"
)
stabilizer
->
setMotionEstimator
(
stabilizer
->
setMotionEstimator
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment