A method for detecting intrusion in emergency management area
By using motion detection algorithms and LSTM models for intrusion detection in the emergency management area, combined with area detection and real-time data flow analysis, the problems of false positives and missing data and data dependence in intrusion detection in the existing technology are solved, and a more efficient Intrusion threat identification and emergency response.
Patent Information
- Application Number
- CN202410478031.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-04-19
AI Technical Summary
Existing technologies are difficult to detect intrusions in a timely manner when detecting complex and changeable attack methods and unknown attack methods. Moreover, conventional technologies have high false positive and false negative rates, are highly dependent on data, are time-consuming and labor-intensive to update rules, and cannot be effective in real time. Process data in large-scale high-traffic network environments.
The motion detection algorithm is used to detect moving targets from the video stream, the normal behavior model is established through LSTM, the area detection algorithm and real-time data flow analysis technology are combined for dual intrusion detection, and the detection rules and models are dynamically updated using data fusion technology and online learning mechanism.
It reduces the rate of false positives and negatives, improves the comprehensiveness, adaptability and accuracy of detection, enhances the rapid response capability of emergency management, reduces potential losses and hazards, ensures system stability and data integrity, and enables Protect against cyberattacks and malicious interference.
Smart Images

Figure CN118247713B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of emergency area management, and in particular to an emergency management area intrusion detection method. Background Art
[0002] Regional intrusion algorithm is an algorithm used to detect abnormal behavior. It identifies intrusion behavior by analyzing pattern changes in data sets. The technology of regional intrusion algorithm is developing rapidly at home and abroad. Conventional technologies include the following:
[0003] 1. Statistical intrusion detection technology: By analyzing network traffic, system logs and other data, the statistical characteristics of normal behavior are extracted and a normal behavior model is established. When the detected data deviates significantly from the normal model, it is considered that an intrusion may have occurred. However, the corresponding disadvantage is that complex and changeable attack methods and unknown attack methods may not be detected in time.
[0004] 2. Rule-based intrusion detection technology: Detect abnormal behaviors by defining a series of rules. The rules are usually formulated by experts, such as specific network traffic patterns, system call sequences, etc. When the detected data matches the rules, it is considered that an intrusion may have occurred. However, the corresponding disadvantage is that unknown attack methods may not be detected in time. At the same time, the formulation and updating of rules require a lot of manpower and time.
[0005] 3. Intrusion detection technology based on machine learning: This technology identifies abnormal behaviors by training machine learning models. The models are usually trained using unsupervised learning algorithms, such as clustering and anomaly detection. When the detected data is marked as abnormal by the model, it is considered that an intrusion may have occurred. However, the corresponding disadvantage is that unknown attack methods may not be detected in time, and a large amount of high-quality data is required for training.
[0006] For example, application number CN201810552474.5 discloses a smart construction site area management and intrusion detection method and system based on video images. By using image recognition technology on the existing video surveillance equipment at the construction site, the on-site regional management needs can be met with very little additional cost; and a method based on video intelligent recognition of markers is used to achieve zoning management within the monitoring range. The division of specific areas can be changed at any time according to actual needs on site. The system can automatically implement security management according to the new area definition. The tracking of mobile targets adopts a two-level tracking strategy of connected area block features and LBP features to ensure the real-time and accuracy of target tracking. However, there are defects such as unclear classification and inaccurate identification of intrusion behavior patterns, difficulty in timely detection of potential intrusion threats, and long data analysis time of the intelligent system that makes it difficult to meet real-time requirements, and long system startup and shutdown and update time that makes it difficult to resist network attacks and malicious interference.
[0007] The existing technology has the following shortcomings: However, the above conventional technology has achieved good results in practice, but at the same time there are still some shortcomings, including that due to the complexity of the network environment and the constant changes in attack methods, it is difficult for conventional technology to completely and accurately detect all intrusion behaviors, and it may also produce more false positives and missed positives;
[0008] In some large-scale and high-traffic network environments, conventional technologies may encounter performance bottlenecks and fail to process data effectively in real time;
[0009] In order to improve the detection accuracy, a large amount of high-quality data needs to be collected for training and testing, which results in high data dependence. However, in practical applications, data acquisition and labeling is a complex and time-consuming task.
[0010] In actual applications, rule-based intrusion detection technology needs to update and adjust rules in a timely manner according to changes in attacks, which requires a lot of manpower and time.
[0011] 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 constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0012] The purpose of the present invention is to provide an emergency management area intrusion detection method. The present invention adopts a motion detection algorithm to obtain a moving target detected in an image from a video stream that has been cleaned, normalized, and feature extracted, and uses a target tracking algorithm to track the moving target to obtain relevant coordinate information, and uses LSTM to establish a normal behavior model, adopts a regional detection algorithm to make intrusion judgments on the moving target, and uses real-time data stream analysis technology to judge the calculated abnormal score with the normal behavior threshold of the normal behavior model, so as to realize dual intrusion detection and judgment of the moving target, so as to solve the problems in the above-mentioned background technology.
[0013] In order to achieve the above object, the present invention provides the following technical solution: an emergency management area intrusion detection method, comprising the following steps:
[0014] S1. Completely cover the emergency management area with camera equipment, monitor and collect video streams in real time, obtain video frame data sets, and perform streaming processing on the video frame data sets to obtain original image data;
[0015] S2, extracting intrusion features in the emergency management area from the original image data after cleaning, standardization and normalization to obtain feature image data;
[0016] S3, using a motion detection algorithm to calculate a moving target from the feature image data, and using a target tracking algorithm to track the moving target to obtain position coordinate information of the moving target;
[0017] S4. Use a neural network algorithm to learn and train historical data of location coordinate information to establish a normal behavior model, and perform abnormal behavior detection and judgment on newly input data based on the trained model;
[0018] S5. Use the area detection algorithm to judge the intrusion of the moving target, and use the real-time data stream analysis technology to calculate the abnormal score that is different from the normal behavior model. Use the abnormal score and the normal behavior threshold to identify the moving target with intrusion behavior, and then trigger an alarm and take countermeasures according to the results of the dual detection of the moving target;
[0019] S6. Use data fusion technology to fuse information from diversified data sources to obtain more comprehensive and accurate detection results, and regularly and dynamically update detection rules and models through online learning mechanisms to adapt to new threats and changing environments.
[0020] Optionally, the logic for acquiring the original image data is as follows:
[0021] Deploy a sufficient number of cameras in the emergency management area based on actual needs and scene characteristics to ensure coverage without blind spots;
[0022] The camera device collects the dynamic situation in the area in real time, generates a video stream and calibrates it as vs;
[0023] Use FFmpeg, GStreamer or HandBrake codec software to convert the video stream vs into a series of continuous video frame data sets through a predetermined frame rate FPS and decoding process according to the H.264 video coding standard, calibrated as vfd. The video frame data set vfd contains all static images of scene information in the emergency management area during the monitoring period;
[0024] The video frame dataset vfd is then stream processed. The streaming processing includes real-time reception, caching, denoising and brightness adjustment preprocessing and output of raw image data, calibrated as oid. The calculation formula for denoising and brightness adjustment preprocessing is and i∈[1,N], j∈[1,N], and oid=vfd(x0,y0)+B0, where vfd(x0,y0) represents the pixel value of the video frame dataset vfd image at position (x0,y0), and N represents the number of pixels covered by the average filter. It is represented by the sum of N pixel translations in the x and y directions of the pixel at the current position (x0, y0) in the video frame dataset vfd image. i and j represent the translation amounts corresponding to the i-th and j-th pixels in the N translatable pixels, respectively. OID represents the original image data output after denoising and brightness adjustment preprocessing. B0 represents the amount of brightness adjustment.
[0025] Optionally, the processing steps of the original image data are as follows:
[0026] First, the original image data oid is cleaned by removing invalid pixels at the edge of the image and repairing lost or damaged data points to obtain the cleaned image data and calibrate it as oid1;
[0027] Standardizing the cleaned image data oid1 is to adjust the range of the image intensity value to a specific range, thereby obtaining standardized image data, calibrated as oid2, and the standardization calculation formula is: Where oid2(x0,y0) represents the result of normalization of the cleaned image data oid1, oid1(x0,y0) represents the pixel value of the cleaned image data oid1 at position (x0,y0), and oid max ,oid min Respectively represent the maximum and minimum values of the original image data oid, oid′ max oid′ min They are represented as the maximum and minimum values of the standardized target range, respectively;
[0028] Scale the standardized image data oid2 to the interval [0,1] for normalization, obtain the normalized image data, and calibrate it as oid3. The normalization calculation formula is: Where oid3(x0,y0) represents the result of normalizing and scaling the standardized image data oid2 to the interval [0,1].
[0029] Optionally, the acquisition logic of the feature image data is as follows:
[0030] The original image data oid is cleaned, standardized and normalized to obtain the normalized image data oid3. The Sobel operator is used to detect the image edge for feature extraction. The edge detection calculation formula of the Sobel operator in the horizontal and vertical directions is: and In the formula, Gx and Gy represent the gradients of the normalized image data oid3 in the horizontal and vertical directions, respectively. They are respectively represented as the Sobel operator convolution kernel corresponding to the horizontal gradient Gx and the Sobel operator convolution kernel corresponding to the vertical gradient Gy, where G represents the edge intensity;
[0031] After extracting several features, a threshold is set based on the edge strength G and calibrated as Th1 to select features containing the required amount of information, and a feature image is constructed based on the selected features to obtain feature image data. The feature selection is determined as follows: when G ≥ Th1, the feature selection is G, and when G < Th1, the feature selection is 0; the feature image data is generated as G (x0, y0).
[0032] Optionally, the moving target detection steps are as follows:
[0033] Using the feature image data G(x0,y0), a background model is constructed and background subtraction is used to update it over time to adapt to scene changes to obtain an estimated value of the foreground object. The calculation formula for background subtraction is: In the formula, It represents the updated pixel value at the position (x0, y0) of the next moment t0+1 frame, α represents the learning rate, t0 represents the previous moment t0 frame, Represented as the pixel value of the feature image of the current time frame t0, Represented as the pixel value of the background model at the position (x0, y0);
[0034] Applying the threshold operation will result in an image Converted to a binary image, the conversion process of the binary image is Bj(x0, y0)>Th2, I binary (x0, y0) = 1, and Bj(x0, y0) ≤ Th2, I binary(x0, y0) = 0, where Bj(x0, y0) represents the result image The pixel value at position (x0, y0), Th2 represents the threshold value pre-set for each pixel, I binary (x0, y0) represents the pixel value of the binary image at position (x0, y0);
[0035] Use morphological operations to remove noise, and apply shadow detection algorithms to further refine the results and identify the contours or areas of moving objects. The calculation formula for removing noise is I dilated (x0, y0) = max{a, b} × I binary (x0+a,y0+b), I eroded (x0, y0) = min{a, b} × I binary (x0+a,y0+b), and {a,b}∈S0, where I dilated (x0, y0) represents the pixel value of the binary image after the dilation operation. eroded (x0, y0) represents the pixel value of the binary image after the erosion operation, max{a,b} and min{a,b} represent the maximum and minimum offsets in the neighborhood S0, respectively, S0 represents the neighborhood defined by the structural element, {a,b} represents the structural element, and a, b represent the offset of a pixel in the structural element {a,b};
[0036] The shadow detection algorithm is judged as follows: When I shadow (x0, y0) = 1, and Δ color <Th5,I shadow (x0, y0) = 0, where I'(x0, y0) represents the pixel value of the image at the position (x0, y0) after the morphological operation, and the actual brightness value is an integer between 0 and 255, Bj(x0, y0)t0 represents the pixel value of the background model at the position (x0, y0), and the actual brightness value is an integer between 0 and 255, [Th3, Th4] represent the brightness ratio threshold range accepted for identifying the shadow area, respectively, Δ color It is represented as the color difference between the current image pixel and the background model pixel, Th5 is represented as the threshold of the color difference, and further confirms the shadow, I shadow (x0, y0) represents the result image of shadow detection, which determines whether the pixel belongs to the shadow. When it is equal to 1, it belongs to the shadow, and when it is equal to 0, it belongs to the non-shadow.
[0037] In order to identify and refine the contour of the moving object, determine the generation of the bounding box of the moving object, and accurately mark the moving target, a set of contour point coordinates and the number of contour points are known, and are calibrated as (x k ,yk ), k∈[1,n], the formula for generating the bounding box by calculating the minimum enclosing rectangle of the contour is: And W Bbox =x max -x min , H Bbox =y max -y min , and Bbox = [x min ,y min ,W Bbox ,H Bbox ], where (x min ,y min )、(x max ,y max ) are represented as the coordinates of the upper left corner and the lower right corner of the bounding box, respectively, W Bbox Expressed as the width of the bounding box, H Bbox It is expressed as the height of the bounding box, and Bbox is expressed as the coordinates of a contour point (x min ,y min ) and the calculated width and height (W Bbox ,H Bbox ) to generate a bounding box.
[0038] Optionally, the logic for acquiring the position coordinate information of the moving target is as follows:
[0039] According to the initial position of the moving target, calibrated as (x, y), the KLT optical flow method is used to track the area of the target feature points, and the target position is updated in each frame. The calculation formula of the KLT optical flow method is I x ×V x +I y ×V y +I t =0, where I x ,I y Respectively represent the horizontal and vertical grayscale gradients of the image at the (x, y) position, V x 、V y They are respectively represented as the velocity vector of the pixel point at the (x, y) position of the image, that is, the optical flow vector, I t Represented as the grayscale gradient of the image at time t;
[0040] The position change of the target in the consecutive frames is used to predict the position of the target in the future frame. In the consecutive k frames, the motion position coordinates of the k-1th frame are set as (x k-1 ,y k-1 ), and set the motion position coordinates of the kth frame to (x k ,y k ), then the calculation formula for predicting the position of the target in the next k+1 frames is: and Where Δx′ and Δy′ represent the position difference between two adjacent frames, respectively. k+1 ,y k+1 They are respectively represented as the position coordinates (x k+1 ,y k+1 ).
[0041] Optionally, the steps of establishing the normal behavior model are as follows:
[0042] Excluding the feature image data G(x0, y0) from the original image data oid and the normalized image data oid3 after normalization, so as to collect a sufficient amount of position coordinate data under normal behavior as historical data for learning and training the normal behavior model;
[0043] Build a long short-term memory network LSTM model that can capture long-term dependencies in time series data, output predictions through an input layer, several LSTM layers, a fully connected layer, and an output layer to establish a normal behavior model;
[0044] Define the mean square error loss function to measure the difference between the model prediction and the real data, and use the Adam optimizer to minimize the loss function by adjusting the weights of the LSTM model;
[0045] The cross-validation method is used to evaluate the generalization ability of the LSTM model, and based on the performance on the training data, a normal behavior threshold is set for the output of the LSTM model, calibrated as Th6, to distinguish normal behavior from abnormal behavior.
[0046] Optionally, the logical steps of the area detection algorithm for intrusion judgment on a moving target are as follows:
[0047] A1. First, a black screen masking method is used to create an image with the same size as the full-area image of the monitoring scene in the emergency management area, and the pixel values of the corresponding pixels of the image are set to 0, that is, RGB = (0,0,0), which is used to perform full-area masking processing on the full area of the monitoring scene;
[0048] A2. Classify and mark the masked area and warning area in the emergency management area and obtain sensitive parameters of the warning area status, where the warning area is a pre-defined specific area in the emergency management area; the masked area is the facial part that is intentionally covered or blurred in the image captured in the emergency management area;
[0049] A3. Use the sensitive parameters of the spatial position state of the moving target area as the basis for judging target intrusion.
[0050] Optionally, the steps for acquiring the sensitive parameters of the alert area status are as follows:
[0051] B1. Input the number of vertices of the polygonal area to be marked in the warning area and the masked area, as well as the coordinates of the vertex pixels;
[0052] B2. Use the scan line algorithm to process the polygonal area. By calculating the maximum and minimum values of the vertical coordinates of all polygon vertices, determine the vertical range of the warning area to be marked, and use it as the height range for scan line processing;
[0053] B3. For each scan line within the height range of the scan line processing, establish a max ,next) elements, where element x represents the horizontal coordinate of the pixel point where the edge intersects the scan line, element k represents the slope of the edge, and element y represents the slope of the edge. max It is represented as the maximum vertical coordinate value of the edge, and the element next is represented as the next node it points to;
[0054] B4. Use the ordered edge table to establish the valid edge table of the current scan line and update the warning area status;
[0055] First, create a valid edge table with the same structure as the ordered edge table, and set the valid edge table to empty;
[0056] Then use the ordered edge table to establish a valid edge table for each scan line, merge the edges in the ordered edge table that are not empty into the valid edge table, and form the valid edge table of the current scan line;
[0057] Secondly, a pair of intersection points are taken out from the valid edge table in turn, and the sensitive parameter of the warning area state of the inner area of the pair of intersection points is set to 1, thereby obtaining the sensitive parameter of the warning area state;
[0058] Next, the valid edge table is updated for the next scan line by increasing the horizontal coordinate value of the intersection point and deleting the edges that no longer intersect;
[0059] Finally, rearrange the valid edge table;
[0060] B5. Use the calculated warning area status to determine whether there is any abnormal intrusion behavior and respond in time. That is, when the sensitive parameters of the warning area status are detected to meet the trigger conditions, such as the warning area status changes from 0 to 1, an area intrusion alarm will be generated.
[0061] Optionally, the steps for obtaining the anomaly score are as follows:
[0062] According to the position coordinate prediction information of the moving target (x k+1 ,y k+1), the P_value is calculated based on the Mahalanobis distance algorithm as the conversion to the anomaly score, and the calculation formula of the anomaly score is: and In the formula, Expressed as Mahalanobis distance, Expressed as the position coordinates of the moving target (x k+1 ,y k+1 ), is represented as the mean vector of the features in the normal behavior model, T is represented as the transpose, Expressed as Mahalanobis distance The covariance matrix of , P_ represents the anomaly score, It is expressed as the cumulative distribution function of the chi-square distribution with K degrees of freedom, χ represents the chi-square statistic, and K represents the degrees of freedom;
[0063] The normal behavior threshold Th6 in the normal behavior model established by the LSTM model is compared with the abnormal score. When P_<Th6, the target behavior is judged to be in the abnormal behavior mode; when P_≥Th6, the target behavior is judged to be in the normal behavior mode;
[0064] When a moving target is in an intrusion state in the emergency management area by combining the sensitive parameters and anomaly scores of the alert area status, the sound and light alarm in the emergency management area, the visual alarm information pushed by the system application and the public broadcast intrusion content alarm are triggered, and response measures such as on-site inspection by security personnel, closure of entrances and exits or evacuation of personnel, linkage with police assistance or remote control are taken.
[0065] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0066] The present invention adopts a motion detection algorithm to obtain the moving target detected in the image, a target tracking algorithm to obtain the relevant coordinate information of the moving target, an LSTM to establish a normal behavior model, and a region detection algorithm to perform intrusion judgment on the moving target. The real-time data stream analysis technology is used to judge the calculated abnormal score with the normal behavior threshold of the normal behavior model, so as to realize the dual intrusion detection and judgment of the moving target, reduce the false alarm and missed alarm rate, improve the comprehensiveness, adaptability, reliability and accuracy of the detection, enhance the rapid response capability and effect of emergency management, and reduce potential losses and hazards.
[0067] The present invention can timely discover potential intrusion threats, abnormal behaviors or intrusion events by adopting a regional intrusion algorithm, and quickly trigger an alarm and take corresponding emergency measures, thereby improving the efficiency and effectiveness of emergency management. During video monitoring, if personal privacy needs to be protected, the regional intrusion algorithm can adopt appropriate blurring and masking technologies to protect the public's privacy rights, so that the monitoring data in the emergency management area has a high degree of security and stability, can resist network attacks and malicious interference, ensure the normal operation of the system and the integrity of the data, and can adopt data fusion technology to integrate information from diversified data sources, and use an online learning mechanism to regularly and dynamically update the system to adapt to new threats and changing environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 The figure is a flow chart of the emergency management area intrusion detection method of the present invention.
[0069] Figure 2 This is a flow chart of the steps of the area detection algorithm of the present invention to perform intrusion judgment on a moving target. DETAILED DESCRIPTION
[0070] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of 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 the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art.
[0071] The present invention provides Figure 1-2 An emergency management area intrusion detection method shown includes the following steps:
[0072] S1. Completely cover the emergency management area with camera equipment, monitor and collect video streams in real time, obtain video frame data sets, establish monitoring scenes based on the video frame data sets and update the monitoring scenes in real time, and perform streaming processing on the video frame data sets to obtain original image data;
[0073] Specifically, the logic for obtaining the original image data is as follows:
[0074] Deploy a sufficient number of cameras in the emergency management area based on actual needs and scene characteristics to ensure coverage without blind spots;
[0075] The camera device collects the dynamic situation in the area in real time, generates a video stream and calibrates it as vs;
[0076] Use FFmpeg, GStreamer or HandBrake codec software to convert the video stream vs into a series of continuous video frame data sets through a predetermined frame rate FPS and decoding process according to the H.264 video coding standard, calibrated as vfd, and the video frame data set vfd contains all static images of scene information in the emergency management area during the monitoring period, wherein the conversion of the video stream decoding process includes prediction, transformation, inverse quantization and conversion output processes, and the prediction calculation formula is P1(vs)=f(vs), and Where P1(vs) represents the intra-frame prediction of decoded pixels in the same image, f(vs) represents the decoded neighboring pixels in the same image, and P2(vs) represents the inter-frame prediction based on the previously decoded reference frame. Represented as the corresponding area in the reference frame and the motion vector of the video stream vs, Represented as motion vectors of video stream vs;
[0077] The transformation calculation formula is D(vs) = T(vs)·(vs-P1(vs))·T(vs) -1 , where D(vs) represents the quantization coefficients of the video stream vs of the predicted intra-frame coding converted into the frequency domain, T(vs) represents the transformation matrix of the intra-frame prediction P1(vs), and T(vs) -1 Expressed as the inverse matrix of the transformation matrix;
[0078] The inverse calculation formula for quantization is D′(vs)=D(vs)×μ0D(vs), where D′(vs) represents the transform coefficient of the reconstructed video stream vs, and μ0D(vs) represents the quantization parameter;
[0079] The conversion output calculation formula is vfd = T (vs) -1 ×D′(vs)×T(vs)+P1(vs), where vfd represents the inverse transform back to the spatial domain plus the prediction value to obtain the final decoded frame, that is, the video frame data set;
[0080] The video frame dataset vfd is then stream processed. The streaming processing includes real-time reception, caching, denoising and brightness adjustment preprocessing and output of raw image data, calibrated as oid. The calculation formula for denoising and brightness adjustment preprocessing is and i∈[1,N], j∈[1,N], and oid=vfd(x0,y0)+B0, where vfd(x0,y0) represents the pixel value of the video frame dataset vfd image at position (x0,y0), and N represents the number of pixels covered by the average filter. It is represented by the sum of N pixel translations in the x and y directions of the pixel at the current position (x0, y0) in the video frame dataset vfd image. i and j represent the translation amounts corresponding to the i-th and j-th pixels in the N translatable pixels, respectively. OID represents the original image data output after denoising and brightness adjustment preprocessing. B0 represents the amount of brightness adjustment.
[0081] S2. After cleaning, standardization and normalization, the original image data is cleaned, standardized and normalized to extract the intrusion features in the emergency management area and obtain feature image data, so as to eliminate redundant and irrelevant features, reduce the data dependence of the system, and improve the processing speed and accuracy;
[0082] Specifically, the processing steps of the original image data are as follows:
[0083] First, the original image data oid is cleaned by removing invalid pixels at the edge of the image and repairing lost or damaged data points to obtain cleaned image data, which is calibrated as oid1 to remove irrelevant information or noise in the image.
[0084] Standardizing the cleaned image data oid1 is to adjust the range of the image intensity value to a specific range, thereby obtaining standardized image data, calibrated as oid2, so that consistency is maintained between images. The standardization calculation formula is: Where oid2(x0,y0) represents the result of normalization of the cleaned image data oid1, oid1(x0,y0) represents the pixel value of the cleaned image data oid1 at position (x0,y0), and oid max ,oid min Respectively represent the maximum and minimum values of the original image data oid, oid′ max oid′ min They are represented as the maximum and minimum values of the standardized target range, respectively;
[0085] Scale the standardized image data oid2 to the interval [0,1] for normalization, obtain the normalized image data, and calibrate it as oid3. The normalization calculation formula is: Where oid3(x0,y0) represents the result of normalizing and scaling the standardized image data oid2 to the interval [0,1], which is similar to the normalization calculation formula and different from oid′ max =1,oid′ min =0.
[0086] Specifically, the logic for obtaining feature image data is as follows:
[0087] The original image data oid is cleaned, standardized and normalized to obtain the normalized image data oid3. The Sobel operator is used to detect the image edge for feature extraction. The edge detection calculation formula of the Sobel operator in the horizontal and vertical directions is: and In the formula, Gx and Gy represent the gradients of the normalized image data oid3 in the horizontal and vertical directions, respectively. They are respectively represented as the Sobel operator convolution kernel corresponding to the horizontal gradient Gx and the Sobel operator convolution kernel corresponding to the vertical gradient Gy, where G represents the edge intensity;
[0088] After extracting several features, a threshold is set based on the edge strength G and calibrated as Th1 to select features containing the required amount of information, and a feature image is constructed based on the selected features to obtain feature image data. The feature selection is determined as follows: when G ≥ Th1, the feature selection is G, and when G < Th1, the feature selection is 0; the feature image data is generated as G (x0, y0) to reduce noise interference and reduce the complexity of subsequent calculations.
[0089] S3, using a motion detection algorithm to calculate a moving target from the feature image data, and using a target tracking algorithm to track the moving target to obtain position coordinate information of the moving target;
[0090] Specifically, the steps for detecting a moving target are as follows:
[0091] Using the feature image data G(x0,y0), a background model is constructed and background subtraction is used to update it over time to adapt to scene changes to obtain an estimated value of the foreground object. The calculation formula for background subtraction is: In the formula, It represents the updated pixel value at the position (x0, y0) of the next moment t0+1 frame, α represents the learning rate, t0 represents the previous moment t0 frame, Represented as the pixel value of the feature image of the current time frame t0, Represented as the pixel value of the background model at the position (x0, y0);
[0092] Applying the threshold operation will result in an image Converted to a binary image, highlighting the moving object, the conversion process of the binary image is Bj(x0, y0)>Th2, I binary (x0, y0) = 1, and Bj(x0, y0) ≤ Th2, I binary (x0, y0) = 0, where Bj(x0, y0) represents the result image The pixel value at position (x0, y0), Th2 represents the threshold value pre-set for each pixel, Ibinary (x0, y0) represents the pixel value of the binary image at position (x0, y0);
[0093] Use morphological operations to remove noise, and apply shadow detection algorithms to further refine the results and identify the contours or areas of moving objects. The calculation formula for removing noise is I dilated (x0, y0) = max{a, b} × I binary (x0+a,y0+b), I eroded (x0, y0) = min{a, b} × I binary (x0+a,y0+b), and {a,b}∈S0, where I dilated (x0, y0) represents the pixel value of the binary image after the dilation operation. eroded (x0, y0) represents the pixel value of the binary image after the erosion operation, max{a,b} and min{a,b} represent the maximum and minimum offsets in the neighborhood S0, respectively, S0 represents the neighborhood defined by the structural element, {a,b} represents the structural element, and a, b represent the offset of a pixel in the structural element {a,b};
[0094] The shadow detection algorithm is judged as follows: When I shadow (x0, y0) = 1, and Δ color <Th5,I shadow (x0, y0) = 0, where I'(x0, y0) represents the pixel value of the image at the position (x0, y0) after the morphological operation, and the actual brightness value is an integer between 0 and 255. It is represented by the pixel value of the background model at the position (x0, y0), and the actual brightness value is an integer between 0 and 255. [Th3, Th4] represent the brightness ratio threshold range accepted by the shadow area. color It is represented as the color difference between the current image pixel and the background model pixel, Th5 is represented as the threshold of the color difference, and further confirms the shadow, I shadow (x0, y0) represents the result image of shadow detection, which determines whether the pixel belongs to the shadow. When it is equal to 1, it belongs to the shadow, and when it is equal to 0, it belongs to the non-shadow.
[0095] In order to identify and refine the contour of the moving object, determine the generation of the bounding box of the moving object, and accurately mark the moving target, a set of contour point coordinates and the number of contour points are known, and are calibrated as (x k ,y k ), k∈[1,n], the formula for generating the bounding box by calculating the minimum enclosing rectangle of the contour is: And W Bbox =xmax -x min , H Bbox =y max -y min , and Bbox = [x min ,y min ,W Bbox ,H Bbox ], where (x min ,y min )、(x max ,y max ) are represented as the coordinates of the upper left corner and the lower right corner of the bounding box, respectively, W Bbox Expressed as the width of the bounding box, H Bbox It is expressed as the height of the bounding box, and Bbox is expressed as the coordinates of a contour point (x min ,y min ) and the calculated width and height (W Bbox ,H Bbox ) to generate a bounding box.
[0096] Specifically, the logic for obtaining the position coordinate information of the moving target is as follows:
[0097] According to the initial position of the moving target, calibrated as (x, y), the KLT optical flow method is used to track the area of the target feature points, and the target position is updated in each frame. The calculation formula of the KLT optical flow method is I x ×V x +I y ×V y +I t =0, where I x ,I y Respectively represent the horizontal and vertical grayscale gradients of the image at the (x, y) position, V x 、V y They are respectively represented as the velocity vector of the pixel point at the (x, y) position of the image, that is, the optical flow vector, I t Represented as the grayscale gradient of the image at time t;
[0098] The position change of the target in the consecutive frames is used to predict the position of the target in the future frame. In the consecutive k frames, the motion position coordinates of the k-1th frame are set as (x k-1 ,y k-1 ), and set the motion position coordinates of the kth frame to (x k ,y k ), then the calculation formula for predicting the position of the target in the next k+1 frames is: and Where Δx′ and Δy′ represent the position difference between two adjacent frames, respectively. k+1 ,yk+1 They are respectively represented as the position coordinates (x k+1 ,y k+1 ).
[0099] S4. Use a neural network algorithm to learn and train historical data of location coordinate information to establish a normal behavior model, and perform abnormal behavior detection and judgment on newly input data based on the trained model to improve detection accuracy and reduce false alarms;
[0100] Specifically, the steps for establishing the normal behavior model are as follows:
[0101] Excluding the feature image data G(x0, y0) from the original image data oid and the normalized image data oid3 after normalization, so as to collect a sufficient amount of position coordinate data under normal behavior as historical data for learning and training the normal behavior model;
[0102] Build a long short-term memory network LSTM model that can capture long-term dependencies in time series data, output predictions through an input layer, several LSTM layers, a fully connected layer, and an output layer to establish a normal behavior model;
[0103] Define the mean square error loss function to measure the difference between the model prediction and the real data, and use the Adam optimizer to minimize the loss function by adjusting the weights of the LSTM model;
[0104] The cross-validation method is used to evaluate the generalization ability of the LSTM model, and based on the performance on the training data, a normal behavior threshold is set for the output of the LSTM model, calibrated as Th6, to distinguish normal behavior from abnormal behavior.
[0105] S5. Use the area detection algorithm to judge the intrusion of the moving target, and use the real-time data stream analysis technology to calculate the abnormal score that is different from the normal behavior model. Use the abnormal score and the normal behavior threshold to identify the moving target with intrusion behavior, and then trigger an alarm and take countermeasures according to the results of the dual detection of the moving target;
[0106] Specifically, the logical steps of the area detection algorithm for intrusion judgment of moving targets are as follows:
[0107] A1. First, a black screen masking method is used to create an image with the same size as the full-area image of the monitoring scene in the emergency management area, and the pixel values of the corresponding pixels of the image are set to 0, that is, RGB = (0,0,0), which is used to perform full-area masking processing on the full area of the monitoring scene;
[0108] A2. Classify and mark the masked areas and warning areas within the emergency management area and obtain sensitive parameters of the warning area status. The warning area is a pre-defined specific area within the emergency management area, which is used for safety monitoring to prevent frequent accidents and difficulty in evacuating people; the masked area is the facial part of the image collected within the emergency management area that is deliberately covered or blurred, which is used to protect privacy information and avoid personal information leakage;
[0109] A3. The sensitive parameters of the spatial position state of the area where the moving target is located are used as the basis for judging the target intrusion. When the sensitive parameters of the spatial position state of the area where the moving target is located are equal to the sensitive parameters of the spatial state of the warning area, it indicates that there is a target invasion, thereby realizing the real-time regional intrusion detection function.
[0110] It should be noted that the steps for obtaining the sensitive parameters of the alert area status are as follows:
[0111] B1. Input the number of vertices of the polygonal area to be marked for marking the warning area and the masked area, as well as the coordinates of the vertex pixels, which are used to define the boundary of the warning area or the masked area;
[0112] B2. Use the scan line algorithm to process the polygonal area. By calculating the maximum and minimum values of the vertical coordinates of all polygon vertices, determine the vertical range of the warning area to be marked, and use it as the height range for scan line processing;
[0113] B3. For each scan line within the height range of the scan line processing, establish a max ,next) elements, where element x represents the horizontal coordinate of the pixel point where the edge intersects the scan line, element k represents the slope of the edge, and element y represents the slope of the edge. max It is represented as the maximum coordinate value of the edge in the vertical direction. The element next is represented as the next node pointed to, which is used to quickly determine the intersection of each scan line and the polygon boundary in subsequent processing;
[0114] B4. Use the ordered edge table to establish the valid edge table of the current scan line and update the warning area status;
[0115] First, create a valid edge table with the same structure as the ordered edge table, and set the valid edge table to empty;
[0116] Then use the ordered edge table to establish a valid edge table for each scan line, merge the edges in the ordered edge table that are not empty into the valid edge table, and form the valid edge table of the current scan line;
[0117] Secondly, a pair of intersection points are taken out from the valid edge table in turn, and the sensitive parameter of the warning area state of the inner area of the pair of intersection points is set to 1, thereby obtaining the sensitive parameter of the warning area state;
[0118] Next, the valid edge table is updated for the next scan line by increasing the horizontal coordinate value of the intersection point and deleting the edges that no longer intersect;
[0119] Finally, the valid edge table is rearranged to facilitate the next processing;
[0120] B5. Use the calculated warning area status to determine whether there is any abnormal intrusion behavior and respond in time. That is, when the sensitive parameters of the warning area status are detected to meet the trigger conditions, such as the warning area status changes from 0 to 1, an area intrusion alarm will be generated.
[0121] Specifically, the steps for obtaining the anomaly score are as follows:
[0122] According to the position coordinate prediction information of the moving target (x k+1 ,y k+1 ), the P_value is calculated based on the Mahalanobis distance algorithm as the conversion to the anomaly score, and the calculation formula of the anomaly score is: and In the formula, Expressed as Mahalanobis distance, Expressed as the position coordinates of the moving target (x k+1 ,y k+1 ), is represented as the mean vector of the features in the normal behavior model, T is represented as the transpose, Expressed as Mahalanobis distance The covariance matrix of , P_ represents the anomaly score, It is expressed as the cumulative distribution function of the chi-square distribution with K degrees of freedom, χ represents the chi-square statistic, and K represents the degrees of freedom;
[0123] The normal behavior threshold Th6 in the normal behavior model established by the LSTM model is compared with the abnormal score. When P_<Th6, the target behavior is judged to be in the abnormal behavior mode; when P_≥Th6, the target behavior is judged to be in the normal behavior mode;
[0124] When a moving target is in an intrusion state in the emergency management area by combining the sensitive parameters and anomaly scores of the alert area status, the sound and light alarm in the emergency management area, the visual alarm information pushed by the system application and the public broadcast intrusion content alarm are triggered, and response measures such as on-site inspection by security personnel, closure of entrances and exits or evacuation of personnel, linkage with police assistance or remote control are taken.
[0125] S6. Use data fusion technology to fuse information from diversified data sources to obtain more comprehensive and accurate detection results, provide a more comprehensive monitoring perspective, enhance the accuracy and reliability of intrusion detection, and regularly and dynamically update detection rules and models through online learning mechanisms to adapt to new threats and changing environments.
[0126] Specifically, the diversified data sources include real-time video streams, images, sensor data, audio information, system network access data and computing databases.
[0127] Specifically, the steps of data fusion are as follows:
[0128] Collect relevant data from diverse data sources and clean, format and standardize the collected data in preparation for subsequent analysis;
[0129] Extract characteristic information from preprocessed data, and match and associate data from different sources to facilitate comprehensive analysis and understanding;
[0130] Use machine learning or deep learning models to fuse and analyze feature data from different data sources, and use the fused data to build a decision model;
[0131] The decision-making model is optimized and adjusted based on data feedback to cope with new data and environmental changes.
[0132] Specifically, the operating logic of the online learning mechanism is as follows:
[0133] Establish a pre-trained initial model in the emergency management area intrusion detection system;
[0134] The online learning mechanism trains and learns by continuously receiving video streams to form a self-learning training model;
[0135] When new data arrives from monitoring, the self-learning training model will evaluate the new data and optimize and adjust based on the prediction results, updating weights and adjusting parameters to capture patterns and relationships in the data;
[0136] Set a cycle to regularly evaluate the performance of the self-learning training model, with the evaluation indicators being accuracy, recall, precision, and F1 value;
[0137] During the learning process, the self-learning training model can also integrate the result feedback into the learning process, further promoting the development and optimization of the model to adapt to changes in the new environment.
[0138] The specific method and process of an emergency management area intrusion detection method provided by an embodiment of the present invention are detailed in the embodiment of the emergency management area intrusion detection method described above, and will not be repeated here.
[0139] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0140] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0141] 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.
[0142] Those of ordinary skill 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 to be beyond the scope of this application.
[0143] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for detecting intrusion in an emergency management area, characterized in that: The steps include: S1. Completely cover the emergency management area with camera equipment, monitor and collect video streams in real time, obtain video frame data sets, and perform streaming processing on the video frame data sets to obtain original image data; S2, extracting intrusion features in the emergency management area from the original image data after cleaning, standardization and normalization to obtain feature image data; The acquisition logic of the feature image data is as follows: The original image data oid is cleaned, standardized and normalized to obtain the normalized image data oid3. The Sobel operator is used to detect the image edge for feature extraction. The edge detection calculation formula of the Sobel operator in the horizontal and vertical directions is: and In the formula, Gx and Gy represent the gradients of the normalized image data oid3 in the horizontal and vertical directions, respectively. They are respectively represented as the Sobel operator convolution kernel corresponding to the horizontal gradient Gx and the Sobel operator convolution kernel corresponding to the vertical gradient Gy, where G represents the edge intensity; After extracting several features, a threshold is set based on the edge strength G and calibrated as Th1 to select features containing the required amount of information, and a feature image is constructed based on the selected features to obtain feature image data. The feature selection method is that when G≥Th1, the feature selection is G, and when G<Th1, the feature selection is 0; the feature image data is generated as G(x0,y0); S3, using a motion detection algorithm to calculate a moving target from the feature image data, and using a target tracking algorithm to track the moving target to obtain position coordinate information of the moving target; The steps of detecting the moving target are as follows: Using the feature image data G(x0,y0), a background model is constructed and background subtraction is used to update it over time to adapt to scene changes to obtain an estimated value of the foreground object. The calculation formula for background subtraction is: In the formula, It represents the updated pixel value at the position (x0, y0) of the next moment t0+1 frame, α represents the learning rate, t0 represents the previous moment t0 frame, Represented as the pixel value of the feature image of the current time frame t0, Represented as the pixel value of the background model at the position (x0, y0); Applying the threshold operation will result in an image Converted to a binary image, the conversion process of the binary image is Bj(x0, y0)>Th2, I binary (x0, y0) = 1, and Bj(x0, y0) ≤ Th2, I binary (x0, y0) = 0, where Bj(x0, y0) represents the result image The pixel value at position (x0, y0), Th2 represents the threshold value pre-set for each pixel, I binary (x0, y0) represents the pixel value of the binary image at position (x0, y0); Use morphological operations to remove noise, and apply shadow detection algorithms to further refine the results and identify the contours or areas of moving objects. The calculation formula for removing noise is I dilated (x0, y0) = max{a, b} × I binary (x0+a,y0+b), I eroded (x0, y0) = min{a, b} × I binary (x0+a,y0+b), and {a,b}∈S0, where I dilated (x0, y0) represents the pixel value of the binary image after the dilation operation. eroded (x0, y0) represents the pixel value of the binary image after the erosion operation, max{a,b} and min{a,b} represent the maximum and minimum offsets in the neighborhood S0, respectively, S0 represents the neighborhood defined by the structural element, {a,b} represents the structural element, and a, b represent the offset of a pixel in the structural element {a,b}; The shadow detection algorithm is judged as follows: When I shadow (x0, y0) = 1, and Δ color <Th5,I shadow (x0, y0) = 0, where I'(x0, y0) represents the pixel value of the image at the position (x0, y0) after the morphological operation, and the actual brightness value is an integer between 0 and 255, Bj(x0, y0)t0 represents the pixel value of the background model at the position (x0, y0), and the actual brightness value is an integer between 0 and 255, [Th3, Th4] represent the brightness ratio threshold range accepted for identifying the shadow area, respectively, Δ color It is represented as the color difference between the current image pixel and the background model pixel, Th5 is represented as the threshold of the color difference, and further confirms the shadow, I shadow (x0, y0) represents the result image of shadow detection, which determines whether the pixel belongs to the shadow. If it is equal to 1, it belongs to the shadow, and if it is equal to 0, it belongs to the non-shadow. In order to identify and refine the contour of the moving object, determine the generation of the bounding box of the moving object, and accurately mark the moving target, a set of contour point coordinates and the number of contour points are known, and are calibrated as (x k ,y k ), k∈[1,n], the formula for generating the bounding box by calculating the minimum enclosing rectangle of the contour is: And W Bbox =x max -x min , H Bbox =y max -y min , and Bbox = [x min ,y min ,W Bbox ,H Bbox ], where (x min ,y min )、(x max ,y max ) are represented as the coordinates of the upper left corner and the lower right corner of the bounding box, respectively, W Bbox Expressed as the width of the bounding box, H Bbox It is expressed as the height of the bounding box, and Bbox is expressed as the coordinates of a contour point (x min ,y min ) and the calculated width and height (W Bbox ,H Bbox ) to generate a bounding box; S4. Use a neural network algorithm to learn and train historical data of location coordinate information to establish a normal behavior model, and perform abnormal behavior detection and judgment on newly input data based on the trained model; The steps for establishing the normal behavior model are as follows: Excluding the feature image data G(x0, y0) from the original image data oid and the normalized image data oid3 after normalization, so as to collect a sufficient amount of position coordinate data under normal behavior as historical data for learning and training the normal behavior model; Build a long short-term memory network LSTM model that can capture long-term dependencies in time series data, output predictions through an input layer, several LSTM layers, a fully connected layer, and an output layer to establish a normal behavior model; Define the mean square error loss function to measure the difference between the model prediction and the real data, and use the Adam optimizer to minimize the loss function by adjusting the weights of the LSTM model; The cross-validation method is used to evaluate the generalization ability of the LSTM model. Based on the performance on the training data, a normal behavior threshold is set for the output of the LSTM model, calibrated as Th6, to distinguish normal behavior from abnormal behavior. S5. Use the area detection algorithm to judge the intrusion of the moving target, and use the real-time data stream analysis technology to calculate the abnormal score that is different from the normal behavior model. Use the abnormal score and the normal behavior threshold to identify the moving target with intrusion behavior, and then trigger an alarm and take countermeasures according to the results of the dual detection of the moving target; The logical steps of the area detection algorithm for intrusion judgment of moving targets are as follows: A1. First, a black screen masking method is used to create an image with the same size as the full-area image of the monitoring scene in the emergency management area, and the pixel values of the corresponding pixels of the image are set to 0, that is, RGB = (0,0,0), which is used to perform full-area masking processing on the full area of the monitoring scene; A2. Classify and mark the masked area and warning area in the emergency management area and obtain sensitive parameters of the warning area status, where the warning area is a pre-defined specific area in the emergency management area; the masked area is the facial part that is intentionally covered or blurred in the image captured in the emergency management area; A3. Use the sensitive parameters of the spatial position state of the moving target area as the basis for judging target intrusion; The steps for obtaining the anomaly score are as follows: According to the position coordinate prediction information of the moving target (x k+1 ,y k+1 ), the P_value is calculated based on the Mahalanobis distance algorithm as the conversion to the anomaly score, and the calculation formula of the anomaly score is: and In the formula, Expressed as Mahalanobis distance, Expressed as the position coordinates of the moving target (x k+1 ,y k+1 ), is represented as the mean vector of the features in the normal behavior model, T is represented as the transpose, Expressed as Mahalanobis distance The covariance matrix of , P_ represents the anomaly score, It is expressed as the cumulative distribution function of the chi-square distribution with K degrees of freedom, χ represents the chi-square statistic, and K represents the degrees of freedom; The normal behavior threshold Th6 in the normal behavior model established by the LSTM model is compared with the abnormal score. When P_<Th6, the target behavior is judged to be in the abnormal behavior mode; when P_≥Th6, the target behavior is judged to be in the normal behavior mode; When the moving target is in an intrusion state in the emergency management area, the sound and light alarm in the emergency management area, the visual alarm information pushed by the system application and the public broadcast intrusion content alarm are triggered, and the response measures such as on-site inspection by security personnel, closure of entrances and exits or evacuation of personnel, linkage with police assistance or remote control are taken; S6. Use data fusion technology to fuse information from diversified data sources to obtain more comprehensive and accurate detection results, and regularly and dynamically update detection rules and models through online learning mechanisms to adapt to new threats and changing environments.
2. The method for detecting intrusion in an emergency management area according to claim 1, characterized in that: The logic for obtaining the original image data is as follows: Deploy a sufficient number of cameras in the emergency management area based on actual needs and scene characteristics to ensure coverage without blind spots; The camera device collects the dynamic situation in the area in real time, generates a video stream and calibrates it as vs; Use FFmpeg, GStreamer or HandBrake codec software to convert the video stream vs into a series of continuous video frame data sets through a predetermined frame rate FPS and decoding process according to the H.264 video coding standard, calibrated as vfd. The video frame data set vfd contains all static images of scene information in the emergency management area during the monitoring period; The video frame dataset vfd is then stream processed. The streaming processing includes real-time reception, caching, denoising and brightness adjustment preprocessing and output of raw image data, calibrated as oid. The calculation formula for denoising and brightness adjustment preprocessing is and i∈[1,N], j∈[1,N], and oid=vfd(x0,y0)+B0, where vfd(x0,y0) represents the pixel value of the video frame dataset vfd image at position (x0,y0), and N represents the number of pixels covered by the average filter. It is represented by the sum of N pixel translations in the x and y directions of the pixel at the current position (x0, y0) in the video frame dataset vfd image. i and j represent the translation amounts corresponding to the i-th and j-th pixels in the N translatable pixels, respectively. OID represents the original image data output after denoising and brightness adjustment preprocessing. B0 represents the amount of brightness adjustment.
3. The method for detecting intrusion in an emergency management area according to claim 2, characterized in that: The processing steps of the original image data are as follows: First, the original image data oid is cleaned by removing invalid pixels at the edge of the image and repairing lost or damaged data points to obtain the cleaned image data and calibrate it as oid1; Standardizing the cleaned image data oid1 is to adjust the range of the image intensity value to a specific range, thereby obtaining standardized image data, calibrated as oid2, and the standardization calculation formula is: Where oid2(x0,y0) represents the result of normalization of the cleaned image data oid1, oid1(x0,y0) represents the pixel value of the cleaned image data oid1 at position (x0,y0), and oid max ,oid min Respectively represent the maximum and minimum values of the original image data oid, oid′ max oid′ min They are represented as the maximum and minimum values of the standardized target range, respectively; Scale the standardized image data oid2 to the interval [0,1] for normalization, obtain the normalized image data, and calibrate it as oid3. The normalization calculation formula is: Where oid3(x0,y0) represents the result of normalizing and scaling the standardized image data oid2 to the interval [0,1].
4. The method for detecting intrusion in an emergency management area according to claim 3, characterized in that: The logic for obtaining the position coordinate information of the moving target is as follows: According to the initial position of the moving target, calibrated as (x, y), the KLT optical flow method is used to track the area of the target feature points, and the target position is updated in each frame. The calculation formula of the KLT optical flow method is I x ×V x +I y ×V y +I t =0, where I x ,I y Respectively represent the horizontal and vertical grayscale gradients of the image at the (x, y) position, V x 、V y They are respectively represented as the velocity vector of the pixel point at the (x, y) position of the image, that is, the optical flow vector, I t Represented as the grayscale gradient of the image at time t; The position change of the target in the consecutive frames is used to predict the position of the target in the future frame. In the consecutive k frames, the motion position coordinates of the k-1th frame are set as (x k-1 ,y k-1 ), and set the motion position coordinates of the kth frame to (x k ,y k ), then the calculation formula for predicting the position of the target in the next k+1 frames is: and Where Δx′ and Δy′ represent the position difference between two adjacent frames, respectively. k+1 ,y k+1 They are respectively represented as the position coordinates (x k+1 ,y k+1 ).
5. The method for detecting intrusion in an emergency management area according to claim 4, characterized in that: The steps for obtaining the sensitive parameters of the warning area status are as follows: B1. Input the number of vertices of the polygonal area to be marked in the warning area and the masked area, as well as the coordinates of the vertex pixels; B2. Use the scan line algorithm to process the polygonal area, and determine the vertical range of the warning area to be marked by calculating the maximum and minimum values of the vertical coordinates of all polygon vertices, and use this as the height range for scan line processing; B3. For each scan line within the height range of the scan line processing, establish a max ,next) elements, where element x represents the horizontal coordinate of the pixel point where the edge intersects the scan line, element k represents the slope of the edge, and element y represents the slope of the edge. max It is represented as the maximum vertical coordinate value of the edge, and the element next is represented as the next node it points to; B4. Use the ordered edge table to establish the valid edge table of the current scan line and update the warning area status; First, create a valid edge table with the same structure as the ordered edge table, and set the valid edge table to empty; Then use the ordered edge table to establish a valid edge table for each scan line, merge the edges in the ordered edge table that are not empty into the valid edge table, and form the valid edge table of the current scan line; Secondly, a pair of intersection points are taken out from the valid edge table in turn, and the sensitive parameter of the warning area state of the inner area of the pair of intersection points is set to 1, thereby obtaining the sensitive parameter of the warning area state; Next, the valid edge table is updated for the next scan line by increasing the horizontal coordinate value of the intersection point and deleting the edges that no longer intersect; Finally, rearrange the valid edge table; B5. Use the calculated warning area status to determine whether there is any abnormal intrusion behavior and respond in time. That is, when the sensitive parameters of the warning area status are detected to meet the trigger conditions, such as the warning area status changes from 0 to 1, an area intrusion alarm will be generated.
