A real-time video processing and intelligent analysis method based on edge computing

By detecting moving objects and matching feature points in video frames in edge computing devices, dividing coding blocks, and screening HEVC prediction modes, the problem of excessive selection of prediction modes in HEVC technology is solved, and the efficiency and real-time performance of real-time video coding are improved.

CN118509607BActive Publication Date: 2024-09-27DIANJI NETWORK TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410968764.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-09-27
Estimated Expiration
2044-07-19

AI Technical Summary

Technical Problem

HEVC technology selects too many prediction modes during real-time video encoding, resulting in increased coding complexity, ignoring the correlation between motion features and feature information directions in the video, and reducing the processing efficiency of video compression and coding by edge computing devices.

Method used

By detecting moving objects within video frames in edge computing devices, constructing motion mask images, matching feature points, determining posture motion vectors and single-point posture vectors, dividing coding blocks based on this information, reducing prediction direction and mode selection, using HEVC technology Filter intra prediction angles, build prediction selection queues, and reduce coding complexity.

Benefits of technology

It improves the efficiency and real-time performance of real-time video encoding, reduces encoding time, reduces the computing load of edge computing devices, and improves the processing efficiency of video compression and encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118509607B
    Figure CN118509607B
Patent Text Reader

Abstract

The present application relates to the field of video coding technology, and proposes a real-time video processing and intelligent analysis method based on edge computing, including: transmitting real-time video to an edge computing device; determining a motion mask image based on the detection result of a moving object, and determining a feature point matching result based on the matching degree of the object movement features between adjacent video frames; determining a posture motion vector and a single-point posture vector based on the matching result; determining a consistency feature value based on the similarity between the single-point posture vector and the posture motion vector of a feature point in a sub-block of a coding block; determining a PU partitioning mode based on the consistency feature value; determining a prediction selection queue based on the direction angle corresponding to the feature point in the PU block and the intra-frame prediction angle; and using HEVC technology to encapsulate the real-time video into a NAL stream based on the prediction selection queue to complete the analysis and processing of the real-time video. The present application reduces the number of intra-frame prediction modes and reduces the encoding time by screening the intra-frame prediction angle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video coding technology, and specifically to a real-time video processing and intelligent analysis method based on edge computing. Background Art

[0002] With the development of smart devices and communication networks, the requirements for real-time video image processing are getting higher and higher. The traditional centralized cloud computing model cannot meet the real-time requirements. Edge computing technology moves computing and data storage to the edge of the network, that is, to the device or terminal, to reduce data transmission delays, improve response speed and reduce network bandwidth requirements, thereby achieving real-time video image processing, such as preprocessing of video image enhancement and denoising, video image recognition, and video image encoding and compression.

[0003] In the process of processing real-time video, edge computing completes the processing and analysis of real-time video data through related calculations on video processing devices such as cameras and encoders, and realizes real-time encoding, compression and transmission of videos. At present, High Efficiency Video Coding (HEVC) is one of the mainstream technologies used in real-time video compression coding. When HEVC technology performs intra-frame prediction on video data, the prediction mode selection is expanded from 8 in H.264 to 35, resulting in greatly increased coding complexity while improving prediction accuracy. However, in a video sequence, only a few video frames are doing relative motion, and there is a lot of redundant information or many similar contents in the previous and next frames in time. Too many prediction options not only ignore the correlation between the motion features and feature information directions in real-time video, but also reduce the processing efficiency of edge computing devices for video compression coding. Summary of the invention

[0004] The present application provides a real-time video processing and intelligent analysis method based on edge computing, which improves the efficiency of edge computing devices in real-time video encoding and reduces encoding complexity by reducing the number of prediction directions and prediction modes when HEVC technology is used to encode real-time videos in each edge node.

[0005] In a first aspect, an embodiment of the present application provides a real-time video processing and intelligent analysis method based on edge computing, the method comprising:

[0006] Transmitting the real-time video acquired by the edge node to the edge computing device of the edge node;

[0007] Determine a motion mask image of each video frame based on a detection result of a moving object in each frame of the real-time video, and determine a feature point matching result between the motion mask images based on a matching degree of object movement features between adjacent video frames in the real-time video;

[0008] Determine the posture motion vector and the single-point posture vector based on the feature point matching results between the motion mask images of adjacent video frames;

[0009] The real-time video is divided into a large number of coding blocks by using HEVC technology, and the consistency feature values ​​between the sub-blocks are determined based on the similarity between the single-point posture vector and the posture motion vector of the feature point in the sub-block in each coding block;

[0010] In each edge computing device, a PU partitioning mode when the HEVC technology performs predictive encoding on the real-time video is determined based on the consistency feature value, and a PU block partitioning result is obtained;

[0011] The prediction selection queue is determined based on the direction angle of the single-point posture vector of each feature point in the PU block and the 33 preset intra-frame prediction angles in the HEVC technology;

[0012] HEVC technology is used to encapsulate the real-time video in each edge computing device into a NAL stream based on the prediction selection queue to complete the analysis and processing of the real-time video.

[0013] In the above scheme, firstly, feature points are obtained by detecting moving objects in adjacent video frames in real-time video, and a motion mask image of each video frame is constructed, so as to determine the matching results between feature points in the motion mask images of adjacent video frames, and the motion center of mass of each video frame is subsequently determined by extracting and matching feature points; secondly, the posture motion vector of each video frame and the single-point posture vector of each feature point are respectively obtained through the matching results of feature points in adjacent video frames, so as to complete the quantification of the overall motion state and single-point movement of each video frame; then, the consistency feature values ​​between sub-blocks are obtained by analyzing the similarity of the motion trend characteristics of objects between sub-blocks in the coding block, and the PU division mode of CTU is determined by combining the rate-distortion criterion; then, for each inter-frame prediction frame, the PU in each CTU is progressively determined according to different calculation results. The partitioning conditions are used to realize adaptive partitioning within different CTUs, so that when encoding real-time video, one coding unit is encoded using as few bits as possible; then, the possibility index of each intra-frame prediction angle is calculated based on the angle deviation between the direction angle of the single-point posture vector of the feature point in the PU block and the 33 intra-frame prediction angles preset in the HEVC technology, and the possibility of each intra-frame prediction angle being selected is evaluated; and the 33 intra-frame prediction angles are screened based on the possibility index, and a prediction selection queue is constructed to obtain a prediction mode, so that the number of the entire intra-frame prediction modes is less than 35, which reduces the real-time video encoding time and improves the real-time performance of video encoding; finally, the VCL data sequence is encapsulated into a NAL stream through the network abstraction layer NAL, and the NAL stream is stored in each edge node to complete localized real-time video processing analysis and storage.

[0014] In combination with the first aspect above, in a possible implementation manner, the method for determining the motion mask image of each video frame based on the detection result of the moving object in each frame of the real-time video is:

[0015] Taking two adjacent video frames as input, using the optical flow method to determine the pixels in motion in the video frames;

[0016] In each video frame, a connected domain of all the pixels is obtained, and the grayscale values ​​of the pixels outside the connected domain are set to 0, so as to obtain a motion mask image of each video frame.

[0017] In the above scheme, the pixels in motion are determined by tracking the movement status in adjacent video frames, and the motion mask image of each video frame is obtained by masking the pixels that are not in motion, thereby reducing the interference of the pixels that are not in motion on the subsequent feature point detection and improving the efficiency of feature point detection.

[0018] In combination with the first aspect above, in a possible implementation manner, the method for determining the feature point matching result between motion mask images based on the matching degree of object movement features between adjacent video frames in the real-time video is:

[0019] The motion mask images of two adjacent video frames are taken as input, and the feature points in each motion mask image are obtained by using the feature point detection method. The matching results of the feature points in the two motion mask images are obtained by using the feature point matching method.

[0020] In the above scheme, the feature points in each motion mask image are first determined by the feature point detection method, and then the matching results between the feature points in adjacent video frames are determined by feature point matching, so as to facilitate the subsequent determination of the overall motion centroid of each video frame.

[0021] In combination with the first aspect above, in a possible implementation manner, the method for determining the posture motion vector and the single-point posture vector based on the feature point matching results between motion mask images of adjacent video frames is:

[0022] In each motion mask image, the centroid point in each motion mask image is determined using the position information of the successfully matched feature points;

[0023] The vector determined by the line connecting the centroid point in the motion mask image of each video frame and the centroid point in the motion mask image of the next adjacent video frame is used as the posture motion vector of each video frame;

[0024] Each feature point in the motion mask image of each video frame is taken as a starting point, a matching feature point of the feature point is taken as an end point, and each vector pointing from the starting point to the end point is taken as a single-point posture vector of the feature point.

[0025] In the above scheme, the center of mass point in each video frame is determined by the position information of all feature points in the motion mask image of each video frame, so as to determine the posture motion vector of each video frame and the single-point posture vector of each feature point, so as to realize quantification of the overall motion state and single-point movement of each video frame. The posture movement direction is determined based on the feature point matching result. When some pixels are lost due to the overlap of foreground and background, the posture movement direction of the moving object in the continuous video frames can be accurately evaluated, so as to facilitate the subsequent analysis of the motion trend characteristics between the sub-blocks of the coding block.

[0026] In combination with the first aspect above, in a possible implementation manner, the method for determining the consistency feature value between sub-blocks based on the similarity between the single-point posture vector and the posture motion vector of the feature point in the sub-block in each coding block is:

[0027] The similarity measurement result between the single-point posture vector of each feature point in each sub-block of the coding block and the posture motion vector of the video frame where the feature point is located is used as the trend feature value of the feature point;

[0028] The sequence composed of all the trend feature values ​​in each sub-block is used as the trend feature sequence of each sub-block, and the similarity measurement result between the trend feature sequences of two sub-blocks is used as the consistency feature value between the two sub-blocks.

[0029] In the above scheme, the trend feature value of the feature point is obtained by calculating the similarity between the single-point posture vector of each feature point in the sub-block and the posture motion vector of the video frame where the feature point is located, so as to measure the motion trend of the single feature point and the entire video frame; then, the consistency feature value between the sub-blocks is determined by using the similarity between the trend feature sequences composed of the trend feature values ​​of all the feature points in the sub-block, and the proximity of the motion directions of the two sub-blocks is evaluated by the consistency between the motion trend of the feature points in the sub-block and the motion trend of the entire video frame, so as to facilitate the subsequent determination of the PU division mode of different coding blocks.

[0030] In combination with the first aspect above, in a possible implementation manner, in each edge computing device, the method for determining the PU partitioning mode when the HEVC technology predictively encodes the real-time video based on the consistency feature value is:

[0031] Calculate the cumulative sum of the absolute values ​​of the differences between the pixel values ​​of each CTU in the inter-frame prediction frame and the pixel values ​​of the same position in the CTU in the previous video frame as the initial difference value of each CTU;

[0032] If the initial difference value of each CTU is less than or equal to the preset value, each CTU continues to use the PU division mode of the CTU at the same position in the previous video frame;

[0033] If the initial difference value is greater than a preset value, respectively calculating consistency feature values ​​between any two sub-blocks in each coding block of the CTU;

[0034] If the consistency feature values ​​between sub-blocks in the coding block are equal, the PU partition mode of 2N×2N and skip is performed;

[0035] If the consistency feature values ​​between sub-blocks in the coding block are not equal, the sum of the consistency feature values ​​between the sub-blocks in the horizontal direction and the vertical direction in the coding block is calculated as the horizontal consistency feature value and the vertical consistency feature value respectively;

[0036] If the horizontal consistency eigenvalue is greater than the vertical consistency eigenvalue, the PU partitioning modes of 2N×2N, 2N×N and skip are performed;

[0037] If the horizontal consistency eigenvalue is equal to the vertical consistency eigenvalue, a 2N×2N PU partitioning mode is performed;

[0038] If the horizontal consistency eigenvalue is smaller than the vertical consistency eigenvalue, PU partitioning modes of 2N×2N, N×2N and skip are performed.

[0039] In the above scheme, firstly, the initial difference value of each CTU is determined by the pixel value difference of the pixel points in the CTU in adjacent video frames, and the first PU division mode is determined by using the initial difference value and the preset value; secondly, the second PU division mode is determined based on whether the consistency feature values ​​between any two sub-blocks in each coding block of the CTU are equal; thereafter, for the case where the consistency feature values ​​between the sub-blocks are unequal, the horizontal consistency feature value and the vertical consistency feature value are obtained by the consistency feature values ​​of the sub-blocks in the horizontal direction and the vertical direction respectively, and a plurality of PU division modes are determined based on the comparison results of the horizontal consistency feature value and the vertical consistency feature value, and the PU division modes in the CTU under different situations are progressively determined by comparing a plurality of calculation results, so that the rate-distortion performance during real-time video processing is better.

[0040] In combination with the first aspect above, in a possible implementation, the method for determining the prediction selection queue based on the direction angle of the single-point posture vector of each feature point in the PU block and the 33 intra-frame prediction angles preset in the HEVC technology is:

[0041] Determine the possibility index of 33 preset intra-frame prediction angles based on the direction angle of the single-point posture vector of the feature point in the divided PU block;

[0042] The possibility indexes of 33 intra-frame prediction angles are taken as input, and the segmentation threshold is obtained using the Otsu threshold method. Each intra-frame prediction angle with a possibility index greater than the segmentation threshold is taken as a prediction direction, and the sequence composed of all prediction directions is taken as the prediction selection queue.

[0043] In the above scheme, the possibility of each intra-frame prediction angle as a prediction direction is evaluated by the angle deviation between the direction angle of the unidirectional posture vector of the feature point in the PU block and the 33 intra-frame prediction angles preset in the HEVC technology. Secondly, the segmentation threshold of the possibility index is obtained by using the Otsu threshold segmentation algorithm. The prediction direction is determined by screening the segmentation threshold, thereby reducing the encoding complexity when encoding real-time video.

[0044] In combination with the first aspect, in a possible implementation manner, the method for determining the possibility index of the preset 33 intra-frame prediction angles based on the direction angle of the single-point posture vector of the feature point in the divided PU block is:

[0045] The sum of the absolute values ​​of the differences between the direction angles of the single-point posture vectors of all feature points in each PU block and the predicted angles of each intra-frame is taken as the cumulative angle deviation of the predicted angles of each intra-frame;

[0046] The ratio of the sum of the angle cumulative deviations of all intra-frame prediction angles to the angle cumulative deviation of each intra-frame prediction angle is used as the possibility index of each intra-frame prediction angle.

[0047] In the above scheme, the cumulative sum of the absolute values ​​of the angular differences between each intra-frame prediction angle and the direction angle is calculated as the angle cumulative deviation of each intra-frame prediction angle, which is used to evaluate the possibility of each intra-frame prediction angle as a prediction direction, so as to facilitate the subsequent use of the possibility index to screen the prediction direction.

[0048] In combination with the first aspect above, in a possible implementation manner, the method of encapsulating the real-time video in each edge computing device into a NAL stream based on the prediction selection queue using HEVC technology is:

[0049] Using HEVC technology to encode real-time video into VCL data sequence based on prediction selection queue;

[0050] The network abstraction layer NAL in HEVC technology is used to encapsulate the VCL data sequence into a NAL stream, and the NAL stream is stored in each edge node.

[0051] In the above scheme, the video coding layer and the network extraction layer in the HEVC technology are used to process the real-time video respectively to obtain the VCL data sequence and the NAL stream, so as to facilitate the subsequent processing of the real-time video by the edge node.

[0052] In combination with the first aspect above, in a possible implementation manner, the method of encoding the real-time video into a VCL data sequence based on the prediction selection queue using HEVC technology is:

[0053] Add planar mode and DC mode to the prediction selection queue to get the intra prediction mode;

[0054] The HEVC technology is used to encode the real-time video in the video coding layer based on the division result of the PU block and the intra-frame prediction mode to obtain a VCL data sequence.

[0055] In the above scheme, by adding planar mode and DC mode to the prediction selection queue, it can be ensured that after the prediction mode is screened, the real-time video still has a high encoding efficiency. Through the effective screening of 35 prediction modes in HEVC technology, the encoding time of edge computing devices when processing real-time video is reduced, and the processing efficiency is improved.

[0056] In a second aspect, a real-time video processing and intelligent analysis system based on edge computing is provided, the system comprising:

[0057] A first acquisition module, used to transmit the real-time video acquired by the edge node to the edge computing device of the edge node;

[0058] A matching module is used to determine a motion mask image of each video frame based on the detection result of the moving object in each frame of the real-time video, and determine the feature point matching result between the motion mask images based on the matching degree of the object movement features between adjacent video frames in the real-time video;

[0059] A second acquisition module is used to determine the posture motion vector and the single-point posture vector respectively based on the feature point matching results between the motion mask images of adjacent video frames;

[0060] A calculation module, used to divide the real-time video into a large number of coding blocks using HEVC technology, and determine the consistency feature values ​​between the sub-blocks based on the similarity between the single-point posture vector and the posture motion vector of the feature point in the sub-block in each coding block;

[0061] A PU partitioning module is used to determine, in each edge computing device, a PU partitioning mode when the HEVC technology predictively encodes the real-time video based on the consistency feature value, and obtain a PU block partitioning result;

[0062] A direction selection module is used to determine a prediction selection queue based on the direction angle of the single-point posture vector of each feature point in the PU block and 33 preset intra-frame prediction angles in the HEVC technology;

[0063] The video processing module is used to encapsulate the real-time video in each edge computing device into a NAL stream based on the prediction selection queue using HEVC technology to complete the analysis and processing of the real-time video.

[0064] In a third aspect, a server is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the device executes the method in the first aspect or any possible implementation of the first aspect.

[0065] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0067] Figure 1 A flowchart of a real-time video processing and intelligent analysis method based on edge computing provided by an embodiment of the present application;

[0068] Figure 2 A schematic diagram of real-time video segmentation provided by an embodiment of the present application;

[0069] Figure 3 Another flowchart of a real-time video processing and intelligent analysis method based on edge computing provided by an embodiment of the present application;

[0070] Figure 4 A schematic diagram of a posture motion vector and a single-point posture vector provided by an embodiment of the present application;

[0071] Figure 5 A schematic diagram of the structure of a real-time video processing and intelligent analysis system based on edge computing provided for one embodiment of the present application. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0073] See also Figure 1 , which shows a flow chart of a real-time video processing and intelligent analysis method based on edge computing provided by an embodiment of the present application, the method comprising the following steps:

[0074] 101, transmitting the real-time video acquired by the edge node to the edge computing device of the edge node.

[0075] In each edge node, a video acquisition device is used to obtain local real-time video in real time, and the video acquisition device transmits the real-time video to the edge computing device in the edge computing system through the edge computing access network ECA (Edge Computing Access). Among them, the video acquisition device includes but is not limited to surveillance cameras, pan-tilt heads, and recording devices; the real-time video includes but is not limited to real-time road monitoring video, real-time underwater monitoring video, and real-time target monitoring video; the edge computing device includes but is not limited to intelligent video analyzers, intelligent analysis gateways, and computers.

[0076] 102, determining a motion mask image of each video frame based on a detection result of a moving object in each frame of the real-time video, and determining a feature point matching result between the motion mask images based on a matching degree of object movement features between adjacent video frames in the real-time video.

[0077] Here, before using HEVC technology to encode the real-time video in the edge device of each node, it is necessary to divide the real-time video into coding tree blocks CTB, coding blocks CB, prediction blocks PB and transform blocks TB through sequence division, image division, block division, etc. The division process is as follows: Figure 2 As shown, the real-time video is divided into multiple video sequences, each video sequence 21 is divided into multiple continuous video frame groups 22, each video frame group contains multiple video frames, each video frame 23 is divided into multiple coding tree blocks, each coding tree block 24 can be divided into multiple coding blocks, and each coding block 25 is composed of a prediction block 26 and a transform block 27. In the coding tree unit CTU, the CU larger than the minimum coding block must traverse 8 inter-frame PU division modes, 2 intra-frame PU division modes and skip mode.

[0078] For each edge node, for each moving object in the real-time video, the coding blocks corresponding to different areas of the object have similar motion directions and strong consistency in motion trends; in the background area of ​​the video, the coding blocks corresponding to different positions are all stationary, and the complexity of the image information between the sub-blocks is relatively close, so PU division can be performed based on the consistency characteristics of the coding blocks.

[0079] For objects in motion in real-time video, the motion of the objects may be complex and changeable, but the motion state of the objects in each frame of adjacent video frames has a unique motion posture. Even if the motion amplitudes of different positions of the objects are inconsistent, the overall trend of the two motion postures in adjacent video frames is fixed, that is, the posture features of the objects have a more stable and higher similarity. Therefore, in the present application, the prediction direction is screened based on the similarity of the posture features of the objects in the adjacent frames of each frame. The more similar the prediction direction is to the posture features in the encoded reference block or adjacent video frames, the more necessary the prediction direction should be. The similarity of the posture features of the object is determined by the matching results of the feature points in the adjacent video frames, that is, step 102 is performed by Figure 3 The steps shown achieve:

[0080] 301, determine feature points in adjacent video frames in the real-time video using an optical flow method.

[0081] Specifically, any two adjacent video frames in the real-time video are used as input, and the optical flow method is used to detect the pixels of the moving objects in the two video frames, and the connected domain is extracted for the pixels to obtain the moving objects in each video frame. Secondly, in each video frame, the gray value of any pixel outside the connected domain is set to 0 to obtain the motion mask image of each video frame. Among them, the optical flow method is a well-known technology, and the specific process is not repeated here.

[0082] Furthermore, the motion mask image of each video frame is taken as input, and the feature points in each video frame are output using a feature point detection method, wherein the feature point detection method includes but is not limited to SIFT feature point detection, SURF feature point detection, FAST feature point detection, and ORB feature point detection.

[0083] 302 : Determine a matching result between feature points in two adjacent video frames by using a feature point matching method.

[0084] Here, the result of feature point matching depends on the similarity between the feature points. In one embodiment of the present application, the feature points in two adjacent video frames are used as input, and the feature point matching result is obtained by using the matcher in the ORB feature point detector.

[0085] In another embodiment of the present application, all feature points in each video frame and the feature descriptor of each feature point are obtained respectively. It should be noted that the dimensions of the feature descriptors obtained by each feature point detection method are the same. The cosine similarity between each feature point in each video frame and the feature descriptor of any feature point in the adjacent video frame of each video frame is calculated, and the feature point corresponding to the maximum value of the cosine similarity between the feature descriptors of each feature point in each video frame is used as the feature point that successfully matches each feature point in each video frame. The calculation of cosine similarity is a well-known technology, and the specific process is not repeated. It should be noted that if there are multiple adjacent video frames with the maximum cosine similarity between a feature point in the current video frame, the Euclidean distance between the feature points is calculated, and the feature point corresponding to the minimum value of the Euclidean distance is used as the feature point that successfully matches the feature point in the current video frame. For example, if there are multiple feature points in the a+1th frame and the cosine similarity of the feature descriptors between the i-th feature point in the a-th video frame is the maximum value, then the feature point with the minimum Euclidean distance between the i-th feature point is taken as the feature point that successfully matches the i-th feature point.

[0086] It should be understood that this embodiment only provides a similarity measurement method between feature descriptors, namely, calculating the cosine similarity between feature descriptors. In other embodiments, other similarity measurement methods may be used as long as the purpose of measuring the similarity of feature descriptors between feature points can be achieved.

[0087] 103 , determining a posture motion vector and a single-point posture vector based on feature point matching results between motion mask images of adjacent video frames.

[0088] Here, the posture motion vector is used to characterize the overall motion trend of the moving object in each video frame, and a single posture vector is used to characterize the motion trend of a single feature point in each video frame.

[0089] Specifically, in the motion mask image of each video frame, the centroid point is determined based on the coordinate information of all successfully matched feature points as the centroid point of the moving object in the motion mask image. The vector determined by the line connecting the centroid point of the moving object in the motion mask image of each video frame and the centroid point of the moving object in the next adjacent frame is used as the posture motion vector of each video frame, such as Figure 4 As shown in 41 in the figure; each feature point in the motion mask image of each video frame is taken as the starting point, the feature point successfully matched by the starting point in the motion mask image of the next frame of each video frame is taken as the end point, and the vector pointing from the starting point to the end point is taken as a single point posture vector, such as Figure 442 in the figure. In the present application, only the successfully matched feature points are used to determine the centroid, and the posture motion vector is constructed to represent the overall motion direction. When some pixels are lost due to the overlap of foreground and background, the posture motion direction of the moving object in the continuous video frames can still be accurately evaluated.

[0090] 104 , determining consistency feature values ​​between sub-blocks based on the similarity between the single-point posture vector and the posture motion vector of the feature point in the sub-block in each coding block.

[0091] Here, the consistency feature value is used to characterize the consistency of the motion trend between two sub-blocks in the same coding block. The larger the consistency feature value, the more similar the motion trend characteristics of the moving objects in the two sub-blocks are. The higher the similarity of the motion trend characteristics between the sub-blocks, the larger the PU division mode should be used in the coding block to save coding bits while reducing rate distortion. The smaller the consistency feature value, the greater the difference in motion trend characteristics of the moving objects in the two sub-blocks, and the greater the difference between the motion directions, the more finely the coding block should be divided to achieve better rate distortion performance.

[0092] Specifically, for each coding block, the Pearson correlation coefficient between the single-point posture vector of each feature point in each sub-block of the coding block and the posture motion vector of the video frame where the feature point is located is calculated as the trend feature value of the feature point, and the sequence composed of the trend feature values ​​of all feature points in each sub-block is taken as the trend feature sequence of each sub-block.

[0093] It should be noted that this embodiment only provides a similarity measurement method between vectors, namely, calculating the Pearson correlation coefficient between the single-point posture vector and the posture motion vector. In other embodiments, other similarity measurement methods between vectors may be used so long as the purpose of similarity measurement between vectors can be achieved.

[0094] 105. In each edge computing device, a PU partitioning mode when the HEVC technology is used to predictively encode the real-time video is determined based on the consistency feature value to obtain a PU block partitioning result.

[0095] It can be seen from the rate-distortion criterion of video coding that under a certain distortion, a coding unit is encoded using as few bits as possible. Therefore, when the edge computing device of each edge node encodes the real-time video, the PU partition mode of the CTU of the inter-frame prediction frame is determined based on the consistency feature value between the sub-blocks of the coding block, while the traditional PU partition mode of the CTU of the inter-frame prediction frame is determined based on the change between the same positions in adjacent video frames. The process of determining the PU partition mode within each CTU is as follows:

[0096] S1: Calculate the sum of the absolute values ​​of the differences between the pixel values ​​of the current CTU and the CTU with the same spatial position in the previous video frame as the initial difference value of the current CTU. If the initial difference value of the current CTU is less than or equal to V times the initial difference value of the CTU with the same spatial position in the previous video frame, continue to use the PU division mode in the CTU with the same spatial position in the previous video frame. In this embodiment, the value of V is 0.5; otherwise, go to S2;

[0097] S2: Calculate the consistency feature values ​​between sub-blocks in each coding block in the CTU; if the consistency feature values ​​between all sub-blocks in each coding block are equal, perform the PU partition mode of 2N×2N and skip; otherwise, determine the PU partition mode based on the consistency feature values ​​between sub-blocks in the horizontal and vertical directions;

[0098] S3: The sum of the consistency eigenvalues ​​between the sub-blocks in the horizontal direction and the vertical direction is used as the horizontal consistency eigenvalue and the vertical consistency eigenvalue respectively. When the horizontal consistency eigenvalue is equal to the vertical consistency eigenvalue, the PU partition mode of 2N×2N is performed; when the horizontal consistency eigenvalue is greater than the vertical consistency eigenvalue, the PU partition modes of 2N×2N, 2N×N and skip are performed; when the horizontal consistency eigenvalue is less than the vertical consistency eigenvalue, the PU partition modes of 2N×2N, N×2N and skip are performed.

[0099] Here, the PU division condition in each CTU is progressively determined through multiple calculation results between CTUs with the same spatial position between adjacent frames, so as to realize adaptive division in different CTUs, so that when encoding real-time video, one coding unit is encoded using as few bits as possible.

[0100] 106 , determining a prediction selection queue based on the direction angle of the single-point posture vector of each feature point in the PU block and 33 intra-frame prediction angles preset in the HEVC technology.

[0101] For each video frame, after completing the division of the PU block according to the above step 105, the present application further screens the prediction direction based on the division result of the PU block to further speed up the coding efficiency. For each feature point in the PU, the direction angle of the single-point posture vector of each feature point is calculated respectively. During encoding, the PU block and the feature points of the moving objects in its adjacent pixel blocks should have a strong correlation in the direction of motion. Therefore, the prediction direction of the necessity of screening based on all the said direction angles in the PU block and the 33 intra-frame prediction angles in HEVC is considered. In one embodiment of the present application, the process of screening the necessary prediction direction is as follows:

[0102] s1: Divide the angular space of 33 prediction directions on the prediction plane, count the differences between the direction angles of all feature points in the entire PU block and the 33 intra-frame prediction angles, and calculate the possibility index of each angle based on the differences:

[0103] , is the probability index of the i-th intra-frame prediction angle, is the sum of the absolute values ​​of the differences between the direction angles of all feature points and the predicted angles within the i-th frame. It is the sum of the absolute values ​​of the differences between the direction angles of all feature points and the 33 intra-frame prediction angles. The larger the probability index of the i-th intra-frame prediction angle, the more consistent the i-th intra-frame prediction angle is with the motion direction of the feature points in the PU block, and the more important it is in coding prediction;

[0104] s2: Take the possibility index of all 33 angle values ​​as input, use the Otsu threshold method to determine the segmentation threshold, select all angles corresponding to the possibility index greater than the segmentation threshold as prediction directions, and form a prediction selection queue with the selected prediction directions. The Otsu threshold algorithm is a well-known technology, and the specific process will not be repeated. It should be noted that if the possibility index greater than the segmentation threshold is less than 5, the 5 corresponding angles with the largest possibility index are selected to form a queue. The purpose of this is to ensure the accuracy of inter-frame prediction;

[0105] s3: In order to ensure high coding efficiency after filtering the prediction modes, planar mode and DC mode are added as intra-frame prediction modes in the prediction selection queue. After the above filtering process, the number of intra-frame prediction modes is significantly less than 35, which not only reduces the coding time but also improves the real-time performance of coding.

[0106] 107. Encapsulate the real-time video in each edge computing device into a NAL stream based on the prediction selection queue using HEVC technology to complete the analysis and processing of the real-time video.

[0107] In one embodiment of the present application, in each edge node, the process of encoding real-time video using HEVC technology is as follows:

[0108] In the edge computing device of each edge node, the real-time video is sent to the video coding layer of the HEVC coding technology. According to the above process, the PU division mode within the CTU in each inter-frame prediction frame and the intra-frame prediction mode are determined respectively. The real-time coding result of the real-time video, that is, the VCL data sequence, is obtained through the video coding layer.

[0109] Furthermore, in order to facilitate the subsequent analysis and storage of real-time videos of all nodes, the VCL data sequence is transmitted to the network abstraction layer NAL, the VCL data sequence is encapsulated into a NAL stream, and each edge computing device is used to complete the processing of local real-time video data. Secondly, after obtaining the NAL stream, the NAL stream obtained by each edge computing device is transmitted to the local video stream storage system of the edge node, and localized data processing is completed at each edge node.

[0110] In the present application, firstly, feature points are obtained by detecting moving objects in adjacent video frames in real-time video, and a motion mask image of each video frame is constructed, so as to determine the matching results between feature points in the motion mask images of adjacent video frames, and the motion center of mass of each video frame is subsequently determined by extracting and matching feature points; secondly, the posture motion vector of each video frame and the single-point posture vector of each feature point are respectively obtained through the matching results of feature points in adjacent video frames, so as to complete the quantification of the overall motion state and single-point movement of each video frame; then, the consistency feature values ​​between the sub-blocks are obtained by analyzing the similarity of the motion trend characteristics of objects between sub-blocks in the coding block, and the PU division mode of the CTU is determined in combination with the rate-distortion criterion; thereafter, for each inter-frame prediction frame, the PU division mode in each CTU is progressively determined according to different calculation results. According to the conditions, adaptive division within different CTUs is realized, so that when encoding real-time video, one coding unit is encoded with as few bits as possible; then, the possibility index of each intra-frame prediction angle is calculated based on the angle deviation between the direction angle of the single-point posture vector of the feature point in the PU block and the 33 intra-frame prediction angles preset in the HEVC technology, and the possibility of each intra-frame prediction angle being selected is evaluated; and the 33 intra-frame prediction angles are screened based on the possibility index, and a prediction selection queue is constructed to obtain a prediction mode, so that the number of the entire intra-frame prediction modes is less than 35, which reduces the real-time video encoding time and improves the real-time performance of video encoding; finally, the VCL data sequence is encapsulated into a NAL stream through the network abstraction layer NAL, and the NAL stream is stored in each edge node to complete localized real-time video processing, analysis and storage.

[0111] Secondly, a real-time video processing and intelligent analysis system based on edge computing is provided, such as Figure 5 As shown, the system 500 includes:

[0112] A first acquisition module 501 is used to transmit the real-time video acquired by the edge node to the edge computing device of the edge node;

[0113] A matching module 502 is used to determine a motion mask image of each video frame based on the detection result of the moving object in each frame of the real-time video, and determine a feature point matching result between the motion mask images based on the matching degree of the object movement features between adjacent video frames in the real-time video;

[0114] A second acquisition module 503 is used to determine the posture motion vector and the single-point posture vector respectively based on the feature point matching results between the motion mask images of adjacent video frames;

[0115] A calculation module 504 is used to divide the real-time video into a large number of coding blocks using HEVC technology, and determine the consistency feature value between the sub-blocks based on the similarity between the single-point posture vector and the posture motion vector of the feature point in the sub-block in each coding block;

[0116] A PU partitioning module 505 is used to determine, in each edge computing device, a PU partitioning mode when the HEVC technology predictively encodes the real-time video based on the consistency feature value, and obtain a PU block partitioning result;

[0117] A direction selection module 506, configured to determine a prediction selection queue based on a direction angle of a single-point posture vector of each feature point in the PU block and 33 preset intra-frame prediction angles in the HEVC technology;

[0118] The video processing module 507 is used to encapsulate the real-time video in each edge computing device into a NAL stream based on the prediction selection queue using HEVC technology to complete the analysis and processing of the real-time video.

[0119] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A real-time video processing and intelligent analysis method based on edge computing, characterized in that: The method comprises the following steps: Transmitting the real-time video acquired by the edge node to the edge computing device of the edge node; Determine a motion mask image of each video frame based on a detection result of a moving object in each frame of the real-time video, and determine a feature point matching result between the motion mask images based on a matching degree of object movement features between adjacent video frames in the real-time video; Determine the posture motion vector and the single-point posture vector based on the feature point matching results between the motion mask images of adjacent video frames; The real-time video is divided into a large number of coding blocks by using HEVC technology, and the consistency feature values ​​between the sub-blocks are determined based on the similarity between the single-point posture vector and the posture motion vector of the feature point in the sub-block in each coding block; In each edge computing device, a PU partitioning mode when the HEVC technology performs predictive encoding on the real-time video is determined based on the consistency feature value, and a PU block partitioning result is obtained; The prediction selection queue is determined based on the direction angle of the single-point posture vector of each feature point in the PU block and the 33 preset intra-frame prediction angles in the HEVC technology; Using HEVC technology to encapsulate the real-time video in each edge computing device into a NAL stream based on the prediction selection queue, and complete the analysis and processing of the real-time video; The method for determining the posture motion vector and the single-point posture vector based on the feature point matching results between the motion mask images of adjacent video frames is: In each motion mask image, the centroid point in each motion mask image is determined using the position information of the successfully matched feature points; The vector determined by the line connecting the centroid point in the motion mask image of each video frame and the centroid point in the motion mask image of the next adjacent video frame is used as the posture motion vector of each video frame; Each feature point in the motion mask image of each video frame is taken as a starting point, a matching feature point of the feature point is taken as an end point, and each vector pointing from the starting point to the end point is taken as a single-point posture vector of the feature point.

2. According to a real-time video processing and intelligent analysis method based on edge computing according to claim 1, it is characterized in that: The method for determining the motion mask image of each video frame based on the detection result of the moving object in each frame of the real-time video is: Taking two adjacent video frames as input, using the optical flow method to determine the pixels in motion in the video frames; In each video frame, a connected domain of all the pixels is obtained, and the grayscale values ​​of the pixels outside the connected domain are set to 0, so as to obtain a motion mask image of each video frame.

3. The real-time video processing and intelligent analysis method based on edge computing according to claim 1, characterized in that: The method for determining the feature point matching result between motion mask images based on the matching degree of object movement features between adjacent video frames in real-time video is: The motion mask images of two adjacent video frames are taken as input, and the feature points in each motion mask image are obtained by using the feature point detection method. The matching results of the feature points in the two motion mask images are obtained by using the feature point matching method.

4. The real-time video processing and intelligent analysis method based on edge computing according to claim 1, characterized in that: The method for determining the consistency feature value between sub-blocks based on the similarity between the single-point posture vector and the posture motion vector of the feature point in the sub-block in each coding block is: The similarity measurement result between the single-point posture vector of each feature point in each sub-block of the coding block and the posture motion vector of the video frame where the feature point is located is used as the trend feature value of the feature point; The sequence composed of all the trend feature values ​​in each sub-block is used as the trend feature sequence of each sub-block, and the similarity measurement result between the trend feature sequences of two sub-blocks is used as the consistency feature value between the two sub-blocks.

5. The real-time video processing and intelligent analysis method based on edge computing according to claim 1, characterized in that: In each edge computing device, the method for determining the PU division mode when the HEVC technology predictively encodes the real-time video based on the consistency feature value is: Calculate the cumulative sum of the absolute values ​​of the differences between the pixel values ​​of each CTU in the inter-frame prediction frame and the pixel values ​​of the same position in the CTU in the previous video frame as the initial difference value of each CTU; If the initial difference value of each CTU is less than or equal to the preset value, each CTU continues to use the PU division mode of the CTU at the same position in the previous video frame; If the initial difference value is greater than a preset value, respectively calculating consistency feature values ​​between any two sub-blocks in each coding block of the CTU; If the consistency feature values ​​between sub-blocks in the coding block are equal, the PU partition mode of 2N×2N and skip is performed; If the consistency feature values ​​between sub-blocks in the coding block are not equal, the sum of the consistency feature values ​​between the sub-blocks in the horizontal direction and the vertical direction in the coding block is calculated as the horizontal consistency feature value and the vertical consistency feature value respectively; If the horizontal consistency eigenvalue is greater than the vertical consistency eigenvalue, the PU partitioning modes of 2N×2N, 2N×N and skip are performed; If the horizontal consistency eigenvalue is equal to the vertical consistency eigenvalue, a 2N×2N PU partitioning mode is performed; If the horizontal consistency eigenvalue is smaller than the vertical consistency eigenvalue, PU partitioning modes of 2N×2N, N×2N and skip are performed.

6. The real-time video processing and intelligent analysis method based on edge computing according to claim 1, characterized in that: The method for determining the prediction selection queue based on the direction angle of the single-point posture vector of each feature point in the PU block and the 33 intra-frame prediction angles preset in the HEVC technology is: Determine the possibility index of 33 preset intra-frame prediction angles based on the direction angle of the single-point posture vector of the feature point in the divided PU block; The possibility indexes of 33 intra-frame prediction angles are taken as input, and the segmentation threshold is obtained using the Otsu threshold method. Each intra-frame prediction angle with a possibility index greater than the segmentation threshold is taken as a prediction direction, and the sequence composed of all prediction directions is taken as the prediction selection queue.

7. The real-time video processing and intelligent analysis method based on edge computing according to claim 6 is characterized in that: The method for determining the possibility index of the preset 33 intra-frame prediction angles based on the direction angle of the single-point posture vector of the feature point in the divided PU block is: The sum of the absolute values ​​of the differences between the direction angles of the single-point posture vectors of all feature points in each PU block and the predicted angles of each intra-frame is taken as the cumulative angle deviation of the predicted angles of each intra-frame; The ratio of the sum of the angle cumulative deviations of all intra-frame prediction angles to the angle cumulative deviation of each intra-frame prediction angle is used as the possibility index of each intra-frame prediction angle.

8. The real-time video processing and intelligent analysis method based on edge computing according to claim 1, characterized in that: The method of encapsulating the real-time video in each edge computing device into a NAL stream based on the prediction selection queue using HEVC technology is: Using HEVC technology to encode real-time video into VCL data sequence based on prediction selection queue; The network abstraction layer NAL in HEVC technology is used to encapsulate the VCL data sequence into a NAL stream, and the NAL stream is stored in each edge node.

9. The real-time video processing and intelligent analysis method based on edge computing according to claim 8, characterized in that: The method of encoding real-time video into a VCL data sequence based on a prediction selection queue using HEVC technology is as follows: Add planar mode and DC mode to the prediction selection queue to get the intra prediction mode; The HEVC technology is used to encode the real-time video in the video coding layer based on the division result of the PU block and the intra-frame prediction mode to obtain a VCL data sequence.