We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 631fe2b commit 824feb1Copy full SHA for 824feb1
VideoStabilization/video_stabilization.py
@@ -91,7 +91,11 @@ def fixBorder(frame):
91
curr_pts = curr_pts[idx]
92
93
#Find transformation matrix
94
- m = cv2.estimateRigidTransform(prev_pts, curr_pts, fullAffine=False) #will only work with OpenCV-3 or less
+ if float((cv2.__version__)[0:3])<=3.0:
95
+ m = cv2.estimateRigidTransform(prev_pts, curr_pts, fullAffine=False) #will only work with OpenCV-3 or less
96
+
97
+ else:
98
+ m,_ = cv2.estimateAffine2D(prev_pts, curr_pts)# will work with OpenCV>3.0
99
100
# Extract traslation
101
dx = m[0,2]
@@ -165,4 +169,4 @@ def fixBorder(frame):
165
169
cap.release()
166
170
out.release()
167
171
# Close windows
168
-cv2.destroyAllWindows()
172
+cv2.destroyAllWindows()
0 commit comments