AdamSpannbauer / python_video_stab

A Python package to stabilize videos using OpenCV
https://adamspannbauer.github.io/python_video_stab/html/index.html
MIT License
696 stars 120 forks source link

The quality of stablization with vidstab is poor as compare to original implementation by nghiaho #74

Closed abhiTronix closed 5 years ago

abhiTronix commented 5 years ago

Hello Adam, While experimenting with vidstab library, I saw vidstab introduces even more Jitteriness to output. Take this test video by NighaHo for example hippo.mp4.

For this test video, If you side-by-side compare vidstab output with the output of NighaHo implementation, you can see the large fluctuations at your output which is not present in the second one.

Code to reproduce

from vidstab.VidStab import VidStab
import cv2
stabilizer = VidStab()
vidcap = cv2.VideoCapture('hippo.mp4')
while True:
    grabbed_frame, frame = vidcap.read()
    # Pass frame to stabilizer even if frame is None
    # stabilized_frame will be an all black frame until iteration 30
    stabilized_frame = stabilizer.stabilize_frame(input_frame=frame,
    smoothing_window=30)
    if stabilized_frame is None:
    # There are no more frames available to stabilize
        break
    cv2.imshow('Compare',stabilized_frame)  

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break 

cv2.destroyAllWindows()
# close output window
vidcap.release()
abhiTronix commented 5 years ago

Closed. I developed and now using my own algorithm build on findings of nghiaho implementation. Goodluck.

AdamSpannbauer commented 5 years ago

Thanks for reporting. I'll look into the issue.