Real-time transmission method of security monitoring video based on Internet of Things
By identifying texture repetitive areas in security surveillance videos and dynamically adjusting the motion vector selection strategy, the image block offset and blurring problems caused by texture repetitive areas in existing technologies are solved, achieving higher quality image transmission and intelligent analysis.
Patent Information
- Application Number
- CN202510499361.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-04-21
AI Technical Summary
When there are repeated texture areas in the image frames of existing IoT-based security surveillance video real-time transmission technology, the encoder cannot effectively control the motion vector selection, resulting in image block restoration position offset, ghosting or blurred outlines, affecting image clarity and intelligent analysis accuracy.
By dividing the image frames of security surveillance videos into macroblocks, identifying texture repetitive areas, and evaluating the degree of discreteness of candidate motion vector directions based on grayscale, edge, and frequency domain features, the motion vector selection strategy is dynamically adjusted, and additional identification information is transmitted to achieve strategy adjustment at the decoding end.
It improves the consistency and clarity of image block restoration, enhances the accuracy of video structured analysis and the intelligent response efficiency of the security system, prevents decoding distortion, and improves the quality of image content.
Smart Images

Figure CN120050421B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of security monitoring video transmission, and in particular to a real-time transmission method of security monitoring video based on the Internet of Things. Background Art
[0002] Security surveillance video refers to the use of surveillance cameras installed in key locations (such as residential communities, commercial buildings, public spaces, and transportation hubs) to capture real-time images and convert them into digital video signals, enabling 24 / 7, comprehensive security monitoring and management of a specific area. As surveillance systems evolve from "local storage + passive viewing" to "remote networking + active response," traditional centralized, wired transmission models are increasingly facing challenges in coverage, deployment flexibility, real-time performance, and fault response, such as limited bandwidth, high transmission latency, and high maintenance costs. The introduction of the Internet of Things (IoT) provides a more intelligent and efficient solution for security surveillance video systems. By tightly connecting front-end monitoring devices with back-end management platforms via wireless communication networks, IoT enables distributed acquisition, edge processing, and real-time transmission of video data. This enables stable and high-speed transmission of video content to command centers or user terminals in complex environments, improving the timeliness of security response and the overall intelligence of the system. Therefore, IoT-based real-time transmission of security surveillance video is not only an inevitable choice for addressing the needs of large-scale surveillance deployments and remote access, but also a key technological support for the development of smart cities and intelligent security systems.
[0003] Existing IoT-based real-time security surveillance video transmission technology primarily integrates front-end monitoring devices into the IoT architecture, automating and intelligently managing the entire video data process, from acquisition to display. During the transmission process, high-definition cameras deployed in the target area continuously capture surveillance footage and use local encoding modules (such as H.264 or H.265) to compress the raw video into a data format suitable for network transmission. Next, the acquisition terminal transmits the video data to an edge gateway or edge computing node via a wireless network (such as Wi-Fi, 4G / 5G, or NB-IoT). During this process, the edge device not only performs relay and forwarding functions but also performs preliminary analysis, noise reduction, caching, and packet retransmission to improve overall transmission efficiency and stability. The optimized data is then transmitted via the IoT core network to a cloud platform or back-end monitoring center, where it is centrally stored, decoded, and dispatched by a server. Finally, the data is played back in real time or viewed remotely via client applications (such as security monitoring apps, web platforms, and management terminals). The entire process relies on the advantages of the Internet of Things in device interconnection, data scheduling and network resource management, forming a closed-loop system from data collection, edge processing, network transmission, platform access to terminal display, and realizing efficient, low-latency and scalable real-time transmission capabilities of security surveillance videos in wide-area environments.
[0004] The existing technology has the following deficiencies:
[0005] During the encoding process of security surveillance video, when the image frames contain large areas of repetitive texture, such as regularly arranged wall tiles or dense vegetation patterns, the grayscale features of multiple macroblocks may be highly similar. In this case, when the encoder performs inter-frame motion estimation on the image frame, it generates multiple candidate motion vectors for these macroblocks with similar amplitudes but dispersed directions. Because the difference in the residual values of these vectors is very small, the encoder selects only one based on the minimum residual principle, ignoring the degree of dispersion in the directional distribution of the candidate vectors. As a result, the final selected vector may deviate from each other in spatial direction. When such motion vectors with large directional dispersion are used for predictive reconstruction, the restored position of the image blocks at the decoder will be slightly offset, causing block boundary misalignment, ghosting, or blurred outlines. However, the existing real-time transmission technology of security surveillance video based on the Internet of Things cannot dynamically adjust the motion vector selection strategy according to the degree of discreteness of the candidate motion vector direction when there are texture repetitive areas in the image frames of the security surveillance video. As a result, the encoder still uses the default minimum residual strategy for vector selection in this case, which will cause the prediction error to spread, and then form visual distortion at the decoding end, reduce image clarity, and affect the accuracy of intelligent analysis results such as target detection and behavior recognition based on image content.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0007] The purpose of the present invention is to provide a real-time transmission method of security monitoring video based on the Internet of Things to solve the problems in the above-mentioned background technology.
[0008] In order to achieve the above object, the present invention provides the following technical solution: a method for real-time transmission of security monitoring video based on the Internet of Things, specifically comprising the following steps:
[0009] During the encoding process of the security surveillance video, the image frame in the security surveillance video is divided into macroblocks, and all the divided macroblocks are monitored to determine whether there is a texture repetitive area in the image frame;
[0010] When a texture repetition region exists in the image frame, all macroblocks constituting the texture repetition region in the image frame are determined and marked as texture repetition blocks;
[0011] Comprehensively analyze each texture repetitive block to evaluate the degree of discreteness of candidate motion vector directions when there are texture repetitive areas in image frames of security surveillance videos;
[0012] Based on the evaluation results, decide whether to classify each texture repetitive block and whether to match the corresponding motion vector selection strategy;
[0013] According to the matching motion vector selection strategy, the corresponding dynamic control operations are performed respectively;
[0014] The encoded video compression stream is transmitted in real time through the Internet of Things channel, and identification information corresponding to the motion vector selection strategy is added to the video stream, so that the receiving end can perform decoding control strategy adjustment according to the identification information.
[0015] Preferably, when there is a texture repetition area in the image frame, all macroblocks constituting the texture repetition area in the image frame are determined and marked as texture repetition blocks, specifically:
[0016] The grayscale histogram distribution, edge gradient direction distribution and frequency domain feature parameters are extracted for each macroblock in the image frame. By calculating the feature similarity between adjacent macroblocks, a set of macroblocks with texture feature similarity higher than a preset threshold and continuously distributed in space are identified and determined as the macroblocks constituting the texture repetition area.
[0017] The identified macroblock sets are grouped in a logical identification manner, and a texture repeat block mark is assigned to each group of macroblocks during encoding preprocessing.
[0018] Preferably, a comprehensive analysis is performed on each texture repetition block to evaluate the degree of discreteness of the candidate motion vector directions when the image frame in the security surveillance video has a texture repetition area, specifically comprising the following steps:
[0019] Extracting the motion feature distribution information of each marked texture repetitive block from the image frames in the security surveillance video and performing preprocessing after extraction;
[0020] Extracting direction consistency information and amplitude stability information from the pre-processed motion feature distribution information of each texture repetitive block, and analyzing them after extraction to generate a direction distribution index and an amplitude deviation coefficient of each texture repetitive block respectively;
[0021] Based on the generated directional distribution index and amplitude offset coefficient of each texture repetition block, a weighted summation model is constructed, and the discrete coefficient of each texture repetition block is generated respectively through weighted summation;
[0022] The discrete coefficients of each generated texture repetitive block are used to generate the standard deviation of the discrete coefficients through the standard deviation formula;
[0023] A preset discrete coefficient standard deviation threshold is determined and compared with the generated discrete coefficient standard deviation after determination. The degree of discreteness of the candidate motion vector direction when there is a texture repetitive area in the image frame of the security surveillance video is evaluated based on the comparison result.
[0024] Preferably, the logic for obtaining the directional distribution index of each texture repetition block is as follows:
[0025] The direction consistency information is extracted from the motion feature distribution information of each texture repetition block after preprocessing, specifically including the direction angle of each candidate motion vector in each texture repetition block, and calibrated as , Indicates the Texture repeating block The direction angles of candidate motion vectors, , , and are all positive integers;
[0026] Calculate the cosine of the angular difference between any two candidate vectors in each texture repeat block , according to the formula: , where Indicates the Texture repeating block candidate vectors and the The cosine of the angular difference between the candidate vectors, ,and , are all positive integers;
[0027] Calculate the directional distribution index of each texture repeat block. The specific calculation formula is as follows:
[0028]
[0029] Where, For the Directional distribution index of texture repeating blocks.
[0030] Preferably, the logic for obtaining the amplitude offset coefficient of each texture repetition block is as follows:
[0031] The direction consistency information and amplitude stability information are extracted from the motion feature distribution information of each texture repetition block after preprocessing, specifically including the modulus of each candidate motion vector in each texture repetition block, and calibrated as , Indicates the Texture repeating block The modulus of candidate motion vectors, , , and are all positive integers;
[0032] Calculate the average value of the modulus of all candidate motion vectors in each texture repeat block , according to the formula: ;
[0033] Calculate the amplitude offset coefficient of each texture repeat block. The specific calculation formula is as follows:
[0034]
[0035] Where, For the Amplitude offset coefficient for each texture repeat block.
[0036] Preferably, the directional distribution index of each texture repetitive block generated is and amplitude offset coefficient , construct a weighted summation model, and generate the discrete coefficients of each texture repetitive block through weighted summation. The specific calculation formula is as follows:
[0037]
[0038] Where, For the The discrete coefficient of the texture repetition block, and are the directional distribution indices of each texture repeat block and amplitude offset coefficient The non-zero weight coefficient of ;
[0039] The discrete coefficients of each texture repeat block generated are used to generate the standard deviation of the discrete coefficients through the standard deviation formula , according to the formula: .
[0040] Preferably, a predetermined standard deviation threshold value of the coefficient of dispersion is determined , and after determination, the standard deviation of the generated coefficient of dispersion A comparison is performed, and based on the comparison results, the degree of discreteness of the candidate motion vector directions when there are texture repetitive areas in the image frames of the security surveillance video is evaluated. The specific comparison analysis is as follows:
[0041] like ,When the image frames in the security surveillance video have texture repetitive regions, the degree of ,discreteness of the candidate motion vector directions is in a normal range;
[0042] like ,When there are texture repetitive regions in the image frames of the security ,surveillance video, the degree of discrete direction of the candidate ,motion vectors is in an abnormal fluctuation state.
[0043] Preferably, based on the evaluation results, it is decided whether to classify each texture repetitive block and whether to match the corresponding motion vector selection strategy respectively, specifically:
[0044] When the evaluation result shows that the degree of discreteness of the candidate motion vector directions in the texture repetition area of the image frame is within the normal range, the texture repetition blocks are not classified and the initial motion vector selection strategy is uniformly adopted;
[0045] When the evaluation result shows that the discrete degree of the candidate motion vector direction in the image frame in the texture repetition area is in an abnormal fluctuation state, a predetermined discrete coefficient threshold interval is determined. , and after determination, the discrete coefficients of each texture repetition block Perform a comparison, classify each texture repetitive block according to the comparison results, and match the corresponding motion vector selection strategy, as follows:
[0046] like , dividing the texture repetitive block into low discrete level blocks, and matching the direction-locked vector selection strategy, which specifically includes: using a preset reference direction angle as a reference, screening a set of vectors whose direction angle deviates from the reference angle by less than a first threshold from all candidate motion vectors in the low discrete level block, calculating the prediction residual value of each vector, and selecting the vector whose prediction residual meets a predetermined range condition as the final motion vector;
[0047] like , the texture repetitive block is divided into medium discrete level blocks, and a direction-weighted vector selection strategy is applied. Specifically, for each candidate motion vector in the medium discrete level block, a preset weighting factor is assigned according to the angle between its direction angle and the reference direction angle, the prediction residual is weighted, and the final motion vector is selected using the weighted residual as the objective function;
[0048] like , divide the texture repetitive block into high discrete level blocks, and match the direction-restricted vector selection strategy. The specific strategy is: set the allowable deviation range of the direction angle, and only retain the candidate motion vectors whose direction angles are within the range to participate in the prediction residual calculation, and exclude the candidate vectors outside the range.
[0049] Preferably, corresponding dynamic control operations are performed respectively according to the matching motion vector selection strategy, specifically:
[0050] When matching the direction-locked vector selection strategy, the dynamic control operation performed specifically includes: setting a reference direction angle and a first deviation threshold, comparing the direction angles of candidate motion vectors one by one, retaining only vectors whose direction angles deviate from the reference angle by no more than the first deviation threshold, forming a restricted candidate set, and limiting subsequent residual calculation and vector selection to only this restricted candidate set;
[0051] When matching the direction-weighted vector selection strategy, the dynamic control operation performed is as follows: based on the angle between each candidate motion vector and the reference direction angle, a weighting function is called to dynamically calculate its direction deviation weight, and this weight is applied to the prediction residual value corresponding to the vector to generate a weighted residual result. The optimal vector is selected based on the weighted residual.
[0052] When matching the direction-restricted vector selection strategy, the dynamic control operations performed are specifically as follows: preset the direction angle restriction interval, traverse the direction angles of the candidate motion vectors, and only construct a valid candidate vector set for all motion vectors whose direction angles fall within the restriction interval, and limit the residual calculation and final vector selection operations to the valid candidate vector set, blocking all vectors out of the range from participating.
[0053] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0054] 1. This invention extracts the macroblock structure of image frames in security surveillance videos and identifies regions of repeated texture based on multimodal features such as grayscale, edges, and frequency domain, achieving precise calibration of high-risk areas. Furthermore, by constructing a directional distribution index and amplitude offset coefficient, a quantifiable model for the discreteness of candidate motion vector directions is formed and integrated into discrete coefficients, mathematically modeling the degree of local directional fluctuation. This approach breaks away from existing coding methods that rely solely on the minimum residual as a single selection criterion, enabling early identification of hidden prediction instability factors in motion estimation and improving the prediction model's adaptability to complex image structures.
[0055] 2. This invention innovatively dynamically classifies texture repetitive blocks based on the standard deviation of discrete coefficients, and matches them with three types of motion vector selection strategies: direction-locked, weighted, and restricted. Each strategy sets targeted parameters for directional constraint strength, candidate vector screening method, and residual weighting method. Dynamic control operations define the vector selection path, allowing the encoder to fine-tune the vector generation and selection process based on local directional behavior characteristics. This mechanism eliminates the need for global unified template processing and instead enables localized difference-driven encoding, effectively suppressing the propagation of prediction errors caused by directional dispersion and enhancing the consistency and clarity of image block restoration.
[0056] 3. This invention not only introduces a directional discrete control mechanism at the encoder end but also transparently carries the encoding strategy across the transmission link by appending identification information corresponding to the vector selection strategy to the compressed stream. During the decoding process, the receiver automatically adjusts decoding parameters based on this strategy identification, maintaining consistency between the predicted path and the decoded image under different directional control models and preventing decoding distortion caused by information fragmentation. This mechanism also improves the image quality for subsequent structured video analysis (such as object detection and behavior recognition), enhancing the intelligent response efficiency and service stability of security systems in practical deployments, demonstrating the advantages of end-to-end control in IoT scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction to the drawings required for use in the embodiments will be given below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0058] Figure 1 Schematic diagram of the process of the real-time transmission method of security monitoring video based on the Internet of Things of the present invention;
[0059] Figure 2 This is a method mind map of the real-time transmission method of security monitoring video based on the Internet of Things of the present invention. DETAILED DESCRIPTION
[0060] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0061] The present invention provides Figure 1 and Figure 2 The method for real-time transmission of security monitoring video based on the Internet of Things specifically includes the following steps:
[0062] During the encoding process of the security surveillance video, the image frame in the security surveillance video is divided into macroblocks, and all the divided macroblocks are monitored to determine whether there is a texture repetitive area in the image frame;
[0063] During the encoding process of security surveillance video, software can be used to partition image frames into fixed-size grids to achieve macroblocking. A common approach involves equally spaced slices of the image's two-dimensional pixel matrix according to preset macroblock sizes (such as 16×16 or 32×32 pixels), forming a macroblock matrix structure. This partitioning process iterates through the image frame's pixel coordinates, creating a data block object for each partitioned region and recording its position index within the image. Once partitioned, each macroblock functions as an independent processing unit for subsequent texture analysis and motion estimation. This process can be performed entirely by software during the initialization of the image frame data structure and can flexibly adapt to image frames of varying resolutions.
[0064] After macroblocking, software can analyze the texture features of each macroblock to determine whether there are areas of repeated texture within the image frame. Specifically, the following metrics can be extracted: First, the macroblock's grayscale histogram distribution, which measures its brightness structure; second, the edge direction histogram, such as the edge gradient direction obtained using the Sobel or Prewitt operators; and third, frequency domain features, such as the low-frequency energy distribution extracted after performing a DCT transform on the macroblock. The system calculates feature similarity (such as Euclidean distance or cosine similarity) between each macroblock and its neighbors to determine whether there are large, continuous areas of high similarity. When multiple macroblocks exhibit high texture similarity and are spatially clustered, this area is identified as a repeated texture area and the relevant macroblocks are marked for subsequent processing.
[0065] The primary purpose of macroblock segmentation and texture repetition region identification within an image frame is to proactively identify high-risk coding regions within the image, thereby providing a foundation for adaptive adjustment of the subsequent motion vector prediction strategy. During the actual encoding process, macroblocks within texture repetition regions often generate multiple candidate motion vectors with similar residuals but significantly different directions. Direct selection based on the minimum residual principle can lead to misjudgment of motion direction, causing image prediction error to spread. Only by deeply understanding the local image structure at the macroblock level and identifying the coding risks associated with texture repetition can these macroblocks be differentiated during the motion estimation phase, enabling targeted motion vector control. This process can be performed entirely by software during the encoding preprocessing stage and is crucial for subsequent prediction accuracy and image clarity.
[0066] When a texture repetition region exists in the image frame, all macroblocks constituting the texture repetition region in the image frame are determined and marked as texture repetition blocks;
[0067] In this embodiment, when there is a texture repetition area in an image frame, all macroblocks in the image frame that constitute the texture repetition area are determined and marked as texture repetition blocks, specifically:
[0068] The grayscale histogram distribution, edge gradient direction distribution and frequency domain feature parameters are extracted for each macroblock in the image frame. By calculating the feature similarity between adjacent macroblocks, a set of macroblocks with texture feature similarity higher than a preset threshold and continuously distributed in space are identified and determined as the macroblocks constituting the texture repetition area.
[0069] Texture structure identification and similarity analysis can be performed within software using image processing and feature extraction algorithms. Specifically, the grayscale histogram of each macroblock in the image frame is first extracted to characterize the macroblock's brightness distribution. Next, the directional distribution of the macroblock's edge gradients is extracted. Gradient operators (such as Sobel or Prewitt) are used to calculate the edge direction of each pixel. The distribution histogram of the directional angles is then statistically analyzed to describe the directional characteristics of the texture. Furthermore, a discrete cosine transform (DCT) or discrete wavelet transform (DWT) is performed on the macroblock to extract its frequency-domain low-frequency energy features, reflecting the periodicity and complexity of the texture. These features are combined to form a unified texture feature vector. Similarity metrics (such as cosine similarity, Euclidean distance, or correlation coefficient) are then used to calculate the similarity between the current macroblock and several surrounding macroblocks. If the feature similarity between a group of spatially adjacent macroblocks exceeds a preset threshold, the software identifies this contiguous region of macroblocks as a texture repetition region, and the coordinate indices of these macroblocks are recorded as logical labels for subsequent processing.
[0070] The reason for identifying repetitive texture regions within image frames based on the similarity of macroblock texture features is that such regions are often "high-risk" for misselecting motion vectors during video encoding. In repetitive texture regions, the visual features (luminance, edges, and frequency) of the macroblocks exhibit high repetition or regularity. This causes the encoder to generate multiple candidate motion vectors for similar macroblocks with similar residuals but diverging directions during inter-frame motion estimation, reducing the uniqueness and stability of vector selection and ultimately causing image prediction error propagation. By identifying these regions before encoding and accurately labeling the relevant macroblock sets, the aforementioned method enables the introduction of differentiated processing logic in the subsequent vector generation and selection stages, achieving a more intelligent and robust motion prediction strategy. This approach, based on image feature modeling and cluster analysis, can be implemented entirely in software, requiring no hardware modifications. It can be flexibly deployed in the encoder module's preprocessing stage or on edge computing terminals, offering high engineering adaptability and practicality.
[0071] The identified macroblock sets are grouped in a logical identification manner, and a texture repeat block mark is assigned to each group of macroblocks during encoding preprocessing to indicate the processing strategy in the motion vector selection stage.
[0072] After identifying the set of macroblocks that constitute a texture repetition region, software can add a logical identification field to the macroblock data structure within the image frame to identify the region as belonging to that macroblock. Specifically, the system maintains a metadata field for each macroblock, such as a region type identifier, a label index, or a Boolean flag. When multiple macroblocks are spatially contiguous and have highly similar texture features, the system can group them into the same logical group and assign them a unified "texture repetition region" identifier. For example, each group can be assigned a unique label ID or a texture repetition flag set to "1." This process can be implemented using a clustering-driven region numbering algorithm, such as density-based macroblock numbering or region expansion based on image coordinate adjacency. During the encoding preprocessing stage, this marking information is transmitted along with the macroblock metadata to the main encoding process to control the strategy decision logic of the subsequent motion vector generation module, enabling differentiated identification and processing of repetitive regions at the coding layer.
[0073] The purpose of logically grouping and uniformly marking macroblocks in texture-repeating regions is to enable structural context awareness and targeted processing strategies during the subsequent encoding process. Because macroblocks in texture-repeating regions share similar visual structure but lack unique spatial motion signatures, without region-level identification, the encoder cannot distinguish which macroblocks belong to the repetitive structure and therefore cannot differentiate between them. This can lead to misuse of vectors with dispersed directions but similar residuals in motion vector selection, causing prediction drift. By pre-assigning these macroblocks the "texture-repeating region" designation, the encoder can read this flag during the subsequent motion estimation or vector selection phase and automatically switch to a specific prediction strategy, such as limiting the candidate direction range, adjusting the vector scoring formula, or initiating a direction aggregation algorithm, thereby optimizing vector selection. The entire grouping and marking process can be performed independently within the encoder's software module, maintaining the versatility of the coding structure while enhancing adaptability to complex image regions, improving overall encoding quality and image reproduction accuracy.
[0074] Comprehensively analyze each texture repetitive block to evaluate the degree of discreteness of candidate motion vector directions when there are texture repetitive areas in image frames of security surveillance videos;
[0075] In this embodiment, a comprehensive analysis is performed on each texture repetition block to evaluate the degree of discreteness of candidate motion vector directions when there is a texture repetition area in an image frame of a security surveillance video. Specifically, the following steps are included:
[0076] Extracting the motion feature distribution information of each marked texture repetitive block from the image frames in the security surveillance video and performing preprocessing after extraction;
[0077] After marking the texture-repeating blocks in an image frame, the software system extracts a set of candidate motion vectors corresponding to these blocks from the encoder's motion estimation module. It also obtains essential data for calculating motion signatures, including azimuth and modulus information. Specifically, during the encoder's inter-frame motion search, the system accesses the candidate motion vector generation record and extracts multiple candidate vectors corresponding to each macroblock. For each texture-repeating block, the extraction process iterates across all macroblocks within it and constructs a set of vector attributes for each macroblock. This attribute set includes the azimuth (in radians, derived from the polar angle of the vector in a two-dimensional coordinate system) and modulus (the pixel distance from the starting point to the end point, calculated from the vector coordinates) of each candidate motion vector. Finally, the system aggregates the vector attribute data from multiple macroblocks corresponding to each texture-repeating block into a single data structure, which serves as the "motion signature distribution information" for that block and provides the foundational data for subsequent analysis.
[0078] The purpose of preprocessing is to improve the accuracy and reliability of subsequent directional consistency and amplitude stability analysis, avoiding biased assessments caused by noise vectors, invalid data, or outliers. Preprocessing operations primarily fall into three categories: First, outlier removal. This involves detecting and removing candidate vectors within each block whose azimuth or modulus deviates significantly from the mean. Common methods include Z-score analysis or IQR-based outlier detection. Second, data normalization. For example, all vector azimuths are converted to radians and modulus values are normalized to ensure comparability between vector features across regions. Third, vector number regularization. When insufficient candidate vectors are generated for certain macroblocks, vectors of standard length are constructed using nearest neighbor macroblocks or by applying a default interpolation strategy to maintain sample consistency across blocks. These preprocessing operations are automatically performed by the software encoder module through data scanning, statistical operations, and conditional screening, eliminating the need for human intervention. This versatile and real-time processing capability effectively improves the robustness and stability of subsequent parameter calculations.
[0079] Extracting direction consistency information and amplitude stability information from the pre-processed motion feature distribution information of each texture repetitive block, and analyzing them after extraction to generate a direction distribution index and an amplitude deviation coefficient of each texture repetitive block respectively;
[0080] After preprocessing the motion feature distribution information for each repetitive texture block, the system uses software algorithms to structure and deconstruct this information to extract directional consistency and amplitude stability information for analysis. Specifically, to extract directional consistency information, the system reads directional angle data from a preprocessed set of candidate motion vectors within each repetitive texture block, constructs this data into an array of directional angle vectors, and then calculates the directional differences between all candidate vectors. The cosine value of each set of differences is then calculated to represent the degree of similarity between the directional pairs. Ultimately, all cosine values serve as the data basis for directional consistency evaluation. To extract amplitude stability information, the system reads the modulus data of each vector in the same set and calculates the absolute deviation between the mean and each data item based on this set of modulus data. These deviations and their statistical properties are then used to construct a modulus fluctuation sequence, which serves as input for amplitude stability analysis. This entire extraction process is performed in the image encoder's pre-analysis module through vector-matrix processing, standard mathematical transformations, and array operations. This highly automated and scalable process ensures that the directional and amplitude characteristics of each repetitive texture block are logically distinct and independently quantifiable.
[0081] Based on the generated directional distribution index and amplitude offset coefficient of each texture repetition block, a weighted summation model is constructed, and the discrete coefficient of each texture repetition block is generated respectively through weighted summation;
[0082] The discrete coefficients of each generated texture repetitive block are used to generate the standard deviation of the discrete coefficients through the standard deviation formula;
[0083] A preset discrete coefficient standard deviation threshold is determined and compared with the generated discrete coefficient standard deviation after determination. The degree of discreteness of the candidate motion vector direction when there is a texture repetitive area in the image frame of the security surveillance video is evaluated based on the comparison result.
[0084] Pre-set standard deviation thresholds for the coefficient of variation are automatically determined within the software system through offline statistical modeling based on historical video data samples. These thresholds are stored as parameters in the system configuration module for real-time evaluation and recall. Specifically, during the initialization phase, the system introduces a large number of representative security surveillance video samples. For each marked repeating texture block in each frame, the corresponding coefficient of variation (weighted by the directional distribution index and the amplitude offset coefficient) is calculated. The standard deviation of all coefficients for each frame is then calculated, ultimately forming a distribution sequence of standard deviations for the coefficient of variation encompassing multiple sample frames. The software system then performs cluster analysis or probability density estimation on this distribution sequence, such as fitting a normal distribution or a piecewise frequency distribution. This analysis then extracts statistically significant quantile values or characteristic interval boundaries as candidate thresholds for the coefficient of variation. For example, multi-level threshold intervals can be constructed based on quantiles at the 33%, 66%, and 90% levels to distinguish image frames as exhibiting "low dispersion trend," "medium dispersion trend," or "high dispersion trend." All threshold data are ultimately solidified through the software configuration parameter table and loaded into memory for rapid comparison during encoding operation. The entire determination process requires no human intervention and is highly repeatable, adaptable, and systematic.
[0085] In this embodiment, the logic for obtaining the directional distribution index of each texture repeating block is as follows:
[0086] The direction consistency information is extracted from the motion feature distribution information of each texture repetition block after preprocessing, specifically including the direction angle of each candidate motion vector in each texture repetition block, and calibrated as , Indicates the Texture repeating block The direction angles of candidate motion vectors, , , and are all positive integers;
[0087] During the encoding process of security surveillance video, the motion estimation module of the encoder can be used to obtain the directional angle of each candidate motion vector in each texture repetitive block in real time. Specifically, in the inter-frame prediction stage, the encoder will perform block matching operations within the search window of the reference frame for each macroblock in the image frame to find multiple positions with the smallest matching error. These positions constitute a set of candidate reference blocks, and the spatial displacement between each reference block and the current macroblock constitutes a candidate motion vector. For each motion vector, the system can calculate the directional angle of the vector through the inverse tangent function based on its two-dimensional displacement components (horizontal offset and vertical offset). The directional angle is usually expressed in radians and is defined in The range is used to describe the angle of a vector relative to the horizontal direction of the image coordinate system. In actual implementation, the software system can record the directional angle values of multiple candidate vectors within each macroblock as a vector feature set in a memory data structure for subsequent integration and call of texture repetitive block features. Because the motion estimation module itself includes vector generation logic, extracting directional angles requires no additional computational overhead, resulting in strong real-time performance and high data accuracy. As a key quantitative indicator for describing motion direction, directional angle provides essential information for determining whether vector distribution is concentrated or dispersed.
[0088] Calculate the cosine of the angular difference between any two candidate vectors in each texture repeat block , according to the formula: , where Indicates the Texture repeating block candidate vectors and the The cosine of the angular difference between the candidate vectors, ,and , are all positive integers;
[0089] Calculate the directional distribution index of each texture repeat block. The specific calculation formula is as follows:
[0090]
[0091] Where, For the Directional distribution index of texture repeating blocks.
[0092] In order to quantitatively evaluate the degree of directional dispersion of candidate motion vectors in texture repetition areas, the present invention constructs a directional distribution index Specifically, first obtain the direction angles of all candidate motion vectors in the iii-th texture repeat block, and calculate the cosine value of the difference between the direction angles of any two vectors based on the cosine function. , and then take its absolute value to measure the consistency of the two vector directions. A value close to 1 indicates that the directions are highly consistent, while a value close to 0 indicates that the directions are highly divergent. This yields a positive measure of directional disparity, with greater disparity indicating a larger value. Subsequently, all candidate vector pairs are summed and averaged to obtain the average directional dispersion for the entire block. To ensure numerical stability and avoid logarithmic arithmetic anomalies, a constant of 1 is added to this mean, and the natural logarithm is then taken to form the directional distribution index. This calculation method not only reflects the discreteness of the motion vector directional distribution, but also provides a monotonically increasing numerical result with the degree of discreteness, making it easy to use in conjunction with other parameters to implement quantitative threshold-based strategy classification and control.
[0093] No. Directional distribution index of texture repetition blocks The scatter coefficient (SSC) is a key component of the discreteness of the motion features of a block. A larger value indicates greater directional variation among candidate motion vectors and poorer directional convergence. The system generates a scatter coefficient for each texture-repeating block using a weighted summation model based on the summed amplitude offset coefficients. The standard deviation of the scatter coefficients for all blocks is then calculated to yield a frame-level scatter coefficient standard deviation. This metric is used to assess whether the motion vector dispersion trend within the texture-repeating region is consistent across the entire image frame or exhibits localized, drastic fluctuations. The system then compares the scatter coefficient standard deviation with a preset scatter coefficient standard deviation threshold. Based on this comparison, the system assesses the degree of directional dispersion of candidate motion vectors in security surveillance video frames containing texture-repeating regions. After completing this assessment, the system retroactively calls a corresponding set of "scatter coefficient threshold intervals" based on this global determination result. The system then compares the scatter coefficients of each texture-repeating block generated previously with these thresholds, achieving fine-grained classification of each texture-repeating block and ultimately matching the appropriate motion vector selection strategy for each block type, implementing precise and controllable coding optimization logic.
[0094] In this embodiment, the logic for obtaining the amplitude offset coefficient of each texture repeating block is as follows:
[0095] The direction consistency information and amplitude stability information are extracted from the motion feature distribution information of each texture repetition block after preprocessing, specifically including the modulus of each candidate motion vector in each texture repetition block, and calibrated as , Indicates the Texture repeating block The modulus of candidate motion vectors, , , and are all positive integers;
[0096] During the encoding process of security surveillance video, the encoder performs inter-frame prediction and selects multiple matching locations within the search area of the reference frame for each macroblock in the image frame. These matching locations form multiple candidate motion vectors with the current macroblock. Each motion vector represents the spatial displacement between the current macroblock and a matching block in the reference frame. This displacement, in the image coordinate system, consists of two components: horizontal and vertical offset. The modulus of a motion vector refers to the magnitude of its overall displacement and can be calculated by performing a distance calculation between the offsets in these two directions. While the encoder generates these candidate motion vectors, the system software internally calls the vector generation results in the motion estimation module, extracting the modulus data for each candidate vector in real time and recording it in memory as one of the vector's attributes, forming a data structure for subsequent access. This modulus data describes the spatial motion amplitude of the candidate vector, reflecting the actual displacement of the image block from its current position to its matching location in the reference frame. In areas of repetitive texture, different candidate vectors may have similar directions but different moduli, or similar moduli but significantly different directions. Therefore, obtaining and analyzing modulus data is crucial for evaluating amplitude fluctuations and motion prediction uncertainty. The entire data extraction process is completed entirely through software logic, and is characterized by real-time, automaticity and high precision.
[0097] Calculate the average value of the modulus of all candidate motion vectors in each texture repeat block , according to the formula: ;
[0098] Calculate the amplitude offset coefficient of each texture repeat block. The specific calculation formula is as follows:
[0099]
[0100] Where, For the Amplitude offset coefficient for each texture repeat block.
[0101] To accurately measure the The fluctuation of the candidate motion vector in the modulus (i.e., motion amplitude) in the texture repetitive block is used to propose the amplitude offset coefficient First, extract the modulus of all candidate vectors in the block. , and calculate its mean , which is used to measure the overall trend of the movement amplitude in the area. Subsequently, for each candidate vector, the system calculates the absolute deviation between its modulus and the average modulus, reflecting the degree to which the vector deviates from the overall trend; by squaring the deviation, the influence weight of individuals with larger offset values in the overall statistics is enhanced; further, an exponential function is introduced to nonlinearly amplify each deviation value, forming an "amplitude fluctuation amplification mechanism", so that candidate vectors with drastic fluctuations in modulus have a stronger warning effect in the overall evaluation. Finally, the composite offset term of all vectors is summed and averaged to obtain A larger value indicates more dramatic fluctuations in the amplitude of candidate motion vectors within the repetitive texture block, and thus greater uncertainty in the motion estimate. This calculation method not only comprehensively reflects the breadth and intensity of modulus deviations but also enhances sensitivity to anomalous vectors, forming an important foundation for constructing image motion stability assessment metrics.
[0102] No. Amplitude offset coefficient of texture repeat blocks The larger the value, the more dramatic the fluctuation of the modulus length of the candidate motion vector in the block, that is, under similar texture structures, the vector displacement size varies significantly, making it difficult to form a stable and consistent motion prediction trend. When evaluating the overall candidate motion vector direction discreteness when there are texture repetitive areas in the image frames of the security surveillance video, the system will use the amplitude offset coefficient of each block. Directional Distribution Index The discrete coefficients are generated by common weighting, and the standard deviation of all discrete coefficients is calculated to evaluate the degree of discreteness of candidate motion vector directions when there are texture repetitive areas in the image frames of the security surveillance video. The evaluation result is used as a global judgment basis to determine the subsequent classification intervals. When the classification standard is established, the system will compare the discrete coefficient corresponding to each texture repetitive block with the matching discrete coefficient threshold interval to determine the discrete level of the direction to which the block belongs, and then match the motion vector selection strategy corresponding to the level. In this process, It plays a key role in the stability assessment and strategy adaptive adjustment of the entire prediction structure, and is one of the core parameters for building a dynamic control model.
[0103] In this embodiment, the directional distribution index of each texture repetition block is generated based on and amplitude offset coefficient , construct a weighted summation model, and generate the discrete coefficients of each texture repetitive block through weighted summation. The specific calculation formula is as follows:
[0104]
[0105] Where, For the The discrete coefficient of the texture repetition block, and are the directional distribution indices of each texture repeat block and amplitude offset coefficient The non-zero weight coefficient of ;
[0106] After obtaining the directional distribution index and amplitude offset coefficient for each texture repetitive block, the system can fuse the two indicators by constructing a weighted summation model to calculate the discrete coefficient of each block to comprehensively reflect the inconsistency of its motion vector in the two dimensions of direction and amplitude. In the specific implementation, the software system will extract the corresponding directional distribution index and amplitude offset coefficient for each texture repetitive block, and substitute the two into a unified linear combination model, that is, use two preset non-zero weight coefficients to assign values to these two parameters respectively, and then add them together. The two weight coefficients are the weights of the directional distribution index (denoted as ) and the weight of the amplitude offset coefficient (denoted as ), whose sum is 1, and none of them are zero, to ensure that the model takes into account information from both dimensions. The specific setting of the weight value can be obtained through offline training of a large number of samples through analysis and empirical models. For example, the optimal weight ratio can be extracted by comparing the recognition accuracy of the system and the quality of image reconstruction in different scenarios. It can also be fine-tuned according to the real-time recognition result feedback during operation through a dynamic update mechanism. During the software execution process, the weighted model can be completed through a matrix operation module or a simple multiplication and addition logic without the need for additional resource overhead. It can achieve unified modeling and efficient processing of the discrete behavior of all texture repetitive blocks, providing a stable basic indicator for subsequent frame-level evaluation and block classification strategies.
[0107] The discrete coefficients of each texture repeat block generated are used to generate the standard deviation of the discrete coefficients through the standard deviation formula , according to the formula: .
[0108] In this embodiment, the preset standard deviation threshold of the coefficient of variation is determined. , and after determination, the standard deviation of the generated coefficient of dispersion A comparison is performed, and based on the comparison results, the degree of discreteness of the candidate motion vector directions when there are texture repetitive areas in the image frames of the security surveillance video is evaluated. The specific comparison analysis is as follows:
[0109] like ,When the image frames in the security surveillance video have texture repetitive regions, the degree of ,discreteness of the candidate motion vector directions is in a normal range;
[0110] This indicates that the candidate motion vectors for each repeated texture block in the current image frame exhibit relatively consistent discrete behavior in both direction and amplitude, with fluctuations within the system's acceptable range and no significant deviations from localized abnormalities. In this case, the system can conclude that the image frame exhibited no complex motion prediction anomalies during encoding, making it suitable to continue using the default or standardized motion vector selection strategy without triggering special processing. This ensures that encoding efficiency is maintained without increasing data processing resources, while also ensuring the stability of image restoration quality within the video transmission link. This helps ensure the accuracy and consistency of back-end intelligent analysis algorithms (such as target recognition and behavior analysis) across large scene consistency.
[0111] like ,When there are texture repetitive regions in the image frames of the security ,surveillance video, the degree of discrete direction of the candidate ,motion vectors is in an abnormal fluctuation state.
[0112] This indicates that the discrete behavior of motion vectors in the repetitive texture blocks within the current image frame differs significantly, meaning that the vector direction or amplitude distribution in some areas deviates significantly from other areas. This phenomenon suggests that localized motion prediction may be unstable due to factors such as highly repetitive textures, occlusion interference, or intra-frame image noise, posing a potential risk to the coherence and clarity of the entire frame's reconstruction. In this case, the system needs to proactively adjust its motion prediction strategy, such as switching to a more conservative vector selection mechanism, limiting the range of prediction directions, or strengthening boundary consistency control, to mitigate the impact of abnormal fluctuations on encoding performance. If left unchecked, problems such as image misalignment, blurred outlines, and ghosting may occur at the decoding end, while also reducing the accuracy of the intelligent perception module based on image content, impacting the reliability and response speed of the overall security system.
[0113] Based on the evaluation results, decide whether to classify each texture repetitive block and whether to match the corresponding motion vector selection strategy;
[0114] In this embodiment, based on the evaluation results, it is decided whether to classify each texture repetitive block and whether to match the corresponding motion vector selection strategy respectively, specifically:
[0115] When the evaluation result shows that the degree of discreteness of the candidate motion vector directions in the texture repetition area of the image frame is within the normal range, the texture repetition blocks are not classified and the initial motion vector selection strategy is uniformly adopted;
[0116] When the system evaluation results indicate that the directional dispersion of candidate motion vectors within the texture repetition region of an image frame is within a normal range, it indicates that the directional distribution and amplitude fluctuations of the texture repetition blocks within the image frame are relatively consistent, with no significant local fluctuations or distribution anomalies. Therefore, the system does not need to perform separate classification operations for each block. In software implementation, a unified process can be triggered using frame-level control parameters. Specifically, if the standard deviation of the dispersion coefficient is less than or equal to a set threshold, the software process skips the classification module and directly enters the motion vector selection phase, invoking a predefined "initial selection strategy template." This initial strategy is typically based on the minimum residual principle. It iterates through all candidate motion vectors within each texture repetition block, calculates their prediction residuals, and selects the vector with the smallest prediction error as the final motion compensation vector. This approach maintains a unified and simplified process during motion estimation, reducing computational resource consumption while avoiding unnecessary processing delays caused by different classification and strategy variations. This ensures coding efficiency and stable real-time transmission performance, providing an effective strategy for dynamically balancing overall resources and coding quality.
[0117] When the evaluation result shows that the discrete degree of the candidate motion vector direction in the image frame in the texture repetition area is in an abnormal fluctuation state, a predetermined discrete coefficient threshold interval is determined. , and after determination, the discrete coefficients of each texture repetition block Perform a comparison, classify each texture repetitive block according to the comparison results, and match the corresponding motion vector selection strategy, as follows:
[0118] like , dividing the texture repetitive block into low discrete level blocks, and matching the direction-locked vector selection strategy, which specifically includes: using a preset reference direction angle as a reference, screening a set of vectors whose direction angle deviates from the reference angle by less than a first threshold from all candidate motion vectors in the low discrete level block, calculating the prediction residual value of each vector, and selecting the vector whose prediction residual meets a predetermined range condition as the final motion vector;
[0119] After dividing a certain texture repetitive block into low-discrete level blocks, the system can screen and select its candidate motion vectors through a direction-locked vector selection strategy. In the specific implementation process, the software system first calls the directional angle data of all candidate motion vectors in the block previously extracted, and uses the average directional angle or weighted directional angle of the block as the reference directional angle, which serves as the unified directional reference of the block. Subsequently, the system traverses all candidate vectors in the block, calculates the deviation angle between the directional angle of each vector and the reference directional angle, and determines whether it is less than a preset first angle threshold; only vectors that meet this condition are included in the "restricted vector set". On this basis, for each vector in the set, its prediction residual value is further calculated, and it is determined whether it meets the quality requirements based on the preset residual tolerance interval. Finally, the final vector for motion compensation is selected from the vectors that meet the directional deviation limit and residual requirements. The design purpose of this strategy is to strengthen the consistency of motion vector direction under the premise of highly concentrated directional distribution and low volatility, and to suppress the risk of spatial dislocation at the decoding end caused by small fluctuations, thereby further improving the image block prediction accuracy and decoding restoration stability in low-discrete scenarios, and achieving dual guarantees of refined control and encoding quality.
[0120] like , the texture repetitive block is divided into medium discrete level blocks, and a direction-weighted vector selection strategy is applied. Specifically, for each candidate motion vector in the medium discrete level block, a preset weighting factor is assigned according to the angle between its direction angle and the reference direction angle, the prediction residual is weighted, and the final motion vector is selected using the weighted residual as the objective function;
[0121] When a repetitive texture block is divided into medium-discrete blocks, the system differentiates candidate motion vectors using a direction-weighted vector selection strategy. In the software implementation, the direction angles of all candidate motion vectors in the block are first extracted and the angle between them and the reference direction angle is calculated. The system then assigns a weighting factor to each candidate vector based on a preset direction-weighting function (such as a decreasing cosine weight model or an exponential decay model), which typically decreases with increasing directional deviation. Next, the system calculates the prediction residual for each candidate vector and multiplies the residual value by the vector's weighting factor to generate a weighted residual. All candidate vectors are sorted by weighted residual value, and the motion vector selected for encoding is selected using the minimum weighted residual as the objective function. The key to this strategy is that in medium-discrete scenes, the directional distribution exhibits certain fluctuations. Using only fixed directions or uniform screening rules can lead to unbalanced predictions. Therefore, by introducing a weighting mechanism, the influence of candidate vectors in different directions on the final decision is dynamically adjusted to achieve elastic tolerance to directional deviations, thereby avoiding excessive compression of the coding path while maintaining prediction robustness, which helps to improve the balance between coding efficiency and image restoration quality.
[0122] like , divide the texture repetitive block into high discrete level blocks, and match the direction-restricted vector selection strategy. The specific strategy is: set the allowable deviation range of the direction angle, and only retain the candidate motion vectors whose direction angles are within the range to participate in the prediction residual calculation, and exclude the candidate vectors outside the range.
[0123] When a repetitive texture block is divided into a high-discrete block, it indicates significant directional divergence among candidate motion vectors within the block, potentially leading to prediction error propagation and image misalignment at the decoder. To address this, the system employs a direction-restricted vector selection strategy to minimize directional fluctuations. In software implementation, the system first sets a set of permissible directional angle deviation ranges, typically centered around the block's reference directional angle. A symmetric directional deviation tolerance (e.g., a ±θ threshold) is defined to construct an acceptable directional range. The system then extracts the directional angles of all candidate motion vectors within the high-discrete block and compares them with the reference directional angle. Only vectors with directional angles within the permissible deviation range are retained, forming the "restricted candidate set." Any remaining vectors outside this directional range are excluded from the current processing cycle and do not participate in subsequent prediction residual calculations. The system then performs a prediction residual calculation on each vector in the restricted candidate set and selects the vector with the best residual value as the final motion vector for encoding. The technical intention of this strategy is to strictly limit the range of candidate directions involved in the selection, exclude those motion vectors that deviate significantly and may cause unstable predictions, so as to minimize the interference of discrete noise sources on the quality of image block reconstruction, enhance the adaptive control capability of highly discrete behaviors in texture repetitive areas, and thus improve the overall image clarity and system decoding consistency.
[0124] After the system calculates the dispersion coefficients for each repeating texture block in an image frame, a set of dispersion coefficient thresholds, typically consisting of lower and upper thresholds, must be pre-set to distinguish the levels of dispersion for subsequent classification and strategy matching. These thresholds are configured using the software's built-in parameter learning module. Specifically, the system first uses a large number of annotated historical image samples to statistically analyze the distribution of dispersion coefficients, formed by combining the directional distribution index and amplitude offset coefficient of each repeating texture block under different texture distributions and motion conditions. Based on these statistical results, the system employs cluster analysis or histogram density estimation to identify multiple stable concentrations in the dispersion coefficient distribution, thereby defining appropriate segmentation intervals. For example, the dispersion coefficients corresponding to two probability quantiles (e.g., the 25th and 75th percentiles) can be set as threshold limits, forming a range supported by engineering experience. Furthermore, the software system supports dynamic adjustment of these threshold intervals: during the actual encoding process, the threshold intervals can be fine-tuned or adaptively reset based on real-time evaluation feedback. This method avoids the adaptability limitations brought about by artificially setting fixed thresholds, making the discrete level division closer to the actual characteristics of image motion, ensuring more accurate subsequent classification and strategy matching, thereby improving the intelligence and robustness of the overall system processing.
[0125] According to the matching motion vector selection strategy, the corresponding dynamic control operations are performed respectively;
[0126] In this embodiment, corresponding dynamic control operations are performed respectively according to the matching motion vector selection strategy, specifically:
[0127] When matching the direction-locked vector selection strategy, the dynamic control operation performed specifically includes: setting a reference direction angle and a first deviation threshold, comparing the direction angles of candidate motion vectors one by one, retaining only vectors whose direction angles deviate from the reference angle by no more than the first deviation threshold, forming a restricted candidate set, and limiting subsequent residual calculation and vector selection to only this restricted candidate set;
[0128] In the scenario of matching the direction-locked vector selection strategy, dynamic control operations can be achieved by setting a "reference direction angle" and a "first deviation threshold" in the encoding preprocessing module. The software system will extract the direction angles of all candidate motion vectors in the texture repetitive block one by one and perform difference calculations with the reference direction angle to determine whether the direction deviation is within the threshold allowable range. Only vectors that meet the deviation range requirements are retained to form a "restricted candidate vector set." The system restricts the subsequent prediction residual calculation process to this set and selects motion vectors whose prediction residual values meet specific optimization goals within this range. The purpose of this control mechanism is to avoid introducing motion vectors with sudden changes in direction in blocks with strong directional consistency, thereby maintaining the consistency and stability of motion compensation and reducing image block reconstruction errors and spatial dislocation.
[0129] When matching the direction-weighted vector selection strategy, the dynamic control operation performed is as follows: based on the angle between each candidate motion vector and the reference direction angle, a weighting function is called to dynamically calculate its direction deviation weight, and this weight is applied to the prediction residual value corresponding to the vector to generate a weighted residual result. The optimal vector is selected based on the weighted residual.
[0130] For blocks that match the direction-weighted vector selection strategy, the software system's dynamic control mechanism adopts a direction deviation weighted model. Specifically, the system first calculates the angle between each candidate motion vector and the reference direction angle through an algorithm module, and inputs the angle value into the set direction weighting function, such as using a cosine, exponential, or Gaussian function to generate a weight factor. The weight factor is then multiplied by the predicted residual value of the vector during the motion estimation process to generate a weighted residual. The weighted residuals of all candidate vectors will be input into the optimization path as the objective function to determine the final motion vector. This dynamic control mechanism introduces a direction deviation adjustment factor in the residual calculation stage, so that the vector that deviates from the reference direction automatically reduces its weight when participating in the selection, avoiding the interference of direction fluctuations on the prediction accuracy, while taking into account direction diversity and stability. It is an adaptive balance strategy for medium-direction discrete situations.
[0131] When matching the direction-restricted vector selection strategy, the dynamic control operations performed are specifically as follows: preset the direction angle restriction interval, traverse the direction angles of the candidate motion vectors, and only construct a valid candidate vector set for all motion vectors whose direction angles fall within the restriction interval, and limit the residual calculation and final vector selection operations to the valid candidate vector set, blocking all vectors out of the range from participating.
[0132] Under the direction-restricted vector selection strategy, dynamic control operations are implemented through the "direction angle restriction interval" configured by the software, which is defined by the reference direction angle and the allowable deviation range. The system will retrieve the direction angles of all candidate motion vectors in the current block one by one, and determine whether they fall within the preset interval. Only vectors whose direction angles are within the restricted range are marked as "valid vectors" and enter the subsequent residual calculation and vector optimization process; all candidate vectors that do not meet the conditions are eliminated in the current processing cycle and do not participate in the prediction calculation. This control method can effectively prevent motion vectors with large deviations from the direction from being incorrectly selected, and is especially suitable for texture areas with severely discrete directions. It helps to converge the prediction path and suppress abnormal fluctuations, thereby improving the overall encoding stability and decoded image quality.
[0133] The encoded video compression stream is transmitted in real time through the Internet of Things channel, and identification information corresponding to the motion vector selection strategy is attached to the video stream, so that the receiving end can adjust the decoding control strategy according to the identification information to optimize the image reconstruction effect and subsequent analysis performance.
[0134] After video compression is completed, the encoding software system will convert the motion vector selection strategy type (such as direction-locked, direction-weighted, and direction-restricted) used for each image frame or coding block into a type of structured identification information, such as by inserting it into the compressed stream through binary tags, frame header extension fields, or metadata tag embedding. This identification information is packaged together with the encoded data and encapsulated into a structured video data frame that can be transmitted in real time through IoT communication protocols (such as MQTT, CoAP, WebSocket, etc.), maintaining low latency and high reliability during the transmission process. On the decoding side, the software system reads this strategy identification information during the decapsulation process and dynamically adjusts the decoding control parameters accordingly. For example, in the case of direction-locked, the motion compensation smoothing weight is increased, and in the case of direction-restricted, the error diffusion suppression is strengthened, thereby achieving strategy-level coordination of the decoding process and ensuring that the image block restoration process is consistent with the encoding strategy.
[0135] The implementation of this step can achieve synchronous adaptation and semantic alignment between encoding strategies and decoding behaviors, and solve the problem of "only decoding data but not decoding strategies" in existing video decoding, which is especially critical in complex texture repetitive scenarios. By introducing strategy identification information, the receiving end can perceive in real time the motion vector selection logic adopted by the encoding end in a specific block, thereby avoiding image reconstruction deviations, boundary dislocations or ghosting blurs caused by inconsistent decoding assumptions. In addition, this mechanism also provides a more consistent basic image quality for subsequent intelligent analysis algorithms such as behavior recognition and object tracking based on image content, thereby improving the analysis accuracy and response stability of the security system on the terminal side. Therefore, this step not only completes the data transmission itself, but is also a key link in realizing the coordinated control of the entire link of "encoding-decoding-analysis".
[0136] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0137] The above embodiments can be implemented in whole or in part via software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When loaded or executed on a computer, the processes or functions described in the embodiments of this application are fully or partially performed. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.
[0138] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0139] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0140] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0141] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0142] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0143] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A real-time transmission method for security monitoring video based on the Internet of Things, characterized in that: The specific steps include: During the encoding process of the security surveillance video, the image frame in the security surveillance video is divided into macroblocks, and all the divided macroblocks are monitored to determine whether there is a texture repetitive area in the image frame; When a texture repetition region exists in the image frame, all macroblocks constituting the texture repetition region in the image frame are determined and marked as texture repetition blocks; Comprehensively analyze each texture repetitive block to evaluate the degree of discreteness of candidate motion vector directions when there are texture repetitive areas in image frames of security surveillance videos; Based on the evaluation results, decide whether to classify each texture repetitive block and whether to match the corresponding motion vector selection strategy; Specifically: When the evaluation result shows that the degree of discreteness of the candidate motion vector directions in the texture repetition area of the image frame is within the normal range, the texture repetition blocks are not classified and the initial motion vector selection strategy is uniformly adopted; When the evaluation result shows that the discrete degree of the candidate motion vector direction in the image frame in the texture repetition area is in an abnormal fluctuation state, a predetermined discrete coefficient threshold interval is determined. , and after determination, the discrete coefficients of each texture repetition block Perform a comparison, classify each texture repetitive block according to the comparison results, and match the corresponding motion vector selection strategy, as follows: like , dividing the texture repetitive block into low discrete level blocks, and matching the direction-locked vector selection strategy, which specifically includes: using a preset reference direction angle as a reference, screening a set of vectors whose direction angle deviates from the reference angle by less than a first threshold from all candidate motion vectors in the low discrete level block, calculating the prediction residual value of each vector, and selecting the vector whose prediction residual meets a predetermined range condition as the final motion vector; like , the texture repetitive block is divided into medium discrete level blocks, and a direction-weighted vector selection strategy is applied. Specifically, for each candidate motion vector in the medium discrete level block, a preset weighting factor is assigned according to the angle between its direction angle and the reference direction angle, the prediction residual is weighted, and the final motion vector is selected using the weighted residual as the objective function; like , the texture repetitive block is divided into high discrete level blocks, and the direction-restricted vector selection strategy is matched. The specific strategy is: set the direction angle allowable deviation range, and only retain the candidate motion vectors whose direction angles are within the range to participate in the prediction residual calculation, and exclude the candidate vectors outside the range; According to the matching motion vector selection strategy, the corresponding dynamic control operations are performed respectively; The encoded video compression stream is transmitted in real time through the Internet of Things channel, and identification information corresponding to the motion vector selection strategy is added to the video stream, so that the receiving end can perform decoding control strategy adjustment according to the identification information.
2. The method for real-time transmission of security monitoring video based on the Internet of Things according to claim 1, characterized in that: When there is a texture repetition area in the image frame, all macroblocks constituting the texture repetition area in the image frame are determined and marked as texture repetition blocks, specifically: The grayscale histogram distribution, edge gradient direction distribution and frequency domain feature parameters are extracted for each macroblock in the image frame. By calculating the feature similarity between adjacent macroblocks, a set of macroblocks with texture feature similarity higher than a preset threshold and continuously distributed in space are identified and determined as the macroblocks constituting the texture repetition area. The identified macroblock sets are grouped in a logical identification manner, and a texture repeat block mark is assigned to each group of macroblocks during encoding preprocessing.
3. The method for real-time transmission of security monitoring video based on the Internet of Things according to claim 2, characterized in that: A comprehensive analysis is performed on each texture repetition block to evaluate the degree of discreteness of candidate motion vector directions when there are texture repetition areas in the image frames of the security surveillance video. Specifically, the following steps are included: Extracting the motion feature distribution information of each marked texture repetitive block from the image frames in the security surveillance video and performing preprocessing after extraction; Extracting direction consistency information and amplitude stability information from the pre-processed motion feature distribution information of each texture repetitive block, and analyzing them after extraction to generate a direction distribution index and an amplitude deviation coefficient of each texture repetitive block respectively; Based on the generated directional distribution index and amplitude offset coefficient of each texture repetition block, a weighted summation model is constructed, and the discrete coefficient of each texture repetition block is generated respectively through weighted summation; The discrete coefficients of each generated texture repetitive block are used to generate the standard deviation of the discrete coefficients through the standard deviation formula; A preset discrete coefficient standard deviation threshold is determined and compared with the generated discrete coefficient standard deviation after determination. The degree of discreteness of the candidate motion vector direction when there is a texture repetitive area in the image frame of the security surveillance video is evaluated based on the comparison result.
4. The method for real-time transmission of security monitoring video based on the Internet of Things according to claim 3, characterized in that: The logic for obtaining the directional distribution index of each texture repeat block is as follows: The direction consistency information is extracted from the motion feature distribution information of each texture repetition block after preprocessing, specifically including the direction angle of each candidate motion vector in each texture repetition block, and calibrated as , Indicates the Texture repeating block The direction angles of candidate motion vectors, , , and are all positive integers; Calculate the cosine of the angular difference between any two candidate vectors in each texture repeat block , according to the formula: , where Indicates the Texture repeating block candidate vectors and the The cosine of the angular difference between the candidate vectors, ,and , are all positive integers; Calculate the directional distribution index of each texture repeat block. The specific calculation formula is as follows: Where, For the Directional distribution index of texture repeating blocks.
5. The method for real-time transmission of security monitoring video based on the Internet of Things according to claim 4, characterized in that: The logic for obtaining the amplitude offset coefficient of each texture repeat block is as follows: The direction consistency information and amplitude stability information are extracted from the motion feature distribution information of each texture repetition block after preprocessing, specifically including the modulus of each candidate motion vector in each texture repetition block, and calibrated as , Indicates the Texture repeating block The modulus of candidate motion vectors, , , and are all positive integers; Calculate the average value of the modulus of all candidate motion vectors in each texture repeat block , according to the formula: ; Calculate the amplitude offset coefficient of each texture repeat block. The specific calculation formula is as follows: Where, For the Amplitude offset coefficient for each texture repeat block.
6. The method for real-time transmission of security monitoring video based on the Internet of Things according to claim 5, characterized in that: Directional distribution index based on the generated repetitive blocks of each texture and amplitude offset coefficient , construct a weighted summation model, and generate the discrete coefficients of each texture repetitive block through weighted summation. The specific calculation formula is as follows: Where, For the The discrete coefficient of the texture repetition block, and are the directional distribution indices of each texture repeat block and amplitude offset coefficient The non-zero weight coefficient of ; The discrete coefficients of each texture repeat block generated are used to generate the standard deviation of the discrete coefficients through the standard deviation formula , according to the formula: .
7. The method for real-time transmission of security monitoring video based on the Internet of Things according to claim 6, characterized in that: Determine the pre-set standard deviation threshold of the coefficient of variation , and after determination, the standard deviation of the generated coefficient of dispersion A comparison is performed, and based on the comparison results, the degree of discreteness of the candidate motion vector directions when there are texture repetitive areas in the image frames of the security surveillance video is evaluated. The specific comparison analysis is as follows: like ,When the image frames in the security surveillance video have texture repetitive regions, the degree of ,discreteness of the candidate motion vector directions is in a normal range; like ,When there are texture repetitive regions in the image frames of the security ,surveillance video, the degree of discrete direction of the candidate ,motion vectors is in an abnormal fluctuation state.
8. The method for real-time transmission of security monitoring video based on the Internet of Things according to claim 7, characterized in that: According to the matching motion vector selection strategy, the corresponding dynamic control operations are performed respectively, specifically: When matching the direction-locked vector selection strategy, the dynamic control operation performed specifically includes: setting a reference direction angle and a first deviation threshold, comparing the direction angles of candidate motion vectors one by one, retaining only vectors whose direction angles deviate from the reference angle by no more than the first deviation threshold, forming a restricted candidate set, and limiting subsequent residual calculation and vector selection to only this restricted candidate set; When matching the direction-weighted vector selection strategy, the dynamic control operation performed is as follows: based on the angle between each candidate motion vector and the reference direction angle, a weighting function is called to dynamically calculate its direction deviation weight, and this weight is applied to the prediction residual value corresponding to the vector to generate a weighted residual result. The optimal vector is selected based on the weighted residual. When matching the direction-restricted vector selection strategy, the dynamic control operations performed are specifically as follows: preset the direction angle restriction interval, traverse the direction angles of the candidate motion vectors, and only construct a valid candidate vector set for all motion vectors whose direction angles fall within the restriction interval, and limit the residual calculation and final vector selection operations to the valid candidate vector set, blocking all vectors out of the range from participating.
Citation Information
Patent Citations
Method and system for detecting repeated structure in motion estimation and motion compensation algorithm
CN107426577A