Intelligent transportation video data encoding method and system
By analyzing the texture orientation consistency of traffic video image blocks, weight coefficients are determined for intra-frame prediction, which solves the problem of prediction error accumulation in the HEVC algorithm and improves the coding quality of traffic video data.
Patent Information
- Application Number
- CN202511021982.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-07-24
AI Technical Summary
The HEVC algorithm assumes that encoded image blocks have the same impact on uncoded image blocks during intra-frame prediction, leading to a gradual accumulation of prediction errors and affecting the coding quality of traffic video data.
By analyzing the consistency of texture direction between the target image block and its adjacent encoded image blocks in traffic video images, the weight coefficients of the pixel to be encoded and its adjacent encoded pixels are determined. Intra-frame prediction is then performed based on these weight coefficients, assigning different weights to different pixels.
It improves the accuracy of intra-frame prediction, reduces prediction errors, and enhances the coding quality of traffic video data.
Smart Images

Figure CN120529080B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image communication technology, specifically to a method and system for encoding intelligent transportation video data. Background Technology
[0002] Due to the large number and wide distribution of traffic cameras, the scale of intelligent traffic video data is enormous, necessitating compression to reduce storage costs and ensure real-time, efficient transmission. HEVC (High Efficiency Video Coding) leverages parallel processing to improve encoding and decoding efficiency, adapting to various network environments and devices while maintaining video quality. However, this improved compression efficiency comes at the cost of increased computational complexity. During intra-frame prediction, HEVC requires predicting uncoded image blocks based on 35 fixed prediction modes and already encoded image blocks.
[0003] However, the influence of different pixels in an encoded image block on an unencoded image block is not consistent. The HEVC algorithm assumes that the influence of different pixels in an encoded image block on an unencoded image block is the same. This causes the intra-frame prediction error to gradually accumulate as the encoding process progresses, making the distortion of the compressed traffic video data more and more serious and affecting the encoding quality of the traffic video data. Summary of the Invention
[0004] This invention provides a method and system for encoding intelligent traffic video data to address the problem that the HEVC algorithm assumes that encoded image blocks have the same impact on unencoded image blocks, causing the intra-frame prediction process to gradually accumulate prediction errors and affecting the encoding quality of traffic video data. The specific technical solution adopted is as follows:
[0005] In a first aspect, one embodiment of the present invention provides a method for encoding intelligent traffic video data, the method comprising the following steps:
[0006] Collect traffic video data and extract traffic video images frame by frame;
[0007] The HEVC algorithm is used to divide traffic video images into image blocks. According to the encoding order of the HEVC algorithm, the first encoded image block, the target image block, and the adjacent encoded image blocks are obtained. Based on the position distribution of pixels on the edges in the target image block and the adjacent encoded image blocks, the direction vector and pixel value sequence of the edges are determined. Based on the differences between the pixel value sequences of the edges in the target image block and the edges in the adjacent encoded image blocks, as well as the differences between the direction vectors, the texture direction consistency between the target image block and the adjacent encoded image blocks is determined.
[0008] Any pixel in the target image block is designated as the pixel to be encoded, and any pixel in the adjacent encoded image block that is adjacent to the target image block is designated as the adjacent encoded pixel. Based on the positional relationship between the pixel to be encoded and the adjacent encoded pixel, the positional relationship between the pixel to be encoded and the adjacent encoded pixel and the edges in the target image block and the adjacent encoded image block respectively, and the difference between the pixel value sequences of the edges in the target image block and the adjacent encoded image block, the weight coefficients of the pixel to be encoded and the adjacent encoded pixel are determined.
[0009] Intra-frame prediction of traffic video images is achieved based on all weight coefficients, and the traffic video data is encoded based on the intra-frame prediction results.
[0010] Furthermore, the method for determining the marked target image block and adjacent encoded image blocks is as follows:
[0011] According to the encoding order of each image block in the traffic video image by the HEVC algorithm, the unencoded image block after the last encoded image block is recorded as the target image block;
[0012] All encoded image blocks adjacent to the target image block are recorded as adjacent encoded image blocks.
[0013] Furthermore, the method for determining the direction vector and pixel value sequence of the edge is as follows:
[0014] Any edge in the target image block and its adjacent encoded image blocks is denoted as the target edge. Image blocks in the target image block and its adjacent encoded image blocks that are different from the image block in which the target edge is located are denoted as the adjacent image blocks of the target edge. The distance between the two endpoints of the target edge and each pixel in the adjacent image blocks is calculated. The minimum distance between the endpoints of the target edge and each pixel in the adjacent image blocks is denoted as the adjacent distance of the endpoints of the target edge. The endpoint of the target edge with the smallest adjacent distance is taken as the starting point and the endpoint of the target edge with the largest adjacent distance is taken as the ending point to establish the direction vector of the target edge.
[0015] Starting from the endpoint of the target edge with the smallest adjacent distance, arrange the pixel values of each pixel on the target edge in sequence to obtain the pixel value sequence of the target edge.
[0016] Furthermore, the specific method for determining the texture direction consistency between the target image block and adjacent encoded image blocks based on the differences in pixel value sequences between edges in the target image block and edges in adjacent encoded image blocks, as well as the differences in direction vectors, includes:
[0017] The normalized value of the DTW distance between the pixel value sequences of the edge in the target image block and the edge in the adjacent encoded image block is denoted as the pixel value distance between the edge in the target image block and the edge in the adjacent encoded image block.
[0018] The absolute value of the cosine similarity between the direction vectors of the edges in the target image block and the edges in the adjacent encoded image blocks is denoted as the direction similarity between the edges in the target image block and the edges in the adjacent encoded image blocks.
[0019] The texture orientation consistency between the target image block and its adjacent encoded image blocks is determined based on the pixel value distance and orientation similarity between all edges in the target image block and all edges in the adjacent encoded image blocks.
[0020] Furthermore, the specific method for determining the texture orientation consistency between the target image block and adjacent encoded image blocks based on the pixel value distance and orientation similarity of all edges in the target image block and all edges in adjacent encoded image blocks includes:
[0021] The ratio of the pixel value distance between the edge in the target image block and the edge in the adjacent encoded image block to the directional similarity is denoted as the first ratio between the edge in the target image block and the edge in the adjacent encoded image block.
[0022] The average of the first ratios of all edges in the target image block and all edges in the adjacent encoded image blocks is denoted as the texture orientation consistency between the target image block and the adjacent encoded image blocks.
[0023] Furthermore, the method for determining the weight coefficients of the pixel to be encoded and its neighboring encoded pixels based on the positional relationship between the pixel to be encoded and its neighboring encoded pixels, the positional relationships between the pixel to be encoded and its neighboring encoded pixels and the edges in the target image block and the adjacent encoded image block, respectively, and the differences between the pixel value sequences of the edges in the target image block and the adjacent encoded image block, includes the following specific methods:
[0024] The Euclidean distance between the pixel to be encoded and its adjacent encoded pixels is denoted as the direct distance between the pixel to be encoded and its adjacent encoded pixels. The minimum Euclidean distance between the pixel to be encoded and all pixels in the target edge is denoted as the direct distance between the pixel to be encoded and the target edge. The minimum direct distance corresponding to the pixel to be encoded is denoted as the nearest direct distance of the pixel to be encoded. The minimum Euclidean distance between adjacent encoded pixels and all pixels in the target edge is denoted as the nearest direct distance between the adjacent encoded pixels and the target edge. The minimum distance is denoted as the nearest direct distance between adjacent encoded pixels; the DTW distance between the pixel value sequence of the edge corresponding to the nearest direct distance of the pixel to be encoded and the pixel value sequence of the edge corresponding to the nearest direct distance of the adjacent encoded pixels is denoted as the texture distance between the pixel to be encoded and the adjacent encoded pixels; the sum of the direct distance, texture distance, nearest direct distance of the pixel to be encoded and the nearest direct distance of the adjacent encoded pixels is denoted as the comprehensive distance evaluation value between the pixel to be encoded and the adjacent encoded pixels.
[0025] The consistency of the texture direction between the target image block containing the pixel to be encoded and the adjacent encoded image block containing the adjacent encoded pixel is recorded as the texture direction evaluation value between the pixel to be encoded and the adjacent encoded pixel.
[0026] The correlation between the pixel to be encoded and its neighboring encoded pixels is determined based on the texture direction evaluation value and the comprehensive distance evaluation value between the pixel to be encoded and its neighboring encoded pixels.
[0027] Based on all the correlation degrees corresponding to the pixel to be encoded, the weight coefficients of the pixel to be encoded and each of the adjacent encoded pixels are determined respectively.
[0028] Furthermore, the specific method for determining the correlation between the pixel to be encoded and its neighboring encoded pixels based on the texture direction evaluation value and the comprehensive distance evaluation value is as follows:
[0029] The ratio of the texture direction evaluation value and the comprehensive distance evaluation value of the pixel to be encoded to its adjacent encoded pixels is denoted as the correlation degree between the pixel to be encoded and its adjacent encoded pixels.
[0030] Furthermore, the specific method for determining the weight coefficients between the pixel to be encoded and each adjacent encoded pixel based on all the correlation degrees corresponding to the pixel to be encoded is as follows:
[0031] The sum of all correlation degrees corresponding to the pixel to be encoded is recorded as the correlation sum of the pixel to be encoded. The ratio between the correlation degree of the pixel to be encoded and its adjacent encoded pixels and the correlation sum of the pixel to be encoded is recorded as the weight coefficient between the pixel to be encoded and its adjacent encoded pixels.
[0032] Furthermore, the specific method for achieving intra-frame prediction of traffic video images based on all weight coefficients includes:
[0033] In the process of intra-frame prediction of traffic video images using the HEVC algorithm, when obtaining the prediction block of the target image block based on the adjacent encoded image blocks, the weight coefficients of each pixel in the adjacent encoded image blocks that is adjacent to the target image block and each pixel to be encoded in the target image block are used as the weights for interpolation calculation to obtain the prediction block of the target image block, thus realizing intra-frame prediction of traffic video images.
[0034] Secondly, embodiments of the present invention also provide an intelligent traffic video data encoding system, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0035] The beneficial effects of this invention are:
[0036] This application first extracts traffic video images frame by frame from traffic video data and analyzes the intra-frame prediction process for these images. To improve the accuracy of intra-frame prediction, considering that there are many similar vehicles or roads in traffic videos distributed in a uniform direction, the texture continuity and texture similarity between adjacent target image blocks and adjacent encoded image blocks in the traffic video images are analyzed to obtain the texture direction consistency between the target image block and adjacent encoded image blocks. Texture direction consistency is a significant evaluation of the texture similarity between the target image block and adjacent encoded image blocks. Furthermore, the analysis combines the pixels adjacent to the target image block in adjacent encoded image blocks with the pixels in the target image block... Texture similarity analysis is performed to determine the influence of pixels adjacent to the target image block in each adjacent encoded image block on the predicted block when obtaining the predicted block based on adjacent encoded image blocks. Weight coefficients are obtained for the pixel to be encoded and its adjacent encoded pixels. Finally, intra-frame prediction of traffic video images is achieved based on all weight coefficients. Different weights are assigned to the influence of encoded image blocks on unencoded image blocks to solve the problem that the HEVC algorithm assumes that encoded image blocks have the same influence on unencoded image blocks, causing the prediction error to gradually accumulate during the intra-frame prediction process and affecting the encoding quality of traffic video data. The encoding of traffic video data is then performed based on the intra-frame prediction results to improve the encoding quality of traffic video data. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating a smart traffic video data encoding method according to an embodiment of the present invention.
[0039] Figure 2 This is a flowchart illustrating the process of acquiring adjacent encoded image blocks according to an embodiment of the present invention. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] Please see Figure 1 The diagram illustrates a flowchart of a smart transportation video data encoding method according to an embodiment of the present invention, which includes the following steps:
[0042] Step S001: Collect traffic video data and extract traffic video images frame by frame.
[0043] Traffic video data is collected using high-definition traffic monitoring cameras. In this embodiment, the frame rate for collecting traffic video data is set to 60fps. The traffic video data is extracted frame by frame to obtain traffic video images. Due to differences in network environments and high-definition traffic monitoring cameras at different locations, the traffic video images are converted to YUV format to ensure consistency in subsequent compression of the traffic video data.
[0044] At this point, traffic video images have been obtained.
[0045] Step S002: Apply the HEVC algorithm to the traffic video image to divide the traffic video image for intra-frame prediction into image blocks. According to the encoding order of the HEVC algorithm, obtain the first encoded image block, the target image block, and the adjacent encoded image blocks. Based on the position distribution of pixels on the edges in the target image block and the adjacent encoded image blocks, determine the direction vector and pixel value sequence of the edges. Based on the differences between the pixel value sequences of the edges in the target image block and the edges in the adjacent encoded image blocks, as well as the differences between the direction vectors, determine the texture direction consistency between the target image block and the adjacent encoded image blocks.
[0046] When using the HEVC algorithm for intra-frame prediction of traffic video images, the prediction of uncoded image blocks is based on the similarity between pixels in encoded and uncoded image blocks. Specifically, prediction blocks are obtained from pixels with high texture continuity and similarity in the traffic video image, which improves the accuracy of intra-frame prediction. However, pixels with texture continuity and similarity in traffic video images have different directional characteristics. This means that different pixels in encoded image blocks have different effects on uncoded image blocks; pixels with more significant texture continuity and similarity in encoded image blocks should have a greater impact on uncoded image blocks.
[0047] The HEVC (High-Efficiency Video Coding) algorithm is used to encode traffic video images. The image is divided into coding units (CUs), prediction units (PUs), and transform units (TUs), each denoted as an image block. Since the encoder scans each coding unit from left to right and top to bottom, the top-leftmost image block in the traffic video image used for intra-frame prediction is encoded. This top-leftmost image block is the first image block encoded using the HEVC algorithm.
[0048] To analyze the texture similarity between image patches, all edges in each image patch are extracted.
[0049] This embodiment uses the Canny edge detection algorithm to extract all edges in an image block. The use of the Canny edge detection algorithm to extract all edges in an image block is a well-known technique and will not be described in detail here. In practical applications, as other implementation methods, based on achieving the goal of extracting all edges in an image block, implementers may use other methods of existing technology, such as the Sobel operator, to extract all edges in an image block. This application does not impose any special restrictions.
[0050] According to the HEVC high-efficiency video coding algorithm, the next uncoded image block after the last encoded image block is denoted as the target image block, and all encoded image blocks adjacent to the target image block are denoted as adjacent encoded image blocks.
[0051] See the flowchart for obtaining adjacent encoded image blocks. Figure 2 .
[0052] Based on the positional distribution of pixels on the edges in the target image block and adjacent encoded image blocks, the direction vector and pixel value sequence of the edges are determined.
[0053] An arbitrary edge in the target image patch and its adjacent encoded image patches is designated as the target edge. Image patches in the target image patch and its adjacent encoded image patches that are different from the target edge are designated as adjacent image patches of the target edge. The distances between the two endpoints of the target edge and every pixel in the adjacent image patches are calculated. The minimum distance between the endpoints of the target edge and every pixel in the adjacent image patches is designated as the adjacent distance of the target edge endpoint. The direction vector of the target edge is established by taking the endpoint of the target edge with the smallest adjacent distance as the starting point and the endpoint of the target edge with the largest adjacent distance as the ending point. Starting from the endpoint of the target edge with the smallest adjacent distance, the pixel values of each pixel on the target edge are arranged sequentially to obtain the pixel value sequence of the target edge.
[0054] The same method can be used to obtain the direction vectors and pixel value sequences of all edges in the target image block and adjacent encoded image blocks.
[0055] It is understandable that, since traffic video images are in YUV format, the pixel value of each pixel point on each edge in the target image block and adjacent encoded image blocks contains three components: Y, U, and V.
[0056] The texture orientation consistency between the target image block and the adjacent encoded image blocks is determined based on the differences in pixel value sequences between the edges in the target image block and the edges in the adjacent encoded image blocks, as well as the differences in orientation vectors.
[0057] The normalized DTW distance between the pixel value sequences of an edge in the target image patch and the edges in adjacent encoded image patches is denoted as the pixel value distance between the edge in the target image patch and the edges in adjacent encoded image patches. The absolute value of the cosine similarity of the direction vectors of the edge in the target image patch and the edges in adjacent encoded image patches is denoted as the direction similarity between the edge in the target image patch and the edges in adjacent encoded image patches. The ratio of the pixel value distance to the direction similarity between the edge in the target image patch and the edges in adjacent encoded image patches is denoted as the first ratio between the edge in the target image patch and the edges in adjacent encoded image patches. The mean of the first ratios between all edges in the target image patch and all edges in adjacent encoded image patches is denoted as the texture direction consistency between the target image patch and the adjacent encoded image patches.
[0058] Calculating the DTW distance between two sequences and the cosine similarity between two vectors are well-known techniques and will not be elaborated further. It should be noted that this embodiment uses the Z-Score standard normalization method to calculate the normalized value. In practical applications, implementers may use other methods of existing technology, such as the maximum-minimum normalization method or the sigmoid function, to calculate the normalized value, which is not limited here.
[0059] The smaller the difference between the pixel value sequences of the edges in the target image patch and the edges in the adjacent encoded image patch, and the smaller the difference between the direction vectors, the more significant the texture similarity between the target image patch and the adjacent encoded image patch. In this case, the greater the consistency of the texture direction between the target image patch and the adjacent encoded image patch.
[0060] It is understandable that the texture orientation consistency between the target image block and each of its adjacent encoded image blocks can be obtained.
[0061] At this point, the texture orientation consistency between the target image block and each adjacent encoded image block is obtained.
[0062] Step S003: Record any pixel in the target image block as the pixel to be encoded, and record any pixel in the adjacent encoded image block that is adjacent to the target image block as the adjacent encoded pixel. Based on the positional relationship between the pixel to be encoded and the adjacent encoded pixel, the positional relationship between the pixel to be encoded and the adjacent encoded pixel and the edges in the target image block and the adjacent encoded image block respectively, and the difference between the pixel value sequences of the edges in the target image block and the adjacent encoded image block, determine the weight coefficients of the pixel to be encoded and the adjacent encoded pixel.
[0063] Furthermore, based on the significance evaluation of texture similarity between the target image block and adjacent encoded image blocks, and combining the texture similarity between pixels adjacent to the target image block in adjacent encoded image blocks and pixels in the target image block, the influence of each pixel adjacent to the target image block in each adjacent encoded image block on the predicted block is determined when obtaining the predicted block of the target image block based on adjacent encoded image blocks.
[0064] Any pixel in the target image block is designated as the pixel to be encoded, and any pixel in an adjacent encoded image block that is adjacent to the target image block is designated as the adjacent encoded pixel.
[0065] The weight coefficients of the pixel to be encoded and its neighboring encoded pixels are determined based on the positional relationship between the pixel to be encoded and its neighboring encoded pixels, the positional relationship between the pixel to be encoded and its neighboring encoded pixels and the edges in the target image block and the adjacent encoded image block, respectively, and the difference between the pixel value sequences of the edges in the target image block and the adjacent encoded image block.
[0066] The Euclidean distance between the pixel to be encoded and its adjacent encoded pixels is denoted as the direct distance between the pixel to be encoded and its adjacent encoded pixels. The minimum Euclidean distance between the pixel to be encoded and all pixels in the target edge is denoted as the direct distance between the pixel to be encoded and the target edge. The minimum direct distance corresponding to the pixel to be encoded is denoted as the nearest direct distance of the pixel to be encoded. The minimum Euclidean distance between adjacent encoded pixels and all pixels in the target edge is denoted as the nearest direct distance between the adjacent encoded pixels and the target edge. The minimum distance is denoted as the nearest direct distance between adjacent encoded pixels. The DTW distance between the pixel value sequence of the edge corresponding to the nearest direct distance of the pixel to be encoded and the pixel value sequence of the edge corresponding to the nearest direct distance of adjacent encoded pixels is denoted as the texture distance between the pixel to be encoded and adjacent encoded pixels. The sum of the direct distance, texture distance, nearest direct distance of the pixel to be encoded, and nearest direct distance of adjacent encoded pixels is denoted as the comprehensive distance evaluation value between the pixel to be encoded and adjacent encoded pixels. The consistency of the texture direction between the target image patch where the pixel to be encoded is located and the adjacent encoded image patch where the adjacent encoded pixels are located is denoted as the texture direction evaluation value between the pixel to be encoded and adjacent encoded pixels. The ratio of the texture direction evaluation value to the comprehensive distance evaluation value is denoted as the correlation degree between the pixel to be encoded and adjacent encoded pixels.
[0067] The sum of all correlation degrees corresponding to the pixel to be encoded is recorded as the correlation sum of the pixel to be encoded. The ratio between the correlation degree of the pixel to be encoded and its adjacent encoded pixels and the correlation sum of the pixel to be encoded is recorded as the weight coefficient between the pixel to be encoded and its adjacent encoded pixels.
[0068] The same method can be used to obtain the weight coefficients of each pixel in the adjacent encoded image block that is adjacent to the target image block and each pixel to be encoded in the target image block.
[0069] The smaller the Euclidean distance between the pixel to be encoded and its adjacent encoded pixels, the smaller the texture distance between the pixel to be encoded and its adjacent encoded pixels, the smaller the nearest direct distance between the pixel to be encoded and its adjacent encoded pixels, the closer the spatial distribution of the pixel to be encoded and its adjacent encoded pixels, the more similar their textures, and the more similar their textures along the texture direction, the greater the weight should be given to predicting the pixel to be encoded based on its adjacent encoded pixels.
[0070] At this point, the weight coefficients of each pixel in the adjacent encoded image block that is adjacent to the target image block and each pixel to be encoded in the target image block are obtained.
[0071] Step S004: Perform intra-frame prediction of traffic video images based on all weight coefficients, and encode traffic video data based on the intra-frame prediction results.
[0072] In the process of intra-frame prediction of traffic video images using the HEVC algorithm, when obtaining the prediction block of the target image block based on the adjacent encoded image blocks, the weight coefficients of each pixel in the adjacent encoded image blocks that is adjacent to the target image block and each pixel to be encoded in the target image block are used as the weights for interpolation calculation to obtain the prediction block of the target image block, thereby realizing intra-frame prediction of traffic video images, and then obtaining the compression result of traffic video data to realize the encoding of traffic video data.
[0073] The use of the HEVC algorithm to compress traffic video data is a well-known technique and will not be elaborated further. Specifically, in this embodiment, the quantization parameter is set to 25 when using the HEVC algorithm to compress traffic video images. In practical applications, as other implementation methods, the quantization parameter should be greater than or equal to 0 and less than or equal to 51. Implementers can decide the value of the quantization parameter according to the actual situation, and this application does not impose any special restrictions.
[0074] This completes the encoding of the traffic video data.
[0075] Based on the same inventive concept as the above methods, embodiments of the present invention also provide an intelligent traffic video data encoding system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-described intelligent traffic video data encoding methods.
[0076] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for encoding intelligent transportation video data, characterized in that, The method includes the following steps: Collect traffic video data and extract traffic video images frame by frame; The HEVC algorithm is used to divide traffic video images into image blocks. According to the encoding order of the HEVC algorithm, the first encoded image block, the target image block, and the adjacent encoded image blocks are obtained. Based on the position distribution of pixels on the edges in the target image block and the adjacent encoded image blocks, the direction vector and pixel value sequence of the edges are determined. Based on the differences between the pixel value sequences of the edges in the target image block and the edges in the adjacent encoded image blocks, as well as the differences between the direction vectors, the texture direction consistency between the target image block and the adjacent encoded image blocks is determined. Any pixel in the target image block is designated as the pixel to be encoded, and any pixel in an adjacent encoded image block is designated as the adjacent encoded pixel. Based on the positional relationship between the pixel to be encoded and the adjacent encoded pixels, the positional relationships between the pixel to be encoded and the adjacent encoded pixels and the edges in the target image block and the adjacent encoded image blocks respectively, and the differences between the pixel value sequences of the edges in the target image block and the adjacent encoded image blocks, the weight coefficients between the pixel to be encoded and the adjacent encoded pixels are determined. Specifically, this includes: defining the Euclidean distance between the pixel to be encoded and the adjacent encoded pixels as the direct distance between them; defining the minimum Euclidean distance between the pixel to be encoded and all pixels in the target edge as the direct distance between the pixel to be encoded and the target edge; and defining the weight coefficients between the pixel to be encoded and the adjacent encoded pixels. The minimum direct distance is denoted as the nearest direct distance of the pixel to be encoded; the minimum Euclidean distance between adjacent encoded pixels and all pixels in the target edge is denoted as the direct distance between the adjacent encoded pixel and the target edge; the minimum direct distance between adjacent encoded pixels is denoted as the nearest direct distance between adjacent encoded pixels; the DTW distance between the pixel value sequence of the edge corresponding to the nearest direct distance of the pixel to be encoded and the pixel value sequence of the edge corresponding to the nearest direct distance of the adjacent encoded pixels is denoted as the texture distance between the pixel to be encoded and the adjacent encoded pixels; the sum of the direct distance, texture distance, nearest direct distance of the pixel to be encoded, and nearest direct distance of the adjacent encoded pixels is denoted as the comprehensive distance evaluation value between the pixel to be encoded and the adjacent encoded pixels. The consistency of the texture direction between the target image block containing the pixel to be encoded and the adjacent encoded image block containing the adjacent encoded pixel is recorded as the texture direction evaluation value between the pixel to be encoded and the adjacent encoded pixel. The correlation between the pixel to be encoded and its neighboring encoded pixels is determined based on the texture direction evaluation value and the comprehensive distance evaluation value between the pixel to be encoded and its neighboring encoded pixels. Based on all the correlation degrees corresponding to the pixel to be encoded, the weight coefficients between the pixel to be encoded and each of its adjacent encoded pixels are determined respectively. Intra-frame prediction of traffic video images is achieved based on all weight coefficients, and the traffic video data is encoded based on the intra-frame prediction results.
2. The intelligent transportation video data encoding method according to claim 1, characterized in that, The method for determining the marked target image block and adjacent encoded image blocks is as follows: According to the encoding order of each image block in the traffic video image by the HEVC algorithm, the unencoded image block after the last encoded image block is recorded as the target image block; All encoded image blocks adjacent to the target image block are recorded as adjacent encoded image blocks.
3. The intelligent transportation video data encoding method according to claim 1, characterized in that, The method for determining the direction vector and pixel value sequence of the edge is as follows: Any edge in the target image block and its adjacent encoded image blocks is denoted as the target edge. Image blocks in the target image block and its adjacent encoded image blocks that are different from the image block in which the target edge is located are denoted as the adjacent image blocks of the target edge. The distance between the two endpoints of the target edge and each pixel in the adjacent image blocks is calculated. The minimum distance between the endpoints of the target edge and each pixel in the adjacent image blocks is denoted as the adjacent distance of the endpoints of the target edge. The endpoint of the target edge with the smallest adjacent distance is taken as the starting point and the endpoint of the target edge with the largest adjacent distance is taken as the ending point to establish the direction vector of the target edge. Starting from the endpoint of the target edge with the smallest adjacent distance, arrange the pixel values of each pixel on the target edge in sequence to obtain the pixel value sequence of the target edge.
4. The intelligent transportation video data encoding method according to claim 1, characterized in that, The method for determining the texture orientation consistency between the target image block and adjacent encoded image blocks based on the differences in pixel value sequences between edges in the target image block and edges in adjacent encoded image blocks, as well as the differences in direction vectors, includes the following specific methods: The normalized value of the DTW distance between the pixel value sequences of the edge in the target image block and the edge in the adjacent encoded image block is denoted as the pixel value distance between the edge in the target image block and the edge in the adjacent encoded image block. The absolute value of the cosine similarity between the direction vectors of the edges in the target image block and the edges in the adjacent encoded image blocks is denoted as the direction similarity between the edges in the target image block and the edges in the adjacent encoded image blocks. The texture orientation consistency between the target image block and its adjacent encoded image blocks is determined based on the pixel value distance and orientation similarity between all edges in the target image block and all edges in the adjacent encoded image blocks.
5. The intelligent transportation video data encoding method according to claim 4, characterized in that, The method for determining the texture orientation consistency between the target image block and its adjacent encoded image blocks based on the pixel value distance and orientation similarity between all edges in the target image block and all edges in the adjacent encoded image blocks includes the following specific methods: The ratio of the pixel value distance between the edge in the target image block and the edge in the adjacent encoded image block to the directional similarity is denoted as the first ratio between the edge in the target image block and the edge in the adjacent encoded image block. The average of the first ratios of all edges in the target image block and all edges in the adjacent encoded image blocks is denoted as the texture orientation consistency between the target image block and the adjacent encoded image blocks.
6. The intelligent transportation video data encoding method according to claim 1, characterized in that, The specific method for determining the correlation between the pixel to be encoded and its adjacent encoded pixels based on the texture direction evaluation value and the comprehensive distance evaluation value is as follows: The ratio of the texture direction evaluation value and the comprehensive distance evaluation value of the pixel to be encoded to its adjacent encoded pixels is denoted as the correlation degree between the pixel to be encoded and its adjacent encoded pixels.
7. The intelligent transportation video data encoding method according to claim 6, characterized in that, The specific method for determining the weight coefficients between the pixel to be encoded and each of its adjacent encoded pixels based on all the correlation degrees corresponding to the pixel to be encoded is as follows: The sum of all correlation degrees corresponding to the pixel to be encoded is recorded as the correlation sum of the pixel to be encoded. The ratio between the correlation degree of the pixel to be encoded and its adjacent encoded pixels and the correlation sum of the pixel to be encoded is recorded as the weight coefficient between the pixel to be encoded and its adjacent encoded pixels.
8. The intelligent transportation video data encoding method according to claim 1, characterized in that, The specific method for intra-frame prediction of traffic video images based on all weight coefficients includes: In the process of intra-frame prediction of traffic video images using the HEVC algorithm, when obtaining the prediction block of the target image block based on the adjacent encoded image blocks, the weight coefficients of each pixel in the adjacent encoded image blocks that is adjacent to the target image block and each pixel to be encoded in the target image block are used as the weights for interpolation calculation to obtain the prediction block of the target image block, thus realizing intra-frame prediction of traffic video images.
9. A smart traffic video data encoding system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as claimed in any one of claims 1-8.
Citation Information
Patent Citations
Method and system for evaluating video quality based on edge detection
CN101621710A
Intra Prediction Method and Apparatus and Image Encoding / Decoding Method and Apparatus Using Same
KR1020140088061A