A method and system for managing environmental security engineering monitoring data

By performing superpixel block decomposition and line fitting of edge point connections on security monitoring videos, a more accurate prediction model is built, which solves the problem of low video data compression efficiency in the existing technology and achieves more efficient data compression.

CN115914634BActive Publication Date: 2025-02-07HUIZHOU XINKECHUANG ENGINEERING CONSTRUCTION SUPERVISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211619607.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-16
Publication Date
2025-02-07
Estimated Expiration
2042-12-16

AI Technical Summary

Technical Problem

In the prior art, when compressing video data, the method of randomly dividing macroblocks leads to inaccurate linear prediction results of macroblocks with large grayscale distributions, which leads to low compression efficiency.

Method used

By obtaining the grayscale image and single-channel image of each frame of the security monitoring video, decompose it into multiple superpixel blocks, and using the fitted straight lines and fitted mass entropy values ​​of edge point lines for classification and prediction model construction. In turn, improve the accuracy of linear prediction.

Benefits of technology

Through a more accurate linear prediction model, prediction errors are reduced, compression efficiency is improved, and the compression effect is further optimized by considering prediction bias.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914634B_ABST
    Figure CN115914634B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for managing environmental security engineering monitoring data, and relates to the field of data processing technology. The method comprises: obtaining multiple super pixel blocks of each single channel image in each frame image in monitoring video data; obtaining a fitting straight line of the grayscale difference of each edge point connection line in the super pixel block, and the fitting quality of the fitting straight line; obtaining a fitting entropy value using the fitting quality of the fitting straight line of the super pixel block in different directions; dividing the super pixel blocks into multiple categories using the correlation between every two super pixel blocks; obtaining the prediction model coefficient of each type of super pixel block; obtaining a prediction error according to the target prediction grayscale value and grayscale value of each pixel point in the grayscale image; encoding and storing the prediction error of each pixel point. The prediction model constructed by the present invention is more accurate, the obtained prediction error value is smaller, and the space occupied after encoding is smaller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for managing environmental security engineering monitoring data. Background Art

[0002] With the development of the information age, digital monitoring is becoming more and more popular in environmental security projects. At the same time, with the improvement of monitoring video quality requirements, the resolution of cameras is constantly improving, which greatly increases the amount of video data collected by monitoring, and thus requires a large amount of storage space to store video data. In order to reduce the storage space occupied by monitoring video data, video data needs to be compressed and stored.

[0003] The existing technology generally adopts lossy compression to compress and store video data, which can greatly reduce the space occupied during storage. The commonly used lossy compression method is predictive coding compression. Predictive coding compression is to divide each frame of the image into multiple rectangular macroblocks of random size, and then use the characteristic values ​​of the pixels in each macroblock for linear prediction. If the grayscale distribution in the same rectangular macroblock is smooth and the grayscale correlation between the pixels is strong, the linear prediction result is relatively ideal. If the grayscale distribution in the same rectangular macroblock is relatively random and there are many mutation points, the linear prediction result is not accurate. The commonly used method of randomly dividing rectangular macroblocks for predictive coding compression does not take into account the grayscale distribution characteristics of the pixels in each rectangular macroblock. Therefore, the prediction results of some macroblocks with a relatively large random grayscale distribution are not accurate enough, resulting in a large prediction error value. After encoding the prediction error, the data occupies a large space and the compression efficiency is low. Summary of the invention

[0004] The present invention provides an environmental security engineering monitoring data management method and system to solve the problem that the linear prediction results of some macroblocks with large grayscale distribution randomness in the existing randomly divided macroblocks are inaccurate, which leads to low compression efficiency.

[0005] The present invention provides an environmental security engineering monitoring data management method and system, which adopts the following technical solutions:

[0006] Obtain a grayscale image and multiple single-channel images of each frame of the security monitoring video; obtain multiple super-pixel blocks of each single-channel image;

[0007] Each edge point in each superpixel block of each single-channel image is connected with edge points in different directions to obtain edge point lines in different directions, and a fitting straight line of the grayscale difference between adjacent pixels on each edge point line in different directions and the fitting quality of the fitting straight line are obtained;

[0008] The fitting quality entropy value of each superpixel block in different directions is obtained by using the fitting quality of the fitting straight line corresponding to each edge point connecting line in different directions in each superpixel block; the minimum fitting quality entropy value is selected as the fitting entropy value of the superpixel block, and the direction in which the minimum fitting quality entropy value is obtained is used as the target direction of the corresponding superpixel block;

[0009] All superpixel blocks are classified using the fitted entropy value and grayscale mean of every two superpixel blocks in each single-channel image to obtain multiple categories of superpixel blocks;

[0010] The prediction model coefficients of each type of superpixel block are obtained by using the grayscale value and distance of each edge point in each type of superpixel block of each single-channel image and the corresponding edge point in the target direction;

[0011] The prediction bias of each type of superpixel block is obtained by using the prediction model coefficient of each type of superpixel block in each single-channel image and the grayscale value of the pixel point in each type of superpixel block; the prediction grayscale value of each pixel point in each type of superpixel block in each single-channel image is obtained according to the prediction bias, prediction model coefficient and grayscale value of the edge point of each type of superpixel block in each single-channel image;

[0012] The prediction error of each pixel in the grayscale image is obtained by using the grayscale value of each pixel in the grayscale image and the predicted grayscale value of each pixel in each single-channel image, and the prediction error of each pixel is encoded and stored.

[0013] Furthermore, the method of obtaining the prediction model coefficients of each type of super pixel block includes:

[0014] Obtain the grayscale difference and distance between each edge point of each superpixel block and the corresponding edge point in the target direction in each type of superpixel block of each single-channel image;

[0015] The grayscale difference and distance obtained between each edge point and the corresponding edge point in the target direction are calculated to obtain the grayscale change rate between each edge point and the corresponding edge point in the target direction;

[0016] The prediction model coefficient of each superpixel block is obtained by using the average value of the grayscale change rate between each edge point in each superpixel block and the corresponding edge point in the target direction;

[0017] The average of the prediction model coefficients of all superpixel blocks in each type of superpixel block is used as the prediction model coefficient of each type of superpixel block.

[0018] Furthermore, the method for obtaining the prediction bias of each type of super pixel block includes:

[0019] Each edge point in each superpixel block of each single-channel image and the corresponding edge point in the target direction are recorded as a pair of edge point pairs, and each pair of edge point pairs corresponds to an edge point line;

[0020] The edge point with the smaller gray value in each edge point pair is recorded as the target point;

[0021] According to the gray value of the target point on each edge point line in each super pixel block and the prediction model coefficient of the category of the super pixel block, the prediction value of each pixel point on each edge point line except the edge point is obtained;

[0022] The prediction bias of each pixel is obtained by using the difference between the predicted value and the gray value of each pixel in each superpixel block;

[0023] The mode of the prediction biases of all pixels in each type of superpixel block is used as the prediction bias of each type of superpixel block.

[0024] Furthermore, the formula for obtaining the predicted bias of each pixel in each superpixel block is:

[0025]

[0026] in, Represents pixel The forecast bias of Represents pixel The gray value of the target point on the line connecting the edge points; Represents pixel The superpixel block belongs to Prediction model coefficients of superpixel-like patches; Represents pixel The value corresponding to the Kth pixel point after the target point on the edge point line; Represents pixel The gray value of .

[0027] Furthermore, the method for obtaining the predicted grayscale value of each pixel is:

[0028] Get the distance between each pixel and the target point on the line connecting the edge points;

[0029] The obtained distance is multiplied by the prediction model coefficient of the superpixel block category to which the superpixel block where the pixel point is located belongs, to obtain the product corresponding to each pixel point;

[0030] The product obtained for each pixel is added to the grayscale value of the target point on the edge point line, and then the predicted bias of the superpixel block category is added to obtain the predicted grayscale value of each pixel.

[0031] Further, the method for obtaining the fitting quality of the fitting line includes:

[0032] The variance of the distance from the grayscale difference of each pair of adjacent pixels on the edge point line to the fitting line is obtained, and the variance obtained from each edge point line is used as the fitting quality of the fitting line corresponding to the edge point line.

[0033] Furthermore, the method for obtaining the prediction error of each pixel in the grayscale image is:

[0034] The predicted grayscale value of each pixel in multiple single-channel images is used to obtain the target predicted grayscale value of each pixel in the grayscale image;

[0035] The absolute value of the difference between the target predicted grayscale value and the grayscale value of each pixel in the grayscale image is taken as the prediction error of each pixel in the grayscale image.

[0036] Further, the method of obtaining multiple categories of super pixel blocks includes:

[0037] The fitting entropy value and grayscale mean of each super-pixel block are used to form the feature vector of the corresponding super-pixel block;

[0038] The cosine similarity of the feature vectors of each two super pixel blocks is calculated as the correlation between the corresponding two super pixel blocks;

[0039] The classification principle is: the correlation between any two superpixel blocks in the same category is within the preset correlation threshold range;

[0040] The classification principle is used to classify the superpixel blocks in each single-channel image to obtain superpixel blocks of multiple categories.

[0041] An environmental security engineering monitoring data management system includes a data acquisition unit, a data analysis unit, and a data compression unit:

[0042] A data acquisition unit is used to obtain a grayscale image and multiple single-channel images of each frame of the security monitoring video; and obtain multiple super-pixel blocks of each single-channel image;

[0043] A data analysis unit is used to obtain edge point lines in different directions by connecting each edge point in each superpixel block of each single-channel image with edge points in different directions, and to obtain a fitting straight line of grayscale differences between adjacent pixel points on each edge point line in different directions and a fitting quality of the fitting straight line;

[0044] The fitting quality entropy value of each superpixel block in different directions is obtained by using the fitting quality of the fitting straight line corresponding to each edge point connecting line in different directions in each superpixel block; the minimum fitting quality entropy value is selected as the fitting entropy value of the superpixel block, and the direction in which the minimum fitting quality entropy value is obtained is used as the target direction of the corresponding superpixel block;

[0045] All superpixel blocks are classified using the fitted entropy value and grayscale mean of every two superpixel blocks in each single-channel image to obtain multiple categories of superpixel blocks;

[0046] The data encoding unit obtains the prediction model coefficient of each type of super pixel block by using the gray value and distance of each edge point in each type of super pixel block of each single-channel image and the corresponding edge point in the target direction;

[0047] The prediction bias of each type of superpixel block is obtained by using the prediction model coefficient of each type of superpixel block in each single-channel image and the grayscale value of the pixel point in each type of superpixel block; the prediction grayscale value of each pixel point in each type of superpixel block in each single-channel image is obtained according to the prediction bias, prediction model coefficient and grayscale value of the edge point of each type of superpixel block in each single-channel image;

[0048] The prediction error of each pixel in the grayscale image is obtained by using the grayscale value of each pixel in the grayscale image and the predicted grayscale value of each pixel in each single-channel image, and the prediction error of each pixel is encoded and stored.

[0049] The beneficial effects of the present invention are as follows: an environmental security engineering monitoring data management method and system of the present invention, since the grayscale connection between the pixels in each single channel in the image is closer, each single channel of the image is analyzed independently, which can make the linear prediction result more accurate; a superpixel block in the grayscale image is obtained, and the pixels with similar texture, similar grayscale and similar distance in the grayscale image are divided into the same superpixel block, and then a linear prediction model is analyzed according to the characteristics of the pixels in the same superpixel block. Compared with randomly dividing macroblocks, the prediction model coefficients obtained in this way are more accurate; by obtaining the fitting straight line of the grayscale difference on the edge point connection line in each direction of the superpixel block, the fitting quality of the superpixel block is obtained. Entropy value, select the minimum fitting quality entropy value from multiple directions as the fitting entropy value of the superpixel block, that is, select the direction with the most regular grayscale change as the direction for linear prediction, which is more in line with the grayscale change law of the pixel point, and can make the subsequent predicted grayscale value closer to the grayscale value of the pixel point itself in the single-channel image, and then convert the predicted grayscale value in the single-channel image to the target predicted grayscale value in the grayscale image, so that the obtained prediction error is smaller, the occupied space after encoding is smaller, and the compression effect is better; and the influence of the prediction bias on the prediction error is taken into account. Compared with directly using the prediction model coefficient to calculate the predicted grayscale value, the obtained predicted grayscale value is more accurate, the subsequent prediction error is smaller, and the compression effect is better. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0051] Figure 1 The present invention is a flowchart of the overall steps of an embodiment of an environmental security engineering monitoring data management method of the present invention. DETAILED DESCRIPTION

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

[0053] An embodiment of the environmental security engineering monitoring data management method of the present invention is aimed at the images collected by environmental security monitoring, most of which are fire-fighting equipment and fixed buildings. There is a large amount of spatially redundant pixel data in the image, so a prediction model is established to compress the data, such as Figure 1 As shown, the method includes:

[0054] S1. Obtain a grayscale image and multiple single-channel images of each frame of a security monitoring video; and obtain multiple superpixel blocks of each single-channel image.

[0055] Specifically, each frame of the security monitoring video is obtained, wherein each frame is an RGB image. Since the pixels in the same channel are more closely connected, the subsequent prediction model for predicting the values ​​of the pixels in the same channel will be more accurate. Therefore, the R, G, and B channels in each frame are processed separately to obtain three single-channel images in each frame; and a grayscale image of each frame is obtained for subsequent calculation of the prediction error of the pixel points.

[0056] In this embodiment, a single-channel image in one frame of the security monitoring video is analyzed and processed, and each single channel of other frame images is processed in the same manner.

[0057] The image data compression method selected in this scheme is predictive coding compression, that is, by establishing a linear prediction model, the predicted grayscale value of each pixel is obtained, and the prediction error is obtained according to the predicted grayscale value and the grayscale value of the pixel itself, and the prediction error is encoded and stored. In order to make the linear prediction result more accurate, it is necessary to classify the pixels with similar features in the single-channel image into one category, and divide the pixels with large feature differences into different parts to construct a linear prediction model. Therefore, the way to preliminarily classify the pixels in the single-channel image is to perform superpixel segmentation on the single-channel image to obtain multiple superpixel blocks, quantize the features of the superpixel blocks, and classify the superpixel blocks according to the correlation between the quantized superpixel blocks. There may be similar connections between adjacent superpixel blocks, or there may not be. There may also be connections between non-adjacent superpixel blocks, and the same prediction model can be used for prediction. Therefore, the same prediction model is established for superpixel blocks of the same category with high correlation, and predictive coding is stored for each frame of the image.

[0058] Specifically, a single-channel image is segmented into superpixels to obtain multiple superpixel blocks. Superpixel segmentation refers to dividing a series of adjacent pixels with similar color, brightness, and texture features into the same superpixel block area. Superpixel segmentation takes into account the edge information in the image and will segment along the pixels with larger grayscale gradients in the image. Within the superpixel block, the grayscale value difference of the pixels is very small.

[0059] S2. Connect each edge point in each superpixel block of each single-channel image with edge points in different directions to obtain edge point lines in different directions, and obtain a fitting straight line of the grayscale difference between adjacent pixels on each edge point line in different directions and the fitting quality of the fitting straight line.

[0060] The features of each superpixel block in a single-channel image are quantitatively analyzed, including the analysis of the brightness value and grayscale change law of the superpixel block. When analyzing the grayscale change law in the superpixel block, the grayscale change law of the edge point in a certain direction can be analyzed, that is, the grayscale difference between adjacent pixels is linear. When storing, the difference value can be further compressed and stored to save storage space.

[0061] Specifically, the edge points of each superpixel block are obtained, and the grayscale change pattern of the pixels on the lines connecting the edge points in the directions of 0°, 45°, 90°, and 135° is analyzed. In this embodiment, the 0° direction is taken as an example, and the processing methods in the directions of 45°, 90°, and 135° are the same.

[0062] First The superpixel block is the analysis object: get the The edge point corresponds to the edge point (the corresponding edge point refers to the intersection of the straight line in the 0° direction passing through the ith edge point and the edge line of the superpixel block, that is, the ith edge point and the corresponding edge points are on the same straight line with a 0° direction), edge points and the corresponding The line connecting the edge points is recorded as The edge points are connected, and the The edge points and The edge points are a pair of edge points.

[0063] Get the The first edge point on the line edge points and the corresponding The grayscale variation law between all adjacent pixels between edge points. Specifically, calculate the The grayscale difference between adjacent pixels on the ith edge point line is linearly fitted to all grayscale differences on the ith edge point line to obtain a fitting straight line of the grayscale difference of the ith edge point line (linear fitting is a prior art and will not be described in detail here). The linear equation of the fitting straight line is: .

[0064] The distance from the grayscale difference of each adjacent pixel on the edge point line to the fitting straight line corresponding to the edge point line is calculated according to the following formula:

[0065]

[0066] in, Represents the distance from the ath grayscale difference on the edge point line to the fitting straight line corresponding to the edge point line; , are the parameters of the straight line equation of the fitting straight line of the grayscale difference of the i-th edge point connection; is the horizontal and vertical coordinates of the ath grayscale difference on the i-th edge point line, that is represents the ath grayscale difference on the i-th edge point line, represents the specific value of the ath grayscale difference; the distance calculation formula from a point to a straight line is an existing formula and will not be repeated here.

[0067] According to this method, the distance from the grayscale difference of adjacent pixels on each edge point line to the corresponding fitting straight line is obtained.

[0068] The variance of the distance from all grayscale differences on each edge point line to the fitting line is used as the fitting quality of the fitting line. The formula for the fitting quality of the fitting line corresponding to the edge point connection line is:

[0069]

[0070] in, Indicates the The fitting quality of the fitting line corresponding to the line connecting the edge points; Indicates The number of pixels on the edge point line; Represents the distance from the ath grayscale difference on the edge point line to the fitting straight line corresponding to the edge point line. Represents the mean distance from all grayscale differences on the edge point line to the corresponding fitting straight line, It represents the variance of the distance from all grayscale differences on the edge point line to the fitting line. The larger the variance, the more dispersed the actual grayscale difference is around the fitting line, and the worse the quality of the fitting line is. The smaller the variance, the closer the actual grayscale difference is to the fitting line, the better the quality of the fitting line is, and the grayscale change relationship on the edge point line is closer to a linear relationship.

[0071] It should be noted that linear fitting of the grayscale differences of adjacent pixels on the edge point line can describe the linear change of the grayscale difference. When the grayscale difference on the edge point line is closer to linear change, similar grayscale differences can be compressed during storage, which can better save compression space. The fitting quality of the fitting line can be calculated using the variance of the distance from the grayscale difference to the fitting line, and the linear fitting quality of the grayscale difference can be evaluated. The distance from the grayscale difference to the fitting line after linear fitting can reflect the connection between the grayscale differences, that is, the grayscale differences can be integrated using the same linear relationship.

[0072] S3. Using the fitting quality of the fitting straight line corresponding to each edge point connecting the lines in different directions in each superpixel block, the fitting quality entropy value of each superpixel block in different directions is obtained; the minimum fitting quality entropy value is selected as the fitting entropy value of the superpixel block, and the direction in which the minimum fitting quality entropy value is obtained is used as the target direction of the corresponding superpixel block.

[0073] Specifically, Taking a superpixel block as an example, the fitting quality entropy value of the superpixel block is calculated according to the following formula:

[0074]

[0075] in, Indicates The fitting quality entropy value of super pixel blocks; The quality of the fit is The fitting straight line is The probability of a superpixel block appearing in all the fitted lines; Indicates The number of fitted lines in a superpixel block is the number of edge point lines; i represents the fitted line corresponding to the i-th edge point line. is the calculation formula of information entropy, which is the prior art. It is used here to indicate the degree of disorder of the fitting quality of all fitting lines in the superpixel block. The larger the fitting quality entropy value, the better the The more chaotic the fitting quality of the fitted line in a superpixel block is, the more chaotic the grayscale value changes in the superpixel block are, and the entropy value The smaller it is, the closer the fitting quality of all the fitted lines in the superpixel block is. The more stable the change pattern of the gray value inside the superpixel block.

[0076] So far, we have obtained The fitting quality entropy value of the superpixel block in the 0° direction.

[0077] According to the method of obtaining the fitting mass entropy value in the 0° direction, the The fitting quality entropy value in the direction, the minimum value is selected from the fitting quality entropy values ​​obtained in the four directions as the fitting entropy value of the superpixel block, and the direction with the minimum fitting quality entropy value is taken as the target direction. It is believed that the grayscale change law in the target direction is the most stable and can be used as the optimal prediction direction.

[0078] S4. Classify all superpixel blocks using the fitting entropy value and grayscale mean of every two superpixel blocks in each single-channel image to obtain superpixel blocks of multiple categories.

[0079] If the brightness and grayscale variation rules of any two superpixel blocks in a single-channel image are closer, the correlation between the two superpixel blocks is considered to be higher. The brightness of the superpixel block can be represented by the grayscale value of the pixel point, and the degree of chaos of the grayscale variation rule can be represented by the fitting entropy value.

[0080] Specifically, the grayscale mean of the pixels in each superpixel block in the single-channel image is obtained, and the fitting entropy value and the grayscale mean of each superpixel block are used to form the feature vector of the corresponding superpixel block; the cosine similarity of the feature vectors of every two superpixel blocks is calculated as the correlation between the corresponding two superpixel blocks.

[0081] First superpixel blocks and Taking a super pixel block as an example, the formula for calculating the correlation between two super pixel blocks is:

[0082]

[0083] in, Indicates superpixel blocks and The correlation of superpixel blocks; Indicates The grayscale mean of the pixels in the superpixel block; Indicates The grayscale mean of the pixels in the superpixel block; Indicates The fitting entropy value of the superpixel block, that is, The degree of disorder of grayscale variation on the edge point connection line in a superpixel block; Indicates The fitting entropy value of the superpixel block, that is, The degree of disorder of the grayscale change law on the edge point connection line in the super pixel block; superpixel blocks and The more similar the superpixel blocks are, the closer the brightness and grayscale change rules are to being equal in value. The feature vector of a superpixel block and The feature vector of a superpixel block The higher the cosine similarity (the cosine similarity calculation formula is an existing formula and will not be repeated here), that is, The closer the value is to 1.

[0084] At this point, the correlation between every two super pixel blocks is obtained, and the super pixel blocks are classified according to the correlation between every two super pixel blocks.

[0085] The reason for choosing classification instead of merging for all superpixel blocks in a single-channel image is that the grayscale change law and brightness value characteristics of the pixels in each superpixel block are similar, and the distribution characteristics of the pixels are similar. However, if the superpixel blocks are merged, the distribution law of the original pixels in the merged superpixel block will change, which will amplify the error of the prediction model originally constructed to meet the distribution law of the pixels in the superpixel block before the merger, resulting in excessively long encoding and poor compression effect.

[0086] All superpixel blocks in a single-channel image are classified according to the correlation between superpixel blocks. The correlation threshold interval can be set according to the actual situation. The number of categories of superpixel blocks obtained according to the correlation threshold interval should be reasonable, not too many or too few. This can not only reduce the amount of calculation and model storage space, but also predict the pixel points of each superpixel block according to the feature change law within the superpixel block, and the prediction result is more accurate.

[0087] The classification principle is: the correlation between any two superpixel blocks in the same category is within the preset correlation threshold range. According to this classification principle, the superpixel blocks in each single-channel image are classified to obtain multiple types of superpixel blocks in each single-channel image, and the correlation threshold range between superpixel blocks is set to , the superpixel blocks in this interval are considered to be closely connected. At this time, there is no need to pay attention to the size, shape, and position of the superpixel blocks. You only need to pay attention to the correlation between different superpixel blocks in the security monitoring video image. The same prediction model is used to predict the same type of superpixel blocks. In each superpixel block, there is a prediction direction belonging to the current superpixel block, that is, the target direction. There are one or more superpixel blocks in each type of superpixel block.

[0088] Superpixel blocks with high correlation are classified into the same category. That is, according to the grayscale value and grayscale change law of the superpixel blocks, superpixel blocks with similar grayscale means and similar grayscale change laws are classified into the same category. Compared with building a linear prediction model for each superpixel block, the classification method reduces the amount of calculation while ensuring the accuracy of the prediction model coefficients.

[0089] S5. Obtain prediction model coefficients of each type of superpixel block by using the grayscale value and distance of each edge point in each type of superpixel block of each single-channel image and the corresponding edge point in the target direction.

[0090] Specifically, the grayscale difference and distance between each edge point of each superpixel block in each type of superpixel block in the single-channel image and the corresponding edge point in the target direction are obtained; the ratio of the grayscale difference and distance between each edge point and the corresponding edge point in the target direction is calculated to obtain the grayscale change rate between each edge point and the corresponding edge point in the target direction; the grayscale change rate between each edge point and the corresponding edge point in the target direction is calculated according to the following formula:

[0091]

[0092] in, Indicates In the superpixel block edge point and the corresponding Grayscale change rate between edge points; Indicates In the superpixel block Gray value of edge points; Indicates In the superpixel block The edge point corresponds to the first Gray value of edge points; Indicates edge point and the corresponding The distance between edge points. That is, the grayscale change rate on the edge point line is obtained by the ratio of the absolute value of the overall grayscale change difference on the edge point line to the length of the edge point line. (The edge points and corresponding edge points in the superpixel block, as well as the edge point lines in steps S5-S6, all refer to the edge point lines in the target direction of the superpixel block, as well as the edge points and the corresponding edge points in the target direction.)

[0093] Since the pixels in a superpixel block have similar eigenvalues ​​and the correlation between superpixel blocks in the same category is high, the same linear prediction model coefficients are used for all pixels in superpixel blocks of the same category.

[0094] The prediction model coefficient of each superpixel block is obtained by using the average value of the grayscale change rate between each edge point in each superpixel block and the corresponding edge point in the target direction.

[0095] Specifically, Taking a super pixel block as an example, the prediction model coefficient of each super pixel block is calculated according to the following formula:

[0096]

[0097] in, Indicates The prediction model coefficient of the superpixel block, that is, The prediction model coefficients of the linear prediction model between the edge points in the super pixel block and the corresponding edge points; Indicates In the superpixel block edge point and the corresponding The grayscale change rate between edge points is Indicates The number of edge points connected in a superpixel block.

[0098] The prediction model coefficient of each type of superpixel block is obtained by using the average value of the prediction model coefficients of all superpixel blocks in each type of superpixel block.

[0099] S6. Utilize the prediction model coefficients of each type of superpixel blocks in each single-channel image and the grayscale values ​​of the pixels in each type of superpixel blocks to obtain the prediction bias of each type of superpixel blocks; and obtain the prediction grayscale value of each pixel in each type of superpixel blocks in each single-channel image according to the prediction bias, prediction model coefficients and grayscale values ​​of the edge points of each type of superpixel blocks in each single-channel image.

[0100] Each edge point in each superpixel block and the corresponding edge point in the target direction are recorded as a pair of edge point pairs, and each pair of edge point pairs corresponds to an edge point line; the edge point with the smaller grayscale value in each edge point pair is recorded as the target point; the predicted value of each pixel point on each edge point line except the edge point is obtained according to the grayscale value of the target point on each edge point line in each superpixel block and the prediction model coefficient of the category to which the superpixel block belongs; the predicted bias of each pixel point is obtained by using the difference between the predicted value and the grayscale value of each pixel point in each superpixel block; the mode of the predicted bias of all pixels in each type of superpixel block is taken as the predicted bias of each type of superpixel block.

[0101] Specifically, when predicting each pixel in the superpixel block, different prediction values ​​will be obtained, that is, there will be different prediction biases. The prediction bias of each pixel in the superpixel block is calculated according to the following formula:

[0102]

[0103] in, Represents pixel The forecast bias of Represents pixel The gray value of the target point on the line connecting the edge points; Represents pixel The superpixel block belongs to Prediction model coefficients of superpixel-like patches; Represents pixel The first point after the target point on the edge point line The value corresponding to the pixel point, for example, the 5th pixel point after the target point, is equal to 5; Represents pixel The gray value of It is obtained by the grayscale change law between the edge point pairs on the edge point line, so the grayscale value of each pixel on the edge point line is obtained according to the grayscale change law, and the grayscale value of the target point on the edge point line plus the linear model coefficient and the pixel point are used. The product of the distance to the target point , get pixel point The predicted value of the pixel point is obtained by adding the grayscale change law to the target point because the target point is the one with the smaller grayscale value in the edge point pair. If the target point is an edge point with a larger grayscale value, the grayscale change law is subtracted from the target point. The pixel point is obtained by the difference between the predicted value and the grayscale value of the pixel point itself. The forecast bias of .

[0104] The mode of the prediction biases of all pixels in each type of superpixel block is obtained as the prediction bias of each type of superpixel block, and the prediction bias of each type is directly stored, which reduces the storage space compared to storing each prediction bias.

[0105] Get the distance between each pixel and the target point on the edge point line; multiply the distance obtained by the prediction model coefficient of the superpixel block category to which the superpixel block where the pixel is located to obtain the product corresponding to each pixel; add the product obtained for each pixel to the grayscale value of the target point on the edge point line, and add the prediction bias of the superpixel block category to obtain the predicted grayscale value of each pixel. Specifically, the predicted grayscale value of each pixel is calculated according to the following formula:

[0106]

[0107] in, Represents pixel The predicted gray value of Represents pixel The gray value of the target point on the line connecting the edge points; Represents pixel The superpixel block belongs to Prediction model coefficients of superpixel-like patches; Represents pixel The first point after the target point on the edge point line pixel points, for example, the 5th pixel point after the target point, It is equal to 5, that is, the distance between the pixel and the target point is 5; Represents pixel Belong to The prediction bias of the super pixel block is calculated by adding the gray value of the target point on the edge point line to the linear model coefficient and the pixel point. The product of the distance to the target point , get pixel point The predicted value, since the target point is the one with the smaller grayscale value in the edge point pair, the target point is added with the grayscale change law. If the target point is the edge point with the larger grayscale value in the edge point pair, the grayscale change law is subtracted from the target point. Taking into account the influence of the prediction bias on the predicted value, the prediction bias of the superpixel block category to which it belongs is added. Compared with directly using the prediction model coefficient to calculate the predicted grayscale value, the obtained predicted grayscale value is more accurate, the subsequent prediction error is smaller, and the compression effect is better.

[0108] S7. Obtain a prediction error for each pixel in the grayscale image using the grayscale value of each pixel in the grayscale image and the predicted grayscale value of each pixel in each single-channel image, and encode and store the prediction error for each pixel.

[0109] Specifically, the predicted grayscale value of each pixel in multiple single-channel images is used to obtain the target predicted grayscale value of each pixel in the grayscale image (converting the grayscale values ​​of pixels in multiple single-channel images into grayscale values ​​of pixels in grayscale images is a prior art and is not described in detail here); the target predicted grayscale value of each pixel in the grayscale image is subtracted from the grayscale value of the pixel in the grayscale image to obtain a difference, and the absolute value of the difference is calculated to obtain the prediction error for each pixel in the grayscale image.

[0110] The prediction error of each pixel in the grayscale image of each frame of the monitoring video is encoded and stored, and the encoding method of the prediction encoding can be run-length encoding.

[0111] An environmental security engineering monitoring data management system includes a data acquisition unit, a data analysis unit, and a data compression unit. Specifically: the data acquisition unit is used to obtain a grayscale image and multiple single-channel images of each frame of a security monitoring video; and to obtain multiple superpixel blocks of each single-channel image.

[0112] The data analysis unit is used to obtain edge point lines in different directions by connecting each edge point in each superpixel block of each single-channel image with edge points in different directions, and obtain the fitting straight line of the grayscale difference of adjacent pixel points on each edge point line in different directions and the fitting quality of the fitting straight line.

[0113] The fitting quality entropy value of each superpixel block in different directions is obtained by using the fitting quality of the fitting straight line corresponding to each edge point connecting line in different directions in each superpixel block; the minimum fitting quality entropy value is selected as the fitting entropy value of the superpixel block, and the direction in which the minimum fitting quality entropy value is obtained is used as the target direction of the corresponding superpixel block;

[0114] All superpixel blocks are classified using the fitting entropy value and grayscale mean of every two superpixel blocks in each single-channel image to obtain superpixel blocks of multiple categories.

[0115] The data encoding unit obtains the prediction model coefficient of each type of super pixel block by using the gray value and distance of each edge point in each type of super pixel block of each single-channel image and the corresponding edge point in the target direction.

[0116] The prediction bias of each type of superpixel block in each single-channel image is obtained by using the prediction model coefficient of each type of superpixel block and the grayscale value of the pixel points in each type of superpixel block; the predicted grayscale value of each pixel point in each type of superpixel block in each single-channel image is obtained according to the prediction bias, prediction model coefficient and grayscale value of the edge point of each type of superpixel block in each single-channel image.

[0117] The prediction error of each pixel in the grayscale image is obtained by using the grayscale value of each pixel in the grayscale image and the predicted grayscale value of each pixel in each single-channel image, and the prediction error of each pixel is encoded and stored.

[0118] In summary, the present invention provides a method and system for managing environmental security engineering monitoring data. Since the grayscale connection between pixels in each single channel in the image is closer, each single channel of the image is analyzed independently, which can make the linear prediction result more accurate; the superpixel block in the grayscale image is obtained, and the pixels with similar texture, similar grayscale and similar distance in the grayscale image are divided into the same superpixel block, and then the linear prediction model is analyzed according to the characteristics of the pixels in the same superpixel block. Compared with randomly dividing macroblocks, the prediction model coefficient obtained in this way is more accurate; by obtaining the fitting straight line of the grayscale difference on the edge point connection line in each direction of the superpixel block, the fitting quality entropy value of the superpixel block is obtained. , the minimum fitting quality entropy value is selected from multiple directions as the fitting entropy value of the superpixel block, that is, the direction with the most regular grayscale change is selected as the direction for linear prediction, which is more in line with the grayscale change law of the pixel point, and can make the subsequent predicted grayscale value closer to the grayscale value of the pixel point itself in the single-channel image, and then convert the predicted grayscale value in the single-channel image to the target predicted grayscale value in the grayscale image, so that the obtained prediction error is smaller, the occupied space after encoding is smaller, and the compression effect is better; and the influence of the prediction bias on the prediction error is taken into account. Compared with directly using the prediction model coefficient to calculate the predicted grayscale value, the obtained predicted grayscale value is more accurate, the subsequent prediction error is smaller, and the compression effect is better.

[0119] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for managing environmental security engineering monitoring data, characterized in that: Obtain a grayscale image and multiple single-channel images of each frame of the security monitoring video; obtain multiple super-pixel blocks of each single-channel image; Each edge point in each superpixel block of each single-channel image is connected with edge points in different directions to obtain edge point lines in different directions, and a fitting straight line of the grayscale difference between adjacent pixels on each edge point line in different directions and the fitting quality of the fitting straight line are obtained; The fitting quality entropy value of each superpixel block in different directions is obtained by using the fitting quality of the fitting straight line corresponding to each edge point connecting line in different directions in each superpixel block; the minimum fitting quality entropy value is selected as the fitting entropy value of the superpixel block, and the direction in which the minimum fitting quality entropy value is obtained is used as the target direction of the corresponding superpixel block; All superpixel blocks are classified using the fitted entropy value and grayscale mean of every two superpixel blocks in each single-channel image to obtain multiple categories of superpixel blocks; The prediction model coefficients of each type of superpixel block are obtained by using the grayscale value and distance of each edge point in each type of superpixel block of each single-channel image and the corresponding edge point in the target direction; The prediction bias of each type of superpixel block is obtained by using the prediction model coefficient of each type of superpixel block in each single-channel image and the grayscale value of the pixel point in each type of superpixel block; the prediction grayscale value of each pixel point in each type of superpixel block in each single-channel image is obtained according to the prediction bias, prediction model coefficient and grayscale value of the edge point of each type of superpixel block in each single-channel image; The prediction error of each pixel in the grayscale image is obtained by using the grayscale value of each pixel in the grayscale image and the predicted grayscale value of each pixel in each single-channel image, and the prediction error of each pixel is encoded and stored; No. The formula corresponding to the fitting quality entropy value of a superpixel block is: in, Indicates The fitting quality entropy value of super pixel blocks; The quality of the fit is The fitting straight line is The probability of a superpixel block appearing in all the fitted lines; Indicates The number of fitted lines in a superpixel block; The method of obtaining the prediction model coefficients of each type of super pixel block includes: Obtain the grayscale difference and distance between each edge point of each superpixel block and the corresponding edge point in the target direction in each type of superpixel block of each single-channel image; The grayscale difference and distance obtained between each edge point and the corresponding edge point in the target direction are calculated to obtain the grayscale change rate between each edge point and the corresponding edge point in the target direction; The prediction model coefficient of each superpixel block is obtained by using the average value of the grayscale change rate between each edge point in each superpixel block and the corresponding edge point in the target direction; The average of the prediction model coefficients of all superpixel blocks in each type of superpixel block is used as the prediction model coefficient of each type of superpixel block.

2. The method for managing environmental security engineering monitoring data according to claim 1, characterized in that: The method of obtaining the prediction bias of each type of super pixel block includes: Each edge point in each superpixel block of each single-channel image and the corresponding edge point in the target direction are recorded as a pair of edge point pairs, and each pair of edge point pairs corresponds to an edge point line; The edge point with the smaller gray value in each edge point pair is recorded as the target point; According to the gray value of the target point on each edge point line in each super pixel block and the prediction model coefficient of the category of the super pixel block, the prediction value of each pixel point on each edge point line except the edge point is obtained; The prediction bias of each pixel is obtained by using the difference between the predicted value and the gray value of each pixel in each superpixel block; The mode of the prediction biases of all pixels in each type of superpixel block is used as the prediction bias of each type of superpixel block.

3. The method for managing environmental security engineering monitoring data according to claim 2, characterized in that: The formula for obtaining the predicted bias of each pixel in each superpixel block is: in, Represents pixel The forecast bias of Represents pixel The gray value of the target point on the line connecting the edge points; Represents pixel The superpixel block belongs to Prediction model coefficients of superpixel-like patches; Represents pixel The distance between the target point and the edge point; Represents pixel The gray value of .

4. The method for managing environmental security engineering monitoring data according to claim 2, characterized in that: The method to get the predicted grayscale value of each pixel is: Get the distance between each pixel and the target point on the line connecting the edge points; The obtained distance is multiplied by the prediction model coefficient of the superpixel block category to which the superpixel block where the pixel point is located belongs, to obtain the product corresponding to each pixel point; The product obtained for each pixel is added to the grayscale value of the target point on the edge point line, and then the predicted bias of the superpixel block category is added to obtain the predicted grayscale value of each pixel.

5. The method for managing environmental security engineering monitoring data according to claim 1, characterized in that: Methods for obtaining the fit quality of the fitted line include: The variance of the distance from the grayscale difference of each pair of adjacent pixels on the edge point line to the fitting line is obtained, and the variance obtained from each edge point line is used as the fitting quality of the fitting line corresponding to the edge point line.

6. The method for managing environmental security engineering monitoring data according to claim 1, characterized in that: The method to obtain the prediction error of each pixel in the grayscale image is: The predicted grayscale value of each pixel in multiple single-channel images is used to obtain the target predicted grayscale value of each pixel in the grayscale image; The absolute value of the difference between the target predicted grayscale value and the grayscale value of each pixel in the grayscale image is taken as the prediction error of each pixel in the grayscale image.

7. The method for managing environmental security engineering monitoring data according to claim 1, characterized in that: Methods for obtaining multiple categories of superpixel blocks include: The fitting entropy value and grayscale mean of each super-pixel block are used to form the feature vector of the corresponding super-pixel block; The cosine similarity of the feature vectors of each two super pixel blocks is calculated as the correlation between the corresponding two super pixel blocks; The classification principle is: the correlation between any two superpixel blocks in the same category is within the preset correlation threshold range; The classification principle is used to classify the superpixel blocks in each single-channel image to obtain superpixel blocks of multiple categories.

8. An environmental security engineering monitoring data management system, used to implement an environmental security engineering monitoring data management method according to any one of claims 1 to 7, comprising: The data acquisition unit, the data analysis unit and the data compression unit are characterized by: A data acquisition unit is used to obtain a grayscale image and multiple single-channel images of each frame of the security monitoring video; and obtain multiple super-pixel blocks of each single-channel image; A data analysis unit is used to obtain edge point lines in different directions by connecting each edge point in each superpixel block of each single-channel image with edge points in different directions, and to obtain a fitting straight line of grayscale differences between adjacent pixel points on each edge point line in different directions and a fitting quality of the fitting straight line; The fitting quality entropy value of each superpixel block in different directions is obtained by using the fitting quality of the fitting straight line corresponding to each edge point connecting line in different directions in each superpixel block; the minimum fitting quality entropy value is selected as the fitting entropy value of the superpixel block, and the direction in which the minimum fitting quality entropy value is obtained is used as the target direction of the corresponding superpixel block; All superpixel blocks are classified using the fitted entropy value and grayscale mean of every two superpixel blocks in each single-channel image to obtain multiple categories of superpixel blocks; The data encoding unit obtains the prediction model coefficient of each type of super pixel block by using the gray value and distance of each edge point in each type of super pixel block of each single-channel image and the corresponding edge point in the target direction; The prediction bias of each type of superpixel block is obtained by using the prediction model coefficient of each type of superpixel block in each single-channel image and the grayscale value of the pixel point in each type of superpixel block; the prediction grayscale value of each pixel point in each type of superpixel block in each single-channel image is obtained according to the prediction bias, prediction model coefficient and grayscale value of the edge point of each type of superpixel block in each single-channel image; The prediction error of each pixel in the grayscale image is obtained by using the grayscale value of each pixel in the grayscale image and the predicted grayscale value of each pixel in each single-channel image, and the prediction error of each pixel is encoded and stored.

Citation Information

Patent Citations

  • Data storage system for safety management of strength equipment

    CN115278255A

  • Power equipment fault rapid positioning method

    CN115439474A