Added GPU version of wobble suppressor (videostab)

This commit is contained in:
Alexey Spizhevoy
2012-04-23 10:37:07 +00:00
parent 3675ef516a
commit 24be840c44
6 changed files with 151 additions and 20 deletions

View File

@@ -273,12 +273,11 @@ int main(int argc, const char **argv)
twoPassStabilizer->setMotionStabilizer(new GaussianMotionFilter(argi("radius"), argf("stdev")));
if (arg("wobble-suppress") == "yes")
{
MoreAccurateMotionWobbleSuppressor *ws = new MoreAccurateMotionWobbleSuppressor();
twoPassStabilizer->setWobbleSuppressor(ws);
ws->setPeriod(argi("ws-period"));
MoreAccurateMotionWobbleSuppressorBase *ws;
if (arg("gpu") == "no")
{
ws = new MoreAccurateMotionWobbleSuppressor();
PyrLkRobustMotionEstimator *est = 0;
if (arg("ws-model") == "transl")
@@ -312,6 +311,7 @@ int main(int argc, const char **argv)
else if (arg("gpu") == "yes")
{
#if HAVE_OPENCV_GPU
ws = new MoreAccurateMotionWobbleSuppressorGpu();
PyrLkRobustMotionEstimatorGpu *est = 0;
if (arg("ws-model") == "transl")
@@ -345,7 +345,10 @@ int main(int argc, const char **argv)
else
{
throw runtime_error("bad gpu optimization argument value: " + arg("gpu"));
}
}
twoPassStabilizer->setWobbleSuppressor(ws);
ws->setPeriod(argi("ws-period"));
MotionModel model = ws->motionEstimator()->motionModel();
if (arg("load-motions2") != "no")