基于特征匹配的简单视频稳定器毕业论文
2021-10-27 22:03:09
摘 要
随着网络技术的不断发展,时代给予了视频更多的机会,在短视频越来越被大众接收的今天,无论是内容制作者还是视频的观赏者都对视频显示的质量有越来越高的要求。视频稳定作为视频处理技术中很关键的一个部分,对视频的质量起到重要的作用。
在第一阶段阐述了两种做特征提取的方案,通过比较各自的适用条件与效果结合自身的目的选择出一种方案,在做平滑滤波和合成的过程中分析各自的算法的优势,最后结合Qt来做图形界面的显示。
针对视频处理的第一阶段,帧的特征点的提取与匹配,提出两套解决方案,第一套方案以ORB算法做特征提取,以光流法来做运动的特征轨迹提取,通过仿射变换将帧与帧之间的数据变化记录到矩阵中,针对图形中特征点的水平、纵向、旋转等偏移得到仿射变换为后续操作做准备。第二套方案是以非线性尺度空间的KAZE算法来做特征提取,非线性尺度相对于线性尺度空间有其独到的优势。通过实验以及本毕业设计只是达到简单的视频稳定器效果,而方案二虽然视频稳定效果在比较复杂的条件下如旋转、压缩重建等可以得到很好的效果,但是其时间复杂度太高,做一次视频稳定消耗的时间太长,实时性很差,并且在一些更复杂的条件下和方案一一样都无法做到相对有效的视频稳定效果,所以综合考虑选择使用方案一来做特征提取与匹配。运动平滑与合成部分采用移动平均滤波和仿射变换矩阵合成。
针对视频显示部分,结合使用Qt图形界面显示系统,作出多线程的视频稳定显示,主要分为原视频显示线程,视频稳定处理线程,Qt的GUI函数构建和显示线程三个部分。原视频显示线程部分主要是对接Qt视频显示流和按键控制等交互操作,目的在于对比视频稳定后的视频,直观的感受视频稳定的效果;视频稳定处理线程部分,也就是将论文的第二章到第四章的视频稳定处理集成到一个线程中,包括视频稳定处理的全过程,得到的输出就是稳定之后的视频;Qt的GUI函数构建和显示线程主要是对接GUI的显示相关的各个函数,以及前两个线程中需要的各种接口。
关键词:视频稳定;OpenCV;特征提取与匹配;运动平滑与运动合成;Qt
Abstract
With the continuous development of network technology, the times have given more opportunities for video. Today, short videos are more and more accepted by the public, both content producers and video viewers have higher and higher quality of video display Requirements. Video stabilization is a critical part of video processing technology and plays an important role in the quality of video.
In the first stage, two schemes for feature extraction are described. A scheme is selected by comparing the applicable conditions and effects with their own purpose. The advantages of the respective algorithms are analyzed in the process of smoothing and synthesis, and finally combined Qt is used to display the graphical interface.
For the first stage of video processing, the extraction and matching of the feature points of the frame, two sets of solutions are proposed. The first set uses the ORB algorithm for feature extraction, and the optical flow method for motion feature trajectory extraction, through affine transformation Record the data changes from frame to frame in the matrix, and obtain the affine transformation for the horizontal, vertical, rotation and other offsets of the feature points in the graphic to prepare for subsequent operations. The second set of schemes is based on the KAZE algorithm of nonlinear scale space for feature extraction. The nonlinear scale has its unique advantages over the linear scale space. Through the experiment and the graduation design, only a simple video stabilizer effect is achieved, and although the second video stabilization effect can be very good under more complicated conditions such as rotation and compression reconstruction, its time complexity is too high. The time taken for a video to stabilize is too long, the real-time performance is very poor, and under some more complicated conditions, it is impossible to achieve a relatively effective video stabilization effect under the same conditions as the first solution, so comprehensively consider using the first solution for feature extraction and match. Motion smoothing and synthesis uses moving average filtering and affine transformation matrix synthesis.
For the video display part, combined with the Qt graphical interface display system, a multi-threaded stable video display is made, which is mainly divided into the original video display thread, the video stabilization processing thread, the Qt GUI function construction and the display thread. The original video display thread part is mainly for interactive operations such as Qt video display stream and key control. The purpose is to compare the stabilized video and intuitively feel the effect of video stabilization; the video stabilization processing thread part is the second chapter of the paper. The video stabilization processing in Chapter 4 is integrated into a thread, including the entire process of video stabilization processing, and the resulting output is the video after stabilization; Qt's GUI function construction and display thread is mainly for docking various functions related to GUI display, And the various interfaces required in the first two threads.
Key Words:Video stabilization;OpenCV;feature extraction and matching;motion smoothing and motion synthesis;Qt
目 录
第1章 绪论 1
1.1 研究背景与意义 1
1.2 国内外研究现状 2
1.3 论文主要内容与结构安排 3
第2章 运动估计 5
2.1 特征点提取 5
2.1.1特征点提取算法理论介绍 5
2.1.2特征点提取算法方案选择 6
2.1.3 ORB特征点提取算法 6
2.1.4 KAZE算法 7
2.2特征点匹配 8
2.2.1特征点匹配算法理论介绍 8
2.2.2 方案二特征点匹配理论介绍 9
2.3 特征点提取与匹配算法方案 10
第3章 运动平滑与运动合成 12
3.1 运动平滑 12
3.1.1 移动平均滤波 12
3.1.2 高斯滤波 13
3.2 运动合成 14
3.2.1 仿射变换 14
3.2.2 运动补偿 15
第4章 结果显示与视频稳定器系统 16
4.1 Qt图像界面显示 16
4.1.1 Qt介绍 16
4.1.2 Qt实现框架 16
4.1.3 结果显示与扩展应用 18
4.2 视频稳定结果 18
4.2.1 视频稳定结果帧对比 18
4.2.2 视频稳定效果评价 20
第5章 总结与展望 22
参考文献 23
致 谢 25
第1章 绪论
1.1 研究背景与意义
如今,人们通过手机等便携式设备每天拍摄大量视频,而在一些场景下,如边走边拍,视频会出现抖动的现象。同样,在一些专业拍摄领域,如航拍监测等,拍摄的视频也会存在晃动的情况,对于这些情况需要通过视频稳定技术,来减少镜头晃动对视频的影响。视频稳定技术是一种可以将不稳定的视频稳定为视觉稳定的技术,该技术有着十分广泛的应用场景,该技术也在不断地发展进步。
本文的研究基于Visual Studio 2019开发环境,结合OpenCV库中称为“点特征匹配”的技术以及跨平台C 图形用户界面应用程序开发框架Qt来实现视频显示封装出简单的视频稳定器,使用特征匹配的方法跟踪两个连续帧之间的一些特征点,估计帧之间的运动并对其进行补偿,以减少摄像机运动对最终视频的影响。