A video frame alignment method

By extracting the spatial and temporal characteristics of video frames and calculating the feature description vectors of significant video frame sequences, it solves the problems of ignoring temporal characteristics and complex calculations in the existing technology, and achieves simple and efficient video frame alignment, which is suitable for video quality and resolution. rates are different.

CN114567780BActive Publication Date: 2024-08-23HANGZHOU ARCVIDEO TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210182828.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2024-08-23
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

Existing video frame alignment methods ignore the temporal characteristics of the video, are computationally complex, and have poor applicability. They perform poorly especially when the video quality is severely lost or the resolution is inconsistent.

Method used

By extracting the spatial and temporal features of the video frame, calculate the feature description vector of the significant video frame sequence, find the frame offset position to achieve frame alignment, use the Sobel filter and standard deviation to calculate the spatial feature, and determine the best value based on the sum of feature vector distances. Best frame offset position.

Benefits of technology

A simple and efficient video frame alignment method is implemented, which is suitable for situations with large differences in video quality and different resolutions, and improves the applicability and accuracy of alignment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114567780B
    Figure CN114567780B
Patent Text Reader

Abstract

The present invention discloses a video frame alignment method. It specifically includes the following steps: (1) selecting a short segment of video frames from the starting position of the source video and the damaged video, extracting the spatial features and temporal features of the video frame components, and obtaining a one-dimensional vector containing the spatial features and the temporal features; (2) segmenting the selected source video frame and the damaged video frame according to a certain step length, and finding a frame number with the largest change in feature description vector distance in each segment, storing these frame numbers in an array, and obtaining a significant video frame sequence; (3) according to the significant video frame sequence of one video, calculating the sum of the feature vector distances of the significant video frame sequences of the two videos at a given frame offset position in another video; (4) selecting the frame offset position with the smallest sum of feature vector distances. The beneficial effects of the present invention are: the selection is based on the spatial characteristics and temporal characteristics of the video, which is simple, efficient, and highly applicable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field related to video quality assessment, and in particular to a video frame alignment method. Background Art

[0002] Video quality assessment refers to the perception, measurement and evaluation of the changes and distortions of two video image information with the same main content in a subjective and objective way.

[0003] The subjective evaluation method is already mature, and the ITU-R BT.500 recommendation has a detailed description of the relevant method, but its biggest disadvantage is that it is time-consuming and labor-intensive. The objective evaluation method is mainly based on the statistical characteristics of the video and the establishment of a human eye system model to design an algorithm tool to evaluate the video quality.

[0004] When performing video quality assessment, whether using subjective or objective evaluation technology, a prerequisite must be met, that is, aligning the video frames in the damaged video with the corresponding video frames in the source video. How to align the video frames in the damaged video with the corresponding video frames in the source video is a technical problem that technicians in this field need to solve.

[0005] There are some methods for video frame alignment, such as those described in CN110493638B and CN109743591A. The alignment is mainly based on the two indicators of PSNR and SSMI. These two indicators are used to compare the quality of two videos, and there will be a lot of repeated calculations in the middle. When the video quality loss is more serious, the applicability of this indicator will also deteriorate. In addition, if the resolution of the compared videos is inconsistent, additional preprocessing operations are required.

[0006] In summary, the main problem with this method is that it ignores the characteristics of a single video, especially the temporal characteristics of the video, and the calculation is relatively complex and has low applicability. Summary of the invention

[0007] The present invention aims to overcome the above-mentioned deficiencies in the prior art and provides a video frame alignment method with strong adaptability.

[0008] In order to achieve the above object, the present invention adopts the following technical solutions:

[0009] A video frame alignment method specifically comprises the following steps:

[0010] (1) A short segment of video frames is selected from the starting position of the source video and the damaged video, and the spatial features and temporal features of the video frame components are extracted to obtain a one-dimensional vector containing the spatial features and the temporal features as a feature description vector of the video frame;

[0011] (2) Extraction of salient video frame sequences: Segment the selected source video frames and damaged video frames according to a certain step size, and find a frame number with the largest change in feature description vector distance in each segment. Store these frame numbers in an array to obtain a salient video frame sequence as an anchor point for video frame alignment.

[0012] (3) Based on the salient video frame sequence of one video, the sum of the feature vector distances of the salient video frame sequences of the two videos at a given frame offset position is calculated in another video as a basis for determining whether the frame offset is the optimal position;

[0013] (4) Select the frame offset position with the smallest sum of feature vector distances, which is the frame offset position of the two videos.

[0014] The present invention selects spatial and temporal characteristics based on the video, which can be calculated separately and change little with the spontaneous reduction of video quality. A simple, efficient and highly applicable frame alignment method is proposed, which is suitable for situations where video quality varies greatly and resolutions are different.

[0015] Preferably, in step (1), the specific method is as follows: selectively crop the given video length through the video decoding module and decode it into YUV format, read the Y, U, and V component information of each video frame according to the YUV format obtained after decoding, and use the component information of the video frame to calculate the spatial feature SI of the current video frame; use the component information of the current video and the previous video frame to calculate the temporal feature TI of the current video frame.

[0016] Preferably, the video is decoded by a video decoding module. After decoding, the video resolution, decoded YUV file and YUV file type are obtained, and the video length is cropped to a certain extent. Only a segment of the video is selected to ensure that the cropped video frame length is greater than 2 times the maximum possible frame offset. The selected video frame length is L, and the maximum possible frame offset is maxdiff, then L>=maxdiff*2 must be satisfied.

[0017] Preferably, the spatial feature SI is based on a Sobel filter. The video frame is first convolution filtered using a Sobel filter, and then the standard deviation of the pixels in each frame filtered by the Sobel filter is calculated to obtain the spatial feature of the current frame.

[0018]

[0019] Where Y[n] represents the Y component matrix of the nth frame, and K h and K v represents horizontal and vertical filter convolution kernels;

[0020] The temporal feature TI is to calculate the standard deviation of the difference between the current frame and the previous frame.

[0021] TI=std(Y[n+1]-Y[n])

[0022] In this way, the spatial feature SI and temporal feature TI feature sequences of the source video frame and the damaged video frame are obtained, which are respectively recorded as the spatial feature SI of the source video frame and the temporal feature TI of the damaged video frame. a [n], spatial features SI of damaged video frames b [n] and the temporal characteristics TI of the source video frame a [n], Temporal characteristics TI of damaged video frames b [n], and use the one-dimensional vector containing two as the feature description vector of the video frame, the source video feature description vector is recorded as ρ a [n], the damaged video feature description vector is denoted as ρ b [n],

[0023] ρ a [n]=[SI a [n],TI a [n]]

[0024] ρ b [n]=[SI b [n],TI b [n]].

[0025] Preferably, in step (2), the specific method is as follows: based on the feature value description vector sequence of the video frame sequence, a certain number of video frame sequences with the largest stage-by-stage changes are selected from the sequence, specifically: according to the set step length step, the video frame sequence is evenly divided into p segments, and a frame number with the largest feature description vector distance change is calculated in each segment, and the significant video frame sequences of the source video and the damaged video are respectively recorded as f a [n], f b [n], where the number of segments p = L / step, and the feature description vector distances of the source video and the damaged video are denoted by d a d b , whose vector representation is:

[0026]

[0027]

[0028] Preferably, in step (3), the specific method is as follows: based on the significant video frame sequence in step (2), the sum of the feature vector distances of the significant video frame sequences of the two videos at a given frame offset position is calculated in another video as a basis for judging whether the frame offset is the optimal position, and the sum of the feature vector distances is recorded as m, and the calculation formula of m is:

[0029]

[0030]

[0031] Where diff represents the current frame offset, diff∈[0,L / 2], m ab Indicates the frame delay of the source video compared to the damaged video, m ba Indicates that the damaged video is delayed compared to the source video.

[0032] Preferably, in step (4), the specific method is as follows: calculate the corresponding sum of feature vector distances when taking values ​​of all frame offsets, select the smallest value among all values, and the diff value at this time is the position where the two video frames are aligned, and record the smallest sum of feature vector distances as m min , then:

[0033] m min =min(m ba [n],m ab [n])

[0034] Where m ba [n],m ab [n] represents the sequence calculated corresponding to the frame offset diff within its value range; the final determined m min The corresponding diff value is the frame offset of the two videos. If the minimum value is in m ba [n] is found, the damaged video is said to be delayed than the source video, otherwise it means that the source video is delayed than the damaged video.

[0035] The beneficial effects of the present invention are: the spatial and temporal characteristics of the video are selected, the characteristics can be calculated separately, and the characteristics change little as the video quality decreases spontaneously, and a simple, efficient and highly applicable frame alignment method is proposed, which is suitable for situations where the video quality varies greatly and the resolution is different. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0037] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.

[0038] like Figure 1 In the embodiment described, a video frame alignment method specifically includes the following steps:

[0039] (1) A short segment of video frames is selected from the starting position of the source video and the damaged video, and the spatial features and temporal features of the video frame components are extracted to obtain a one-dimensional vector containing the spatial features and the temporal features as a feature description vector of the video frame;

[0040] The specific method is as follows: selectively crop the given video length through the video decoding module and decode it into YUV format; read the Y, U, and V component information of each video frame according to the YUV format obtained after decoding; use the component information of the video frame to calculate the spatial feature SI of the current video frame; use the component information of the current video and the previous video frame to calculate the temporal feature TI of the current video frame.

[0041] The video is decoded by the video decoding module. After decoding, the video resolution, decoded YUV file and YUV file type are obtained, and the video length is cropped to a certain extent. Only a section of the video is selected to ensure that the cropped video frame length is greater than 2 times the maximum possible frame offset. The selected video frame length is L, and the maximum possible frame offset is maxdiff, then L>=maxdiff*2 must be satisfied.

[0042] The spatial feature SI is based on the Sobel filter. The video frame is first convolution filtered with the Sobel filter, and then the standard deviation of the pixels in each frame filtered by the Sobel filter is calculated to obtain the spatial feature of the current frame.

[0043]

[0044] Where Y[n] represents the Y component matrix of the nth frame, and K h and K v represents horizontal and vertical filter convolution kernels;

[0045]

[0046]

[0047] The temporal feature TI is to calculate the standard deviation of the difference between the current frame and the previous frame.

[0048] TI=std(Y[n+1]-Y[n])

[0049] In this way, the spatial feature SI and temporal feature TI feature sequences of the source video frame and the damaged video frame are obtained, which are respectively recorded as the spatial feature SI of the source video frame and the temporal feature TI of the damaged video frame. a [n], spatial features SI of damaged video frames b [n] and the temporal characteristics TI of the source video frame a [n], Temporal characteristics TI of damaged video frames b[n], and use the one-dimensional vector containing two as the feature description vector of the video frame, the source video feature description vector is recorded as ρ a [n], the damaged video feature description vector is denoted as ρ b [n],

[0050] ρ a [n]=[SI a [n],TI a [n]]

[0051] ρ b [n]=[SI b [n],TI b [n]].

[0052] In addition, if you need to extract video features from more dimensions, you can extract SI and TI feature values ​​for the three components Y, U, and V of the video, so that the number of feature frames becomes 6. Here, only the SI and TI feature values ​​of the Y component are extracted, so the number of feature values ​​is 2. The methods used by the two are the same.

[0053] (2) Extraction of salient video frame sequences: Segment the selected source video frames and damaged video frames according to a certain step size, and find a frame number with the largest change in feature description vector distance in each segment. Store these frame numbers in an array to obtain a salient video frame sequence as an anchor point for video frame alignment.

[0054] The specific method is as follows: according to the feature value description vector sequence of the video frame sequence, a certain number of video frame sequences with the largest stage changes are selected from them. Specifically, according to the set step size step, the video frame sequence is divided into p segments, and a frame number with the largest feature description vector distance change is calculated in each segment. The significant video frame sequences of the source video and the damaged video are respectively recorded as f a [n], f b [n], where the number of segments p = L / step. In particular, when the step size is 1, the sequence of salient video frames is the same as the original video sequence. The distance between the feature description vectors of the source video and the damaged video is denoted by d a d b , whose vector representation is:

[0055]

[0056]

[0057] (3) Based on the salient video frame sequence of one video, the sum of the feature vector distances of the salient video frame sequences of the two videos at a given frame offset position is calculated in another video as a basis for determining whether the frame offset is the optimal position;

[0058] The specific method is as follows: Based on the salient video frame sequence in step (2), the sum of the feature vector distances of the salient video frame sequences of the two videos at a given frame offset position is calculated in another video as a basis for judging whether the frame offset is the optimal position. The sum of the feature vector distances is recorded as m, and the calculation formula of m is:

[0059]

[0060]

[0061] Where diff represents the current frame offset, diff∈[0,L / 2], m ab Indicates the frame delay of the source video compared to the damaged video, m ba Indicates that the damaged video is delayed compared to the source video.

[0062] (4) Select the frame offset position with the smallest sum of feature vector distances, which is the frame offset position of the two videos;

[0063] The specific method is as follows: Calculate the sum of the corresponding feature vector distances when taking all frame offset values, select the smallest value among all values, and the diff value at this time is the position where the two video frames are aligned. The smallest feature vector distance sum is recorded as m min , then:

[0064] m min =min(m ba [n],m ab [n])

[0065] Where m ba [n],m ab [n] represents the sequence calculated corresponding to the frame offset diff within its value range;

[0066] The final m min The corresponding diff value is the frame offset of the two videos. If the minimum value is in m ba [n] is found, the damaged video is said to be delayed than the source video, otherwise it means that the source video is delayed than the damaged video.

[0067] The present invention selects spatial and temporal characteristics based on the video, which can be calculated separately and change little with the spontaneous reduction of video quality. A simple, efficient and highly applicable frame alignment method is proposed, which is suitable for situations where video quality varies greatly and resolutions are different.

Claims

1. A video frame alignment method, characterized in that: The specific steps include: (1) A short segment of video frames is selected from the starting position of the source video and the damaged video, and the spatial features and temporal features of the video frame components are extracted to obtain a one-dimensional vector containing the spatial features and the temporal features as a feature description vector of the video frame; (2) Extraction of salient video frame sequences: Segment the selected source video frames and damaged video frames according to a certain step size, and find a frame number with the largest change in feature description vector distance in each segment. Store these frame numbers in an array to obtain a salient video frame sequence as an anchor point for video frame alignment. (3) Based on the salient video frame sequence of one video, the sum of the feature vector distances of the salient video frame sequences of the two videos at a given frame offset position is calculated in another video as a basis for determining whether the frame offset is the optimal position; (4) Select the frame offset position with the smallest sum of feature vector distances, which is the frame offset position of the two videos.

2. A video frame alignment method according to claim 1, characterized in that: In step (1), the specific method is as follows: selectively crop the given video length through the video decoding module and decode it into YUV format, read the Y, U, and V component information of each video frame according to the YUV format obtained after decoding, and use the component information of the video frame to calculate the spatial feature SI of the current video frame; use the component information of the current video and the previous video frame to calculate the temporal feature TI of the current video frame.

3. A video frame alignment method according to claim 2, characterized in that: The video is decoded by the video decoding module. After decoding, the video resolution, decoded YUV file and YUV file type are obtained, and the video length is cropped to a certain extent. Only a section of the video is selected to ensure that the cropped video frame length is greater than 2 times the maximum possible frame offset. The selected video frame length is L, and the maximum possible frame offset is maxdiff, then L>=maxdiff*2 must be satisfied.

4. A video frame alignment method according to claim 2 or 3, characterized in that the space The feature SI is based on the Sobel filter. The video frame is first convolution filtered with the Sobel filter, and then the standard deviation of the pixels in each frame filtered by the Sobel filter is calculated to obtain the spatial features of the current frame. Where Y[n] represents the Y component matrix of the nth frame, and K h and K v represents horizontal and vertical filter convolution kernels; The temporal feature TI is to calculate the standard deviation of the difference between the current frame and the previous frame. TI=std(Y[n+1]-Y[n]) In this way, the spatial feature SI and temporal feature TI feature sequences of the source video frame and the damaged video frame are obtained. They are respectively denoted as the spatial features SI of the source video frame a [n], spatial features SI of damaged video frames b [n] and the temporal characteristics TI of the source video frame a [n], Temporal characteristics TI of damaged video frames b [n], and use the one-dimensional vector containing two as the feature description vector of the video frame, and the source video feature description vector is recorded as ρ a [n], the damaged video feature description vector is denoted as ρ b [n], ρ a [n]=[SI a [n],IT a [n]] ρ b [n]=[SI b [n],IT b [n]].

5. A video frame alignment method according to claim 4, characterized in that: In step (2), the specific method is as follows: according to the feature value description vector sequence of the video frame sequence, a certain number of video frame sequences with the largest stage changes are selected from them. Specifically, according to the set step size step, the video frame sequence is divided into p segments, and a frame number with the largest feature description vector distance change is calculated in each segment. The significant video frame sequences of the source video and the damaged video are respectively recorded as f a [n], f b [n], where the number of segments p = L / step, and the feature description vector distances of the source video and the damaged video are denoted by d a ,d b , whose vector representation is:

6. A video frame alignment method according to claim 5, characterized in that, In step (3), the specific method is as follows: based on the significant video frame sequence in step (2), the sum of the feature vector distances of the significant video frame sequences of the two videos at a given frame offset position is calculated in another video as a basis for judging whether the frame offset is the optimal position. The sum of the feature vector distances is recorded as m, and the calculation formula of m is: Where diff represents the current frame offset, diff∈[0,L / 2], m ab Indicates the frame delay of the source video compared to the damaged video, m ba Indicates that the damaged video is delayed compared to the source video.

7. A video frame alignment method according to claim 6, characterized in that: In step (4), the specific method is as follows: calculate the corresponding sum of feature vector distances for all frame offset values, select the smallest value among all values, and the diff value at this time is the position where the two video frames are aligned. The smallest sum of feature vector distances is recorded as m min , then: m min =min(m ba [ n ], m ab [n]) Where m ba [n],m ab [n] represents the sequence calculated corresponding to the frame offset diff within its value range; the final determined m min The corresponding diff value is the frame offset of the two videos. If the minimum value is in m ba [n] is found, the damaged video is said to be delayed than the source video, otherwise it means that the source video is delayed than the damaged video.

Citation Information

Patent Citations

  • Video frame alignment method

    CN109743591A

  • Video frame alignment methods, devices, electronic devices, and readable storage media

    CN110493638B

  • Video quality assessing apparatus, video quality assessing method, video quality assessing program, video aligning apparatus, video aligning method, and video aligning program

    CA2525812A1

  • Variable frame rate audio feature extraction method

    CN105448290A

  • Video frame alignment method and device, electronic equipment and readable storage medium

    CN110493638A