From 79878a57a90ebe25b68e7c40b377e4e548d7c6cd Mon Sep 17 00:00:00 2001 From: Leonid Beynenson Date: Fri, 11 Jul 2014 15:47:41 +0400 Subject: [PATCH] Fixed bug in cv::detail::waveCorrect The function makes wave correction of a stitched panorama. Earlier it gave wrong results for panorama made from 1 frame. --- modules/stitching/src/motion_estimators.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/stitching/src/motion_estimators.cpp b/modules/stitching/src/motion_estimators.cpp index 98f4ec2e2..2ba691b7d 100644 --- a/modules/stitching/src/motion_estimators.cpp +++ b/modules/stitching/src/motion_estimators.cpp @@ -589,6 +589,11 @@ void waveCorrect(vector &rmats, WaveCorrectKind kind) #if ENABLE_LOG int64 t = getTickCount(); #endif + if (rmats.size() <= 1) + { + LOGLN("Wave correcting, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec"); + return; + } Mat moment = Mat::zeros(3, 3, CV_32F); for (size_t i = 0; i < rmats.size(); ++i)