krutikabapat / Video-Stabilization-using-OpenCV

Video Stabilization Using Point Feature Matching in OpenCV
34 stars 12 forks source link

Not working with OpenCV 4 #2

Open A-Specker opened 5 years ago

A-Specker commented 5 years ago

https://github.com/krutikabapat/Video-Stabilization-using-OpenCV/blob/36581dcb243c6364559235b2eed385c812eeb152/video_stabilization.py#L92

The function estimateRigidTransform is deprecated in version 4 and the could won't work. Would be cool if you fix it.

ofir1080 commented 4 years ago

replace with m = cv2.estimateAffinePartial2D(prev_pts, curr_pts)[0]

RobinRajSB commented 4 years ago

File "Stabilize.py", line 93 m = cv2.estimateAffinePartial2D(prev_pts, curr_pts)[0] ^ IndentationError: unindent does not match any outer indentation level

RobinRajSB commented 4 years ago

File "Stabilize.py", line 93 m = cv2.estimateAffinePartial2D(prev_pts, curr_pts)[0] ^ IndentationError: unindent does not match any outer indentation level

IntendationError, Worked now, thank you

RobinRajSB commented 4 years ago

435 height 1280 height 720 1196444237 Traceback (most recent call last): File "Stabilize.py", line 147, in frame_out = cv2.resize(frame_out, (frame_out.shape[1]/2, frame_out.shape[0]/2)); TypeError: integer argument expected, got float

naldoxable commented 4 years ago

fix with frame_out = cv2.resize(frame_out, (int(frame_out.shape[1]/2), int(frame_out.shape[0]/2)));

jbjbjb1 commented 3 years ago

I tried the above and got this error:

Exception has occurred: error
OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-6lylwdcz\opencv\modules\calib3d\src\ptsetreg.cpp:174: error: (-215:Assertion failed) count >= 0 && count2 == count in function 'cv::RANSACPointSetRegistrator::run'
  File "C:\...\video_stabilization.py", line 96, in <module>
    m = cv2.estimateAffinePartial2D(prev_pts, curr_pts)[0]
fatbringer commented 8 months ago

Wonder how does this work on a live stream? because there is no an entire video worth of frames to compare