Minor changes in videostab module and sample
This commit is contained in:
parent
f42eea1029
commit
f355f798a4
@ -120,7 +120,7 @@ void MoreAccurateMotionWobbleSuppressor::suppress(int idx, const Mat &frame, Mat
|
|||||||
if (result.data == frame.data)
|
if (result.data == frame.data)
|
||||||
result = Mat(frame.size(), frame.type());
|
result = Mat(frame.size(), frame.type());
|
||||||
|
|
||||||
remap(frame, result, mapx_, mapy_, INTER_LANCZOS4, BORDER_REPLICATE);
|
remap(frame, result, mapx_, mapy_, INTER_LINEAR, BORDER_REPLICATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace videostab
|
} // namespace videostab
|
||||||
|
@ -153,7 +153,7 @@ void printHelp()
|
|||||||
" Save motions estimated for wobble suppression. The default is no.\n"
|
" Save motions estimated for wobble suppression. The default is no.\n"
|
||||||
" -lm2, --load-motions2=(<file_path>|no)\n"
|
" -lm2, --load-motions2=(<file_path>|no)\n"
|
||||||
" Load motions for wobble suppression from file. The default is no.\n\n"
|
" Load motions for wobble suppression from file. The default is no.\n\n"
|
||||||
" --gpu=(yes|no)\n"
|
" -gpu=(yes|no)\n"
|
||||||
" Use GPU optimization whenever possible. The default is no.\n\n"
|
" Use GPU optimization whenever possible. The default is no.\n\n"
|
||||||
" -o, --output=(no|<file_path>)\n"
|
" -o, --output=(no|<file_path>)\n"
|
||||||
" Set output file path explicitely. The default is stabilized.avi.\n"
|
" Set output file path explicitely. The default is stabilized.avi.\n"
|
||||||
@ -184,7 +184,7 @@ int main(int argc, const char **argv)
|
|||||||
"{ lm | load-motions | no | }"
|
"{ lm | load-motions | no | }"
|
||||||
"{ r | radius | 15 | }"
|
"{ r | radius | 15 | }"
|
||||||
"{ | stdev | auto | }"
|
"{ | stdev | auto | }"
|
||||||
"{ lp | lp-stab | no | }"
|
"{ lps | lin-prog-stab | no | }"
|
||||||
"{ | lp-trim-ratio | auto | }"
|
"{ | lp-trim-ratio | auto | }"
|
||||||
"{ | lp-w1 | 1 | }"
|
"{ | lp-w1 | 1 | }"
|
||||||
"{ | lp-w2 | 10 | }"
|
"{ | lp-w2 | 10 | }"
|
||||||
@ -213,7 +213,7 @@ int main(int argc, const char **argv)
|
|||||||
"{ | ws-extra-kps | 0 | }"
|
"{ | ws-extra-kps | 0 | }"
|
||||||
"{ sm2 | save-motions2 | no | }"
|
"{ sm2 | save-motions2 | no | }"
|
||||||
"{ lm2 | load-motions2 | no | }"
|
"{ lm2 | load-motions2 | no | }"
|
||||||
"{ | gpu | no }"
|
"{ gpu | | no }"
|
||||||
"{ o | output | stabilized.avi | }"
|
"{ o | output | stabilized.avi | }"
|
||||||
"{ | fps | auto | }"
|
"{ | fps | auto | }"
|
||||||
"{ q | quiet | false | }"
|
"{ q | quiet | false | }"
|
||||||
@ -249,14 +249,14 @@ int main(int argc, const char **argv)
|
|||||||
StabilizerBase *stabilizer;
|
StabilizerBase *stabilizer;
|
||||||
|
|
||||||
bool isTwoPass =
|
bool isTwoPass =
|
||||||
arg("est-trim") == "yes" || arg("wobble-suppress") == "yes" || arg("lp-stab") == "yes";
|
arg("est-trim") == "yes" || arg("wobble-suppress") == "yes" || arg("lin-prog-stab") == "yes";
|
||||||
|
|
||||||
if (isTwoPass)
|
if (isTwoPass)
|
||||||
{
|
{
|
||||||
TwoPassStabilizer *twoPassStabilizer = new TwoPassStabilizer();
|
TwoPassStabilizer *twoPassStabilizer = new TwoPassStabilizer();
|
||||||
stabilizer = twoPassStabilizer;
|
stabilizer = twoPassStabilizer;
|
||||||
twoPassStabilizer->setEstimateTrimRatio(arg("est-trim") == "yes");
|
twoPassStabilizer->setEstimateTrimRatio(arg("est-trim") == "yes");
|
||||||
if (arg("lp-stab") == "yes")
|
if (arg("lin-prog-stab") == "yes")
|
||||||
{
|
{
|
||||||
LpMotionStabilizer *stab = new LpMotionStabilizer();
|
LpMotionStabilizer *stab = new LpMotionStabilizer();
|
||||||
stab->setFrameSize(Size(source->width(), source->height()));
|
stab->setFrameSize(Size(source->width(), source->height()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user