[mousetrap] BugFix #584928
- From: Flavio Percoco <flaper src gnome org>
- To: svn-commits-list gnome org
- Subject: [mousetrap] BugFix #584928
- Date: Sat, 18 Jul 2009 14:10:04 +0000 (UTC)
commit 3ab7973762f37a1df9ee931403f2de36c5a4bef0
Author: Flavio Percoco Premoli <flaper87 gmail com>
Date: Sat Jul 18 16:18:34 2009 +0200
BugFix #584928
src/ocvfw/_ocv.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/ocvfw/_ocv.py b/src/ocvfw/_ocv.py
index d836f8b..97288c0 100644
--- a/src/ocvfw/_ocv.py
+++ b/src/ocvfw/_ocv.py
@@ -195,11 +195,17 @@ class OcvfwBase:
"""
# calculate the optical flow
- self.img_lkpoints["current"], status = co.cv.cvCalcOpticalFlowPyrLK (
+ optical_flow = co.cv.cvCalcOpticalFlowPyrLK (
self.prevGrey, self.grey, self.prevPyramid, self.pyramid,
self.img_lkpoints["last"], len( self.img_lkpoints["last"] ),
co.cv.cvSize (20, 20), 3, len( self.img_lkpoints["last"] ), None,
- co.cv.cvTermCriteria (co.cv.CV_TERMCRIT_ITER|co.cv.CV_TERMCRIT_EPS, 20, 0.03), 0)[0]
+ co.cv.cvTermCriteria (co.cv.CV_TERMCRIT_ITER|co.cv.CV_TERMCRIT_EPS, 20, 0.03), 0)
+
+ if isinstance(optical_flow[0], tuple):
+ self.img_lkpoints["current"], status = optical_flow[0]
+ else:
+ self.img_lkpoints["current"], status = optical_flow
+
# initializations
counter = 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]