+

CN106657713A - Video motion amplification method - Google Patents

Video motion amplification method Download PDF

Info

Publication number
CN106657713A
CN106657713A CN201611264001.2A CN201611264001A CN106657713A CN 106657713 A CN106657713 A CN 106657713A CN 201611264001 A CN201611264001 A CN 201611264001A CN 106657713 A CN106657713 A CN 106657713A
Authority
CN
China
Prior art keywords
matrix
row
column
frequency band
spatial frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611264001.2A
Other languages
Chinese (zh)
Other versions
CN106657713B (en
Inventor
轩建平
李锐
刘超峰
翟康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201611264001.2A priority Critical patent/CN106657713B/en
Publication of CN106657713A publication Critical patent/CN106657713A/en
Application granted granted Critical
Publication of CN106657713B publication Critical patent/CN106657713B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region
    • H04N5/148Video amplifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/2628Alteration of picture size, shape, position or orientation, e.g. zooming, rotation, rolling, perspective, translation

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

一种视频运动放大方法,属于图像处理方法,解决现有基于线性欧拉视频运动放大方法存在的增加放大因子会显著增大噪声的问题和基于复数可操作金字塔的视频运动放大方法运动失真等问题。本发明包括视频图像分解、视频帧色彩空间转换、N层金字塔分解、时域带通滤波、第二空间频率带组放大、得到第四空间频率带组、重构亮度矩阵、视频帧色彩空间还原、输出视频图像步骤;本发明解决了现有基于线性欧拉视频运动放大方法存在的增加放大因子会显著增大噪声的问题和现有基于复数可操作金字塔的视频运动放大方法运动失真等问题,适用于将微小的时空运动放大。

A video motion amplification method, which belongs to the image processing method, solves the problem that the existing linear Euler video motion amplification method will significantly increase the noise when the amplification factor is increased, and the motion distortion of the video motion amplification method based on complex operable pyramids. . The present invention includes video image decomposition, video frame color space conversion, N-layer pyramid decomposition, time domain bandpass filtering, second spatial frequency band group amplification, obtaining fourth spatial frequency band group, reconstructing brightness matrix, video frame color space restoration , output video image step; the present invention solves the problem that the existing linear Euler video motion amplification method based on increasing the amplification factor can significantly increase the noise and the existing video motion amplification method based on complex operable pyramids. Problems such as motion distortion, It is suitable for amplifying tiny space-time movements.

Description

一种视频运动放大方法A video motion amplification method

技术领域technical field

本发明属于图像处理方法,具体涉及一种视频运动放大方法,用于将微小的时空运动放大。The invention belongs to an image processing method, and in particular relates to a video motion amplification method, which is used for amplifying tiny spatiotemporal motion.

背景技术Background technique

人眼具有有限的时空敏感性,很多真实的运动或者颜色变化不能被人眼所捕获,比如血液流经皮肤,皮肤颜色会发生轻微的变化,又比如由于心脏的周期性跳动引起的脉搏,然而人眼睛很难观察到皮肤颜色的变化和脉搏的跳动。采用视频运动放大方法,可以将这些不能引起视觉反应的运动放大,以便我们更好的观察各种现象。The human eye has limited temporal and spatial sensitivity, and many real movements or color changes cannot be captured by the human eye, such as blood flowing through the skin, the skin color will change slightly, and the pulse caused by the periodic beating of the heart, however It is difficult for human eyes to observe the change of skin color and the beating of pulse. Using the method of video motion magnification, these motions that cannot cause visual responses can be amplified so that we can better observe various phenomena.

Mallat和Meyer于二十世纪八十年代末提出了小波多分辨率分析(Multiresolution Analysis,MRA),小波多分辨率分析是基于小波函数和尺度函数的缩放和平移,在Hilbert空间L2(R)的某个子空间建立基底,然后经过缩放和平移变换,将子空间的基底扩充到L2(R)中去。在小波多分辨率信号分解中,尺度函数φj,k和小波函数ψj,k共同构成了小波分解,其中j为缩放因子,k为平移因子,由尺度函数表征信号的低频部分,小波函数表征信号的细节部分。对比文件1和2,1989年7月发表,美国,S.G.Mallat,A theoryfor multiresolution signal decomposition:the wavelet representation,IEEE TPATTERN ANAL,11(1989)674-693;1989年9月发表,美国,S.G.Mallat,MultiresolutionApproximations and Wavelet Orthonormal Bases of L2(R),T AM MATH SOC,315(1989)69-87。通过小波缩放能进行不同尺度的小波分解和重构,不同尺度的小波分解和重构构成了小波金字塔分解和重构。Mallat and Meyer proposed wavelet multiresolution analysis (Multiresolution Analysis, MRA) in the late 1980s. Wavelet multiresolution analysis is based on the scaling and translation of wavelet function and scale function, in the Hilbert space L 2 (R) A certain subspace of a base is established, and then the base of the subspace is expanded to L 2 (R) through scaling and translation transformation. In the wavelet multi-resolution signal decomposition, the scaling function φ j,k and the wavelet function ψ j,k together constitute the wavelet decomposition, where j is the scaling factor, k is the translation factor, the low frequency part of the signal is characterized by the scaling function, and the wavelet function Characterize the details of the signal. Comparative documents 1 and 2, published in July 1989, the United States, SGMallat, A theory for multiresolution signal decomposition: the wavelet representation, IEEE TPATTERN ANAL, 11 (1989) 674-693; published in September 1989, the United States, SGMallat, Multiresolution Approximations and Wavelet Orthonormal Bases of L 2 (R), T AM MATH SOC, 315 (1989) 69-87. Wavelet decomposition and reconstruction of different scales can be performed through wavelet scaling, and wavelet decomposition and reconstruction of different scales constitute wavelet pyramid decomposition and reconstruction.

现有的视频运动放大方法主要分为两种,第一种是线性欧拉视频运动放大方法,如对比文件3,2012年8月5日发表,美国,H.Wu,M.Rubinstein, E.Shih,J.Guttag,Fr,D.Durand,W.Freeman,Eulerian video magnification for revealing subtle changesin the world,ACM Trans.Graph.,31(2012)1-8。其采用拉普拉斯金字塔算法进行时空分解和重构,该方法存在两个缺陷,第一个缺陷是在视频的空间尺寸较小的时候,其只支持较小的放大因子,也就是说放大倍数有限,第二个缺陷是增加放大因子会显著增大噪声。第二种视频运动放大方法是基于复数可操作金字塔的视频运动放大方法,如对比文件4,2013年发表,美国,N.Wadhwa,M.Rubinstein,Fr,D.Durand,W.T.Freeman,Phase-based videomotion processing,ACM Trans.Graph.,32(2013)1-10;该方法虽然解决了线性欧拉视频运动放大方法的两个缺陷,但是其引入了新的缺陷,第一个缺陷就是放大的运动发生失真,出现紊乱;第二个缺陷是对视频采集系统的振动较为敏感,也就是说相机的微小振动会在结果文件中体现出来。Existing video motion amplification methods are mainly divided into two types. The first is the linear Euler video motion amplification method, such as comparative document 3, published on August 5, 2012, the United States, H.Wu, M.Rubinstein, E. Shih, J. Guttag, Fr, D. Durand, W. Freeman, Eulerian video magnification for revealing subtle changes in the world, ACM Trans. Graph., 31(2012) 1-8. It uses the Laplacian pyramid algorithm for space-time decomposition and reconstruction. There are two defects in this method. The first defect is that when the spatial size of the video is small, it only supports a small magnification factor, that is, magnification The magnification is limited, and the second drawback is that increasing the amplification factor will significantly increase the noise. The second video motion magnification method is a video motion magnification method based on complex operable pyramids, such as Comparative Document 4, published in 2013, the United States, N.Wadhwa, M.Rubinstein, Fr, D.Durand, W.T.Freeman, Phase-based videomotion processing, ACM Trans.Graph., 32(2013) 1-10; although this method solves the two defects of the linear Euler video motion amplification method, it introduces a new defect, the first defect is the enlarged motion Distortion occurs, disorder occurs; the second defect is that it is relatively sensitive to vibrations of the video capture system, which means that small vibrations of the camera will be reflected in the resulting file.

针对欧拉视频运动放大存在对噪声比较敏感和基于相位的可操作金字塔算法运动放大在处理波传播过程中的紊乱,申请人致力于寻求一种能够解决上述问题的方法。由于小波在噪声处理方面存在优势,申请人将小波分解运用到视频运动放大中。Coiflet小波滤波器具有线性相位这一特性,在信号重构的时候可以极大的减少由于相位引起的信号失真,因而本方法采用的小波为Coiflet小波,由此申请人在前人工作的基础之上,提出了一种新的运动放大方法,称之为基于Coiflet小波的视频运动放大方法。该方法首先利用小波的多尺度分析的优点,采用小波金字塔算法对视频帧进行空间分解,将视频帧分解为不同尺度的空间频率带,然后为了提取特定的运动,采用一个与运动频率相适应的带通滤波器对空间频率带进行时域滤波,接着将滤波后的空间频带,由一个给定因子α放大,再加回到原始信号上,最后采用小波金字塔算法对视频重构,即可将微小不可见的波动放大为明显的波动。Aiming at the fact that Eulerian video motion amplification is sensitive to noise and that phase-based operable pyramid algorithm motion amplification is disordered in the process of dealing with wave propagation, the applicant is committed to seeking a method that can solve the above problems. Because wavelet has advantages in noise processing, the applicant applies wavelet decomposition to video motion amplification. The Coiflet wavelet filter has the characteristic of linear phase, which can greatly reduce the signal distortion caused by the phase when the signal is reconstructed. Therefore, the wavelet used in this method is the Coiflet wavelet. Therefore, based on the previous work, the applicant In this paper, a new motion amplification method is proposed, which is called video motion amplification method based on Coiflet wavelet. This method first utilizes the advantages of multi-scale analysis of wavelet, uses the wavelet pyramid algorithm to spatially decompose the video frame, and decomposes the video frame into spatial frequency bands of different scales, then in order to extract specific motion, adopts a motion frequency adaptive The band-pass filter performs time-domain filtering on the spatial frequency band, and then amplifies the filtered spatial frequency band by a given factor α, and then returns it to the original signal, and finally uses the wavelet pyramid algorithm to reconstruct the video, that is, Small invisible fluctuations magnify into visible fluctuations.

为方便理解本发明,现对有关概念加以解释:For convenience of understanding the present invention, relevant concept is explained now:

RGB色彩空间:一般视频帧的色彩空间都属于RGB色彩空间,RGB色彩空 间是通过对红(Red),绿(Green)和蓝(Blue)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色,通常情况下,RGB色彩空间采用三个无符号整数(常用uint8,8位无符号整数)表示一种颜色,RGB各有256级亮度,用数字表示为从0、1、2...直到255,其亮度依次增加,通过各种不同的组合可以构成高达2563种颜色,因而RGB色彩空间几乎包括了人类视力所能感知的所有颜色,是目前运用最广的颜色系统之一。RGB color space: the color space of a general video frame belongs to the RGB color space, and the RGB color space is obtained by changing the three color channels of red (Red), green (Green) and blue (Blue) Get a wide variety of colors. Usually, the RGB color space uses three unsigned integers (commonly used uint8, 8-bit unsigned integers) to represent a color. RGB each has 256 levels of brightness, expressed digitally from 0, 1, 2... until 255, the brightness increases sequentially, and up to 256 3 colors can be formed through various combinations, so the RGB color space includes almost all colors that human vision can perceive, and is currently the most widely used One of the color systems.

YIQ色彩空间:YIQ色彩空间通常被北美的电视系统所采用,属于NTSC(NationalTelevision Standards Committee)系统。在YIQ色彩空间中,Y分量代表图像的亮度信息,I、Q两个分量则携带颜色信息,I分量代表从橙色到青色的颜色变化,而Q分量则代表从紫色到黄绿色的颜色变化。较其他颜色空间,YIQ颜色空间具有能将图像中的亮度分量分离提取出来的优点,而亮度分量可用于在自然条件下采集到的复杂背景下的运动目标的识别,因此有必要将视频由RGB色彩空间转换到YIQ色彩空间;YIQ color space: YIQ color space is usually adopted by the North American TV system and belongs to the NTSC (National Television Standards Committee) system. In the YIQ color space, the Y component represents the brightness information of the image, and the I and Q components carry color information. The I component represents the color change from orange to cyan, while the Q component represents the color change from purple to yellow-green. Compared with other color spaces, the YIQ color space has the advantage of being able to separate and extract the luminance components in the image, and the luminance components can be used to identify moving targets under complex backgrounds collected under natural conditions, so it is necessary to convert the video by RGB Color space conversion to YIQ color space;

常见的小波函数有Haar,Daubechies,Coiflets,Symlets等;以Coiflets小波函数为例,该小波函数的缩写名为coif,根据支撑的长度不同,又分为coif1,coif2,coif3,coif4和coif5;所谓支撑长度,是指小波高通滤波器或低通滤波器是一个时间有限信号序列,在支撑长度区间内信号值非零,支撑区间外信号值为零,非零区间的长度为其支撑长度;Common wavelet functions include Haar, Daubechies, Coiflets, Symlets, etc.; taking the Coiflets wavelet function as an example, the abbreviation of the wavelet function is coif, which is divided into coif1, coif2, coif3, coif4 and coif5 according to the length of the support; the so-called The support length means that the wavelet high-pass filter or low-pass filter is a time-limited signal sequence, the signal value is non-zero in the support length interval, the signal value is zero outside the support interval, and the length of the non-zero interval is its support length;

小波高通滤波器系数和小波低通滤波器系数:小波高通滤波器系数是一个向量,小波低通滤波器系数是另外一个向量,通过查阅相关文献可以得到对应于不同小波函数的小波高通滤波器系数和小波低通滤波器系数;如范延斌等,《小波理论算法与滤波器组》,160-192页,科学出版社,北京,2011年6月第一版。Wavelet high-pass filter coefficients and wavelet low-pass filter coefficients: wavelet high-pass filter coefficients are one vector, wavelet low-pass filter coefficients are another vector, and wavelet high-pass filter coefficients corresponding to different wavelet functions can be obtained by consulting relevant literature and wavelet low-pass filter coefficients; such as Fan Yanbin et al., "Wavelet Theoretical Algorithms and Filter Banks", pp. 160-192, Science Press, Beijing, first edition in June 2011.

当采用小波分解算法或小波重构算法时,对行、列进行低通滤波或高通滤 波,实质是将该行或列的元素与小波低通滤波器系数或小波高通滤波器系数求卷积,当小波低通滤波器系数或小波高通滤波器系数的长度小于该行或列的元素个数时,则需对短缺的位数补0。When wavelet decomposition algorithm or wavelet reconstruction algorithm is used, performing low-pass filtering or high-pass filtering on rows and columns is essentially to convolve the elements of the row or column with wavelet low-pass filter coefficients or wavelet high-pass filter coefficients, When the length of wavelet low-pass filter coefficients or wavelet high-pass filter coefficients is less than the number of elements in the row or column, you need to fill the missing digits with 0.

计算机文件:任何一个计算机文件,都包含两个部分,第一部分为头文件部分,第二部分为数据部分。视频图像的头文件部分一般包括视频帧的宽度、高度、存储空间、格式类型、帧数率、数据压缩方式和说明部分等关键内容,视频图像的数据部分保存的是与头文件相关联的数据。计算机读取视频图像时,首先读取头文件以获取各种关键信息,尤其是数据文件的组成形式,比如视频帧的宽度、高度、帧数率等信息。在进行视频帧处理的时候,就是对数据的处理,如色彩空间变换、小波金字塔分解、小波金字塔重构和时域滤波。Computer file: Any computer file contains two parts, the first part is the header file part, and the second part is the data part. The header file part of the video image generally includes key content such as the width, height, storage space, format type, frame rate, data compression method and description of the video frame, and the data part of the video image stores the data associated with the header file . When a computer reads a video image, it first reads the header file to obtain various key information, especially the composition form of the data file, such as the width, height, frame rate and other information of the video frame. When processing video frames, it is the processing of data, such as color space transformation, wavelet pyramid decomposition, wavelet pyramid reconstruction and time domain filtering.

发明内容Contents of the invention

本发明提供一种视频运动放大方法,属于线性欧拉视频运动放大方法,解决现有基于线性欧拉视频运动放大方法存在的增加放大因子会显著增大噪声的问题和基于复数可操作金字塔的视频运动放大方法运动失真等问题。The invention provides a video motion amplification method, which belongs to the linear Euler video motion amplification method, which solves the problem that the increase of the amplification factor will significantly increase the noise existing in the existing linear Euler video motion amplification method and the video based on the complex operable pyramid. Problems such as motion distortion in the motion amplification method.

本发明所提供的一种视频运动放大方法,包括视频图像分解步骤、视频帧色彩空间转换步骤、N层金字塔分解步骤、时域带通滤波步骤、第二空间频率带组放大步骤、得到第四空间频率带组步骤、重构亮度矩阵步骤、视频帧色彩空间还原步骤、输出视频图像步骤,其特征在于:A video motion amplification method provided by the present invention includes a video image decomposition step, a video frame color space conversion step, an N-layer pyramid decomposition step, a time domain bandpass filtering step, a second spatial frequency band group amplification step, and a fourth Spatial frequency band group step, reconstruction brightness matrix step, video frame color space restoration step, output video image step, it is characterized in that:

(1)视频图像分解步骤:(1) Video image decomposition steps:

录制运动主体在空间微小运动的RGB色彩空间视频图像,再根据时间先后将RGB色彩空间视频图像分解为一帧一帧的RGB色彩空间视频帧,读取所有的RGB色彩空间视频帧;Record the RGB color space video image of the moving subject moving slightly in space, and then decompose the RGB color space video image into RGB color space video frames frame by frame according to time, and read all the RGB color space video frames;

(2)视频帧色彩空间转换步骤:(2) video frame color space conversion steps:

将每一RGB色彩空间视频帧用R矩阵、G矩阵、B矩阵三个二维矩阵表示, R矩阵表示像素点红颜色强度,表示像素点绿色强度,B矩阵表示像素点蓝色强度;Each RGB color space video frame is represented by three two-dimensional matrices of R matrix, G matrix, and B matrix. The R matrix represents the red color intensity of the pixel point, represents the green intensity of the pixel point, and the B matrix represents the blue intensity of the pixel point;

通过下式对R矩阵、G矩阵和B矩阵进行矩阵运算,得到YIQ色彩空间视频帧的Y矩阵、I矩阵和Q矩阵三个二维矩阵:Perform matrix operations on the R matrix, G matrix, and B matrix by the following formula to obtain three two-dimensional matrices of the Y matrix, I matrix, and Q matrix of the YIQ color space video frame:

Y=0.299R+0.587G+0.114B,Y=0.299R+0.587G+0.114B,

I=0.596R-0.275G-0.321B,I=0.596R-0.275G-0.321B,

Q=0.212R-0.523G+0.311B;Q=0.212R-0.523G+0.311B;

其中,Y矩阵表示YIQ色彩空间视频帧各像素的亮度值,I矩阵表示YIQ色彩空间视频帧各像素从橙色到青色的颜色强度,Q矩阵表示表示YIQ色彩空间视频帧各像素从紫色到黄绿色的颜色强度;Among them, the Y matrix represents the brightness value of each pixel in the YIQ color space video frame, the I matrix represents the color intensity of each pixel in the YIQ color space video frame from orange to cyan, and the Q matrix represents the color intensity of each pixel in the YIQ color space video frame from purple to yellow-green the color intensity;

(3)N层金字塔分解步骤:(3) N layer pyramid decomposition steps:

对各YIQ色彩空间视频帧中的Y矩阵,采用小波分解算法将其分解为四个矩阵:第1近似系数矩阵cA1、第1水平细节矩阵cH1、第1垂直细节矩阵cV1和第1对角细节矩阵cD1;此过程为第一层金字塔分解,cH1、cV1和cD1构成金字塔第一层;For the Y matrix in each YIQ color space video frame, use the wavelet decomposition algorithm to decompose it into four matrices: the first approximate coefficient matrix cA 1 , the first horizontal detail matrix cH 1 , the first vertical detail matrix cV 1 and the first Diagonal detail matrix cD 1 ; this process is the first layer of pyramid decomposition, cH 1 , cV 1 and cD 1 constitute the first layer of the pyramid;

再采用小波分解算法对第1近似系数矩阵cA1进行分解,将其分解为第2近似系数矩阵cA2、第2水平细节矩阵cH2、第2垂直细节矩阵cV2和第2对角细节矩阵cD2;此过程为第二层金字塔分解,cH2、cV2和cD2构成金字塔第二层;Then, the wavelet decomposition algorithm is used to decompose the first approximate coefficient matrix cA 1 into the second approximate coefficient matrix cA 2 , the second horizontal detail matrix cH 2 , the second vertical detail matrix cV 2 and the second diagonal detail matrix cD 2 ; this process is the second layer of pyramid decomposition, cH 2 , cV 2 and cD 2 constitute the second layer of the pyramid;

如此依次进行N次分解,最后得到第N近似系数矩阵cAN、第N水平细节矩阵cHN、第N垂直细节矩阵cVN和第N对角细节矩阵cDN;cAN、cHN、cVN和cDN构成金字塔第N层;N≥3,图片尺寸越大,N值越大,反之则N值越小;Carry out N times of decomposition in this way, and finally get the Nth approximate coefficient matrix cA N , the Nth horizontal detail matrix cH N , the Nth vertical detail matrix cV N and the Nth diagonal detail matrix cD N ; cA N , cH N , cV N and cD N constitute the Nth layer of the pyramid; N≥3, the larger the picture size, the larger the N value, otherwise the smaller the N value;

对所有YIQ色彩空间视频帧进行N次金字塔分解后,由各帧YIQ色彩空间视频帧的第n水平细节矩阵cHn组成尺度为n的水平细节空间频率带,由各帧YIQ色彩空间视频帧的第n垂直细节矩阵cVn组成尺度为n的垂直细节空间频率带,由各帧YIQ色彩空间视频帧的第n对角细节矩阵cDn组成尺度为n的对角细节空间频率带;其中n称为尺度,表示不同金字塔层,n=1、2、…、 N;由各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN组成近似系数空间频率带;上述各空间频率带构成第一空间频率带组;After performing N times of pyramid decomposition on all YIQ color space video frames, the nth horizontal detail matrix cH n of each YIQ color space video frame forms a horizontal detail space frequency band with a scale of n, and each frame of YIQ color space video frame The nth vertical detail matrix cV n forms a vertical detail space frequency band with a scale of n, and the nth diagonal detail matrix cD n of each YIQ color space video frame forms a diagonal detail space frequency band with a scale of n; where n is called Be scale, represent different pyramid levels, n=1, 2, ..., N; The approximate coefficient space frequency band is formed by the Nth approximation coefficient matrix cA N of each frame YIQ color space video frame; Above-mentioned each space frequency band forms the first space frequency band group;

(4)时域带通滤波步骤:(4) Steps of time-domain bandpass filtering:

采用第一低通IIR(Infinite Impulse Response,无限脉冲响应)数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波,滤波后得到的各空间频率带构成第一临时空间频率带组;The first low-pass IIR (Infinite Impulse Response, Infinite Impulse Response) digital filter is used to perform time-domain filtering on each spatial frequency band forming the first spatial frequency band group, and each spatial frequency band obtained after filtering constitutes the first temporary space frequency band group;

采用第二低通IIR数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波,滤波后得到的各空间频率带构成第二临时空间频率带组;The second low-pass IIR digital filter is used to perform time-domain filtering on each spatial frequency band forming the first spatial frequency band group respectively, and each spatial frequency band obtained after filtering forms a second temporary spatial frequency band group;

将第一临时空间频率带组中各空间频率带与第二临时空间频率带组中对应的各空间频率带相减,所得到的各空间频率带共同构成第二空间频率带组;Subtract each spatial frequency band in the first temporary spatial frequency band group from each corresponding spatial frequency band in the second temporary spatial frequency band group, and the resulting spatial frequency bands together form a second spatial frequency band group;

第一低通IIR数字滤波器和第二低通IIR数字滤波器的截止频率分别为f1和f2,0<f2<f1<fs/2,fs为视频图像的录制帧速率;The cut-off frequencies of the first low-pass IIR digital filter and the second low-pass IIR digital filter are f 1 and f 2 respectively, 0<f 2 <f 1 <f s /2, f s is the recording frame rate of the video image ;

(5)第二空间频率带组放大步骤:(5) second spatial frequency band group amplification step:

分别计算金字塔每一层的最大放大倍数α(n)max,分别比较是否α(n)max≤α,是则将α(n)max作为相应层实际放大倍数,否则将α作为相应层实际放大倍数;其中α为设定放大倍数,5<α<30;Calculate the maximum magnification α(n) max of each layer of the pyramid separately, and compare whether α(n) max ≤ α, if yes, use α(n) max as the actual magnification of the corresponding layer, otherwise use α as the actual magnification of the corresponding layer Multiple; where α is the set magnification, 5<α<30;

将构成第二空间频率带组的各空间频率带按照其所在金字塔的层数分别乘以相应层实际放大倍数,所得到的各空间频率带共同构成第三空间频率带组;Each spatial frequency band forming the second spatial frequency band group is multiplied by the actual magnification factor of the corresponding layer according to the number of layers of the pyramid where it is located, and the resulting spatial frequency bands jointly form the third spatial frequency band group;

(6)得到第四空间频率带组步骤:(6) Obtain the fourth spatial frequency band group step:

将构成第三空间频率带组的各空间频率带分别与所述第一空间频率带组中相应的空间频率带进行矩阵加法运算,所得到的各空间频率带共同构成第四空间频率带组;所述矩阵加法运算为两组对应尺度、对应位置的矩阵运算;performing matrix addition operation on each spatial frequency band constituting the third spatial frequency band group and corresponding spatial frequency bands in the first spatial frequency band group, and the obtained spatial frequency bands together form a fourth spatial frequency band group; The matrix addition operation is a matrix operation of two groups of corresponding scales and corresponding positions;

(7)重构亮度矩阵Y步骤:(7) Steps of reconstructing brightness matrix Y:

采用小波重构算法将第四空间频率带组重构YIQ色彩空间视频帧的Y4矩阵,具体过程如下:Adopt the wavelet reconstruction algorithm to reconstruct the Y4 matrix of the YIQ color space video frame with the fourth spatial frequency band group, the specific process is as follows:

对第四空间频率带组中不同金字塔层的每一层进行逐层重构,从金字塔第N层开始,采用小波重构算法,将构成第四空间频率带组中各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN 4与第N水平细节矩阵cHN 4、第N垂直细节矩阵cVN 4和第N对角细节矩阵cDN 4重构第N-1近似系数矩阵cAN-1 4Each layer of the different pyramid layers in the fourth spatial frequency band group is reconstructed layer by layer. Starting from the Nth layer of the pyramid, the wavelet reconstruction algorithm will be used to form the YIQ color space video frame of each frame in the fourth spatial frequency band group. The Nth approximate coefficient matrix cA N 4 and the Nth horizontal detail matrix cH N 4 , the Nth vertical detail matrix cV N 4 and the Nth diagonal detail matrix cD N 4 reconstruct the N-1th approximate coefficient matrix cA N-1 4 ;

再进行金字塔第N-1层重构,对各帧YIQ色彩空间视频帧,采用小波重构算法,将上一层重构的第N-1近似系数矩阵cAN-1 4与第N-1水平细节矩阵cHN-1 4、第N-1垂直细节矩阵cVN-1 4、第N-1对角细节矩阵cDN-1 4重构第N-2近似系数矩阵cAN-2 4Then carry out the reconstruction of the N-1th layer of the pyramid, and use the wavelet reconstruction algorithm for each frame of YIQ color space video frame to combine the N-1th approximate coefficient matrix cA N-1 4 and the N-1th The horizontal detail matrix cH N-1 4 , the N-1th vertical detail matrix cV N-1 4 , the N-1th diagonal detail matrix cD N-1 4 reconstruct the N-2th approximate coefficient matrix cA N-2 4 ;

如此依次进行,直到得到重构的第1近似系数矩阵cA1 4;然后采用小波重构算法进行金字塔第1层重构,对各帧YIQ色彩空间视频帧,采用小波重构算法,将第1近似系数矩阵cA1 4与第1水平细节矩阵cH1 4、第1垂直细节矩阵cV1 4、第1对角细节矩阵cD1 4重构为Y4矩阵;Proceed in this way until the first reconstructed approximate coefficient matrix cA 1 4 is obtained; then the wavelet reconstruction algorithm is used to reconstruct the first layer of the pyramid, and for each frame of YIQ color space video frame, the wavelet reconstruction algorithm is used to transform the first The approximation coefficient matrix cA 1 4 and the first horizontal detail matrix cH 1 4 , the first vertical detail matrix cV 1 4 , and the first diagonal detail matrix cD 1 4 are reconstructed into a Y 4 matrix;

(8)视频帧色彩空间还原步骤:(8) video frame color space restoration steps:

通过下式对步骤(7)重构的Y矩阵、步骤(2)中的I矩阵和Q矩阵进行矩阵运算,得到新的R矩阵、G矩阵和B矩阵:Carry out matrix operations to the Y matrix reconstructed in step (7), the I matrix and Q matrix in step (2) by the following formula to obtain new R matrix, G matrix and B matrix:

R=1.000Y4+0.956I+0.621Q,R= 1.000Y4 +0.956I+0.621Q,

G=1.000Y4-0.272I-0.647Q,G=1.000Y4-0.272I - 0.647Q,

B=1.000Y4-1.106I+1.703Q;B=1.000Y4-1.106I + 1.703Q;

新的R矩阵、G矩阵和B矩阵合成新RGB色彩空间视频帧;The new R matrix, G matrix and B matrix synthesize new RGB color space video frames;

依次对每一新YIQ色彩空间视频帧进行上述转换,就将YIQ色彩空间视频帧还原为RGB色彩空间视频帧;Carry out above-mentioned conversion to each new YIQ color space video frame successively, just YIQ color space video frame is restored to RGB color space video frame;

(9)输出视频图像步骤:(9) Output video image steps:

构造一个视频图像文件,包括头文件部分和数据部分,首先设置视频图像文件存储位置,然后按照输入视频图像的头文件格式,构造输出视频图像的头文件,并将其写入硬盘指定位置,接着将每一帧视频帧数据硬盘指定位置,由此完成RGB色彩空间视频图像的构造。Construct a video image file, including the header file part and the data part, first set the storage location of the video image file, then construct the header file of the output video image according to the header file format of the input video image, and write it to the specified location on the hard disk, and then Designate a location on the hard disk for each frame of video frame data, thereby completing the construction of the RGB color space video image.

所述的视频运动放大方法,其特征在于:The video motion amplification method is characterized in that:

所述步骤(3)中,对Y矩阵,采用小波分解算法将其分解为四个矩阵包括下述子步骤:In described step (3), to Y matrix, adopting wavelet decomposition algorithm to decompose it into four matrices comprises the following substeps:

(3.1)对Y矩阵的每一行进行低通滤波,然后进行列下采样,接着对每一列进行低通滤波,最后进行行下采样得到第1近似系数cA1矩阵;(3.1) carry out low-pass filtering to each row of Y matrix, then carry out column down-sampling, then carry out low-pass filtering to each column, carry out row down-sampling at last to obtain the first approximation coefficient cA 1 matrix;

(3.2)对Y矩阵的每一行进行低通滤波,然后进行列下采样,接着对每一列进行高通滤波,最后进行行下采样得到第1水平细节cH1矩阵;(3.2) Low-pass filtering is carried out to each row of the Y matrix, then column down-sampling is performed, then each column is subjected to high-pass filtering, and row down-sampling is finally performed to obtain the first horizontal detail c H 1 matrix;

(3.3)对Y矩阵的每一行进行高通滤波,然后进行列下采样,接着对每一列进行低通滤波,最后进行行下采样得到第1垂直细节cV1矩阵;(3.3) High-pass filtering is performed on each row of the Y matrix, then column downsampling is performed, then each column is low-pass filtered, and row downsampling is finally performed to obtain the first vertical detail cV 1 matrix;

(3.4)对Y矩阵的每一行进行高通滤波,然后进行列下采样,接着对每一列进行高通滤波,最后进行行下采样得到第1对角细节cD1矩阵;(3.4) Carry out high-pass filtering to each row of Y matrix, then carry out column down-sampling, then carry out high-pass filtering to each column, finally carry out row down-sampling to obtain the first diagonal detail cD 1 matrix;

采用小波分解算法对第n近似系数矩阵cAn-1进行分解,子步骤与上述相同,n=1、2、…、N;Adopt wavelet decomposition algorithm to decompose the nth approximate coefficient matrix cA n-1 , the sub-steps are the same as above, n=1, 2, ..., N;

所述列下采样就是保留偶数列,丢弃奇数列;所述行下采样就是保留偶数行,丢弃奇数行;The column downsampling is to keep the even columns and discard the odd columns; the row downsampling is to keep the even rows and discard the odd rows;

所述对行进行低通滤波就是将该行元素与小波低通滤波器系数求卷积,得到一行新元素值,代替原有行;The low-pass filtering of the row is to convolve the row element with the wavelet low-pass filter coefficient to obtain a row of new element values to replace the original row;

所述对行进行高通滤波就是将该行元素与小波高通滤波器系数求卷积,得到一行新元素值,代替原有行;Carrying out high-pass filtering to row is exactly to convolve this row element and wavelet high-pass filter coefficient, obtain a row of new element value, replace original row;

所述对列进行低通滤波就是将该列元素与小波低通滤波器系数求卷积,得到一列新元素值,代替原有列;The low-pass filtering of the column is to convolve the column elements with wavelet low-pass filter coefficients to obtain a column of new element values to replace the original column;

所述对列进行高通滤波就是将该列元素与小波高通滤波器系数求卷积,得到一列新元素值,代替原有列;Carrying out high-pass filtering to the column is to convolve the column elements with wavelet high-pass filter coefficients to obtain a column of new element values to replace the original column;

所述小波低通滤波器系数和小波高通滤波器系数通过查阅相关文献可以得到。The coefficients of the wavelet low-pass filter and the wavelet high-pass filter can be obtained by consulting related documents.

所述的视频运动放大方法,其特征在于:The video motion amplification method is characterized in that:

所述步骤(4)中,采用第一低通IIR数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波包括下述子步骤:In said step (4), adopting the first low-pass IIR digital filter to carry out time-domain filtering respectively to each spatial frequency band forming the first spatial frequency band group includes the following sub-steps:

(4.1)计算低通IIR滤波器的滤波器系数r1(4.1) Calculate the filter coefficient r 1 of the low-pass IIR filter:

r1=2πf1/fsr 1 =2πf 1 /f s ,

式中f1为第一低通IIR数字滤波器的截止频率,fs为视频图像的录制帧速率;In the formula, f 1 is the cut-off frequency of the first low-pass IIR digital filter, and f s is the recording frame rate of the video image;

(4.2)计算第一低通IIR数字滤波器的输出Y(m):(4.2) Calculate the output Y(m) of the first low-pass IIR digital filter:

Y(m)=(1-r1)×Y(m-1)+r1×X(m),Y(m)=(1-r 1 )×Y(m-1)+r 1 ×X(m),

式中,X(m)为滤波器的输入,m为视频帧序号,m=1、2、…、K;其中K为视频帧的总帧数,当m为1,X(1)是已知的,Y(0)为:In the formula, X(m) is the input of the filter, m is the sequence number of the video frame, m=1, 2, ..., K; wherein K is the total frame number of the video frame, when m is 1, X(1) is the Known, Y(0) is:

采用第二低通IIR数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波,其过程与上述过程完全相同,区别仅在于将f1换成f2The second low-pass IIR digital filter is used to perform time-domain filtering on the spatial frequency bands constituting the first spatial frequency band group, the process is exactly the same as the above process, the only difference is that f 1 is replaced by f 2 .

所述的视频运动放大方法,其特征在于:The video motion amplification method is characterized in that:

所述步骤(5)中,计算金字塔每一层的最大放大倍数α(n)max包括下述子步骤:In the described step (5), the maximum magnification α (n) max of calculating each layer of the pyramid comprises the following sub-steps:

(5.1)计算金字塔每一层的空间波长λ(n):(5.1) Calculate the spatial wavelength λ(n) of each layer of the pyramid:

式中,Wn和Hn分别为金字塔第n层的宽与高,单位为像素;In the formula, W n and H n are the width and height of the nth layer of the pyramid respectively, and the unit is pixel;

(5.2)计算位移函数δ(t):(5.2) Calculate the displacement function δ(t):

式中,λc为空间临界波长,取值为16~20像素;In the formula, λ c is the spatial critical wavelength, and the value is 16 to 20 pixels;

(5.3)计算金字塔每一层的最大放大倍数α(n)max(5.3) Calculate the maximum magnification α(n) max of each layer of the pyramid:

所述的视频运动放大方法,其特征在于:The video motion amplification method is characterized in that:

所述步骤(7)中,采用小波重构算法,将构成第四空间频率带组中各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN 4与第N水平细节矩阵cHN 4、第N垂直细节矩阵cVN 4和第N对角细节矩阵cDN 4重构第N-1近似系数矩阵cAN-1 4,包括下述子步骤:In the step (7), the wavelet reconstruction algorithm is used to form the Nth approximate coefficient matrix cA N 4 and the Nth horizontal detail matrix cH N 4 and the Nth level detail matrix cH N 4 of each frame YIQ color space video frame in the fourth spatial frequency band group. The N vertical detail matrix cV N 4 and the Nth diagonal detail matrix cD N 4 reconstruct the N-1th approximate coefficient matrix cA N-1 4 , including the following sub-steps:

(7.1)对矩阵cAN 4进行行上采样,然后对行上采样后矩阵的每一列进行低通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行低通滤波得到AN1矩阵;(7.1) Perform row upsampling on the matrix cA N 4 , then perform low-pass filtering on each column of the row upsampled matrix, then perform column upsampling on the filtered matrix, and then perform row upsampling on each row of the matrix obtained by column upsampling A N1 matrix is obtained by low-pass filtering;

(7.2)对矩阵cHN 4进行行上采样,然后对行上采样后矩阵的每一列进行高通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行低通滤波得到AN2矩阵;(7.2) Perform row upsampling on the matrix cH N 4 , then perform high-pass filtering on each column of the matrix after row upsampling, then perform column upsampling on the filtered matrix, and then perform low-pass on each row of the matrix obtained by column upsampling Obtain A N2 matrix through filtering;

(7.3)对cVN 4矩阵进行行上采样,然后对行上采样后矩阵的每一列进行低通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行高通滤波得到AN3矩阵;(7.3) Perform row up-sampling on the cV N 4 matrix, then perform low-pass filtering on each column of the row-up-sampled matrix, then perform column up-sampling on the filtered matrix, and then perform on-column up-sampling to obtain each row of the matrix A N3 matrix is obtained by high-pass filtering;

(7.4)对cDN 4矩阵进行行上采样,然后对行上采样后矩阵的每一列进行高通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行高通滤波得到AN4矩阵;(7.4) Perform row upsampling on the cD N 4 matrix, then perform high-pass filtering on each column of the matrix after row upsampling, then perform column upsampling on the filtered matrix, and then perform high-pass on each row of the matrix obtained by column upsampling Filter to get A N4 matrix;

(7.5)将上述AN1矩阵、AN2矩阵、AN3矩阵和AN4矩阵进行矩阵加法运算得到第N-1近似系数矩阵cAN-1 4(7.5) carry out matrix addition operation above-mentioned A N1 matrix, A N2 matrix, A N3 matrix and A N4 matrix obtain the N-1th approximation coefficient matrix cA N-1 4 ;

所谓矩阵行上采样,就是将矩阵的行数增加一倍,在原始矩阵任意两行之间插入一行零向量,最后对新构矩阵的最后一行补零;所谓矩阵列上采样,就是将矩阵的列数增加一倍,在原始矩阵任意两列之间插入一列零向量,最 后对新构矩阵的最后一列补零;The so-called matrix row upsampling is to double the number of matrix rows, insert a row of zero vectors between any two rows of the original matrix, and finally fill the last row of the newly constructed matrix with zeros; the so-called matrix column upsampling is to multiply the matrix Double the number of columns, insert a column of zero vectors between any two columns of the original matrix, and finally fill the last column of the newly constructed matrix with zeros;

所述对行进行低通滤波就是将该行元素与小波低通滤波器系数求卷积,得到一行新元素值,代替原有行;The low-pass filtering of the row is to convolve the row element with the wavelet low-pass filter coefficient to obtain a row of new element values to replace the original row;

所述对行进行高通滤波就是将该行元素与小波高通滤波器系数求卷积,得到一行新元素值,代替原有行;Carrying out high-pass filtering to row is exactly to convolve this row element and wavelet high-pass filter coefficient, obtain a row of new element value, replace original row;

所述对列进行低通滤波就是将该列元素与小波低通滤波器系数求卷积,得到一列新元素值,代替原有列;The low-pass filtering of the column is to convolve the column elements with wavelet low-pass filter coefficients to obtain a column of new element values to replace the original column;

所述对列进行高通滤波就是将该列元素与小波高通滤波器系数求卷积,得到一列新元素值,代替原有列;Carrying out high-pass filtering to the column is to convolve the column elements with wavelet high-pass filter coefficients to obtain a column of new element values to replace the original column;

所述小波低通滤波器系数和小波高通滤波器系数通过查阅相关文献可以得到。The coefficients of the wavelet low-pass filter and the wavelet high-pass filter can be obtained by consulting related documents.

视频图像的相位梯度与视频图像中的运动有直接的关系,现有基于相位的复数可操作金字塔运动放大方法的基本思想是将图像的相位梯度进行放大,达到将图像中的运动放大的目的,由于图像的相位梯度发生畸变,导致放大的运动也会发生畸变。本发明并没有涉及图像的相位梯度,因而不存在运动发生畸变。The phase gradient of the video image is directly related to the motion in the video image. The basic idea of the existing phase-based complex operable pyramid motion amplification method is to amplify the phase gradient of the image to achieve the purpose of amplifying the motion in the image. Because the phase gradient of the image is distorted, the movement that causes the magnification is also distorted. The present invention does not involve the phase gradient of the image, so there is no motion distortion.

现有的线性欧拉视频运动放大方法存在增加放大因子会显著增大噪声的问题,本发明在步骤(4)中,第一低通IIR数字滤波器的差分方程为:Y(m)=(1-r1)×Y(m-1)+r1×X(m),实际操作中,现有线性欧拉视频运动放大方法将滤波器的初始输入X(1)和Y(0)进行了舍弃,直接从X(2)和Y(1)进行时域滤波,其中令Y(1)=X(1),具体计算过程为:Existing linear Euler video motion amplification method has the problem that increasing the amplification factor can significantly increase noise, the present invention in step (4), the difference equation of the first low-pass IIR digital filter is: Y(m)=( 1-r 1 )×Y(m-1)+r 1 ×X(m), in actual operation, the existing linear Euler video motion amplification method performs the initial input of the filter X(1) and Y(0) In order to give up, time-domain filtering is performed directly from X(2) and Y(1), where Y(1)=X(1), the specific calculation process is:

Y(1)=X(1)Y(1)=X(1)

Y(2)=(1-r1)*Y(1)+r1*X(2)Y(2)=(1-r 1 )*Y(1)+r 1 *X(2)

Y(3)=(1-r1)*Y(2)+r1*X(3)Y(3)=(1-r 1 )*Y(2)+r 1 *X(3)

Y(m)=(1-r1)*Y(m-1)+r1*X(m)Y(m)=(1-r 1 )*Y(m-1)+r 1 *X(m)

Y(K)=(1-r1)*Y(K-1)+r1*X(K)Y(K)=(1-r 1 )*Y(K-1)+r 1 *X(K)

本发明步骤(4)的具体计算过程为:The concrete calculation process of step (4) of the present invention is:

Y(1)=(1-r1)*Y(0)+r1*X(1)Y(1)=(1-r 1 )*Y(0)+r 1 *X(1)

Y(2)=(1-r1)*Y(1)+r1*X(2)Y(2)=(1-r 1 )*Y(1)+r 1 *X(2)

Y(m)=(1-r1)*Y(m-1)+r1*X(m)Y(m)=(1-r 1 )*Y(m-1)+r 1 *X(m)

Y(K)=(1-r1)*Y(K-1)+r1*X(K)Y(K)=(1-r 1 )*Y(K-1)+r 1 *X(K)

通过对现有线性欧拉视频运动放大方法的输出视频进行噪声分析,发现其噪声呈现初始小,然后快速增加,接着缓慢衰减的趋势。采用本发明的试验结果显示,输出视频中的噪声很平稳,基本保持不变,另外从噪声的大小来看,本发明极大的减少了输出视频中的噪声。By analyzing the noise of the output video of the existing linear Euler video motion amplification method, it is found that the noise is initially small, then increases rapidly, and then slowly decays. The test results using the present invention show that the noise in the output video is very stable and basically remains unchanged. In addition, from the perspective of the size of the noise, the present invention greatly reduces the noise in the output video.

综上所述,本发明解决了现有基于线性欧拉视频运动放大方法存在的增加放大因子会显著增大噪声的问题和现有基于复数可操作金字塔的视频运动放大方法运动失真等问题。To sum up, the present invention solves the problem that increasing the amplification factor will significantly increase the noise in the existing linear Euler video motion amplification method and the motion distortion problem in the existing video motion amplification method based on complex operable pyramids.

附图说明Description of drawings

图1为本发明的流程示意图;Fig. 1 is a schematic flow sheet of the present invention;

图2为原始视频帧序列;Fig. 2 is original video frame sequence;

图3为小波金字塔分解示意图;Fig. 3 is a schematic diagram of wavelet pyramid decomposition;

图4(A)为原始图片;Figure 4 (A) is the original picture;

图4(B)为三层小波金字塔结构示意图;Fig. 4 (B) is a schematic diagram of a three-layer wavelet pyramid structure;

图5为第一空间频率带组示意图;5 is a schematic diagram of a first spatial frequency band group;

图6为小波分解示意图,Figure 6 is a schematic diagram of wavelet decomposition,

图7(A)为第一低通IIR数字滤波器的频响特性示意图;Fig. 7 (A) is the schematic diagram of the frequency response characteristic of the first low-pass IIR digital filter;

图7(B)为第二低通IIR数字滤波器的频响特性示意图;Fig. 7 (B) is the frequency response characteristic schematic diagram of the second low-pass IIR digital filter;

图7(C)为使用第一、第二低通IIR数字滤波器两个不同截止频率的低通滤波器所构造的带通滤波器的频响特性示意图;Fig. 7 (C) is the frequency response characteristic schematic diagram of the band-pass filter that uses the first, the second low-pass IIR digital filter two low-pass filters of different cut-off frequencies to construct;

图8为第四空间频率带组;Figure 8 is a fourth spatial frequency band group;

图9为小波重构示意图;Fig. 9 is a schematic diagram of wavelet reconstruction;

图10为重构的视频序列。Figure 10 shows the reconstructed video sequence.

具体实施方式detailed description

以下结合附图和实施例,对本发明进一步说明。The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

如图1所示,本发明包括视频图像分解步骤、视频帧色彩空间转换步骤、N层金字塔分解步骤、时域带通滤波步骤、第二空间频率带组放大步骤、得到第四空间频率带组步骤、重构亮度矩阵步骤、视频帧色彩空间还原步骤、输出视频图像步骤。As shown in Figure 1, the present invention includes video image decomposition step, video frame color space conversion step, N layer pyramid decomposition step, time domain bandpass filtering step, second spatial frequency band group amplification step, obtains the 4th spatial frequency band group Step, the step of reconstructing the luminance matrix, the step of restoring the color space of the video frame, and the step of outputting the video image.

本发明的一个实施例,包括下述步骤:An embodiment of the present invention comprises the following steps:

(1)视频图像分解步骤:(1) Video image decomposition steps:

录制运动主体在空间微小运动的RGB色彩空间视频图像,再根据时间先后将RGB色彩空间视频图像分解为一帧一帧的RGB色彩空间视频帧,读取所有的RGB色彩空间视频帧;如图2所示,申请人采用单反相机录制了两颗银杏树在空中微小运动的视频,视频的帧速率fs为25帧每秒,视频大小为512×512像素。Record the RGB color space video image of the moving subject moving slightly in space, and then decompose the RGB color space video image into RGB color space video frames frame by frame according to time, and read all the RGB color space video frames; as shown in Figure 2 As shown, the applicant used a SLR camera to record a video of two ginkgo trees moving slightly in the air, the frame rate f s of the video is 25 frames per second, and the video size is 512×512 pixels.

(2)视频帧色彩空间转换步骤:(2) video frame color space conversion steps:

将每一RGB色彩空间视频帧用R矩阵、G矩阵、B矩阵三个二维矩阵表示, R矩阵表示像素点红颜色强度,表示像素点绿色强度,B矩阵表示像素点蓝色强度;Each RGB color space video frame is represented by three two-dimensional matrices of R matrix, G matrix, and B matrix. The R matrix represents the red color intensity of the pixel point, represents the green intensity of the pixel point, and the B matrix represents the blue intensity of the pixel point;

通过下式对R矩阵、G矩阵和B矩阵进行矩阵运算,得到YIQ色彩空间视频帧的Y矩阵、I矩阵和Q矩阵三个二维矩阵:Perform matrix operations on the R matrix, G matrix, and B matrix by the following formula to obtain three two-dimensional matrices of the Y matrix, I matrix, and Q matrix of the YIQ color space video frame:

Y=0.299R+0.587G+0.114B,Y=0.299R+0.587G+0.114B,

I=0.596R-0.275G-0.321B,I=0.596R-0.275G-0.321B,

Q=0.212R-0.523G+0.311B;Q=0.212R-0.523G+0.311B;

其中,Y矩阵表示YIQ色彩空间视频帧各像素的亮度值,I矩阵表示YIQ色彩空间视频帧各像素从橙色到青色的颜色强度,Q矩阵表示表示YIQ色彩空间视频帧各像素从紫色到黄绿色的颜色强度;Among them, the Y matrix represents the brightness value of each pixel in the YIQ color space video frame, the I matrix represents the color intensity of each pixel in the YIQ color space video frame from orange to cyan, and the Q matrix represents the color intensity of each pixel in the YIQ color space video frame from purple to yellow-green the color intensity;

(3)N层金字塔分解步骤:(3) N layer pyramid decomposition steps:

对各YIQ色彩空间视频帧中的Y矩阵,采用小波分解算法将其分解为四个矩阵:第1近似系数矩阵cA1、第1水平细节矩阵cH1、第1垂直细节矩阵cV1和第1对角细节矩阵cD1;此过程为第一层金字塔分解,cH1、cV1和cD1构成金字塔第一层;For the Y matrix in each YIQ color space video frame, use the wavelet decomposition algorithm to decompose it into four matrices: the first approximate coefficient matrix cA 1 , the first horizontal detail matrix cH 1 , the first vertical detail matrix cV 1 and the first Diagonal detail matrix cD 1 ; this process is the first layer of pyramid decomposition, cH 1 , cV 1 and cD 1 constitute the first layer of the pyramid;

再采用小波分解算法对第1近似系数矩阵cA1进行分解,将其分解为第2近似系数矩阵cA2、第2水平细节矩阵cH2、第2垂直细节矩阵cV2和第2对角细节矩阵cD2;此过程为第二层金字塔分解,cH2、cV2和cD2构成金字塔第二层;Then, the wavelet decomposition algorithm is used to decompose the first approximate coefficient matrix cA 1 into the second approximate coefficient matrix cA 2 , the second horizontal detail matrix cH 2 , the second vertical detail matrix cV 2 and the second diagonal detail matrix cD 2 ; this process is the second layer of pyramid decomposition, cH 2 , cV 2 and cD 2 constitute the second layer of the pyramid;

如此依次进行N次分解,最后得到第N近似系数矩阵cAN、第N水平细节矩阵cHN、第N垂直细节矩阵cVN和第N对角细节矩阵cDN;cAN、cHN、cVN和cDN构成金字塔第N层;N≥3,图片尺寸越大,N值越大,反之则N值越小;Carry out N times of decomposition in this way, and finally get the Nth approximate coefficient matrix cA N , the Nth horizontal detail matrix cH N , the Nth vertical detail matrix cV N and the Nth diagonal detail matrix cD N ; cA N , cH N , cV N and cD N constitute the Nth layer of the pyramid; N≥3, the larger the picture size, the larger the N value, otherwise the smaller the N value;

对所有YIQ色彩空间视频帧进行N次金字塔分解后,由各帧YIQ色彩空间视频帧的第n水平细节矩阵cHn组成尺度为n的水平细节空间频率带,由各帧YIQ色彩空间视频帧的第n垂直细节矩阵cVn组成尺度为n的垂直细节空间频率带,由各帧YIQ色彩空间视频帧的第n对角细节矩阵cDn组成尺度为n的对角细节空间频率带;其中n称为尺度,表示不同金字塔层,n=1、2、…、 N;由各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN组成近似系数空间频率带;上述各空间频率带构成第一空间频率带组;After performing N times of pyramid decomposition on all YIQ color space video frames, the nth horizontal detail matrix cH n of each YIQ color space video frame forms a horizontal detail space frequency band with a scale of n, and each frame of YIQ color space video frame The nth vertical detail matrix cV n forms a vertical detail space frequency band with a scale of n, and the nth diagonal detail matrix cD n of each YIQ color space video frame forms a diagonal detail space frequency band with a scale of n; where n is called Be scale, represent different pyramid levels, n=1, 2, ..., N; The approximate coefficient space frequency band is formed by the Nth approximation coefficient matrix cA N of each frame YIQ color space video frame; Above-mentioned each space frequency band forms the first space frequency band group;

图3表示采用小波金字塔算法进行小波金字塔分解图像数据的存储形式,该图是对一幅尺寸为512×512像素的图片进行小波金字塔分解,C表示分解后矩阵的个数,S表示各矩阵的尺寸信息。图4(B)表示小波分解后的三层小波金字塔结构示意图,首先采用小波分解算法将图片分解为cA1,cH1,cV1和cD1,图中左上角为cA1,将cA1再分解为第二层金字塔cA2,cH2,cV2,cD2,cA1被cA2,cH2,cV2,cD2取代,将cA2再分解为第三层金字塔cA3,cH3,cV3,cD3,cA2被cA3,cH3,cV3,cD3取代,于是就构成三层金字塔的结构;图5表示了第一空间频率带组,此图结构布局类似于图4(B),为了简化,仅仅进行了1层金字塔分解,金字塔的总层数为1;Figure 3 shows the storage form of wavelet pyramid decomposition image data using the wavelet pyramid algorithm. This figure is to perform wavelet pyramid decomposition on a picture with a size of 512×512 pixels. C represents the number of decomposed matrices, and S represents the number of each matrix. Size Information. Figure 4(B) shows the schematic diagram of the three-layer wavelet pyramid structure after wavelet decomposition. Firstly , the wavelet decomposition algorithm is used to decompose the picture into cA 1 , cH 1 , cV 1 and cD 1 . Decompose into the second layer pyramid cA 2 , cH 2 , cV 2 , cD 2 , cA 1 is replaced by cA 2 , cH 2 , cV 2 , cD 2 , decompose cA 2 into the third layer pyramid cA 3 , cH 3 , cV 3 , cD 3 , and cA 2 are replaced by cA 3 , cH 3 , cV 3 , and cD 3 , thus forming a three-layer pyramid structure; Figure 5 shows the first spatial frequency band group, and the layout of this figure is similar to that of Figure 4 (B), for simplicity, only one layer of pyramid decomposition is performed, and the total number of layers of the pyramid is 1;

如图6所示,采用小波分解算法将Y矩阵其分解为四个矩阵包括下述子步骤:As shown in Figure 6, using the wavelet decomposition algorithm to decompose the Y matrix into four matrices includes the following sub-steps:

(3.1)对Y矩阵的每一行进行低通滤波,然后进行列下采样,接着对每一列进行低通滤波,最后进行行下采样得到第1近似系数cA1矩阵;(3.1) carry out low-pass filtering to each row of Y matrix, then carry out column down-sampling, then carry out low-pass filtering to each column, carry out row down-sampling at last to obtain the first approximation coefficient cA 1 matrix;

(3.2)对Y矩阵的每一行进行低通滤波,然后进行列下采样,接着对每一列进行高通滤波,最后进行行下采样得到第1水平细节cH1矩阵;(3.2) Low-pass filtering is carried out to each row of the Y matrix, then column down-sampling is performed, then each column is subjected to high-pass filtering, and row down-sampling is finally performed to obtain the first horizontal detail c H 1 matrix;

(3.3)对Y矩阵的每一行进行高通滤波,然后进行列下采样,接着对每一列进行低通滤波,最后进行行下采样得到第1垂直细节cV1矩阵;(3.3) High-pass filtering is performed on each row of the Y matrix, then column downsampling is performed, then each column is low-pass filtered, and row downsampling is finally performed to obtain the first vertical detail cV 1 matrix;

(3.4)对Y矩阵的每一行进行高通滤波,然后进行列下采样,接着对每一列进行高通滤波,最后进行行下采样得到第1对角细节cD1矩阵;(3.4) Carry out high-pass filtering to each row of Y matrix, then carry out column down-sampling, then carry out high-pass filtering to each column, finally carry out row down-sampling to obtain the first diagonal detail cD 1 matrix;

采用小波分解算法对第n近似系数矩阵cAn-1进行分解,子步骤与上述相同,n=1、2、…、N;Adopt wavelet decomposition algorithm to decompose the nth approximate coefficient matrix cA n-1 , the sub-steps are the same as above, n=1, 2, ..., N;

所述列下采样就是保留偶数列,丢弃奇数列;所述行下采样就是保留偶数行,丢弃奇数行;The column downsampling is to keep the even columns and discard the odd columns; the row downsampling is to keep the even rows and discard the odd rows;

所述对行进行低通滤波就是将该行元素与小波低通滤波器系数求卷积, 得到一行新元素值,代替原有行;The low-pass filtering of the row is to convolve the row elements with wavelet low-pass filter coefficients to obtain a row of new element values to replace the original rows;

所述对行进行高通滤波就是将该行元素与小波高通滤波器系数求卷积,得到一行新元素值,代替原有行;Carrying out high-pass filtering to row is exactly to convolve this row element and wavelet high-pass filter coefficient, obtain a row of new element value, replace original row;

所述对列进行低通滤波就是将该列元素与小波低通滤波器系数求卷积,得到一列新元素值,代替原有列;The low-pass filtering of the column is to convolve the column elements with wavelet low-pass filter coefficients to obtain a column of new element values to replace the original column;

所述对列进行高通滤波就是将该列元素与小波高通滤波器系数求卷积,得到一列新元素值,代替原有列;Carrying out high-pass filtering to the column is to convolve the column elements with wavelet high-pass filter coefficients to obtain a column of new element values to replace the original column;

本实施例中,所采用的小波函数为coif5,通过查阅参考文件1和参考文件2,得到低通滤波器和高通滤波器,如表1所列;In the present embodiment, the wavelet function that adopts is coif5, by consulting reference document 1 and reference document 2, obtain low-pass filter and high-pass filter, as listed in table 1;

参考文件1:中国,轩建平等,“高阶Coiflet小波系构造与应用”,振动工程学报,(2008)521-529;参考文件2:禹如杰,“基于零矩尺度函数的波传播问题求解方法研究”,华中科技大学硕士论文,1-52,2013年发表;Reference 1: China, Jianping Xuan, "Construction and Application of Higher-Order Coiflet Wavelet Systems", Journal of Vibration Engineering, (2008) 521-529; Reference 2: Rujie Yu, "Wave Propagation Problems Based on Zero-moment Scaling Functions Research on Solving Method", Master Thesis of Huazhong University of Science and Technology, 1-52, published in 2013;

(4)时域带通滤波步骤:(4) Steps of time-domain bandpass filtering:

采用第一低通IIR数字滤波器(Infinite Impulse Response,无限脉冲响应数字滤波器)对构成第一空间频率带组的各空间频率带分别进行时域滤波,滤波后得到的各空间频率带构成第一临时空间频率带组;The first low-pass IIR digital filter (Infinite Impulse Response, infinite impulse response digital filter) is used to perform time-domain filtering on each spatial frequency band forming the first spatial frequency band group, and each spatial frequency band obtained after filtering constitutes the second spatial frequency band. a temporary set of spatial frequency bands;

采用第二低通IIR数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波,滤波后得到的各空间频率带构成第二临时空间频率带组;The second low-pass IIR digital filter is used to perform time-domain filtering on each spatial frequency band forming the first spatial frequency band group respectively, and each spatial frequency band obtained after filtering forms a second temporary spatial frequency band group;

将第一临时空间频率带组中各空间频率带与第二临时空间频率带组中对应的各空间频率带相减,所得到的各空间频率带共同构成第二空间频率带组;Subtract each spatial frequency band in the first temporary spatial frequency band group from each corresponding spatial frequency band in the second temporary spatial frequency band group, and the resulting spatial frequency bands together form a second spatial frequency band group;

本实施例中,第一低通IIR数字滤波器和第二低通IIR数字滤波器的截止频率f1和f2分别为0.4Hz和0.2Hz,图7(A)表示第一低通IIR数字滤波器的频响特性、图7(B)表示第二低通IIR数字滤波器的频响特性、图7(C)表示由第一和第二低通IIR数字滤波器构成的带通滤波器的频响特性。In the present embodiment, the cut-off frequencies f1 and f2 of the first low-pass IIR digital filter and the second low-pass IIR digital filter are 0.4Hz and 0.2Hz respectively, and Fig. 7 (A) shows the first low-pass IIR digital filter The frequency response characteristic of the filter, Fig. 7 (B) shows the frequency response characteristic of the second low-pass IIR digital filter, Fig. 7 (C) shows the band-pass filter that is made of the first and the second low-pass IIR digital filter frequency response characteristics.

(5)第二空间频率带组放大步骤:(5) second spatial frequency band group amplification step:

分别计算金字塔每一层的最大放大倍数α(n)max,分别比较是否α(n)max ≤α,是则将α(n)max作为相应层实际放大倍数,否则将α作为相应层实际放大倍数;其中α为设定放大倍数,5<α<30;Calculate the maximum magnification α(n) max of each layer of the pyramid separately, and compare whether α(n) max ≤ α, if yes, use α(n) max as the actual magnification of the corresponding layer, otherwise use α as the actual magnification of the corresponding layer Multiple; where α is the set magnification, 5<α<30;

将构成第二空间频率带组的各空间频率带按照其所在金字塔的层数分别乘以相应层实际放大倍数,所得到的各空间频率带共同构成第三空间频率带组;Each spatial frequency band forming the second spatial frequency band group is multiplied by the actual magnification factor of the corresponding layer according to the number of layers of the pyramid where it is located, and the resulting spatial frequency bands jointly form the third spatial frequency band group;

本实施例中,计算金字塔每一层的最大放大倍数α(n)max包括下述子步骤:In the present embodiment, calculating the maximum magnification α(n) max of each layer of the pyramid includes the following sub-steps:

(5.1)计算金字塔每一层的空间波长λ(n):(5.1) Calculate the spatial wavelength λ(n) of each layer of the pyramid:

式中,Wn和Hn分别为金字塔第n层的宽与高,单位为像素;以第1层和第2层为例,第1层宽W1与高H1分别为256和256,第二层的宽W2与高H2分别为128和128,参考图3。In the formula, W n and H n are the width and height of the nth layer of the pyramid, and the unit is pixel; taking the first layer and the second layer as an example, the width W 1 and height H 1 of the first layer are 256 and 256 respectively, The width W 2 and height H 2 of the second layer are 128 and 128 respectively, refer to FIG. 3 .

(5.2)计算位移函数δ(t):(5.2) Calculate the displacement function δ(t):

式中,λc为空间临界波长,取值为16像素,设定放大倍数α取为15;In the formula, λ c is the spatial critical wavelength, which takes a value of 16 pixels, and sets the magnification factor α to 15;

(5.3)计算金字塔每一层的最大放大倍数α(n)max(5.3) Calculate the maximum magnification α(n) max of each layer of the pyramid:

以第1层和第2层为例,计算最大放大倍数的具体过程为:首先利用已知第一层的宽W1与高H1分别为256和256,第二层的宽W2与高H2分别为128和128,将其代入计算公式,计算每一层的空间波长,得到λ(1)=361.984和λ(2)=180.992,然后根据设定的空间临界波长λc=16和设定放大倍数α=15计算得到δ(t)=0.125,最后将这三个计算值代入,求得第一层和第二层的最大放大倍数分别为:α(1)max=119.661,α(2)max=59.331。Taking the first layer and the second layer as an example, the specific process of calculating the maximum magnification is as follows: First, the width W 1 and height H 1 of the first layer are known to be 256 and 256 respectively, and the width W 2 and height of the second layer are H 2 are 128 and 128 respectively, and they are substituted into the calculation formula to calculate the spatial wavelength of each layer to obtain λ(1)=361.984 and λ(2)=180.992, and then according to the set spatial critical wavelength λ c =16 and Set the magnification α=15 to calculate δ(t)=0.125, and finally substitute these three calculated values to obtain the maximum magnifications of the first layer and the second layer respectively: α(1) max =119.661, α (2) max = 59.331.

(6)得到第四空间频率带组步骤:(6) Obtain the fourth spatial frequency band group step:

将构成第三空间频率带组的各空间频率带分别与所述第一空间频率带组中相应的空间频率带进行矩阵加法运算,所得到的各空间频率带共同构成第 四空间频率带组;所述矩阵加法运算为两组对应尺度、对应位置的矩阵运算;performing matrix addition operation on each spatial frequency band constituting the third spatial frequency band group and corresponding spatial frequency bands in the first spatial frequency band group, and the obtained spatial frequency bands together form a fourth spatial frequency band group; The matrix addition operation is a matrix operation of two groups of corresponding scales and corresponding positions;

如图8所示,该图就是叠加后的空间频率带。此叠加过程是线性欧拉的核心近似部分,在线性欧拉视频运动放大中,其核心思想可以表述为:As shown in FIG. 8 , this figure is the superimposed spatial frequency band. This superposition process is the core approximation part of linear Euler. In linear Euler video motion amplification, its core idea can be expressed as:

假设一个一维图像中任意一个像素点的强度I(x)随着时间t的变化为I(x,t),将初始值写为I(x,0)=h(x),那么任意时刻该像素点的强度可以表示为I(x,t)=h(x+δ(t)),当物体的运动为小运动的时候,可以通过泰勒近似展开如式1所示:Assuming that the intensity I(x) of any pixel in a one-dimensional image changes with time t as I(x,t), and the initial value is written as I(x,0)=h(x), then at any time The intensity of the pixel point can be expressed as I(x,t)=h(x+δ(t)), when the motion of the object is small, it can be expanded by Taylor approximation as shown in formula 1:

在公式1中,h(x+δ(t))为图像原始像素点强度,表征着第一空间频率带,为表征物体的运动像素点强度变化,为了获取感兴趣的运动,可以用一个带通滤波器对第一空间频率带进行时域带通滤波。通过这种时域处理得到第二空间频率带,第二空间频率带可以用表示,将第二空间频率带的强度值乘以一个放大因子α,于是就得到了第三空间频率带,用表示第三空间频率带,再将其加到原始第一空间频率带中,用下式表示该相加过程:In formula 1, h(x+δ(t)) is the original pixel intensity of the image, which represents the first spatial frequency band, In order to characterize the change in intensity of moving pixels of the object, and to obtain the motion of interest, a band-pass filter may be used to perform time-domain band-pass filtering on the first spatial frequency band. The second spatial frequency band is obtained by this time-domain processing, and the second spatial frequency band can be used Indicates that the intensity value of the second spatial frequency band is multiplied by an amplification factor α, so that the third spatial frequency band is obtained, using Represent the third spatial frequency band, and then add it to the original first spatial frequency band, the addition process is represented by the following formula:

公式2右边还可以近似表示为:The right side of formula 2 can also be approximated as:

通过回加,就得到第四空间频率带,通过对比公式1的左边和公式3的右边,可以发现表征随着时间变化的运动被放大了(1+α)倍。By adding back, the fourth spatial frequency band is obtained. By comparing the left side of formula 1 with the right side of formula 3, it can be found that the motion representing the change with time is amplified by (1+α) times.

(7)重构亮度矩阵步骤:(7) Steps of reconstructing brightness matrix:

采用小波重构算法将第四空间频率带组重构YIQ色彩空间视频帧的Y4矩阵,具体过程如下:Adopt the wavelet reconstruction algorithm to reconstruct the Y4 matrix of the YIQ color space video frame with the fourth spatial frequency band group, the specific process is as follows:

对第四空间频率带组中不同金字塔层的每一层进行逐层重构,从金字塔第N层开始,采用小波重构算法,将构成第四空间频率带组中各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN 4与第N水平细节矩阵cHN 4、第N垂直细节 矩阵cVN 4和第N对角细节矩阵cDN 4重构第N-1近似系数矩阵cAN-1 4Each layer of the different pyramid layers in the fourth spatial frequency band group is reconstructed layer by layer. Starting from the Nth layer of the pyramid, the wavelet reconstruction algorithm will be used to form the YIQ color space video frame of each frame in the fourth spatial frequency band group. The Nth approximate coefficient matrix cA N 4 and the Nth horizontal detail matrix cH N 4 , the Nth vertical detail matrix cV N 4 and the Nth diagonal detail matrix cD N 4 reconstruct the N-1th approximate coefficient matrix cA N-1 4 ;

再进行金字塔第N-1层重构,对各帧YIQ色彩空间视频帧,采用小波重构算法,将上一层重构的第N-1近似系数矩阵cAN-1 4与第N-1水平细节矩阵cHN-1 4、第N-1垂直细节矩阵cVN-1 4、第N-1对角细节矩阵cDN-1 4重构第N-2近似系数矩阵cAN-2 4Then carry out the reconstruction of the N-1th layer of the pyramid, and use the wavelet reconstruction algorithm for each frame of YIQ color space video frame to combine the N-1th approximate coefficient matrix cA N-1 4 and the N-1th The horizontal detail matrix cH N-1 4 , the N-1th vertical detail matrix cV N-1 4 , the N-1th diagonal detail matrix cD N-1 4 reconstruct the N-2th approximate coefficient matrix cA N-2 4 ;

如此依次进行,直到得到重构的第1近似系数矩阵cA1 4;然后采用小波重构算法进行金字塔第1层重构,对各帧YIQ色彩空间视频帧,采用小波重构算法,将第1近似系数矩阵cA1 4与第1水平细节矩阵cH1 4、第1垂直细节矩阵cV1 4、第1对角细节矩阵cD1 4重构为Y4矩阵;Proceed in this way until the first reconstructed approximate coefficient matrix cA 1 4 is obtained; then the wavelet reconstruction algorithm is used to reconstruct the first layer of the pyramid, and for each frame of YIQ color space video frame, the wavelet reconstruction algorithm is used to transform the first The approximation coefficient matrix cA 1 4 and the first horizontal detail matrix cH 1 4 , the first vertical detail matrix cV 1 4 , and the first diagonal detail matrix cD 1 4 are reconstructed into a Y 4 matrix;

如图9所示,本实施例中,采用小波重构算法,将构成第四空间频率带组中各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN 4与第N水平细节矩阵cHN 4、第N垂直细节矩阵cVN 4和第N对角细节矩阵cDN 4重构第N-1近似系数矩阵cAN-1 4,包括下述子步骤:As shown in Figure 9, in this embodiment, the wavelet reconstruction algorithm is used to combine the Nth approximation coefficient matrix cA N4 and the Nth horizontal detail matrix cHN of each frame YIQ color space video frame in the fourth spatial frequency band group 4. The Nth vertical detail matrix cV N 4 and the Nth diagonal detail matrix cD N 4 reconstruct the N-1th approximate coefficient matrix cA N-1 4 , including the following sub-steps:

(7.1)对矩阵cAN 4进行行上采样,然后对行上采样后矩阵的每一列进行低通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行低通滤波得到AN1矩阵;(7.1) Perform row upsampling on the matrix cA N 4 , then perform low-pass filtering on each column of the row upsampled matrix, then perform column upsampling on the filtered matrix, and then perform row upsampling on each row of the matrix obtained by column upsampling A N1 matrix is obtained by low-pass filtering;

(7.2)对矩阵cHN 4进行行上采样,然后对行上采样后矩阵的每一列进行高通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行低通滤波得到AN2矩阵;(7.2) Perform row upsampling on the matrix cH N 4 , then perform high-pass filtering on each column of the matrix after row upsampling, then perform column upsampling on the filtered matrix, and then perform low-pass on each row of the matrix obtained by column upsampling Obtain A N2 matrix through filtering;

(7.3)对cVN 4矩阵进行行上采样,然后对行上采样后矩阵的每一列进行低通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行高通滤波得到AN3矩阵;(7.3) Perform row up-sampling on the cV N 4 matrix, then perform low-pass filtering on each column of the row-up-sampled matrix, then perform column up-sampling on the filtered matrix, and then perform on-column up-sampling to obtain each row of the matrix A N3 matrix is obtained by high-pass filtering;

(7.4)对cDN 4矩阵进行行上采样,然后对行上采样后矩阵的每一列进行高通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行高通滤波得到AN4矩阵;(7.4) Perform row upsampling on the cD N 4 matrix, then perform high-pass filtering on each column of the matrix after row upsampling, then perform column upsampling on the filtered matrix, and then perform high-pass on each row of the matrix obtained by column upsampling Filter to get A N4 matrix;

(7.5)将上述AN1矩阵、AN2矩阵、AN3矩阵和AN4矩阵进行矩阵加法运算得 到第N-1近似系数矩阵cAN-1 4(7.5) carry out matrix addition operation above-mentioned A N1 matrix, A N2 matrix, A N3 matrix and A N4 matrix obtain the N-1th approximation coefficient matrix cA N-1 4 ;

所谓矩阵行上采样,就是将矩阵的行数增加一倍,在原始矩阵任意两行之间插入一行零向量,最后对新构矩阵的最后一行补零;所谓矩阵列上采样,就是将矩阵的列数增加一倍,在原始矩阵任意两列之间插入一列零向量,最后对新构矩阵的最后一列补零;The so-called matrix row upsampling is to double the number of matrix rows, insert a row of zero vectors between any two rows of the original matrix, and finally fill the last row of the newly constructed matrix with zeros; the so-called matrix column upsampling is to multiply the matrix Double the number of columns, insert a column of zero vectors between any two columns of the original matrix, and finally fill the last column of the newly constructed matrix with zeros;

所述对行进行低通滤波就是将该行元素与小波低通滤波器系数求卷积,得到一行新元素值,代替原有行;The low-pass filtering of the row is to convolve the row element with the wavelet low-pass filter coefficient to obtain a row of new element values to replace the original row;

所述对行进行高通滤波就是将该行元素与小波高通滤波器系数求卷积,得到一行新元素值,代替原有行;Carrying out high-pass filtering to row is exactly to convolve this row element and wavelet high-pass filter coefficient, obtain a row of new element value, replace original row;

所述对列进行低通滤波就是将该列元素与小波低通滤波器系数求卷积,得到一列新元素值,代替原有列;The low-pass filtering of the column is to convolve the column elements with wavelet low-pass filter coefficients to obtain a column of new element values to replace the original column;

所述对列进行高通滤波就是将该列元素与小波高通滤波器系数求卷积,得到一列新元素值,代替原有列;Carrying out high-pass filtering to the column is to convolve the column elements with wavelet high-pass filter coefficients to obtain a column of new element values to replace the original column;

本实施例中,所采用的小波函数为coif5,通过查阅前述参考文件1和参考文件2,得到小波低通滤波器系数和小波高通滤波器系数如表1所列;In the present embodiment, the wavelet function adopted is coif5, by consulting aforementioned reference document 1 and reference document 2, obtain wavelet low-pass filter coefficient and wavelet high-pass filter coefficient as listed in Table 1;

(8)视频帧色彩空间还原步骤:(8) video frame color space restoration steps:

通过下式对步骤(7)重构的Y4矩阵、步骤(2)中的I矩阵和Q矩阵进行矩阵运算,得到新的R矩阵、G矩阵和B矩阵:Carry out matrix operation to the Y matrix in step ( 7 ) reconstruction, I matrix and Q matrix in step (2) by following formula, obtain new R matrix, G matrix and B matrix:

R=1.000Y4+0.956I+0.621Q,R= 1.000Y4 +0.956I+0.621Q,

G=1.000Y4-0.272I-0.647Q,G=1.000Y4-0.272I - 0.647Q,

B=1.000Y4-1.106I+1.703Q;B=1.000Y4-1.106I + 1.703Q;

新的R矩阵、G矩阵和B矩阵合成新RGB色彩空间视频帧;The new R matrix, G matrix and B matrix synthesize new RGB color space video frames;

依次对每一新YIQ色彩空间视频帧进行上述转换,就将YIQ色彩空间视频帧还原为RGB色彩空间视频帧;Carry out above-mentioned conversion to each new YIQ color space video frame successively, just YIQ color space video frame is restored to RGB color space video frame;

(9)输出视频图像步骤:(9) Output video image steps:

构造一个视频图像文件,包括头文件部分和数据部分,首先设置视频图 像文件存储位置,然后按照输入视频图像的头文件格式,构造输出视频图像的头文件,并将其写入硬盘指定位置,接着将每一帧视频帧数据硬盘指定位置,由此完成RGB色彩空间视频图像的构造。所构造的RGB色彩空间视频图像如图10所示,将其与图2对比,可以很明显的看到视频中的运动被放大了。Construct a video image file, including the header file part and the data part, first set the storage location of the video image file, then construct the header file of the output video image according to the header file format of the input video image, and write it to the specified location on the hard disk, and then Designate a location on the hard disk for each frame of video frame data, thereby completing the construction of the RGB color space video image. The constructed RGB color space video image is shown in Figure 10. Comparing it with Figure 2, it is obvious that the motion in the video is amplified.

表1 coif5低通滤波器系数和高通滤波器系数Table 1 coif5 low-pass filter coefficients and high-pass filter coefficients

Claims (5)

1.一种视频运动放大方法,包括视频图像分解步骤、视频帧色彩空间转换步骤、N层金字塔分解步骤、时域带通滤波步骤、第二空间频率带组放大步骤、得到第四空间频率带组步骤、重构亮度矩阵步骤、视频帧色彩空间还原步骤、输出视频图像步骤,其特征在于:1. A video motion amplification method, comprising a video image decomposition step, a video frame color space conversion step, an N-layer pyramid decomposition step, a time domain bandpass filtering step, a second spatial frequency band group amplification step, and obtaining the fourth spatial frequency band Group step, reconstruct brightness matrix step, video frame color space restoration step, output video image step, it is characterized in that: (1)视频图像分解步骤:(1) Video image decomposition steps: 录制运动主体在空间微小运动的RGB色彩空间视频图像,再根据时间先后将RGB色彩空间视频图像分解为一帧一帧的RGB色彩空间视频帧,读取所有的RGB色彩空间视频帧;Record the RGB color space video image of the moving subject moving slightly in space, and then decompose the RGB color space video image into RGB color space video frames frame by frame according to time, and read all the RGB color space video frames; (2)视频帧色彩空间转换步骤:(2) video frame color space conversion steps: 将每一RGB色彩空间视频帧用R矩阵、G矩阵、B矩阵三个二维矩阵表示,R矩阵表示像素点红颜色强度,表示像素点绿色强度,B矩阵表示像素点蓝色强度;Each RGB color space video frame is represented by three two-dimensional matrices of R matrix, G matrix, and B matrix. The R matrix represents the red color intensity of the pixel point, represents the green intensity of the pixel point, and the B matrix represents the blue intensity of the pixel point; 通过下式对R矩阵、G矩阵和B矩阵进行矩阵运算,得到YIQ色彩空间视频帧的Y矩阵、I矩阵和Q矩阵三个二维矩阵:Perform matrix operations on the R matrix, G matrix, and B matrix by the following formula to obtain three two-dimensional matrices of the Y matrix, I matrix, and Q matrix of the YIQ color space video frame: Y=0.299R+0.587G+0.114B,Y=0.299R+0.587G+0.114B, I=0.596R-0.275G-0.321B,I=0.596R-0.275G-0.321B, Q=0.212R-0.523G+0.311B;Q=0.212R-0.523G+0.311B; 其中,Y矩阵表示YIQ色彩空间视频帧各像素的亮度值,I矩阵表示YIQ色彩空间视频帧各像素从橙色到青色的颜色强度,Q矩阵表示表示YIQ色彩空间视频帧各像素从紫色到黄绿色的颜色强度;Among them, the Y matrix represents the brightness value of each pixel in the YIQ color space video frame, the I matrix represents the color intensity of each pixel in the YIQ color space video frame from orange to cyan, and the Q matrix represents the color intensity of each pixel in the YIQ color space video frame from purple to yellow-green the color intensity; (3)N层金字塔分解步骤:(3) N layer pyramid decomposition steps: 对各YIQ色彩空间视频帧中的Y矩阵,采用小波分解算法将其分解为四个矩阵:第1近似系数矩阵cA1、第1水平细节矩阵cH1、第1垂直细节矩阵cV1和第1对角细节矩阵cD1;此过程为第一层金字塔分解,cH1、cV1和cD1构成金字塔第一层;For the Y matrix in each YIQ color space video frame, use the wavelet decomposition algorithm to decompose it into four matrices: the first approximate coefficient matrix cA 1 , the first horizontal detail matrix cH 1 , the first vertical detail matrix cV 1 and the first Diagonal detail matrix cD 1 ; this process is the first layer of pyramid decomposition, cH 1 , cV 1 and cD 1 constitute the first layer of the pyramid; 再采用小波分解算法对第1近似系数矩阵cA1进行分解,将其分解为第2近似系数矩阵cA2、第2水平细节矩阵cH2、第2垂直细节矩阵cV2和第2对角细节矩阵cD2;此过程为第二层金字塔分解,cH2、cV2和cD2构成金字塔第二层;Then, the wavelet decomposition algorithm is used to decompose the first approximate coefficient matrix cA 1 into the second approximate coefficient matrix cA 2 , the second horizontal detail matrix cH 2 , the second vertical detail matrix cV 2 and the second diagonal detail matrix cD 2 ; this process is the second layer of pyramid decomposition, cH 2 , cV 2 and cD 2 constitute the second layer of the pyramid; 如此依次进行N次分解,最后得到第N近似系数矩阵cAN、第N水平细节矩阵cHN、第N垂直细节矩阵cVN和第N对角细节矩阵cDN;cAN、cHN、cVN和cDN构成金字塔第N层;N≥3,图片尺寸越大,N值越大,反之则N值越小;Carry out N times of decomposition in this way, and finally get the Nth approximate coefficient matrix cA N , the Nth horizontal detail matrix cH N , the Nth vertical detail matrix cV N and the Nth diagonal detail matrix cD N ; cA N , cH N , cV N and cD N constitute the Nth layer of the pyramid; N≥3, the larger the picture size, the larger the N value, otherwise the smaller the N value; 对所有YIQ色彩空间视频帧进行N次金字塔分解后,由各帧YIQ色彩空间视频帧的第n水平细节矩阵cHn组成尺度为n的水平细节空间频率带,由各帧YIQ色彩空间视频帧的第n垂直细节矩阵cVn组成尺度为n的垂直细节空间频率带,由各帧YIQ色彩空间视频帧的第n对角细节矩阵cDn组成尺度为n的对角细节空间频率带;其中n称为尺度,表示不同金字塔层,n=1、2、…、N;由各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN组成近似系数空间频率带;上述各空间频率带构成第一空间频率带组;After performing N times of pyramid decomposition on all YIQ color space video frames, the nth horizontal detail matrix cH n of each YIQ color space video frame forms a horizontal detail space frequency band with a scale of n, and each frame of YIQ color space video frame The nth vertical detail matrix cV n forms a vertical detail space frequency band with a scale of n, and the nth diagonal detail matrix cD n of each YIQ color space video frame forms a diagonal detail space frequency band with a scale of n; where n is called Be scale, represent different pyramid levels, n=1, 2, ..., N; The approximate coefficient space frequency band is formed by the Nth approximation coefficient matrix cA N of each frame YIQ color space video frame; Above-mentioned each space frequency band forms the first space frequency band group; (4)时域带通滤波步骤:(4) Steps of time-domain bandpass filtering: 采用第一低通IIR数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波,滤波后得到的各空间频率带构成第一临时空间频率带组;Using the first low-pass IIR digital filter to perform time-domain filtering on the spatial frequency bands forming the first spatial frequency band group respectively, and each spatial frequency band obtained after filtering constitutes the first temporary spatial frequency band group; 采用第二低通IIR数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波,滤波后得到的各空间频率带构成第二临时空间频率带组;The second low-pass IIR digital filter is used to perform time-domain filtering on each spatial frequency band forming the first spatial frequency band group respectively, and each spatial frequency band obtained after filtering forms a second temporary spatial frequency band group; 将第一临时空间频率带组中各空间频率带与第二临时空间频率带组中对应的各空间频率带相减,所得到的各空间频率带共同构成第二空间频率带组;Subtract each spatial frequency band in the first temporary spatial frequency band group from each corresponding spatial frequency band in the second temporary spatial frequency band group, and the resulting spatial frequency bands together form a second spatial frequency band group; 第一低通IIR数字滤波器和第二低通IIR数字滤波器的截止频率分别为f1和f2,0<f2<f1<fs/2,fs为视频图像的录制帧速率;The cut-off frequencies of the first low-pass IIR digital filter and the second low-pass IIR digital filter are f 1 and f 2 respectively, 0<f 2 <f 1 <f s /2, f s is the recording frame rate of the video image ; (5)第二空间频率带组放大步骤:(5) second spatial frequency band group amplification step: 分别计算金字塔每一层的最大放大倍数α(n)max,分别比较是否α(n)max≤α,是则将α(n)max作为相应层实际放大倍数,否则将α作为相应层实际放大倍数;其中α为设定放大倍数,5<α<30;Calculate the maximum magnification α(n) max of each layer of the pyramid separately, and compare whether α(n) max ≤ α, if yes, use α(n) max as the actual magnification of the corresponding layer, otherwise use α as the actual magnification of the corresponding layer Multiple; where α is the set magnification, 5<α<30; 将构成第二空间频率带组的各空间频率带按照其所在金字塔的层数分别乘以相应层实际放大倍数,所得到的各空间频率带共同构成第三空间频率带组;Each spatial frequency band forming the second spatial frequency band group is multiplied by the actual magnification factor of the corresponding layer according to the number of layers of the pyramid where it is located, and the resulting spatial frequency bands jointly form the third spatial frequency band group; (6)得到第四空间频率带组步骤:(6) Obtain the fourth spatial frequency band group step: 将构成第三空间频率带组的各空间频率带分别与所述第一空间频率带组中相应的空间频率带进行矩阵加法运算,所得到的各空间频率带共同构成第四空间频率带组;所述矩阵加法运算为两组对应尺度、对应位置的矩阵运算;performing matrix addition operation on each spatial frequency band constituting the third spatial frequency band group and corresponding spatial frequency bands in the first spatial frequency band group, and the obtained spatial frequency bands together form a fourth spatial frequency band group; The matrix addition operation is a matrix operation of two groups of corresponding scales and corresponding positions; (7)重构亮度矩阵步骤:(7) Steps of reconstructing brightness matrix: 采用小波重构算法将第四空间频率带组重构YIQ色彩空间视频帧的Y4矩阵,具体过程如下:Adopt the wavelet reconstruction algorithm to reconstruct the Y4 matrix of the YIQ color space video frame with the fourth spatial frequency band group, the specific process is as follows: 对第四空间频率带组中不同金字塔层的每一层进行逐层重构,从金字塔第N层开始,采用小波重构算法,将构成第四空间频率带组中各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN 4与第N水平细节矩阵cHN 4、第N垂直细节矩阵cVN 4和第N对角细节矩阵cDN 4重构第N-1近似系数矩阵cAN-1 4Each layer of the different pyramid layers in the fourth spatial frequency band group is reconstructed layer by layer. Starting from the Nth layer of the pyramid, the wavelet reconstruction algorithm is used to form the YIQ color space video frame of each frame in the fourth spatial frequency band group The Nth approximate coefficient matrix cA N 4 and the Nth horizontal detail matrix cH N 4 , the Nth vertical detail matrix cV N 4 and the Nth diagonal detail matrix cD N 4 reconstruct the N-1th approximate coefficient matrix cA N-1 4 ; 再进行金字塔第N-1层重构,对各帧YIQ色彩空间视频帧,采用小波重构算法,将上一层重构的第N-1近似系数矩阵cAN-1 4与第N-1水平细节矩阵cHN-1 4、第N-1垂直细节矩阵cVN-1 4、第N-1对角细节矩阵cDN-1 4重构第N-2近似系数矩阵cAN-2 4Then carry out the reconstruction of the N-1th layer of the pyramid, and use the wavelet reconstruction algorithm for each frame of YIQ color space video frame to combine the N-1th approximate coefficient matrix cA N-1 4 and the N-1th The horizontal detail matrix cH N-1 4 , the N-1th vertical detail matrix cV N-1 4 , the N-1th diagonal detail matrix cD N-1 4 reconstruct the N-2th approximate coefficient matrix cA N-2 4 ; 如此依次进行,直到得到重构的第1近似系数矩阵cA1 4;然后采用小波重构算法进行金字塔第1层重构,对各帧YIQ色彩空间视频帧,采用小波重构算法,将第1近似系数矩阵cA1 4与第1水平细节矩阵cH1 4、第1垂直细节矩阵cV1 4、第1对角细节矩阵cD1 4重构为Y4矩阵;Proceed in this way until the first reconstructed approximate coefficient matrix cA 1 4 is obtained; then the wavelet reconstruction algorithm is used to reconstruct the first layer of the pyramid, and for each frame of YIQ color space video frame, the wavelet reconstruction algorithm is used to transform the first The approximation coefficient matrix cA 1 4 and the first horizontal detail matrix cH 1 4 , the first vertical detail matrix cV 1 4 , and the first diagonal detail matrix cD 1 4 are reconstructed into a Y 4 matrix; (8)视频帧色彩空间还原步骤:(8) video frame color space restoration steps: 通过下式对步骤(7)重构的Y4矩阵、步骤(2)中的I矩阵和Q矩阵进行矩阵运算,得到新的R矩阵、G矩阵和B矩阵:Carry out matrix operation to the Y matrix in step ( 7 ) reconstruction, I matrix and Q matrix in step (2) by following formula, obtain new R matrix, G matrix and B matrix: R=1.000Y4+0.956I+0.621Q,R= 1.000Y4 +0.956I+0.621Q, G=1.000Y4-0.272I-0.647Q,G=1.000Y4-0.272I - 0.647Q, B=1.000Y4-1.106I+1.703Q;B=1.000Y4-1.106I + 1.703Q; 新的R矩阵、G矩阵和B矩阵合成新RGB色彩空间视频帧;The new R matrix, G matrix and B matrix synthesize new RGB color space video frames; 依次对每一新YIQ色彩空间视频帧进行上述转换,就将YIQ色彩空间视频帧还原为RGB色彩空间视频帧;Carry out above-mentioned conversion to each new YIQ color space video frame successively, just YIQ color space video frame is restored to RGB color space video frame; (9)输出视频图像步骤:(9) Output video image steps: 构造一个视频图像文件,包括头文件部分和数据部分,首先设置视频图像文件存储位置,然后按照输入视频图像的头文件格式,构造输出视频图像的头文件,并将其写入硬盘指定位置,接着将每一帧视频帧数据硬盘指定位置,由此完成RGB色彩空间视频图像的构造。Construct a video image file, including the header file part and the data part, first set the storage location of the video image file, then construct the header file of the output video image according to the header file format of the input video image, and write it to the specified location on the hard disk, and then Designate a location on the hard disk for each frame of video frame data, thereby completing the construction of the RGB color space video image. 2.如权利要求1所述的视频运动放大方法,其特征在于:2. video motion amplification method as claimed in claim 1, is characterized in that: 所述步骤(3)中,对Y矩阵,采用小波分解算法将其分解为四个矩阵包括下述子步骤:In described step (3), to Y matrix, adopting wavelet decomposition algorithm to decompose it into four matrices comprises the following substeps: (3.1)对Y矩阵的每一行进行低通滤波,然后进行列下采样,接着对每一列进行低通滤波,最后进行行下采样得到第1近似系数cA1矩阵;(3.1) carry out low-pass filtering to each row of Y matrix, then carry out column down-sampling, then carry out low-pass filtering to each column, carry out row down-sampling at last to obtain the first approximation coefficient cA 1 matrix; (3.2)对Y矩阵的每一行进行低通滤波,然后进行列下采样,接着对每一列进行高通滤波,最后进行行下采样得到第1水平细节cH1矩阵;(3.2) Low-pass filtering is carried out to each row of the Y matrix, then column down-sampling is performed, then each column is subjected to high-pass filtering, and row down-sampling is finally performed to obtain the first horizontal detail c H 1 matrix; (3.3)对Y矩阵的每一行进行高通滤波,然后进行列下采样,接着对每一列进行低通滤波,最后进行行下采样得到第1垂直细节cV1矩阵;(3.3) High-pass filtering is performed on each row of the Y matrix, then column downsampling is performed, then each column is low-pass filtered, and row downsampling is finally performed to obtain the first vertical detail cV 1 matrix; (3.4)对Y矩阵的每一行进行高通滤波,然后进行列下采样,接着对每一列进行高通滤波,最后进行行下采样得到第1对角细节cD1矩阵;(3.4) Carry out high-pass filtering to each row of Y matrix, then carry out column down-sampling, then carry out high-pass filtering to each column, finally carry out row down-sampling to obtain the first diagonal detail cD 1 matrix; 采用小波分解算法对第n近似系数矩阵cAn-1进行分解,子步骤与上述相同,n=1、2、…、N;Adopt wavelet decomposition algorithm to decompose the nth approximate coefficient matrix cA n-1 , the sub-steps are the same as above, n=1, 2, ..., N; 所述列下采样就是保留偶数列,丢弃奇数列;所述行下采样就是保留偶数行,丢弃奇数行;The column downsampling is to keep the even columns and discard the odd columns; the row downsampling is to keep the even rows and discard the odd rows; 所述对行进行低通滤波就是将该行元素与小波低通滤波器系数求卷积,得到一行新元素值,代替原有行;The low-pass filtering of the row is to convolve the row element with the wavelet low-pass filter coefficient to obtain a row of new element values to replace the original row; 所述对行进行高通滤波就是将该行元素与小波高通滤波器系数求卷积,得到一行新元素值,代替原有行;Carrying out high-pass filtering to row is exactly to convolve this row element and wavelet high-pass filter coefficient, obtain a row of new element value, replace original row; 所述对列进行低通滤波就是将该列元素与小波低通滤波器系数求卷积,得到一列新元素值,代替原有列;The low-pass filtering of the column is to convolve the column elements with wavelet low-pass filter coefficients to obtain a column of new element values to replace the original column; 所述对列进行高通滤波就是将该列元素与小波高通滤波器系数求卷积,得到一列新元素值,代替原有列;Carrying out high-pass filtering to the column is to convolve the column elements with wavelet high-pass filter coefficients to obtain a column of new element values to replace the original column; 所述小波低通滤波器系数和小波高通滤波器系数通过查阅相关文献可以得到。The coefficients of the wavelet low-pass filter and the wavelet high-pass filter can be obtained by consulting related documents. 3.如权利要求1所述的视频运动放大方法,其特征在于:3. video motion amplification method as claimed in claim 1, is characterized in that: 所述步骤(4)中,采用第一低通IIR数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波包括下述子步骤:In said step (4), adopting the first low-pass IIR digital filter to carry out time-domain filtering respectively to each spatial frequency band forming the first spatial frequency band group includes the following sub-steps: (4.1)计算低通IIR滤波器的滤波器系数r1(4.1) Calculate the filter coefficient r 1 of the low-pass IIR filter: r1=2πf1/fsr 1 =2πf 1 /f s , 式中f1为第一低通IIR数字滤波器的截止频率,fs为视频图像的录制帧速率;In the formula, f 1 is the cut-off frequency of the first low-pass IIR digital filter, and f s is the recording frame rate of the video image; (4.2)计算第一低通IIR数字滤波器的输出Y(m):(4.2) Calculate the output Y(m) of the first low-pass IIR digital filter: Y(m)=(1-r1)×Y(m-1)+r1×X(m),Y(m)=(1-r 1 )×Y(m-1)+r 1 ×X(m), 式中,X(m)为滤波器的输入,m为视频帧序号,m=1、2、…、K;K为视频帧的总帧数,当m为1,X(1)是已知的,Y(0)为:In the formula, X(m) is the input of the filter, m is the sequence number of the video frame, m=1, 2, ..., K; K is the total frame number of the video frame, when m is 1, X(1) is known , Y(0) is: YY (( 00 )) == 11 KK &Sigma;&Sigma; mm == 11 KK Xx (( mm )) ,, 采用第二低通IIR数字滤波器对构成第一空间频率带组的各空间频率带分别进行时域滤波,其过程与上述过程完全相同,区别仅在于将f1换成f2The second low-pass IIR digital filter is used to perform time-domain filtering on the spatial frequency bands constituting the first spatial frequency band group, the process is exactly the same as the above process, the only difference is that f 1 is replaced by f 2 . 4.如权利要求1所述的视频运动放大方法,其特征在于:4. video motion amplification method as claimed in claim 1, is characterized in that: 所述步骤(5)中,计算金字塔每一层的最大放大倍数α(n)max包括下述子步骤:In the described step (5), the maximum magnification α (n) max of calculating each layer of the pyramid comprises the following sub-steps: (5.1)计算金字塔每一层的空间波长λ(n):(5.1) Calculate the spatial wavelength λ(n) of each layer of the pyramid: &lambda;&lambda; (( nno )) == WW nno 22 ++ Hh nno 22 ,, nno == 11 ,, 22 ,, ...... ,, NN ;; 式中,Wn和Hn分别为金字塔第n层的宽与高,单位为像素;In the formula, W n and H n are the width and height of the nth layer of the pyramid respectively, and the unit is pixel; (5.2)计算位移函数δ(t):(5.2) Calculate the displacement function δ(t): &delta;&delta; (( tt )) == &lambda;&lambda; cc 88 (( 11 ++ &alpha;&alpha; )) ,, 式中,λc为空间临界波长,取值为16~20像素;In the formula, λ c is the spatial critical wavelength, and the value is 16 to 20 pixels; (5.3)计算金字塔每一层的最大放大倍数α(n)max(5.3) Calculate the maximum magnification α(n) max of each layer of the pyramid: &alpha;&alpha; (( nno )) mm aa xx == &lambda;&lambda; (( nno )) 33 &times;&times; 88 &times;&times; &delta;&delta; (( tt )) -- 1.1. 5.如权利要求1所述的视频运动放大方法,其特征在于:5. video motion amplification method as claimed in claim 1, is characterized in that: 所述步骤(7)中,采用小波重构算法,将构成第四空间频率带组中各帧YIQ色彩空间视频帧的第N近似系数矩阵cAN 4与第N水平细节矩阵cHN 4、第N垂直细节矩阵cVN 4和第N对角细节矩阵cDN 4重构第N-1近似系数矩阵cAN-1 4,包括下述子步骤:In the step (7), the wavelet reconstruction algorithm is used to form the Nth approximate coefficient matrix cA N 4 and the Nth horizontal detail matrix cH N 4 and the Nth level detail matrix cH N 4 of each frame YIQ color space video frame in the fourth spatial frequency band group. The N vertical detail matrix cV N 4 and the Nth diagonal detail matrix cD N 4 reconstruct the N-1th approximate coefficient matrix cA N-1 4 , including the following sub-steps: (7.1)对矩阵cAN 4进行行上采样,然后对行上采样后矩阵的每一列进行低通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行低通滤波得到AN1矩阵;(7.1) Carry out row upsampling to matrix cAN 4 , then perform low-pass filtering on each column of the matrix after row upsampling, then perform column upsampling on the filtered matrix, and then perform each row of the matrix obtained by column upsampling A N1 matrix is obtained by low-pass filtering; (7.2)对矩阵cHN 4进行行上采样,然后对行上采样后矩阵的每一列进行高通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行低通滤波得到AN2矩阵;(7.2) Perform row upsampling on the matrix cH N 4 , then perform high-pass filtering on each column of the matrix after row upsampling, then perform column upsampling on the filtered matrix, and then perform low-pass on each row of the matrix obtained by column upsampling Obtain A N2 matrix by filtering; (7.3)对cVN 4矩阵进行行上采样,然后对行上采样后矩阵的每一列进行低通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行高通滤波得到AN3矩阵;(7.3) Perform row up-sampling on the cV N 4 matrix, then perform low-pass filtering on each column of the row-up-sampled matrix, then perform column up-sampling on the filtered matrix, and then perform on-column up-sampling to obtain each row of the matrix A N3 matrix is obtained by high-pass filtering; (7.4)对cDN 4矩阵进行行上采样,然后对行上采样后矩阵的每一列进行高通滤波,接着对滤波后矩阵进行列上采样,再接着对列上采样得到矩阵的每一行进行高通滤波得到AN4矩阵;(7.4) Perform row upsampling on the cD N 4 matrix, then perform high-pass filtering on each column of the matrix after row upsampling, then perform column upsampling on the filtered matrix, and then perform high-pass on each row of the matrix obtained by column upsampling Filter to get A N4 matrix; (7.5)将上述AN1矩阵、AN2矩阵、AN3矩阵和AN4矩阵进行矩阵加法运算得到第N-1近似系数矩阵cAN-1 4(7.5) carry out matrix addition operation above-mentioned A N1 matrix, A N2 matrix, A N3 matrix and A N4 matrix obtain the N-1th approximation coefficient matrix cA N-1 4 ; 所谓矩阵行上采样,就是将矩阵的行数增加一倍,在原始矩阵任意两行之间插入一行零向量,最后对新构矩阵的最后一行补零;所谓矩阵列上采样,就是将矩阵的列数增加一倍,在原始矩阵任意两列之间插入一列零向量,最后对新构矩阵的最后一列补零;The so-called matrix row upsampling is to double the number of rows of the matrix, insert a row of zero vectors between any two rows of the original matrix, and finally fill the last row of the newly constructed matrix with zeros; the so-called matrix column upsampling is to multiply the matrix Double the number of columns, insert a column of zero vectors between any two columns of the original matrix, and finally fill the last column of the newly constructed matrix with zeros; 所述对行进行低通滤波就是将该行元素与小波低通滤波器系数求卷积,得到一行新元素值,代替原有行;The low-pass filtering of the row is to convolve the row element with the wavelet low-pass filter coefficient to obtain a row of new element values to replace the original row; 所述对行进行高通滤波就是将该行元素与小波高通滤波器系数求卷积,得到一行新元素值,代替原有行;Carrying out high-pass filtering to row is exactly to convolve this row element and wavelet high-pass filter coefficient, obtain a row of new element value, replace original row; 所述对列进行低通滤波就是将该列元素与小波低通滤波器系数求卷积,得到一列新元素值,代替原有列;The low-pass filtering of the column is to convolve the column elements with wavelet low-pass filter coefficients to obtain a column of new element values to replace the original column; 所述对列进行高通滤波就是将该列元素与小波高通滤波器系数求卷积,得到一列新元素值,代替原有列;Carrying out high-pass filtering to the column is to convolve the column elements with wavelet high-pass filter coefficients to obtain a column of new element values to replace the original column; 所述小波低通滤波器系数和小波高通滤波器系数通过查阅相关文献可以得到。The coefficients of the wavelet low-pass filter and the wavelet high-pass filter can be obtained by consulting related documents.
CN201611264001.2A 2016-12-30 2016-12-30 A kind of video motion amplification method Active CN106657713B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611264001.2A CN106657713B (en) 2016-12-30 2016-12-30 A kind of video motion amplification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611264001.2A CN106657713B (en) 2016-12-30 2016-12-30 A kind of video motion amplification method

Publications (2)

Publication Number Publication Date
CN106657713A true CN106657713A (en) 2017-05-10
CN106657713B CN106657713B (en) 2019-03-22

Family

ID=58837315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611264001.2A Active CN106657713B (en) 2016-12-30 2016-12-30 A kind of video motion amplification method

Country Status (1)

Country Link
CN (1) CN106657713B (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108433727A (en) * 2018-03-15 2018-08-24 广东工业大学 A kind of method and device of monitoring baby breathing
CN109063763A (en) * 2018-07-26 2018-12-21 合肥工业大学 Video minor change amplification method based on PCA
CN110517266A (en) * 2019-04-26 2019-11-29 深圳市豪视智能科技有限公司 Rope vibration detection method and related device
CN110595603A (en) * 2019-04-26 2019-12-20 深圳市豪视智能科技有限公司 Video-based Vibration Analysis Method and Related Products
CN110595749A (en) * 2019-04-26 2019-12-20 深圳市豪视智能科技有限公司 Electric fan vibration fault detection method and device
CN110617965A (en) * 2019-04-26 2019-12-27 深圳市豪视智能科技有限公司 Method for detecting gear set abnormality and related product
CN110631812A (en) * 2019-04-26 2019-12-31 深圳市豪视智能科技有限公司 Track vibration detection method and device, vibration detection equipment
CN111277833A (en) * 2020-01-20 2020-06-12 合肥工业大学 Multi-passband filter-based multi-target micro-vibration video amplification method
CN111476715A (en) * 2020-04-03 2020-07-31 三峡大学 Lagrange video motion amplification method based on image deformation technology
CN112597836A (en) * 2020-12-11 2021-04-02 昆明理工大学 Method for amplifying solar low-amplitude oscillation signal
CN112672072A (en) * 2020-12-18 2021-04-16 南京邮电大学 Segmented steady video amplification method based on improved Euler amplification
CN113791140A (en) * 2021-11-18 2021-12-14 湖南大学 Nondestructive testing method and system for bridge girder bottom interior based on local vibration response
CN114222033A (en) * 2021-11-01 2022-03-22 三峡大学 Adaptive Euler video amplification method based on empirical mode decomposition
CN114646381A (en) * 2022-03-30 2022-06-21 西安交通大学 A kind of rotating machinery vibration measurement method, system, equipment and storage medium
CN115797335A (en) * 2023-01-31 2023-03-14 武汉地震工程研究院有限公司 Euler movement amplification effect evaluation and optimization method for bridge vibration measurement

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101023662A (en) * 2004-07-20 2007-08-22 高通股份有限公司 Method and apparatus for motion vector processing
CN101957983A (en) * 2009-07-15 2011-01-26 吴云东 Light homogenizing method for digital image
CN103873875A (en) * 2014-03-25 2014-06-18 山东大学 Layering sub pixel motion estimation method for image super resolution
CN105303535A (en) * 2015-11-15 2016-02-03 中国人民解放军空军航空大学 Global subdivision pyramid model based on wavelet transformation
CN105956632A (en) * 2016-05-20 2016-09-21 浙江宇视科技有限公司 Target detection method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101023662A (en) * 2004-07-20 2007-08-22 高通股份有限公司 Method and apparatus for motion vector processing
CN101957983A (en) * 2009-07-15 2011-01-26 吴云东 Light homogenizing method for digital image
CN103873875A (en) * 2014-03-25 2014-06-18 山东大学 Layering sub pixel motion estimation method for image super resolution
CN105303535A (en) * 2015-11-15 2016-02-03 中国人民解放军空军航空大学 Global subdivision pyramid model based on wavelet transformation
CN105956632A (en) * 2016-05-20 2016-09-21 浙江宇视科技有限公司 Target detection method and device

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108433727A (en) * 2018-03-15 2018-08-24 广东工业大学 A kind of method and device of monitoring baby breathing
CN109063763A (en) * 2018-07-26 2018-12-21 合肥工业大学 Video minor change amplification method based on PCA
CN110595603B (en) * 2019-04-26 2022-04-19 深圳市豪视智能科技有限公司 Video-based vibration analysis method and related product
CN110517266A (en) * 2019-04-26 2019-11-29 深圳市豪视智能科技有限公司 Rope vibration detection method and related device
CN110595749A (en) * 2019-04-26 2019-12-20 深圳市豪视智能科技有限公司 Electric fan vibration fault detection method and device
CN110617965A (en) * 2019-04-26 2019-12-27 深圳市豪视智能科技有限公司 Method for detecting gear set abnormality and related product
CN110631812A (en) * 2019-04-26 2019-12-31 深圳市豪视智能科技有限公司 Track vibration detection method and device, vibration detection equipment
CN110595749B (en) * 2019-04-26 2021-08-20 深圳市豪视智能科技有限公司 Electric fan vibration fault detection method and device
CN110595603A (en) * 2019-04-26 2019-12-20 深圳市豪视智能科技有限公司 Video-based Vibration Analysis Method and Related Products
WO2021036637A1 (en) * 2019-04-26 2021-03-04 深圳市豪视智能科技有限公司 Gear set abnormality detection method and related product
WO2021042907A1 (en) * 2019-04-26 2021-03-11 深圳市豪视智能科技有限公司 Rope vibration measurement method and related apparatus
CN111277833B (en) * 2020-01-20 2022-04-15 合肥工业大学 Multi-passband filter-based multi-target micro-vibration video amplification method
CN111277833A (en) * 2020-01-20 2020-06-12 合肥工业大学 Multi-passband filter-based multi-target micro-vibration video amplification method
CN111476715A (en) * 2020-04-03 2020-07-31 三峡大学 Lagrange video motion amplification method based on image deformation technology
CN112597836B (en) * 2020-12-11 2023-07-07 昆明理工大学 A method for amplifying solar low-amplitude oscillation signals
CN112597836A (en) * 2020-12-11 2021-04-02 昆明理工大学 Method for amplifying solar low-amplitude oscillation signal
CN112672072A (en) * 2020-12-18 2021-04-16 南京邮电大学 Segmented steady video amplification method based on improved Euler amplification
CN114222033A (en) * 2021-11-01 2022-03-22 三峡大学 Adaptive Euler video amplification method based on empirical mode decomposition
CN114222033B (en) * 2021-11-01 2023-07-11 三峡大学 Adaptive Euler video amplification method based on empirical mode decomposition
CN113791140B (en) * 2021-11-18 2022-02-25 湖南大学 Bridge bottom interior nondestructive testing method and system based on local vibration response
CN113791140A (en) * 2021-11-18 2021-12-14 湖南大学 Nondestructive testing method and system for bridge girder bottom interior based on local vibration response
CN114646381A (en) * 2022-03-30 2022-06-21 西安交通大学 A kind of rotating machinery vibration measurement method, system, equipment and storage medium
CN114646381B (en) * 2022-03-30 2023-01-24 西安交通大学 Method, system, device and storage medium for measuring vibration of rotating machinery
CN115797335A (en) * 2023-01-31 2023-03-14 武汉地震工程研究院有限公司 Euler movement amplification effect evaluation and optimization method for bridge vibration measurement

Also Published As

Publication number Publication date
CN106657713B (en) 2019-03-22

Similar Documents

Publication Publication Date Title
CN106657713A (en) Video motion amplification method
CN109889800B (en) Image enhancement method and device, electronic equipment and storage medium
CN108090886B (en) A Display and Detail Enhancement Method for High Dynamic Range Infrared Image
JP5668105B2 (en) Image processing apparatus, image processing method, and image processing program
CN104835130A (en) Multi-exposure image fusion method
US20020118887A1 (en) Multiresolution based method for removing noise from digital images
CN111105352A (en) Super-resolution image reconstruction method, system, computer device and storage medium
CN103871041B (en) The image super-resolution reconstructing method built based on cognitive regularization parameter
Wei Image super‐resolution reconstruction using the high‐order derivative interpolation associated with fractional filter functions
CN106709875A (en) Compressed low-resolution image restoration method based on combined deep network
WO2007114363A1 (en) Image processing method
WO2007116543A1 (en) Image processing method
JP2008541282A (en) Continuous extension of discrete transforms for data processing.
CN112270646B (en) Super-resolution enhancement method based on residual dense skip network
CN105550989A (en) Image super-resolution method based on nonlocal Gaussian process regression
CN109559278A (en) Super resolution image reconstruction method and system based on multiple features study
CN113128583A (en) Medical image fusion method and medium based on multi-scale mechanism and residual attention
CN103400360A (en) Multi-source image fusing method based on Wedgelet and NSCT (Non Subsampled Contourlet Transform)
Liu et al. CNN-Enhanced graph attention network for hyperspectral image super-resolution using non-local self-similarity
Duanmu et al. The image super-resolution algorithm based on the dense space attention network
Hemalatha et al. Comparison of DWT, DWT-SWT, and DT-CWT for low resolution satellite images enhancement
CN113902618B (en) Image super-resolution algorithm based on multi-modal spatial filtering
CN111476743B (en) A Digital Signal Filtering and Image Processing Method Based on Fractional Differentiation
CN106251288B (en) Subpixel image synthesis method of dual line array imaging device based on multi-resolution analysis
CN115314025A (en) Time-Vertex Joint Graph Filter Bank and Design Method Based on Joint Graph Frequency Domain Sampling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载