Visual intelligence-based power station abnormal personnel intrusion identification method and system

By combining adaptive histogram equalization and dense optical flow analysis with density clustering technology, the problem of background model update lag caused by changes in illumination in the power plant environment was solved. This enabled accurate identification and identity verification of abnormal personnel intrusion into the power plant, reduced the false alarm rate, and improved the system's adaptability and accuracy.

CN122024162APending Publication Date: 2026-05-12ZIJIN LONGJING CLEAN ENERGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZIJIN LONGJING CLEAN ENERGY CO LTD
Filing Date
2026-02-02
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies suffer from lag in background model updates due to changes in lighting and weather in power plant environments, leading to unstable background extraction, high false positive rates, and impacting the accuracy of intrusion detection.

Method used

Image preprocessing combining adaptive histogram equalization and local contrast enhancement is employed, along with dense optical flow analysis and density clustering techniques. Morphological optimization and connected component analysis are used to describe the target's appearance and verify its identity.

Benefits of technology

It effectively overcomes the challenges of varying lighting conditions in complex power plant environments, achieves precise positioning of moving areas and reliable extraction of foreground targets, reduces false alarm rates, can distinguish and identify authorized and unauthorized personnel, and improves the accuracy of intrusion detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122024162A_ABST
    Figure CN122024162A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power station safety monitoring, and discloses a visual intelligence-based power station abnormal personnel intrusion identification method and system, and the method comprises the steps: carrying out the adaptive equalization preprocessing of a monitoring image; extracting and optimizing a motion area boundary based on the optical flow field; obtaining a foreground target contour through density clustering, and obtaining a target mask through morphological processing; extracting gradient histogram features of the target sub-image, and performing similarity matching on the gradient histogram features and an authorized officer feature library to generate a verification identifier; and performing sensitive area overlapping and behavior trajectory analysis on the unauthorized target according to the verification result to trigger an intrusion alarm. According to the method, the moving target can be stably extracted and the identity of the person can be accurately identified under the complex illumination and environment, false alarm and missing detection are remarkably reduced, and the intelligence and reliability of power station security and protection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power plant security monitoring technology, and in particular to a method and system for identifying abnormal personnel intrusion in power plants based on visual intelligence. Background Technology

[0002] The field of power plant security monitoring is directly related to the stable operation of national energy infrastructure and public safety. Once an unauthorized intrusion occurs, it may lead to equipment damage, power outages, or even greater security risks. Therefore, the real-time and accurate identification of intrusion behavior has become a key link in ensuring power plant security.

[0003] In one existing technology, a common intrusion detection scheme in the field of industrial vision adopts a motion detection method based on background modeling. For example, a static background is established for the monitoring video through a Gaussian mixture model, and the foreground moving target is extracted using the frame difference method. Then, contour analysis or trajectory tracking is combined to determine whether it is an abnormal intrusion behavior.

[0004] However, existing technologies typically assume a relatively stable background for the monitored scene. In complex outdoor environments such as power plants, factors like changes in lighting, weather, and vegetation growth cause continuous background changes, leading to lag in background model updates and unstable foreground extraction. The system is prone to misidentifying shadows, reflections, and swaying vegetation as targets, resulting in numerous false alarms. This also affects the accuracy of subsequent feature extraction and identity verification, creating risks of missed detections and false alarms. Therefore, existing technologies suffer from poor adaptability to complex environmental changes and are susceptible to interference from lighting and weather, leading to high false detection rates. Summary of the Invention

[0005] This invention provides a visual intelligence-based method and system for identifying abnormal personnel intrusion in power plants, in order to solve the problems of poor adaptability to complex environmental changes and high false detection rate caused by light and weather interference in the existing technology.

[0006] Firstly, in order to solve the above-mentioned technical problems, the present invention provides a method for identifying abnormal personnel intrusion in power plants based on visual intelligence, comprising: After obtaining the original image sequence, grayscale conversion is performed. The pixel brightness distribution of the converted grayscale image sequence is adjusted and the detail features are enhanced. Boundary information is extracted and optimized. After denoising, an equalized image is obtained. The optical flow vector field is calculated based on the equalized image, pixels with amplitudes exceeding the motion intensity threshold are extracted, discontinuous boundaries are connected and pixel displacements are tracked, and the boundaries of the motion region are determined after smoothing and filtering. Extract foreground pixel clusters from the boundary of the motion region. If the density of the foreground pixel clusters exceeds a preset density threshold, it is determined to be a potential target region, and a target contour map is obtained. A binary mask is generated based on the target contour map. After removing isolated noise points from the binary mask, a first mask is obtained. Connectivity component analysis and merging are performed. After smoothing and repairing broken parts, the complete target mask is determined. Based on the complete target mask, target sub-images are extracted from the equalized image, gradients are calculated and gradient direction histograms are generated. After direction interval weighted sum and vector normalization processing, gradient histogram feature vectors for identity verification are obtained. Retrieve similar feature vectors from a pre-established database of authorized personnel features. If the similarity score is higher than a preset similarity threshold, the person is identified as an authorized personnel and a verification pass is obtained. Based on the verification, potential target areas are filtered by the identifier. If the verification fails, an intrusion alarm mechanism is triggered to obtain the final intrusion detection result.

[0007] Secondly, the present invention provides a power plant abnormal personnel intrusion identification system based on visual intelligence, comprising: The image preprocessing and equalization module acquires the original image sequence and performs grayscale conversion. It then adjusts the pixel brightness distribution and enhances detail features in the converted grayscale image sequence, extracts and optimizes boundary information, and obtains an equalized image after denoising. The motion region detection and boundary determination module calculates the optical flow vector field based on the equalized image, extracts pixels whose amplitude exceeds the motion intensity threshold, connects discontinuous boundaries and tracks pixel displacement, and determines the boundary of the motion region after smoothing and filtering. The foreground target extraction and contour generation module extracts foreground pixel clusters from the boundary of the motion region. If the density of the foreground pixel clusters exceeds a preset density threshold, it is determined to be a potential target region, and a target contour map is obtained. The target mask optimization module generates a binary mask based on the target contour map, removes isolated noise points from the binary mask to obtain a first mask, performs connected component analysis and merging, and determines the complete target mask after smoothing and repairing broken parts. The feature extraction module extracts the target sub-image from the equalized image based on the complete target mask, calculates the gradient and generates a gradient direction histogram, and after direction interval weighting and vector normalization, obtains the gradient histogram feature vector for identity verification. The identity verification module retrieves similar feature vectors from a pre-established authorized personnel feature database. If the similarity score is higher than the preset similarity threshold, the user is determined to be an authorized person and a verification pass flag is obtained. The intrusion alarm decision module filters potential target areas based on the verification pass identifier. If the verification fails, the intrusion alarm mechanism is triggered to obtain the final intrusion detection result.

[0008] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention effectively overcomes the problem of uneven illumination caused by day and night alternation and weather changes in the outdoor environment of the power station by combining adaptive histogram equalization adjustment and local contrast enhancement in image preprocessing process, improves image quality, provides a stable and clear input basis for subsequent motion detection and feature extraction, and significantly enhances the system's adaptability to dynamic environment.

[0009] (2) This invention achieves accurate localization of moving areas and reliable extraction of foreground targets under complex background interference by integrating dense optical flow analysis and density clustering technology. Through morphological optimization and connected component analysis, noise interference is further eliminated, resulting in a complete and accurate target mask, which effectively avoids misjudging environmental factors such as shadows and vegetation movement as intrusion targets and significantly reduces the false alarm rate.

[0010] (3) This invention uses gradient orientation histogram features to describe the appearance of the target and combines it with a similarity matching verification based on an authorized personnel feature database to achieve intelligent identification of the identity of moving targets. This method can not only distinguish whether a moving object is a person, but also further identify whether it is an authorized person, thereby achieving accurate screening and alarm for unauthorized intrusion behavior and solving the problem of insufficient identity recognition capability of traditional methods. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of the power plant abnormal personnel intrusion identification method based on visual intelligence provided in the first embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a power plant abnormal personnel intrusion identification system based on visual intelligence provided in the second embodiment of the present invention. Detailed Implementation

[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0013] Reference Figure 1 The first embodiment of the present invention provides a method for identifying abnormal personnel intrusion in power plants based on visual intelligence, including the following steps: S11. After obtaining the original image sequence, perform grayscale conversion, adjust the pixel brightness distribution and enhance the detail features of the converted grayscale image sequence, extract and optimize the boundary information, and obtain the equalized image after denoising. S12, calculate the optical flow vector field based on the equalized image, extract pixels whose amplitude exceeds the motion intensity threshold, connect discontinuous boundaries and track pixel displacement, and determine the boundary of the motion region after smoothing and filtering. S13, extract the foreground pixel cluster from the boundary of the motion region. If the density of the foreground pixel cluster exceeds a preset density threshold, it is determined to be a potential target region, and a target contour map is obtained. S14. Generate a binary mask based on the target contour map. After removing isolated noise points from the binary mask, obtain the first mask. Perform connected component analysis and merging. After smoothing and repairing broken parts, determine the complete target mask. S15, Based on the complete target mask, extract the target sub-image from the equalized image, calculate the gradient and generate a gradient direction histogram, and after direction interval weighting and vector normalization processing, obtain the gradient histogram feature vector for identity verification. S16. Retrieve similar feature vectors from the pre-established authorized personnel feature database. If the similarity score is higher than the preset similarity threshold, the person is judged to be an authorized personnel and a verification pass mark is obtained. S17, based on the verification pass identifier, filter potential target areas. If the verification fails, trigger the intrusion alarm mechanism to obtain the final intrusion detection result.

[0014] In step S11, after acquiring the original image sequence, grayscale conversion is performed. The pixel brightness distribution of the converted grayscale image sequence is adjusted and detail features are enhanced. Boundary information is extracted and optimized. After denoising, an equalized image is obtained, including: S1101, acquire the original image sequence containing multiple consecutive monitoring frames from the surveillance camera; S1102, perform grayscale conversion on each frame of the original image sequence to obtain a grayscale image sequence; S1103, Adaptive histogram equalization is used to adjust the pixel brightness distribution of each frame in the grayscale image sequence to obtain a brightness equalized image sequence. S1104, perform local contrast enhancement processing on each frame of the brightness equalization image sequence to enhance detail features and obtain a detail-enhanced image sequence; S1105, edge detection is used to extract and optimize the boundary information in the detail-enhanced image sequence to obtain a sharpened image sequence; S1106, Median filtering is applied to the sharpened image sequence to suppress noise, resulting in the final equalized image.

[0015] In step S1101, an original image sequence containing multiple consecutive monitoring frames is acquired from the surveillance camera.

[0016] It should be noted that the raw image sequence is acquired in real time from the surveillance camera via a video streaming interface. This sequence consists of multiple consecutive monitoring frames in chronological order. For example, under nighttime perimeter monitoring of a power plant area, the acquired consecutive frame images may have areas that are too dark or too bright due to uneven ambient lighting, such as the area illuminated by tower lights versus the shadow area of ​​equipment.

[0017] In step S1102, each frame of the original image sequence is subjected to grayscale conversion to obtain a grayscale image sequence.

[0018] It should be noted that each frame of the original image sequence is sequentially converted to grayscale. By weighted averaging of the brightness values ​​of the red, green, and blue channels of each pixel, the single grayscale value of that pixel is calculated, thereby converting the color image into a grayscale image and generating the corresponding grayscale image sequence.

[0019] In step S1103, adaptive histogram equalization is used to adjust the pixel brightness distribution of each frame in the grayscale image sequence to obtain a brightness equalized image sequence.

[0020] It should be noted that adaptive histogram equalization is used to adjust the pixel brightness distribution of each frame in the grayscale image sequence to obtain a brightness-equalized image sequence. For each frame of grayscale image, it is first divided into multiple non-overlapping local regions, such as 64 pixels × 64 pixels; for each local region, its grayscale histogram is calculated independently, and the contrast increase is limited during histogram equalization to avoid excessive noise amplification; then, the equalization results of each local region are fused using bilinear interpolation to generate the equalized output of the entire image.

[0021] In step S1104, local contrast enhancement processing is performed on each frame of the brightness equalization image sequence to enhance detail features and obtain a detail-enhanced image sequence.

[0022] It should be noted that by limiting the contrast amplification factor of local histogram equalization to enhance image detail features, each input frame image is divided into several equally sized local rectangular regions, such as 8×8 pixels. The grayscale histogram of each local region is calculated independently. To prevent noise from excessive enhancement in uniform regions, a contrast limit threshold is set for the histogram of each region. After calculating the region histogram, the number of pixels exceeding this preset threshold is cropped, and the cropped pixels are redistributed evenly across all grayscale levels. The contrast limit threshold can be set as a percentage of the maximum number of grayscale pixels in the local region, for example, 1% to 5%. A cumulative distribution function is calculated for the cropped local histogram, and a grayscale transformation function for that region is generated accordingly. Using this transformation function, grayscale mapping is performed on all pixels within the region, thereby achieving contrast enhancement in that local region.

[0023] In one embodiment, during actual power plant perimeter monitoring, local details in different areas of the image are enhanced in a targeted manner, and key information such as personnel outlines, safety helmet edges, and work clothes textures are significantly improved, making previously blurry text and object boundaries clear and distinguishable.

[0024] In step S1105, edge detection is used to extract and optimize the boundary information in the detail-enhanced image sequence to obtain a sharpened image sequence.

[0025] It should be noted that for each frame in the detail-enhanced image sequence, boundary information is extracted and optimized by constructing and applying a complete Canny edge detector.

[0026] First, Gaussian filtering is applied to each frame of the input detail-enhanced image to smooth noise. A Gaussian convolution kernel of a preset size (e.g., 5×5 pixels) is used to convolve the image. The standard deviation of the kernel is set according to the noise level in the image and the scale of details to be preserved, typically between 1.0 and 1.5. The gradient magnitude and direction of the image are calculated. The Sobel operator is used to calculate the gradient components in the horizontal and vertical directions of the image, respectively. Based on these two components, the gradient magnitude and direction are calculated pixel by pixel. Non-maximum suppression is performed to refine edges. For each pixel, the gradient magnitude of that pixel is compared with the magnitudes of its two neighboring pixels along its gradient direction. Only if the gradient magnitude of that point is a local maximum in its gradient direction is it preserved; otherwise, its magnitude is set to zero. A dual-threshold algorithm is applied for edge detection and concatenation. A high threshold (e.g., 30% of the maximum gradient magnitude) and a low threshold (e.g., 40% of the high threshold) are set. In the image after non-maximum suppression, pixels with gradient magnitudes greater than a high threshold are marked as strong edges and considered as defined edges; pixels with gradient magnitudes lower than a low threshold are directly suppressed as background; and pixels with gradient magnitudes in between are marked as weak edges. Then, each weak edge is examined: if at least one strong edge exists within its 8-neighborhood, the weak edge is connected and promoted to a strong edge; otherwise, it is suppressed. The final output is a sharpened image sequence containing only significant, continuous, single-pixel-wide edges.

[0027] In one embodiment, in a nighttime power station scenario, after this step, key structural information such as the outline of a person's body, the boundaries of their head and limbs, etc., is clearly and completely extracted, while ground texture noise and false edges caused by uneven lighting are effectively suppressed.

[0028] In step S1106, the sharpened image sequence is subjected to median filtering for noise suppression to obtain the final equalized image.

[0029] It should be noted that median filtering is used for further noise suppression on top of the sharpened image sequence. A sliding window centered on the current pixel is defined, for example, with a size of 3×3 pixels or 5×5 pixels. The gray values ​​of all pixels within this window are sorted, and the median value is taken as the new gray value of the current center pixel. This process is then repeated across the entire image. The size of the filtering window balances the noise reduction intensity with edge preservation. A smaller window size (e.g., 3×3) can preserve details to the maximum extent, but has limited suppression of large-grain noise; a slightly larger window size (e.g., 5×5) can filter out noise more thoroughly, but may slightly blunt corners or fine lines.

[0030] In one embodiment, in the application of nighttime power plant monitoring, to ensure that key details such as the outline of people are not distorted while removing noise, a window size of 3×3 pixels is usually preferred. After processing the personnel outline image obtained in the aforementioned steps, sporadic white spots generated by the reflective areas of clothing and discrete black noise spots in the shadows are filtered out, while the overall boundary of the human body remains smooth and intact.

[0031] In step S12, the optical flow vector field is calculated based on the equalized image, pixels with amplitudes exceeding the motion intensity threshold are extracted, discontinuous boundaries are connected and pixel displacements are tracked, and the boundaries of the motion region are determined after smoothing and filtering. This includes: S1201, Based on the equalized image, the displacement vector of pixels between consecutive frames is calculated using an optical flow algorithm to obtain a dense optical flow vector field; S1202, determine the motion intensity threshold based on the amplitude distribution of the dense optical flow vector field, extract the set of pixels whose amplitude exceeds the threshold, and form a preliminary motion region mask; S1203, Morphological closing operation is applied to the preliminary motion region mask to remove isolated noise points and connect discontinuous boundaries to obtain the boundary contour of the continuous motion region. S1204, after smoothing the point set of the boundary contour line of the continuous motion area using a Gaussian smoothing filter, a smooth boundary curve is generated to determine the boundary of the motion area in the monitoring screen.

[0032] In step S1201, based on the equalized image, the displacement vectors of pixels between consecutive frames are calculated using an optical flow algorithm to obtain a dense optical flow vector field.

[0033] It should be noted that the Horn-Schunck optical flow algorithm is used to calculate the displacement vectors of pixels between consecutive frames, forming a dense optical flow vector field. Based on the assumption of constant brightness and global smoothness constraints, the optical flow is solved by minimizing the energy function containing data terms and regularization terms.

[0034] First, the spatial grayscale gradient of each pixel in the t-th frame image is calculated in the horizontal and vertical directions. Then, the optical flow field is solved by minimizing a global energy function. This function consists of two parts: a data term reflecting the assumption of constant brightness (i.e., the grayscale change of the corresponding pixel should be as small as possible); and a regularization term reflecting the smoothing constraint (i.e., the motion vectors of adjacent pixels should be as smooth as possible). The relative importance between these two parts is adjusted by a preset smoothing weight parameter λ. The setting of the smoothing weight parameter λ is based on the characteristics of moving objects and the noise level in the actual scene. For scenarios such as power plant perimeter monitoring involving continuous movement of physical objects such as people walking and running, the movement usually has obvious regional consistency. Therefore, a larger λ value (e.g., selected in the range of 1.0 to 2.0) can be set to emphasize the smoothing constraint. After determining the parameter, the minimum value of the energy function is solved using the Gauss-Seidel iteration method. The number of iterations is usually set to 100 to 500, or the average residual change between two adjacent iterations is less than 1 × 10⁻⁶. -4 As a convergence condition, the final output is the displacement components of each pixel in the x and y directions, forming a dense optical flow field.

[0035] In one embodiment, in a power plant perimeter scene, the pixel area corresponding to a walking or running person will show a displacement vector with a consistent direction and gradually increasing amplitude, while the vector amplitude of the stationary background area is close to zero, thereby effectively separating the moving foreground from the static background.

[0036] In step S1202, a motion intensity threshold is determined based on the amplitude distribution of the dense optical flow vector field, and a set of pixels with amplitudes exceeding the threshold is extracted to form a preliminary motion region mask.

[0037] It should be noted that the motion intensity threshold is determined by analyzing the statistical distribution of optical flow amplitude, i.e., the magnitude of the displacement vector of each pixel. To effectively separate real moving targets from background noise or calculate outliers, a composite threshold strategy is adopted. The average and standard deviation of the optical flow amplitude of all pixels are calculated, and the lower threshold is set to the average plus k times the standard deviation (k is typically 1.5 to 2.0; a larger k value results in stronger noise suppression). This method is based on the assumption of a predominantly normal distribution of the data and can effectively filter out most low-amplitude noise caused by minor vibrations (such as vegetation shaking or reflections). Secondly, to exclude a few extremely high-amplitude outliers caused by optical flow calculation errors, and to avoid missing fast-moving targets due to a single threshold, an upper threshold is set. This upper threshold can be taken as a higher quantile of the optical flow amplitude ranking (e.g., the 99.5th quantile). Finally, pixels with optical flow amplitudes higher than the lower threshold and lower than the upper threshold are identified as foreground moving pixels (e.g., assigned a value of 1), and the remaining pixels are identified as background (e.g., assigned a value of 0), thereby generating a preliminary binary motion region mask image.

[0038] In one embodiment, in a 25fps video stream at the perimeter of the power station, the average optical flow amplitude of background pixels was statistically analyzed to be approximately 0.2 pixels / frame, with a standard deviation of approximately 0.1 pixels / frame. Taking k=2.0, the lower threshold can be calculated as 0.4 pixels / frame; the upper threshold is taken as the 99.5th percentile of the amplitude sorting, such as 5.0 pixels / frame, to filter out occasional outliers. After application, motion pixels corresponding to people walking or running normally are effectively extracted, while minor vibrations caused by ground reflections, continuous swaying of vegetation in a light breeze, etc., are effectively filtered out.

[0039] In step S1203, morphological closing operations are performed on the preliminary motion region mask to remove isolated noise points and connect discontinuous boundaries to obtain the boundary contour line of the continuous motion region.

[0040] It should be noted that morphological closing operations are applied to the initial motion region mask. Based on the scale of the gap between noise and the target in typical surveillance scenarios, a 3×3 pixel circular (or square) structuring element is typically chosen. This size effectively fills small holes caused by noise within the target area and bridges contour breaks of several pixels in width, while avoiding the loss of fine structures due to excessive smoothing. Morphological dilation and erosion operations are then performed sequentially. The initial motion region mask is dilated using the aforementioned structuring element. When the center of the structuring element traverses each foreground pixel (pixel with a value of 1) of the mask image, all pixels in its neighborhood are set as foreground pixels. This operation expands the foreground area, thereby connecting adjacent but broken contour fragments. The same structuring element is then used to erode the dilated result. Only when the structuring element is completely contained within the foreground area is the center pixel retained as foreground. This operation can restore over-magnified areas to approximately their original size while ensuring that connected areas are no longer broken. After this dilation-erosion closing operation, isolated noise points are eliminated, small holes inside the target are filled, and discontinuous motion contours are connected into coherent boundaries in the output binary mask image.

[0041] In one embodiment, in a power plant perimeter monitoring scenario, an inspection personnel appears as several broken outline blocks in the initial mask due to equipment obstruction. After this step, these outline blocks are connected into a complete, closed personnel shape area.

[0042] In step S1204, the point set of the boundary contour line of the continuous motion region is smoothed by a Gaussian smoothing filter to generate a smooth boundary curve, thereby determining the boundary of the motion region in the monitoring screen.

[0043] It should be noted that a Gaussian smoothing filter is used for curve fitting on the point set of the boundary contour of the continuous motion region. A one-dimensional Gaussian convolution kernel is selected, and its standard deviation σ and kernel size are set according to the expected smoothness and detail preservation requirements of the target contour. For example, for large targets with smooth surfaces, such as personnel in a power station, a filter with σ=1.5 and a kernel size of 7 can be used to effectively smooth jagged edges while avoiding excessive blurring that would cause the loss of corner features such as limb connections. For each coordinate point (x, y) in the contour point sequence, a Gaussian weighted average is performed on it and several adjacent points (determined by the kernel size) to calculate the new smoothed coordinate position.

[0044] In one embodiment, for the silhouette of a person, the originally uneven transition between the torso and limbs becomes smooth and natural after smoothing, better conforming to the geometry of a real object. This final smooth boundary curve is the defined boundary of the precise motion area.

[0045] In step S13, foreground pixel clusters are extracted from the boundary of the motion region. If the density of the foreground pixel clusters exceeds a preset density threshold, it is determined to be a potential target region, and a target contour map is obtained, including: S1301, extract the set of foreground pixel coordinates from the internal region defined by the boundary of the motion region, and use a density clustering algorithm to divide the foreground pixel clusters to obtain the cluster center coordinates and the number of cluster points; S1302, if the number of cluster points exceeds the preset density threshold upper limit, it is marked as a potential target area, and its pixel set is determined as the central area point set; S1303, the boundary of the central region point set is expanded and the boundaries of adjacent clusters are connected to form the outline of the expanded region; S1304, superimpose the original contour line in the boundary of the motion area and the contour line of the extended area, and generate a refined target contour map after removing the overlapping part; S1305, perform pixel connectivity analysis on the refined target contour map and fill the internal holes to obtain a complete target contour map.

[0046] In step S1301, the set of foreground pixel coordinates is extracted from the internal region defined by the boundary of the motion region, and the foreground pixel clusters are divided using a density clustering algorithm to obtain the cluster center coordinates and the number of cluster points.

[0047] It should be noted that, starting from the motion region boundary map, the coordinate set of all pixels within the boundary is extracted to form the foreground pixel set. These pixels mainly correspond to the actual moving target areas such as people, and may also contain a small number of residual noise points or background interference. The DBSCAN density clustering algorithm is used to divide these foreground pixels, with a pre-set neighborhood radius (Eps) and minimum sample size (MinPts). The Eps setting is based on the minimum expected size of the target in the image. For example, for a 1920×1080 resolution image, Eps can be set to approximately 1% of the image width (e.g., 19 pixels) to ensure that the pixels of a complete target (e.g., an adult body) can be effectively connected. The MinPts setting is used to distinguish dense regions from noise, and can be set to 20 for example. During algorithm execution, the number of points in the Eps neighborhood of each pixel is calculated. If it is not less than MinPts, it is marked as a core point, and the cluster is expanded recursively, ultimately dividing the foreground pixels into several clusters and marking noise points. After clustering, for each pixel cluster, the arithmetic mean of the coordinates of all its points is calculated as the center coordinates of the cluster. At the same time, the total number of pixels contained in the cluster is counted.

[0048] In one embodiment, in a power plant perimeter monitoring scenario, taking a typical configuration of 1920×1080 resolution and a shooting distance of approximately 10 meters as an example, the pixel area of ​​an adult target in the image can vary significantly depending on the camera resolution, installation location, and monitoring distance, and usually needs to be determined through calibration during actual deployment. For example, at typical perimeter monitoring distances such as 20-50 meters and 1080P resolution, the pixel area of ​​a complete adult may be in the tens of thousands of pixels. The center coordinates of a pixel cluster of an adult that is relatively close or has a complete pose may be located at (450, 280), with approximately 8500 cluster points; the center coordinates of a pixel cluster of a person that is far away or partially obscured may be at (1200, 150), with approximately 2500 cluster points. Based on this, for multiple adjacent clusters whose center point Euclidean distance is less than twice a preset merging threshold such as Eps, they are merged into a unified potential target pixel cluster to address the situation where the target is fragmented during the clustering stage due to factors such as occlusion.

[0049] In step S1302, if the number of cluster points exceeds the preset density threshold upper limit, it is marked as a potential target area, and its pixel set is determined as the central area point set.

[0050] It should be noted that the preset density threshold includes a lower limit and an upper limit. A mapping model between pixel area and target physical size is established through the calibration process during deployment, thereby determining the minimum pixel area in the image that conforms to human body size as the lower limit; the upper limit is set based on statistical analysis of the maximum pixel area of ​​typical non-target interference areas in the scene. During the initial learning phase, the system can adaptively fine-tune the threshold based on detection data within a safe period. Subsequently, the number of cluster points in each foreground pixel cluster is compared with the set density threshold range. After actual deployment, the system can enter an initial learning phase, automatically counting the effective moving target pixel area detected within a safe period, dynamically fitting its distribution, thereby fine-tuning and optimizing the preset threshold. Therefore, the threshold is a configurable parameter related to camera resolution, installation location, viewing angle, and specific security rules. For example, statistical results show that the target area for adults is generally between 2000 and 8000 pixels, while that for small animals or noise is generally less than 1000 pixels.

[0051] In one embodiment, within a pre-defined power station perimeter scene (camera resolution 1920×1080, installation height approximately 5 meters, main monitoring distance 10-30 meters), a density threshold is set with a lower limit of 2000 pixels and an upper limit of 12000 pixels. If a pixel cluster has 4500 pixels falling within this range, it is identified as a potential target area (such as a person), and the coordinates of all pixels within the cluster are determined as its central area point set. This step achieves the differentiation and filtering of valid human targets from interference such as small animals and floating objects.

[0052] In step S1303, the central region point set is extended by boundary expansion and adjacent cluster boundaries are connected to form the extended region outline.

[0053] It should be noted that, taking the binary mask image corresponding to each central region point set as the processing object, a rectangular structuring element with a size of 5×5 pixels is selected, and two standard morphological dilation operations are performed sequentially. In each dilation operation, when the center of the structuring element traverses every foreground pixel in the mask image, all pixels within its neighborhood (i.e., within the 5×5 pixel range) are set as foreground. After two consecutive dilations, the boundary of the foreground region will expand outward by approximately 10 pixels. After dilation, by appropriately expanding the boundary, the small number of pixels lost due to uneven lighting or partial occlusion (such as a person being briefly obscured by equipment) at the edge of the target subject are compensated for, making the outline more complete; at the same time, the boundaries of these neighboring subclusters with multiple minor breaks due to noise are connected and merged into a unified connected region.

[0054] In one embodiment, in a power plant scenario, the outline of a person may exhibit minute breaks on a binary mask due to equipment shadows or localized overexposure from strong light. After the two dilation operations described above, these broken outline portions are connected by the expanded boundaries, ultimately forming a complete, closed outline of the person. This expanded outline provides a more robust regional basis for subsequent precise feature analysis.

[0055] In step S1304, the original contour line in the boundary of the motion area and the contour line of the extended area are superimposed, and the overlapping part is removed to generate a refined target contour map.

[0056] It should be noted that by superimposing the extended region contour line with the original motion region contour line, only the newly added part after expansion is retained, and the area overlapping with the original boundary is removed, thereby generating a more refined target contour map; it should be noted that in this invention, unless otherwise specified, the original contour line refers to the motion region boundary curve generated and smoothed by step S12.

[0057] In step S1305, pixel connectivity analysis is performed on the refined target contour map and internal holes are filled to obtain a complete target contour map.

[0058] It should be noted that morphological closing operations are used to scan the binary image and identify all independent connected regions formed by foreground pixels. For each connected region, seed filling is performed, starting from an interior point within the region boundary and spreading outwards, marking all background pixels surrounded by the foreground boundary as foreground pixels. This process completely fills all holes within the region.

[0059] In one embodiment, in the personnel profile map, the internal black holes caused by clothing wrinkles or backpacks during binarization are completely filled after this step, and the final output is a personnel target profile map that is solid internally, has continuous and closed boundaries.

[0060] In step S14, a binary mask is generated based on the target contour map. Isolated noise points in the binary mask are removed to obtain a first mask. Connectivity component analysis and merging are performed, and after smoothing and repairing broken parts, a complete target mask is determined. This includes: S1401, Generate a binary mask based on the target contour map, and perform morphological erosion operation on the binary mask to remove isolated noise points, thereby obtaining a first mask with preliminary cleaning; S1402, Perform connectivity component analysis on the first mask, identify and merge spatially adjacent pixel groups that meet preset area conditions, and determine the set of connected regions; S1403, Apply dilation operation to the connected region set to perform boundary smoothing processing, and obtain the smoothed region boundary; S1404, the smoothed region boundary is superimposed and compared with the original contour line, and the broken part is repaired by the boundary tracking algorithm to determine the final complete target mask.

[0061] In step S1401, a binary mask is generated based on the target contour map, and morphological erosion is applied to the binary mask to remove isolated noise points, resulting in a preliminary cleaned first mask.

[0062] It should be noted that the target contour image is converted into a binary mask image, where the pixel value inside the contour is 1 (foreground) and the value outside is 0 (background). Morphological erosion is used to process the binary mask image to remove isolated noise points. A 3×3 pixel rectangular structuring element is used, and its center is traversed through every foreground pixel (value 1) in the mask image. The center pixel is retained as foreground only if all pixels within the 3×3 neighborhood covered by the structuring element are foreground; otherwise, the center pixel is set as background.

[0063] In one embodiment, for a binary mask containing a standing person, the initially extracted edge pixels are approximately 5000, including both the actual boundary points of the person's body and a few isolated noise points caused by light reflection or camera shake. After this erosion operation, isolated foreground spots consisting of only 2 to 3 pixels caused by device reflection or image noise are effectively eliminated, while the continuous foreground area containing the person is preserved, resulting in a preliminary cleaned mask with less noise.

[0064] In step S1402, connectivity component analysis is performed on the first mask to identify and merge spatially adjacent pixel groups that meet preset area conditions, thereby determining a set of connected regions.

[0065] It should be noted that the first mask is subjected to connected component analysis using an 8-neighborhood connection-based scanning algorithm. This algorithm traverses the mask image, marking directly or indirectly adjacent foreground pixels as the same connected component, thus dividing the image into several independent initial connected regions. Subsequently, these initial connected regions are filtered and merged according to preset area conditions: a minimum pixel count threshold (e.g., 500 pixels) is set, determined based on the minimum expected size of the target subject (e.g., a person's torso); for each connected region, if its pixel count is greater than or equal to this threshold, it is retained as a primary connected region; if its pixel count is less than this threshold, its spatial position is checked. If it is adjacent to a primary connected region (within a few pixels of boundary distance), it is merged into that primary region; otherwise, it is considered secondary noise and retained or removed.

[0066] In one embodiment, when processing the person mask, the torso edge forms a main connected region containing approximately 4,000 pixels, which is directly preserved; the arm region, formed by its shadow and containing approximately 300 pixels, is merged into the torso region because it is adjacent to the torso region and its area is less than a threshold. Ultimately, one or more sets of connected regions representing the complete target are obtained.

[0067] In step S1403, the set of connected regions is subjected to dilation operation to perform boundary smoothing processing, resulting in smoothed region boundaries.

[0068] It should be noted that a 5×5 pixel rectangular structuring element is chosen for the dilation operation. This size is set to cover the typical boundary break width (usually within a few pixels) caused by local shadows or noise, effectively bridging these small gaps while avoiding excessive distortion of the overall contour shape. For each connected region's binary mask, the structuring element is used for a single dilation process. As the center of the structuring element traverses every foreground pixel on the boundary of that region, all pixels within its 5×5 neighborhood are set to foreground. This operation causes the boundary of each connected region to expand outwards uniformly by approximately 2 to 3 pixels, filling in any existing small depressions and breaks, forming a more continuous and smooth boundary contour.

[0069] In one embodiment, when processing the connected area of ​​a person's torso, the breaks on its boundary caused by local shadows and with a width in the range of 3 to 4 pixels are connected by newly filled pixels after this dilation operation, thereby forming a more continuous and complete boundary line.

[0070] In step S1404, the smoothed region boundary is superimposed and compared with the original contour line, and the broken part is repaired by the boundary tracking algorithm to determine the final complete target mask.

[0071] It should be noted that a logical XOR operation is performed on the smoothed region boundary map and the original contour line to obtain a difference image. The highlighted pixels in this image represent the boundary parts added during the smoothing operation and the boundary parts that may have been lost in the original contour. Based on the difference image, a target boundary tracking algorithm based on endpoint connection is used to repair the break. The algorithm identifies two unconnected endpoints at the break in the original contour, then calculates all possible pixel paths between these two endpoints and selects the shortest path that is most consistent with the tangent direction of the local contour at both endpoints, connecting the two endpoints with a new pixel chain. The path search range can be set according to the typical break size, for example, limited to a 15×15 pixel area around the endpoints. After connecting all breaks, the algorithm outputs a completely closed contour. Finally, seed filling is performed on the internal region enclosed by this closed contour to generate a final complete target mask with all target pixels having a value of 1 and background pixels having a value of 0.

[0072] In one embodiment, due to insufficient lighting, a break of approximately 10 pixels appears on the original contour at the junction of the arm and torso in the person's silhouette. A boundary tracing algorithm identifies the two endpoints of the break and infers a reasonable connection path based on the direction of its adjacent contours, thus completing the contour. The resulting target mask completely covers the entire person, without internal holes or external breaks.

[0073] In step S15, the target sub-image is extracted from the equalized image based on the complete target mask, and the gradient histogram feature vector of the target sub-image is obtained, including: S1501, Separate the pixel region corresponding to the complete target mask from the equalized image to obtain the target sub-image; S1502, calculate the grayscale gradient magnitude and direction of the target sub-image, and generate a gradient direction histogram. S1503, Divide the direction interval according to the gradient direction histogram, and generate a direction-weighted histogram vector by accumulating the frequency; S1504, the direction-weighted histogram vector is normalized to obtain the gradient histogram feature vector used for identity verification.

[0074] In step S1501, the pixel region corresponding to the complete target mask is separated from the equalized image to obtain the target sub-image.

[0075] It should be noted that a bitwise AND operation is performed between the pixel region corresponding to the complete target mask and the equalization image. Using the mask as a template, for each pixel position with a value of 1 in the mask, the pixel grayscale value at the same position is copied from the equalization image to the output image; for pixel positions with a value of 0 in the mask, the pixel value at the corresponding position in the output image is set to 0. The final output image is the target sub-image, which only contains the original grayscale information of the target region defined by the mask, while the background is removed.

[0076] In one embodiment, in a nighttime power station perimeter scene, a mask covering the main body of a person is obtained through the aforementioned steps, with approximately 4,500 foreground pixels. By performing the above-described calculations on this mask and an equalized grayscale monitoring image, a new image is obtained. This image displays only the grayscale details of the person's body, such as the texture of their work clothes and limb outlines, while the surrounding ground, equipment, and other background elements become pure black.

[0077] In step S1502, the grayscale gradient magnitude and direction of the target sub-image are calculated, and a gradient direction histogram is generated statistically.

[0078] It should be noted that the grayscale gradient magnitude and direction of the target sub-image region can be calculated using the Sobel operator for convolution. A 3×3 Sobel convolution kernel is used to convolve with the target sub-image in both the horizontal (x) and vertical (y) directions, obtaining the horizontal gradient component Gx and the vertical gradient component Gy for each pixel. The gradient magnitude is then calculated based on these components. Used to measure the intensity of an edge; gradient direction angle The range of its results is After linear transformation, the gradient direction, ranging from 0 to 360 degrees, represents the normal direction of the edge. To enhance the robustness of the feature to changes in illumination and improve discriminative power, the target sub-image is divided into multiple non-overlapping cell units, for example, each unit is 8×8 pixels, and a local gradient orientation histogram is calculated for each cell unit. When using gradient orientation histogram features, mainstream practices can be followed, and the 0-360 degree direction can be evenly divided into 9 intervals. The number of intervals can be adjusted according to the balance between recognition accuracy and computational resources; for example, it can be increased to 12 or 16 intervals to improve feature discriminative power, or reduced to 6 intervals to reduce computational cost. To suppress noise, a gradient magnitude threshold is set (for example, taking the 50th percentile of all pixel magnitudes). For a pixel within each cell unit, if its gradient magnitude is greater than the threshold, the gradient magnitude of that pixel is accumulated into the statistical value of that interval according to its gradient direction, generating the histogram vector of that unit. For human targets, their gradient orientation histograms can usually reflect structural features such as the vertical edges of the torso and the contours of the limbs.

[0079] In one embodiment, the 360-degree directional range is uniformly divided into nine intervals (each interval being 40 degrees wide) to quantize the gradient direction. To suppress the influence of noise, a gradient magnitude threshold (e.g., 30) is set. When generating the histogram, only pixels with gradient magnitudes greater than this threshold are counted, and their magnitudes are accumulated into the corresponding directional intervals based on their quantized directional angles. This process generates a histogram vector containing statistical values ​​from the nine intervals, which describes the directional distribution of the main edges within the target region.

[0080] In step S1503, the direction intervals are divided according to the gradient direction histogram, and the frequency is accumulated to generate a direction-weighted histogram vector.

[0081] It should be noted that the gradient orientation histogram has been pre-divided into N, for example, 9, uniform intervals along the 360-degree direction. For the i-th orientation interval, a weighted value is calculated, determined by the cumulative frequency of gradient directions within that interval and the average gradient magnitude of all pixels within that interval. For each orientation interval, its cumulative frequency is multiplied by the average gradient magnitude of that interval to obtain the final weighted contribution value for that interval. This weighting operation strengthens the importance of directions with large gradient magnitudes and significant edges (such as the vertical edges of the human torso) in the feature vector, while weakening the influence of uniform regions or noisy edges with smaller magnitudes. Arranging the weighted contribution values ​​of all orientation intervals in order constitutes an N-dimensional orientation-weighted histogram vector. This vector integrates the orientation distribution and intensity information of the target edge.

[0082] In one embodiment, within the person target sub-image, the interval representing the vertical direction (e.g., 80-120 degrees) contains a large number of high-intensity torso side edges, resulting in a high cumulative frequency and average amplitude. After weighting, its contribution value may account for approximately 35% of the total, making it the most significant component in the vector. Conversely, the interval representing the 45-degree direction, corresponding to the hypotenuse of the arms or legs, may account for approximately 20% of the weighted contribution value. Vectors generated in this way can more robustly reflect the essential contour features of the human body.

[0083] In step S1504, the direction-weighted histogram vector is normalized to obtain a gradient histogram feature vector for identity verification.

[0084] It should be noted that the L2 norm method is typically used to normalize the histogram vector. The L2 norm of the weighted histogram vector is calculated, which is the square root of the sum of the squares of all its components. Then, each component of the vector is divided by this L2 norm value. After this operation, the original vector is transformed into a unit vector with a magnitude of 1.

[0085] In one embodiment, two original directional weighted histogram vectors are generated for the same person under twilight (generally dark) and nighttime searchlight illumination (locally bright), respectively. Their component values ​​may differ by several times. However, after L2 normalization, the proportions of each component in the two vectors will tend to be consistent, thus representing the same person's contour structure features, providing a stable and reliable feature representation for subsequent identity verification.

[0086] In step S16, similar feature vectors are retrieved from a pre-established authorized personnel feature database. If the similarity score is higher than a preset similarity threshold, the person is determined to be an authorized personnel, and a verification pass identifier is obtained, including: S1601, Extract the stored standardized feature vector from the pre-established authorized personnel feature database; S1602, calculate the similarity between the gradient histogram feature vector and each standardized feature vector in the authorized personnel feature database to obtain a similarity score matrix; S1603, Select the highest value in the similarity score matrix. If it is higher than the preset similarity threshold, it is determined that the match is successful. S1604: Associate the authorized personnel identity information corresponding to the successfully matched feature vector with the moving target to be verified, and generate a verification pass identifier.

[0087] In step S1601, the stored standardized feature vectors are extracted from the pre-established authorized personnel feature library.

[0088] It should be noted that the pre-established authorized personnel feature database is stored in the form of a data structure, where each record contains at least one unique identifier, such as a personnel ID, and one or more corresponding standardized gradient histogram feature vectors. The authorized personnel feature database is established and maintained as follows: under controlled lighting conditions, multi-angle (e.g., frontal, side) images of authorized power plant personnel wearing standard work clothes and safety helmets are collected; the above steps are performed independently on each image to extract gradient histogram feature vectors; after L2 normalization of the feature vectors of the same person from all angles, their mean vector is calculated, and this mean vector is normalized again by L2 to become the final standardized feature vector for that person, which is then stored in the feature database; to improve the system's robustness to recognition under different conditions, the feature database can store a feature vector set for each authorized person, containing their features under typical working hours, different lighting conditions, and standard attire. The system also supports adding features with high confidence matching from daily monitoring as new samples to this set under manual confirmation, achieving dynamic optimization of the feature database. During the verification phase, the system generates a query request based on the temporary identifier or associated information of the target to be verified, and retrieves and loads the corresponding L2 norm normalized gradient histogram feature vector into the memory buffer through the database interface.

[0089] In one embodiment, when the system processes a person to be identified, the system compares the extracted feature vector of the person with the feature database in real time.

[0090] In step S1602, the similarity between the gradient histogram feature vector and each standardized feature vector in the authorized personnel feature database is calculated to obtain a similarity score matrix.

[0091] It should be noted that the similarity measurement method is cosine similarity. Since both the gradient histogram feature vector and the vectors in the authorized personnel feature library have been L2 norm normalized (magnitude of 1) as described above, the cosine similarity between them can be simplified to their dot product operation. The calculated value ranges from [-1, 1]. The closer the value is to 1, the more consistent the directions of the two vectors are, meaning the more similar the gradient direction distribution features of the images they represent. Batch similarity calculation is performed. The real-time gradient histogram feature vector to be verified is sequentially multiplied with N standardized feature vectors extracted from the feature library to obtain N similarity scores. These N scores are arranged in order to form an N-row, 1-column similarity score matrix. The similarity score matrix of each element of this matrix corresponds to the similarity between the real-time gradient histogram feature vector and the i-th feature vector in the library.

[0092] In one embodiment, in a verification scenario at the entrance or core area of ​​a power station, the personnel gradient histogram feature vector extracted from real-time monitoring images needs to be compared with the feature vectors of three authorized personnel registered in the feature library. The system sequentially calculates the dot product of the real-time gradient histogram feature vector with these three library vectors, and the similarity scores obtained are 0.78, 0.15 and 0.08, respectively, thereby generating a score matrix [0.78; 0.15; 0.08].

[0093] In step S1603, the highest value in the similarity score matrix is ​​selected. If it is higher than the preset similarity threshold, it is determined that the match is successful.

[0094] It should be noted that the preset similarity threshold is a dynamic parameter determined based on statistical analysis of historical verification data and a balance of recognition performance requirements, rather than a fixed empirical value. During system initialization, a batch of positive and negative sample pairs can be collected, the similarity distribution calculated, and the corresponding threshold selected on the ROC curve based on the acceptable false recognition rate (FAR) and false rejection rate (FRR) as the initial value. For example, after statistical analysis, the threshold is set to 0.65. Furthermore, this threshold is affected by factors such as the quality of the feature library and changes in ambient lighting. Therefore, the system should support dynamic calibration of the threshold based on statistical analysis of historical recognition results, such as the false recognition rate and false rejection rate within a period, or provide a manual adjustment interface to adapt to feature drift or changes in recognition requirements during long-term operation. The highest value in the similarity score matrix is ​​selected. If it is higher than the preset similarity threshold, the current target to be verified is determined to have successfully matched the identity identifier corresponding to the highest similarity score in the library, and the verification passes; otherwise, the matching fails, and the verification fails.

[0095] In one embodiment, by statistically analyzing sample data collected from the entrance and exit of a power station over a month and setting an acceptable maximum false recognition rate target, the similarity threshold is determined to be 0.65. In subsequent identification, if the score matrix is ​​[0.78; 0.15; 0.08], and the highest score of 0.78 is higher than the threshold of 0.65, the system determines that the person to be verified has successfully matched the authorized personnel in the database corresponding to a score of 0.78, and the verification passes. Otherwise, the matching is deemed unsuccessful. This threshold can be periodically evaluated and adjusted based on subsequent operational data.

[0096] In step S1604, the authorized personnel identity information corresponding to the successfully matched feature vector is associated with the moving target to be verified, and a verification pass identifier is generated.

[0097] It should be noted that after a successful match, the system retrieves the complete record from the authorized personnel feature database based on the record index of the feature vector corresponding to the highest similarity score. In addition to the feature vector, this record also pre-stores associated identity information such as the person's name, employee ID, license plate number, and their corresponding set of permission tags, such as "Entry to Area A Allowed" and "Nighttime Access Permitted." The system creates a structured verification pass object. This object contains at least the following fields: the matched identity, the corresponding list of permission tags, the timestamp of this verification, and the matching similarity score. Finally, this object is output to the system to trigger subsequent operations such as access permission or logging.

[0098] In one embodiment, at the entrance of the core area of ​​the power plant, the person to be verified successfully matches the record of Zhang San in the feature database. The system retrieves Zhang San's record, whose permission tags are "Entry to Area A" and "Nighttime Access Allowed". The system then generates a verification pass identifier with the following content: {Identity: Zhang San, Permissions: ["Entry to Area A", "Nighttime Access Allowed"]; Time: [Current Time]; Match Score: 0.92}. This identifier is sent to the access control system, and the access control automatically opens to allow passage.

[0099] In step S17, potential target areas are filtered based on the verification criteria. If the verification fails, an intrusion alarm mechanism is triggered to obtain the final intrusion detection result, including: S1701, if the moving target does not obtain the verification pass mark, then the potential target area where it is located is marked as an unauthorized target area; S1702, compare the spatial location of the unauthorized target area with the predefined intrusion sensitive area. If there is an overlap with any intrusion sensitive area, it is determined to be a suspicious intrusion area. S1703, if the suspected intrusion area has an abnormal movement path and the speed or direction change exceeds the preset safety threshold, the intrusion alarm mechanism is triggered to obtain the final intrusion detection result.

[0100] It should be noted that if the moving target obtains a verification pass mark, an authorization operation will be performed based on the permission information in the mark. For example, its passage status will be updated to authorized, it will be marked with a green box in the monitoring screen, the verification log will be recorded, and the automatic release mechanism will be triggered.

[0101] In step S1701, if the moving target does not obtain the verification pass mark, the potential target area where it is located is marked as an unauthorized target area.

[0102] It should be noted that if a match fails (i.e., the highest similarity score is below a preset threshold), the system obtains the potential target region information corresponding to the failed moving target in the image, defined by the bounding box coordinates or the complete target mask. The system sets an "unauthorized" status label in the metadata of this region and records its location coordinates, timestamp, and the feature vector used for verification into the unauthorized target log list. Simultaneously, the region can be overlaid with a prominent visual marker (such as a red border) on the monitoring video stream or the current frame image to provide real-time alerts.

[0103] In one embodiment, during a monitoring scenario at the perimeter or core area entrance of a power plant, an unauthorized person enters, and their characteristics do not match any records in the authorization database. Upon determining that the verification has failed, the system immediately marks the image area where the person is located as unauthorized, highlights the person with a red rectangle on the monitoring screen of the management terminal, and generates an alarm record containing their location and time, prompting security personnel to intervene.

[0104] In step S1702, the unauthorized target area is spatially compared with the predefined intrusion-sensitive area. If it overlaps with any intrusion-sensitive area, it is determined to be a suspicious intrusion area.

[0105] It should be noted that the system accesses a pre-stored electronic map or scene plan, which defines several intrusion-sensitive areas, such as the "main transformer area" and the "high-voltage distribution room perimeter," as sets of polygon coordinates. These areas are pre-marked as red polygons on the map. The system retrieves the location information of the marked unauthorized target area, represented by the coordinates of its smallest bounding rectangle or the precise polygon outline point set. The system then performs an "intersection" check between the polygon outline of the unauthorized target area and each pre-defined intrusion-sensitive area polygon. This calculation is achieved by using a ray casting method to determine polygon overlap, detecting whether two polygons have any area intersection. If the calculation result indicates an intersection (i.e., the overlapping area is greater than zero), the system immediately classifies the unauthorized target area as a "suspicious intrusion area." The system records the target information associated with this area, the type of intrusion-sensitive area, and the area or proportion of the overlapping portion.

[0106] In one embodiment, in the monitoring screen, the boundary outline of an unauthorized target, such as an intruder, intersects with the polygonal area of ​​the "main transformer area" on the electronic map, as determined by the algorithm. Even if the overlapping area is only a few pixels, the system will mark the area where the intruder is located as a suspicious intrusion area and generate an alarm event containing "intrusion into the main transformer area," along with the specific spatial location information, and report it.

[0107] In step S1703, if the suspected intrusion area has an abnormal movement path and the speed or direction change exceeds a preset safety threshold, the intrusion alarm mechanism is triggered to obtain the final intrusion detection result.

[0108] It should be noted that the preset security thresholds are set based on statistical analysis of authorized personnel's normal activities, such as patrols and passage, within the corresponding sensitive areas from historical monitoring data. This analysis examines the normal behavioral trajectories of authorized personnel within sensitive areas in historical data, statistically analyzing the distribution of pixel displacement, directional change angles, and number of frames remaining between consecutive frames. The mean value plus a certain multiple of the standard deviation is then used as the anomaly threshold for each indicator. This includes the velocity mutation threshold, which is the pixel displacement rate (in pixels per frame) within the image coordinate system. Its setting needs to be obtained through scene calibration, such as marking a line segment with a known physical length, such as 5 meters, in the monitoring screen and calculating its pixel length in the image. Based on the video frame rate (frames / second), the physical speed (meters / second) is converted into a pixel speed threshold, which is calculated by multiplying the physical speed threshold by the pixel length L and then dividing by the video frame rate. A sudden change in direction threshold is set to 90 degrees by statistically analyzing the angular change distribution of motion directions between adjacent frames during normal movement. A dwell time threshold is set to, for example, 250 frames (approximately 10 seconds, assuming a video frame rate of 25fps) by analyzing the reasonable number of frames a normal activity can stay in a sensitive area. Once a target's behavior exceeds any of these thresholds, the system determines it as an intrusion, immediately triggering an alarm mechanism. It generates and sends the highest-priority intrusion alarm event to the security platform, overlays a warning box and label on the monitoring video, and can also link with on-site audible and visual alarms and broadcast systems for voice-activated dispersal or locking of relevant access control points.

[0109] In one embodiment, after an unauthorized target enters the sensitive area of ​​the "main transformer zone," if the pixel displacement of the center point of its bounding box exceeds 20 pixels per frame between consecutive frames (physical speed of 5 m / s, pixel length of 100 pixels / m, video frame rate of 25 fps), the change in movement direction exceeds 90 degrees, and it remains continuously in that area for more than 250 frames, the system determines that its movement behavior exceeds the security threshold, immediately triggers an intrusion alarm, generates a final intrusion detection result including the target's location, behavior description, and video evidence, and activates on-site audio-visual warnings.

[0110] In summary, this invention discloses a visual intelligence-based method for identifying abnormal personnel intrusion in power plants. The method includes: adaptive equalization preprocessing of monitoring images; extraction and optimization of motion region boundaries based on optical flow fields; obtaining foreground target contours through density clustering and obtaining target masks through morphological processing; extracting gradient histogram features from target sub-images and performing similarity matching with an authorized personnel feature database to generate verification identifiers; and, based on the verification results, performing sensitive area overlap and behavioral trajectory analysis on unauthorized targets to trigger intrusion alarms. This invention relies on industrial vision technology and constructs a complete technical chain from image preprocessing, moving target extraction, feature representation to intelligent decision-making, achieving real-time, accurate identification and reliable alarming of abnormal personnel intrusion behavior within power plant areas, significantly improving the automation level and environmental adaptability of the security monitoring system.

[0111] Reference Figure 2 The second embodiment of the present invention provides a power plant abnormal personnel intrusion identification system based on visual intelligence, comprising: The image preprocessing and equalization module acquires the original image sequence and performs grayscale conversion. It then adjusts the pixel brightness distribution and enhances detail features in the converted grayscale image sequence, extracts and optimizes boundary information, and obtains an equalized image after denoising. The motion region detection and boundary determination module calculates the optical flow vector field based on the equalized image, extracts pixels whose amplitude exceeds the motion intensity threshold, connects discontinuous boundaries and tracks pixel displacement, and determines the boundary of the motion region after smoothing and filtering. The foreground target extraction and contour generation module extracts foreground pixel clusters from the boundary of the motion region. If the density of the foreground pixel clusters exceeds a preset density threshold, it is determined to be a potential target region, and a target contour map is obtained. The target mask optimization module generates a binary mask based on the target contour map, removes isolated noise points from the binary mask to obtain a first mask, performs connected component analysis and merging, and determines the complete target mask after smoothing and repairing broken parts. The feature extraction module extracts the target sub-image from the equalized image based on the complete target mask, calculates the gradient and generates a gradient direction histogram, and after direction interval weighting and vector normalization, obtains the gradient histogram feature vector for identity verification. The identity verification module retrieves similar feature vectors from a pre-established authorized personnel feature database. If the similarity score is higher than the preset similarity threshold, the user is determined to be an authorized person and a verification pass flag is obtained. The intrusion alarm decision module filters potential target areas based on the verification pass identifier. If the verification fails, the intrusion alarm mechanism is triggered to obtain the final intrusion detection result.

[0112] It should be noted that the visual intelligence-based power plant abnormal personnel intrusion identification system provided in this embodiment of the invention is used to execute all the process steps of the visual intelligence-based power plant abnormal personnel intrusion identification method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.

[0113] This invention also provides an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a visual intelligence-based power plant intrusion detection program. When the processor executes the computer program, it implements the steps described in the various visual intelligence-based power plant intrusion detection method embodiments above, for example... Figure 1 The step S11 shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above system embodiments, such as the identity verification module.

[0114] It should be noted that the system can be deployed on a server in the power plant monitoring center. The server connects to high-definition network cameras (image preprocessing and equalization modules) in various areas via a local area network. Algorithm programs run in the server's memory, including software modules for motion area detection, feature extraction, and identity verification (corresponding to the modules in the claims). The authorized personnel feature database is stored in the server's associated database. After the intrusion alarm decision module is triggered, it can send alarm information to audible and visual alarms and security personnel terminals via the network. The intrusion alarm decision module generates an alarm event containing target information, location, and time, and sends it to the security management platform and on-site alarm devices through the system's internal communication interface.

[0115] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.

[0116] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0117] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A method for identifying abnormal personnel intrusion in a power plant based on visual intelligence, characterized in that, include: After obtaining the original image sequence, grayscale conversion is performed. The pixel brightness distribution of the converted grayscale image sequence is adjusted and the detail features are enhanced. Boundary information is extracted and optimized. After denoising, an equalized image is obtained. The optical flow vector field is calculated based on the equalized image, pixels with amplitudes exceeding the motion intensity threshold are extracted, discontinuous boundaries are connected and pixel displacements are tracked, and the boundaries of the motion region are determined after smoothing and filtering. Extract foreground pixel clusters from the boundary of the motion region. If the density of the foreground pixel clusters exceeds a preset density threshold, it is determined to be a potential target region, and a target contour map is obtained. A binary mask is generated based on the target contour map. After removing isolated noise points from the binary mask, a first mask is obtained. Connectivity component analysis and merging are performed. After smoothing and repairing broken parts, the complete target mask is determined. Based on the complete target mask, target sub-images are extracted from the equalized image, gradients are calculated and gradient direction histograms are generated. After direction interval weighted sum and vector normalization processing, gradient histogram feature vectors for identity verification are obtained. Retrieve similar feature vectors from a pre-established database of authorized personnel features. If the similarity score is higher than a preset similarity threshold, the person is identified as an authorized personnel and a verification pass is obtained. Based on the verification, potential target areas are filtered by the identifier. If the verification fails, an intrusion alarm mechanism is triggered to obtain the final intrusion detection result.

2. The method for identifying abnormal personnel intrusion in a power plant based on visual intelligence according to claim 1, characterized in that, After acquiring the original image sequence, grayscale conversion is performed. The pixel brightness distribution is adjusted and detail features are enhanced in the converted grayscale image sequence. Boundary information is extracted and optimized. After denoising, an equalized image is obtained, including: Obtain raw image sequences containing multiple consecutive frames of surveillance footage from surveillance cameras; Each frame of the original image sequence is converted to grayscale to obtain a grayscale image sequence; Adaptive histogram equalization is used to adjust the pixel brightness distribution of each frame in the grayscale image sequence to obtain a brightness-equalized image sequence. Local contrast enhancement processing is performed on each frame of the brightness equalization image sequence to enhance detail features, resulting in a detail-enhanced image sequence. By extracting and optimizing the boundary information in the detail-enhanced image sequence through edge detection, a sharpened image sequence is obtained. The sharpened image sequence is subjected to median filtering for noise suppression to obtain the final equalized image.

3. The method for identifying abnormal personnel intrusion in a power plant based on visual intelligence according to claim 1, characterized in that, The optical flow vector field is calculated based on the equalized image. Pixels with amplitudes exceeding the motion intensity threshold are extracted, discontinuous boundaries are connected, and pixel displacements are tracked. After smoothing and filtering, the boundaries of the motion region are determined, including: Based on the equalized image, the displacement vectors of pixels between consecutive frames are calculated using an optical flow algorithm to obtain a dense optical flow vector field. The motion intensity threshold is determined based on the amplitude distribution of the dense optical flow vector field, and the set of pixels with amplitudes exceeding the threshold is extracted to form a preliminary motion region mask. Morphological closing operations are applied to the preliminary motion region mask to remove isolated noise points and connect discontinuous boundaries to obtain the boundary contour of the continuous motion region. The point set of the boundary contour line of the continuous motion region is smoothed by a Gaussian smoothing filter to generate a smooth boundary curve, thereby determining the boundary of the motion region in the monitoring screen.

4. The method for identifying abnormal personnel intrusion in a power plant based on visual intelligence according to claim 1, characterized in that, Foreground pixel clusters are extracted from the boundary of the motion region. If the density of the foreground pixel clusters exceeds a preset density threshold, it is determined to be a potential target region, resulting in a target contour map, including: Extract the set of foreground pixel coordinates from the internal region defined by the boundary of the motion region, and use density clustering algorithm to divide the foreground pixel clusters to obtain the cluster center coordinates and the number of cluster points; If the number of cluster points exceeds the preset density threshold, it is marked as a potential target region, and its pixel set is determined as the central region point set; The boundary of the central region point set is expanded and the boundaries of adjacent clusters are connected to form the outline of the expanded region. The original contour line in the boundary of the motion area and the contour line of the extended area are superimposed, and the overlapping part is removed to generate a refined target contour map. The refined target contour map is subjected to pixel connectivity analysis and internal holes are filled to obtain a complete target contour map.

5. The method for identifying abnormal personnel intrusion in a power plant based on visual intelligence according to claim 4, characterized in that, A binary mask is generated based on the target contour map. Isolated noise points are removed from the binary mask to obtain a first mask. Connectivity component analysis and merging are performed, and after smoothing and repairing broken parts, a complete target mask is determined, including: A binary mask is generated based on the target contour map. A morphological erosion operation is then performed on the binary mask to remove isolated noise points, resulting in a preliminary cleaned first mask. Perform connectivity component analysis on the first mask, identify and merge spatially adjacent pixel groups that meet preset area conditions, and determine the set of connected regions; Apply dilation to the set of connected regions to perform boundary smoothing, and obtain the smoothed region boundaries; The smoothed region boundary is superimposed and compared with the original contour line, and the broken parts are repaired by the boundary tracking algorithm to determine the final complete target mask.

6. The method for identifying abnormal personnel intrusion in a power plant based on visual intelligence according to claim 1, characterized in that, Based on the complete target mask, target sub-images are extracted from the equalized image, gradients are calculated, and gradient orientation histograms are generated. After direction interval weighting and vector normalization, gradient histogram feature vectors for identity verification are obtained, including: The pixel region corresponding to the complete target mask is separated from the equalized image to obtain the target sub-image; Calculate the grayscale gradient magnitude and direction of the target sub-image, and generate a gradient direction histogram. The gradient direction histogram is used to divide the direction intervals, and the cumulative frequency is used to generate a direction-weighted histogram vector; The directional weighted histogram vector is normalized to obtain the gradient histogram feature vector used for identity verification.

7. The method for identifying abnormal personnel intrusion in a power plant based on visual intelligence according to claim 6, characterized in that, Retrieve similar feature vectors from a pre-established authorized personnel feature database. If the similarity score is higher than a preset similarity threshold, the person is identified as an authorized personnel and a verification pass identifier is obtained, including: Extract the stored standardized feature vectors from the pre-established authorized personnel feature database; Calculate the similarity between the gradient histogram feature vector and each standardized feature vector in the authorized personnel feature database to obtain a similarity score matrix; The highest value in the similarity score matrix is ​​selected. If it is higher than the preset similarity threshold, the match is considered successful. Associate the authorized personnel identity information corresponding to the successfully matched feature vector with the moving target to be verified, and generate a verification pass identifier.

8. The power plant abnormal personnel intrusion identification method based on visual intelligence according to claim 7, characterized in that, Based on the verification, potential target areas are filtered by identifiers. If the verification fails, an intrusion alarm mechanism is triggered to obtain the final intrusion detection result, including: If the moving target does not obtain a verification pass mark, the potential target area where it is located will be marked as an unauthorized target area; The unauthorized target area is spatially compared with the predefined intrusion-sensitive area. If it overlaps with any intrusion-sensitive area, it is determined to be a suspicious intrusion area. If the suspected intrusion area has an abnormal movement path and the speed or direction change exceeds a preset safety threshold, the intrusion alarm mechanism is triggered to obtain the final intrusion detection result.

9. A power plant abnormal personnel intrusion identification system based on visual intelligence, characterized in that, include: The image preprocessing and equalization module acquires the original image sequence and performs grayscale conversion. It then adjusts the pixel brightness distribution and enhances detail features in the converted grayscale image sequence, extracts and optimizes boundary information, and obtains an equalized image after denoising. The motion region detection and boundary determination module calculates the optical flow vector field based on the equalized image, extracts pixels whose amplitude exceeds the motion intensity threshold, connects discontinuous boundaries and tracks pixel displacement, and determines the boundary of the motion region after smoothing and filtering. The foreground target extraction and contour generation module extracts foreground pixel clusters from the boundary of the motion region. If the density of the foreground pixel clusters exceeds a preset density threshold, it is determined to be a potential target region, and a target contour map is obtained. The target mask optimization module generates a binary mask based on the target contour map, removes isolated noise points from the binary mask to obtain a first mask, performs connected component analysis and merging, and determines the complete target mask after smoothing and repairing broken parts. The feature extraction module extracts the target sub-image from the equalized image based on the complete target mask, calculates the gradient and generates a gradient direction histogram, and after direction interval weighting and vector normalization, obtains the gradient histogram feature vector for identity verification. The identity verification module retrieves similar feature vectors from a pre-established authorized personnel feature database. If the similarity score is higher than the preset similarity threshold, the user is determined to be an authorized person and a verification pass flag is obtained. The intrusion alarm decision module filters potential target areas based on the verification pass identifier. If the verification fails, the intrusion alarm mechanism is triggered to obtain the final intrusion detection result.