Home / Current Issue / Paper 1724396
Real-Time Video Stabilization Using a Modified Optical Flow Algorithm
Subject area: Science,Engineering and Technology · Area of research: Machine Learning/Computer Vision
Abstract
Camera shake degrades video recorded from vehicles, drones and handheld devices. This paper describes a real-time digital video stabilizer built on a modified optical flow algorithm, written in Python with OpenCV and run on a Raspberry Pi. To test it under controlled conditions we built a vibration rig from an Arduino UNO and an SG90 servo motor. Two cameras were mounted on the rig together. One fed the stabilizer, and the other fed a second Raspberry Pi that only recorded, which gave a shaky reference of the same scene. We recorded twelve pairs of 640 × 480 videos at 50 frames per second, each pair at a different vibration frequency, and compared them using average peak signal-to-noise ratio (PSNR) and video quality metric (VQM). Stabilized video had a higher average PSNR than shaky video at eleven of the twelve frequencies and an equal one at the twelfth. The mean gain was 0.4 dB and the largest was 1.1 dB, at 1.5 Hz. Side-by-side viewing of the paired videos also showed less visible jitter.
Keywords
video stabilization; optical flow; Raspberry Pi; real-time processing; vibration rig; PSNR
References
[1] Xu J, Chang HW, Yang S, Wang M. Fast feature-based video stabilization without accumulative global motion estimation. IEEE Transactions on Consumer Electronics. 2012;58(3):993–999.
[2] Rouhafzay A. Video stabilization using point feature matching. 2015.
[3] Windau J, Itti L. Multilayer real-time video image stabilization. In: 2011 IEEE/RSJ International Conference on Intelligent Robots and Systems. IEEE; 2011. p. 2397–2402.
[4] Karpenko A, Jacobs D, Baek J, Levoy M. Digital video stabilization and rolling shutter correction using gyroscopes. Stanford Computer Science Technical Report CSTR 2011-03. 2011.
[5] e Souza MR, Pedrini H. Visual rhythms for qualitative evaluation of video stabilization. EURASIP Journal on Image and Video Processing. 2020;2020(1):19.
[6] Ljubičić R, Strelnikova D, Perks MT, Eltner A, Peña-Haro S, Pizarro A, et al. A comparison of tools and techniques for stabilising UAS imagery for surface flow observations. Hydrology and Earth System Sciences Discussions. 2021;2021:1–42.
[7] Morimoto C, Chellappa R. Automatic digital image stabilization. In: Proceedings of the IEEE International Conference on Pattern Recognition; Vienna, Austria; 1996.
[8] Kornilova AV, Kirilenko IA, Zabelina NI. Real-time digital video stabilization using MEMS-sensors. Proceedings of the Institute for System Programming of the RAS. 2017;29(4):73–86.
[9] Bayrak S. Video stabilization: digital and mechanical approaches [Master’s thesis]. Ankara, Turkey: Middle East Technical University; 2008.
[10] Matsushita Y, Ofek E, Ge W, Tang X, Shum HY. Full-frame video stabilization with motion inpainting. IEEE Trans Pattern Anal Mach Intell. 2006;28(7):1150–1163.
[11] Liu F, Gleicher M, Jin H, Agarwala A. Content-preserving warps for 3D video stabilization. ACM Trans Graph. 2009;28(3).
[12] Zhang G, Hua W, Qin X, Shao Y, Bao H. Video stabilization based on a 3D perspective camera model. Vis Comput. 2009;25(11):997–1008.
[13] Grundmann M, Kwatra V, Essa I. Auto-directed video stabilization with robust L1 optimal camera paths. In: Proc. IEEE Conf. Comput. Vis. Pattern Recognit. (CVPR); 2011. p. 225–232.
[14] Goldstein A, Fattal R. Video stabilization using epipolar geometry. ACM Trans Graph. 2012;31(5).
[15] Liu S, Yuan L, Tan P, Sun J. Bundled camera paths for video stabilization. ACM Trans Graph. 2013;32(4).
[16] Liu S, Wang Y, Yuan L, Bu J, Tan P, Sun J. Video stabilization with a depth camera. In: 2012 IEEE Conference on Computer Vision and Pattern Recognition. IEEE; 2012. p. 89–95.
[17] Smith BM, Zhang L, Jin H, Agarwala A. Light field video stabilization. In: 2009 IEEE 12th International Conference on Computer Vision. IEEE; 2009. p. 341–348.
[18] Yu J, Ramamoorthi R. Selfie video stabilization. In: Proc. Eur. Conf. Comput. Vis. (ECCV); 2018.
[19] Yu J, Ramamoorthi R. Robust video stabilization by optimization in CNN weight space. In: Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR); 2019. p. 3800–3808.
[20] Yu J, Ramamoorthi R. Learning video stabilization using optical flow. In: Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR); 2020. p. 8159–8167.
[21] Deng Z, Yang D, Zhang X, Dong Y, Liu C, Shen Q. Real-time image stabilization method based on optical flow and binary point feature matching. Electronics. 2020;9(1):198.
[22] Martínez-Rach MO, Piñol P, López OM, Perez Malumbres M, Oliver J, Calafate CT. On the performance of video quality assessment metrics under different compression and packet loss scenarios. The Scientific World Journal. 2014;2014(1):743604.
[23] Vranjes I, Baillien E, Vandebosch H, Erreygers S, De Witte H. When workplace bullying goes online: Construction and validation of the Inventory of Cyberbullying Acts at Work (ICA-W). European Journal of Work and Organizational Psychology. 2018;27(1):28–39.
How to cite this paper
@article{1724396,
author = {A. S. Rassan, E. E. Omizegba, E. C. Anene, Bathlome Paul},
title = {Real-Time Video Stabilization Using a Modified Optical Flow Algorithm},
journal = {Iconic Research And Engineering Journals},
year = {2026},
volume = {10},
number = {4},
pages = {3921-3930},
issn = {2456-8880},
url = {https://www.irejournals.com/formatedpaper/1724396.pdf},
abstract = {Camera shake degrades video recorded from vehicles, drones and handheld devices. This paper describes a real-time digital video stabilizer built on a modified optical flow algorithm, written in Python with OpenCV and run on a Raspberry Pi. To test it under controlled conditions we built a vibration rig from an Arduino UNO and an SG90 servo motor. Two cameras were mounted on the rig together. One fed the stabilizer, and the other fed a second Raspberry Pi that only recorded, which gave a shaky reference of the same scene. We recorded twelve pairs of 640 × 480 videos at 50 frames per second, each pair at a different vibration frequency, and compared them using average peak signal-to-noise ratio (PSNR) and video quality metric (VQM). Stabilized video had a higher average PSNR than shaky video at eleven of the twelve frequencies and an equal one at the twelfth. The mean gain was 0.4 dB and the largest was 1.1 dB, at 1.5 Hz. Side-by-side viewing of the paired videos also showed less visible jitter.},
keywords = {video stabilization; optical flow; Raspberry Pi; real-time processing; vibration rig; PSNR},
month = {October},
}