Substation safety operation monitoring method and system based on OpenCV
In the substation safety operation monitoring system through OpenCV technology, adaptive Monte Carlo forest and multi-scale spatio-temporal graph modules are used to process images, which solves the problems of image quality and equipment identification, improves monitoring accuracy and efficiency, and reduces costs.
Patent Information
- Application Number
- CN202410948694.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-07-16
AI Technical Summary
The existing substation safety operation monitoring system has difficulty in ensuring image quality and analysis accuracy in complex environments. It also lacks adaptive capabilities and cannot effectively identify the status of different types of equipment. It has high costs and insufficient generalization capabilities.
An OpenCV-based method is used to collect video images through pre-configured video cameras, perform semantic segmentation and feature extraction, and call adaptive Monte Carlo forest and multi-scale spatiotemporal graph modules to optimize image data and identify abnormal behaviors and states.
It improves the accuracy and efficiency of security monitoring, reduces system resource consumption, enhances the generalization ability of model configuration, reduces usage costs, adapts to different scenarios and equipment types, and improves recognition effects.
Smart Images

Figure CN118485973B
Abstract
Description
Technical Field
[0001] The present invention relates to safety monitoring technology, and in particular to a substation safety operation monitoring method and system based on OpenCV. Background Art
[0002] Substations are key nodes in the power system, and their safe operation is directly related to the stability and reliability of the power grid. With the rapid development of smart grids, the automation level of substations is constantly improving, but manual operation and automated monitoring are still indispensable links. In a complex power environment, operators face a variety of safety risks such as high-voltage electric shock and equipment misoperation. It is of great practical significance to establish an efficient and reliable substation safety operation monitoring system. This can not only monitor the operation process in real time and detect potential dangers in time, but also provide data support for safety management, and improve operation efficiency and safety level.
[0003] At present, research on substation safety operation monitoring has made some progress. Traditional methods mainly rely on fixed cameras and manual monitoring, which have problems such as limited coverage and poor real-time performance. With the development of computer vision technology, intelligent monitoring systems based on image analysis have gradually become a research hotspot. Some researchers have proposed a human behavior recognition method based on deep learning, which can automatically detect illegal operations. Other studies have used infrared thermal imaging technology to monitor equipment temperature anomalies and improve fault warning capabilities. Most of these studies are still in the laboratory stage, and their application in actual substation environments still faces many challenges.
[0004] Although existing research has achieved certain results, there are still some key technical problems that need to be solved in the field of substation safety operation monitoring. For example, the substation environment is complex, and the working environment and lighting conditions vary greatly in different substations. How to ensure image quality and analysis accuracy under different weather and time conditions is a challenge. For example, the existing abnormal behavior recognition algorithms are mostly based on predefined rules, which are difficult to cope with complex and changeable operating scenarios and lack adaptive capabilities. In addition, there are many types of substation equipment. How to achieve accurate identification and status monitoring of different types of equipment is also a technical difficulty. The generalization ability of the existing model does not meet the requirements, and training and configuration are required every time, which is very costly.
[0005] Therefore, research and innovation are needed. Summary of the invention
[0006] The purpose of the invention is to provide a substation safety operation monitoring method and system based on OpenCV, in order to solve one of the above-mentioned problems existing in the prior art.
[0007] Technical solution, according to one aspect of the present application, a substation safety operation monitoring method based on OpenCV is implemented by at least two OpenCV modules, and the method includes the following steps:
[0008] Step S1: collect video images of the substation operation area through a pre-configured video camera, extract video frames and perform semantic segmentation on the images to obtain a segmented image set;
[0009] Step S2: extracting image features for each segmented image in the segmented image set, wherein the image features include content features, quality features, and association features;
[0010] Step S3: Based on the image features, the pre-configured adaptive Monte Carlo forest module is called to select the corresponding OpenCV processing module for each segmented image, and after processing, an optimized image data set is obtained;
[0011] Step S4: Based on the optimized image data set, call the preconfigured adaptive multi-scale spatiotemporal graph module for processing to obtain spatiotemporal data, including spatiotemporal behavior patterns, interaction information, and trend analysis data; based on the spatiotemporal data, identify abnormal behaviors and abnormal states and output them.
[0012] According to another aspect of the present application, a substation safety operation monitoring system based on OpenCV is also provided, which is characterized by comprising:
[0013] at least one processor; and,
[0014] a memory communicatively connected to at least one of the processors; wherein,
[0015] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the substation safety operation monitoring method based on OpenCV described in any of the above technical solutions.
[0016] Beneficial effects: This solution improves the accuracy and efficiency of security monitoring, reduces system resource consumption, enhances the generalization ability of model configuration, and reduces system use costs. It solves the problem that traditional security monitoring systems need to be retrained and reconfigured in each type of scenario, or even in each customer environment. Through multiple OpenCV modules, it is applicable to different scenarios and processes pictures with different characteristics. It can be flexibly customized and can be increased according to the situation. At the same time, through the idea of random forest, combined calls are made, and the pictures are sent to one or more OpenCV modules with the best processing effect for processing, which improves the recognition effect and provides a basis for subsequent analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of the present invention.
[0018] Figure 2 It is a flow chart of step S1 of the present invention.
[0019] Figure 3 It is a flow chart of step S2 of the present invention.
[0020] Figure 4 It is a flow chart of step S3 of the present invention.
[0021] Figure 5 It is a flow chart of step S4 of the present invention. DETAILED DESCRIPTION
[0022] like Figure 1 As shown, according to one aspect of the present application, a substation safety operation monitoring method based on OpenCV is implemented by at least two OpenCV modules, and the method includes the following steps:
[0023] Step S1: collect video images of the substation operation area through a pre-configured video camera, extract video frames and perform semantic segmentation on the images to obtain a segmented image set;
[0024] Step S2: extracting image features for each segmented image in the segmented image set, wherein the image features include content features, quality features, and association features;
[0025] Step S3: Based on the image features, the pre-configured adaptive Monte Carlo forest module is called to select the corresponding OpenCV processing module for each segmented image, and after processing, an optimized image data set is obtained;
[0026] Step S4: Based on the optimized image data set, call the preconfigured adaptive multi-scale spatiotemporal graph module for processing to obtain spatiotemporal data, including spatiotemporal behavior patterns, interaction information, and trend analysis data; based on the spatiotemporal data, identify abnormal behaviors and abnormal states and output them.
[0027] In this embodiment, a video image of the substation operation area is collected by a preconfigured video camera, and semantic segmentation is performed to obtain a set of segmented images. The image acquisition and segmentation technology of OpenCV is used to solve the problem of image acquisition quality in the complex environment of the substation. Semantic segmentation technology can effectively distinguish between operators, equipment and background, laying the foundation for subsequent analysis. The extracted image features include content features, quality features and association features. This multi-dimensional feature extraction method makes full use of the image processing capabilities of OpenCV and can fully capture various attributes of the image. Content features reflect the visual information of the image, quality features evaluate the clarity and availability of the image, and association features reflect the spatiotemporal relationship between images. This comprehensive feature extraction method significantly improves the accuracy and robustness of subsequent analysis. Through the adaptive Monte Carlo forest module, the system can dynamically select the most suitable OpenCV processing module for each segmented image. This adaptive processing strategy improves the flexibility and efficiency of the system, can automatically adjust the processing method according to different scenes and image features, and solves the problem that traditional fixed processing procedures are difficult to cope with changing environments. Use an adaptive multi-scale spatiotemporal graph module for processing to obtain spatiotemporal data including spatiotemporal behavior patterns, interaction information and trend analysis data. This multi-scale analysis method can simultaneously capture short-term, medium-term and long-term behavior patterns and trends, improving the system's predictive ability and the accuracy of anomaly detection. Based on the acquired spatiotemporal data, the system can timely identify abnormal behaviors and abnormal states and output warnings. This directly improves the safety management level of substations and can detect and prevent dangers in time before they occur.
[0028] In some embodiments, the OpenCV module includes:
[0029] Design an edge enhancement module that uses an improved Canny algorithm to process images with prominent edges. A low-light enhancement module that combines adaptive histogram equalization and a deep learning denoising network. A motion blur correction module that uses a blind deconvolution algorithm to process motion blurred images. A color correction module that uses a color constancy algorithm to process color-shifted images. Noise suppression module: used to process various types of image noise, such as Gaussian noise, salt and pepper noise, etc. Contrast enhancement module: suitable for scenes with uneven lighting or low contrast. Image defogging module: used to process images in foggy or smoky environments. Halo removal module: handles halo effects caused by strong light sources (such as nighttime lighting). Shadow removal module: reduces or removes shadows cast by equipment and structures. Perspective correction module: corrects image distortion caused by camera angles. Super-resolution module: improves the quality of low-resolution images. Image stabilization module: reduces blur caused by camera shake. Thermal imaging enhancement module: optimizes images captured by thermal imaging cameras. Night vision enhancement module: enhances image quality in low-light conditions. Smoke removal module: handles image interference caused by smoke. Specular reflection suppression module: reduces strong reflections caused by metal surfaces, etc. Dynamic range compression module: handles high dynamic range scenes, such as images that contain both bright and dark areas. Image fusion module: merges different types of sensor data, such as the fusion of visible light and infrared images. Local adaptive binarization module: used for text or instrument reading extraction under complex backgrounds. Geometry correction module: corrects image deformation caused by wide-angle lenses. Color enhancement module: improves color distortion caused by weather or lighting conditions. Edge preservation smoothing module: reduces noise while retaining important edge information. Motion detection module: identifies moving objects in images for security monitoring.
[0030] like Figure 2 As shown, according to one aspect of the present application, step S1 is specifically:
[0031] Step S11: Obtain image data in the visible light, infrared and ultraviolet bands through a pre-configured multispectral camera and add a timestamp to each frame of the image to obtain a time-synchronized video frame data set;
[0032] Step S12, obtaining a video frame data set after time synchronization, sequentially using a non-local means method to perform denoising on each video frame, using an adaptive gamma method to correct and optimize the image contrast of the video frame, and obtaining a preliminarily processed video frame set;
[0033] Step S13, reading the preliminarily processed video frame set, calling the adaptive optical flow method to calculate the motion between adjacent video frames, and removing duplicate and redundant video frames according to the calculation results to obtain a screened video frame set;
[0034] Step S14, read the filtered video frame set, segment each video frame using a graph cutting method and optimize the segmentation boundary, obtain a segmented video frame data set and perform segmentation quality assessment, and output a segmented image set.
[0035] In this embodiment, through the pre-configured multispectral camera, the system can simultaneously acquire image data in the visible, infrared, and ultraviolet bands. This multispectral acquisition method expands the system's perception capabilities and can capture information that cannot be obtained by a single band. For example, the infrared band can detect abnormal device temperature, the ultraviolet band can identify corona discharge, and visible light provides high-resolution scene details. By adding a timestamp to each frame of the image, precise time synchronization of multi-band data is achieved, laying the foundation for subsequent multimodal data fusion.
[0036] The non-local mean method is used for denoising, which effectively reduces image noise while retaining important details. It is suitable for processing complex textures and edge information in substation environments. The adaptive gamma method is then used to correct and optimize image contrast, which can automatically adjust image brightness and contrast under different lighting conditions to ensure that the image has good visibility in various environments. These two steps of preprocessing significantly improve the accuracy and reliability of subsequent analysis.
[0037] By calculating the motion between adjacent video frames using the adaptive optical flow method, the system can identify and remove duplicate and redundant video frames. This step not only reduces the burden of data storage and processing, but also retains key change information in the scene. The adaptive optical flow method can adapt to different motion patterns and accurately capture both fast movement and slow changes.
[0038] By using the graph cutting method for segmentation and optimizing the segmentation boundaries, the system can accurately segment the image into different semantic regions (such as personnel, equipment, background, etc.). The advantage of the graph cutting method is that it can consider both global and local information and produce coherent segmentation results. By optimizing the segmentation boundaries, the accuracy of segmentation is further improved, especially the edges of targets in complex backgrounds. The quality of the segmentation results is evaluated to ensure the reliability of subsequent analysis. This step can identify poorly segmented areas and provide quality feedback for subsequent processing, thereby achieving quality control throughout the entire processing flow. It provides high-quality, low-redundancy, and information-rich image data for subsequent advanced analysis. In particular, the acquisition and fusion of multispectral data enhances the system's perception of the substation environment and can detect abnormalities that are difficult to detect with a single band.
[0039] like Figure 3 As shown, according to one aspect of the present application, the step S2 is further:
[0040] Step S21, reading a set of segmented images, and extracting content features for each segmented image, including: multi-scale local binary pattern features, directional gradient histogram and local structure tensor fusion features, color moment and color contrast distribution features, and Gabor filter group features;
[0041] Step S22, reading the segmented image set, and extracting quality features for each segmented image, including: a reference-free image quality assessment index based on natural scene statistics, a local quality map of multi-scale structural similarity, and a frequency domain quality feature based on phase consistency;
[0042] Step S23, reading the segmented image set, and extracting related features for each segmented image, including: regional relationship features, spatiotemporal cube features, and optical flow and trajectory feature fusion features;
[0043] Step S24, calling and configuring the feature fusion and dimension reduction module to fuse and reduce the dimension of the content features, quality features and association features, and outputting the final image feature vector set, namely, the fusion image features.
[0044] In this embodiment, by extracting multi-scale local binary pattern features, directional gradient histogram and local structure tensor fusion features, color moment and color contrast distribution features, and Gabor filter group features. This multi-dimensional feature extraction method can fully capture the texture, shape, color and direction information of the image. The multi-scale local binary pattern features can effectively describe the local texture pattern and are robust to changes in illumination. The directional gradient histogram and local structure tensor fusion features combine edge direction and local structure information to accurately describe the shape and posture of the object. The color moment and color contrast distribution features capture the color distribution and contrast information of the image, which helps to distinguish different types of objects and scenes. The Gabor filter group features provide multi-scale and multi-directional texture analysis, which is suitable for detecting periodic structures and subtle texture changes. By extracting a non-reference image quality assessment index based on natural scene statistics, a local quality map of multi-scale structural similarity, and a frequency domain quality feature based on phase consistency. These quality features not only evaluate the overall quality of the image, but also provide distribution information of local quality: the non-reference image quality assessment index can evaluate image quality without a reference image, which is suitable for real-time monitoring scenarios. The local quality map based on multi-scale structural similarity provides detailed quality distribution information, which helps to identify the poor quality areas in the image. The frequency domain quality features based on phase consistency can capture the subtle distortion of the image, especially in the edge and texture-rich areas.
[0045] By extracting regional relationship features, spatiotemporal cube features, and optical flow and trajectory feature fusion features. These associated features can capture the spatiotemporal relationship and motion information in the image sequence: regional relationship features describe the spatial relationship between different regions in the image, which helps to understand the scene structure. The spatiotemporal cube feature introduces the time dimension into feature extraction, which can capture the pattern of object movement and scene change. The optical flow and trajectory feature fusion feature combines instantaneous motion information and long-term motion trajectory to provide comprehensive motion analysis. Through the feature fusion and dimensionality reduction module, the system can effectively combine multiple features and reduce the dimension of the feature space. This not only improves the efficiency of subsequent processing, but also enhances the discriminative ability of features.
[0046] This embodiment can simultaneously consider image content, quality, and spatiotemporal relationships, improving the accuracy and robustness of subsequent analysis. Especially in complex substation environments, this multi-dimensional feature extraction method can effectively distinguish normal operations from abnormal behaviors and identify equipment status changes, thereby providing reliable technical support for timely discovery of potential safety hazards. At the same time, the steps of feature fusion and dimensionality reduction ensure that the system can process a large amount of video data in real time with limited computing resources to meet the needs of real-time monitoring.
[0047] like Figure 4 As shown, according to one aspect of the present application, step S3 is further:
[0048] Step S31, read image features, initialize the preconfigured adaptive Monte Carlo forest module, build and train the self-organizing map network; perform self-organizing mapping and clustering on the image features, and output the clustering results;
[0049] Step S32: Based on the image features and the adaptive Monte Carlo forest module, perform adaptive Monte Carlo tree search and parameter optimization to obtain optimized parameters, that is, obtain the OpenCV processing module combination strategy;
[0050] Step S33, constructing an image evaluation function and evaluating the image processing quality, calculating the quality gain, and outputting the optimization parameters if the quality gain exceeds a threshold;
[0051] Step S34: Process the image based on the optimized adaptive Monte Carlo forest module to obtain a multi-scale optimized image dataset, that is, a multi-scale spatiotemporal atlas.
[0052] In this embodiment, the system constructs and trains a self-organizing map network by initializing a preconfigured adaptive Monte Carlo forest module. It can automatically discover the intrinsic structure and pattern of image features: the use of the self-organizing map network realizes nonlinear dimensionality reduction and visualization of high-dimensional image features. The clustering results provide a basis for the subsequent selection of processing strategies, enabling the system to adopt different processing methods according to different types of image features. This unsupervised learning method enables the system to adapt to new and unseen image feature patterns, improving the versatility and adaptability of the system.
[0053] By performing adaptive Monte Carlo tree search and parameter optimization, the system can dynamically adjust the parameters of the OpenCV processing module: the Monte Carlo tree search method can efficiently explore the optimal parameter combination in a large-scale parameter space. The adaptive optimization process takes into account the characteristics of the current image, making the parameter selection more targeted and effective. It solves the limitations of traditional fixed parameter methods in the face of complex and changing substation environments, and significantly improves the flexibility and performance of the system.
[0054] The system builds an image evaluation function and evaluates the image processing quality in real time, calculating the quality gain: This dynamic evaluation mechanism can detect poor processing results in time and trigger parameter re-optimization. The calculation of quality gain provides the system with a clear optimization goal and ensures continuous improvement of processing results. This step forms a closed-loop feedback system that continuously optimizes the processing strategy to adapt to changing environmental conditions.
[0055] Based on the optimized adaptive Monte Carlo forest module to process images, the system can generate multi-scale optimized image datasets: multi-scale processing can capture the global structure and local details of the image at the same time, improving the comprehensiveness of subsequent analysis. The optimized image dataset significantly improves the image quality and provides high-quality input for subsequent advanced analysis (such as behavior recognition and anomaly detection). It is suitable for processing targets of different scales (such as large equipment and small tools) in the substation environment.
[0056] Improves the adaptability and performance of the substation safety monitoring system. Especially when facing complex and changing scenes in the substation (such as changes in lighting, weather conditions, equipment status, etc.), the system can automatically adjust the processing strategy and always maintain high-quality image analysis results. This not only improves the accuracy of anomaly detection, but also reduces the probability of false positives and missed positives. At the same time, the generation of multi-scale optimized images provides a comprehensive and detailed information basis for subsequent behavior analysis and equipment status monitoring, and can simultaneously focus on large-scale scene changes and tiny abnormal details.
[0057] like Figure 5 As shown, according to another aspect of the present application, step S4 is further provided as follows:
[0058] Step S41, read the optimized image data set, extract the time series features, and construct an adaptive multi-scale space-time graph module; apply the improved Delaunay triangulation algorithm to construct a basic spatial relationship graph, construct an adaptive time window to establish time edges, and generate short-term, medium-term and long-term multi-scale graph structures; perform graph compression and important node retention, and output a multi-scale space-time atlas;
[0059] Step S42, read the fusion graph features, perform spatiotemporal pattern recognition and anomaly detection; apply the multidimensional time series decomposition algorithm and the adaptive time series segmentation method to extract the spatiotemporal pattern; construct a behavior dictionary and use the elastic spatiotemporal pattern matching algorithm for behavior recognition; build a multi-scale anomaly detector, including local, global and temporal anomaly detection; output the behavior recognition results, anomaly detection results and anomaly explanations through the integrated anomaly scoring system;
[0060] Step S43: Based on the multi-scale spatiotemporal atlas and behavior recognition results, perform multi-agent interaction analysis; construct an interaction graph and a multi-granularity interaction intensity calculation method; apply a community detection algorithm and an incremental community evolution tracking algorithm to perform group dynamics analysis; construct a multidimensional centrality index to identify key nodes; construct an interaction effect propagation model and apply a causal inference method to quantify the interaction effect, and output the interaction pattern, group dynamics, key node list, and interaction effect matrix;
[0061] Step S44, read time series features, fusion graph features and group dynamics data, perform trend analysis and prediction; apply improved wavelet transform for multi-scale trend decomposition; construct spatiotemporal sequence pattern mining algorithm and association rule analysis; construct an integrated framework for multivariate time series prediction; construct a multi-scenario simulation algorithm based on the Monte Carlo method for risk assessment, and output trend reports, prediction results and risk assessment reports.
[0062] In this embodiment, the system constructs short-term, medium-term and long-term multi-scale graph structures through the improved Delaunay triangulation algorithm and adaptive time window: the improved Delaunay triangulation algorithm can efficiently construct the basic spatial relationship graph, accurately reflecting the spatial distribution and relationship of objects in the scene. The introduction of the adaptive time window enables the system to capture behavioral patterns of different time scales at the same time, effectively representing everything from instantaneous actions to long-term trends. Graph compression and important node retention technology ensure that the system significantly reduces computational complexity while maintaining key information.
[0063] Extract spatiotemporal patterns through multidimensional time series decomposition and adaptive time series segmentation methods, and build multiscale anomaly detectors: Multidimensional time series decomposition can separate trends, cycles, and random components, which helps to more accurately identify abnormal patterns. Adaptive time series segmentation methods can automatically identify key turning points in behavior, improving the accuracy of behavior recognition. Multiscale anomaly detectors (including local, global, and temporal anomaly detection) can comprehensively capture anomalies of different types and scales, significantly reducing false positives and false negatives.
[0064] Construct a multi-granularity interaction strength calculation method and apply community detection algorithm and incremental community evolution tracking algorithm: The multi-granularity interaction strength calculation method can quantify the degree of interaction between different entities (such as personnel and equipment), which helps to understand complex operation scenarios. Community detection and evolution tracking algorithms can identify and track the group dynamics of operators, which helps to discover potential collaboration problems or abnormal group behaviors. The introduction of multidimensional centrality indicators helps identify key nodes (such as key equipment or core operators), providing an important reference for safety management.
[0065] Improved wavelet transform can also be used for multi-scale trend decomposition, and an integrated framework for multivariate time series prediction is constructed: multi-scale trend decomposition can separate trend components of different time scales, which helps to understand long-term, medium-term and short-term change patterns. Spatiotemporal sequence pattern mining algorithms and association rule analysis can discover complex spatiotemporal association patterns and provide a basis for prediction. The integrated framework for multivariate time series prediction improves the accuracy and robustness of predictions and can simultaneously consider the influence of multiple related factors. Multi-scenario simulation based on the Monte Carlo method provides a probabilistic perspective for risk assessment and helps to formulate a more comprehensive safety strategy. The intelligence level of the substation safety monitoring system is improved. The system can not only detect abnormal behaviors and states in real time, but also deeply analyze the interaction patterns between multiple subjects and predict potential risks. This multi-scale and multi-angle analysis method is suitable for complex operating environments such as substations, and can simultaneously focus on immediate safety hazards and long-term safety trends.
[0066] According to one aspect of the present application, in step S12, the process of sequentially using the non-local means method to perform denoising on each video frame, using the adaptive gamma method to correct and optimize the image contrast of the video frame, and obtaining a set of preliminarily processed video frames is further as follows:
[0067] Step S121, calculate the local covariance matrix of each pixel neighborhood, use principal component analysis to search for similar blocks and extract the main noise direction; consider the main direction of the noise when searching for similar blocks, and dynamically adjust the shape of the search window;
[0068] Step S122, introducing an adaptive weight factor when calculating the weighted average, and dynamically adjusting it according to the block similarity and noise intensity; outputting the denoised video frame data set;
[0069] Step S123, read the denoised video frame data set, calculate the histogram of each frame image and estimate the overall brightness; construct an adaptive gamma function γ(L) = a * exp(-b * L) + c, where a, b, c are preset parameters, L is the overall brightness, and exp( ) represents an exponential function; apply gamma correction to each pixel; output the contrast-optimized video frame data set, which is the preliminarily processed video frame set.
[0070] In this embodiment, the system achieves high-quality noise suppression by performing denoising through an improved non-local mean method: Specifically, by calculating the local covariance matrix of each pixel neighborhood and searching for similar blocks using principal component analysis, the noise pattern in the image can be more accurately identified. The shape of the search window is dynamically adjusted considering the main direction of the noise, which improves the accuracy and efficiency of the similar block search. An adaptive weight factor is introduced and dynamically adjusted according to the block similarity and noise intensity, making the denoising process more flexible and effective. It is suitable for processing images in the complex environment of substations, and can effectively remove noise while retaining important detail information, such as equipment edges and small components.
[0071] By calculating the histogram of each frame and estimating the overall brightness, the system can automatically adapt to different lighting conditions. The adaptive gamma function γ(L) = a * exp(-b * L) + c is constructed, where the parameters a, b, c can be preset, L is the overall brightness, and exp( ) represents the exponential function, so that the contrast correction can be automatically adjusted according to the overall brightness of the image. Applying gamma correction to each pixel ensures the improvement of the overall visual quality of the image.
[0072] It can effectively handle various types of image noise, such as noise caused by electromagnetic interference, low light conditions or the camera itself. It can remove noise while retaining important details, such as fine cracks or abnormal indications on the surface of the device. It can automatically adapt to different lighting conditions, whether it is outdoor areas with direct sunlight or indoor areas with insufficient light, to provide clear and recognizable images. It can improve the accuracy and reliability of subsequent image analysis and processing steps (such as object detection, behavior recognition, etc.).
[0073] According to one aspect of the present application, step S13 is specifically:
[0074] Step S131, applying the Farnabeck optical flow algorithm to the contrast-optimized video frame dataset to calculate the dense optical flow field F between consecutive frames;
[0075] Step S132, calculate the gradient amplitude map of the optical flow field and use the adaptive threshold T = mean(G) + k * std(G) to binarize the gradient amplitude map, G is the gradient amplitude of the optical flow field, mean() represents the average value, k represents the coefficient of controlling the threshold sensitivity, and std() represents the standard deviation;
[0076] Step S133, calculating the ratio of non-zero pixels in the binarized image, and if the ratio is less than a preset threshold, discarding the current frame; outputting a video frame data set after removing redundant frames, that is, a filtered video frame set.
[0077] In this embodiment, the dense optical flow field between consecutive frames is calculated by applying the Farneback optical flow algorithm: the Farneback algorithm can provide accurate motion estimation at the pixel level, which is suitable for subtle motion detection in complex scenes. The calculation of the dense optical flow field enables the system to capture comprehensive motion information in the entire scene, not just limited to specific targets. It is suitable for substation environments and can detect both personnel movement and equipment status changes.
[0078] The construction of adaptive threshold T = mean(G) + k * std(G), where G is the gradient amplitude of the optical flow field, mean( ) represents the average value, k represents the coefficient controlling the threshold sensitivity, and std( ) represents the standard deviation, enables the system to automatically adapt to the motion characteristics of different scenes. It can work effectively under different lighting conditions and scene complexities, improving the robustness of the system.
[0079] By calculating the proportion of non-zero pixels in the binary image, the system can intelligently identify and remove redundant frames: it can effectively reduce the data storage and processing burden while retaining key scene change information. By setting appropriate thresholds, the system can balance information retention and storage efficiency to adapt to different monitoring needs.
[0080] This embodiment significantly reduces storage requirements, making long-term, high-quality video monitoring possible. It reduces the computational burden of subsequent processing steps and improves the real-time performance of the entire system. It retains key change information in the scene to ensure that important safety-related events are not missed. It improves the efficiency of abnormal event detection because the system only needs to process frames containing significant changes. It is suitable for the long-term continuous monitoring needs of substations. It can effectively capture important operating behaviors and equipment status changes while significantly reducing resource consumption for storing and processing unnecessary static scenes. It not only improves the cost-effectiveness of the system, but also makes fast playback and event retrieval more efficient. By intelligently retaining key information, this method provides high-quality, low-redundancy data input for subsequent advanced analysis (such as behavior pattern recognition, anomaly detection, etc.), thereby improving the performance and reliability of the entire safety monitoring system.
[0081] According to one aspect of the present application, step S14 is specifically:
[0082] Step S141: read the filtered video frame set, construct and perform preliminary segmentation based on the superpixel adaptive region growing algorithm, specifically:
[0083] Use a simple linear iterative clustering algorithm to initialize the superpixel set and calculate the average color and texture features of each superpixel; construct a superpixel adjacency graph, with the edge weight being the similarity of adjacent superpixel features; construct an adaptive growing threshold T(si) = μ(si) + α * σ(si), where μ and σ are the local mean and standard deviation, and α represents the coefficient that controls the sensitivity of the growing threshold; perform region growing based on the superpixel adjacency graph and the adaptive growing threshold, and merge similar regions; output the preliminary segmentation result;
[0084] Step S142: read the preliminary segmentation result and apply the improved graph cutting method to optimize the segmentation boundary, specifically:
[0085] Construct a cutting graph, where nodes are regions in the preliminary segmentation results and edges are adjacent regions; construct similarity metrics between regions, boundary penalty terms, and energy functions for graph cutting; use the α-expansion algorithm to iteratively optimize the energy function; and obtain the optimized segmentation results;
[0086] Step S143: read the optimized segmentation result and use morphological post-processing to repair small areas and holes, specifically:
[0087] Apply area opening operation to remove areas smaller than the threshold; use reconstruction opening operation to fill internal holes; apply conditional dilation algorithm to smooth the region boundary; output the repaired segmentation result;
[0088] Step S144: read the repaired segmentation result and construct a segmentation quality evaluation index based on fractal dimension, specifically:
[0089] Use the box counting method to calculate the fractal dimension of each segmented region; calculate the global segmentation quality index Q = Σ(wi* Di), where wi is the area weight of the region and Di is the fractal dimension of the region; if the global segmentation quality index Q is lower than the threshold T_Q, mark it as a region to be optimized; obtain the quality evaluation results and the mark of the region to be optimized;
[0090] Step S145, read the mark of the area to be optimized and the repaired segmentation result, and apply the active contour model to the area to be optimized, specifically:
[0091] Initialize the contour as the current segmentation boundary; construct an external force field based on gradient vector flow; introduce curvature constraints to prevent excessive deformation of the contour; iteratively update the contour until convergence or the maximum number of iterations is reached; output the optimized region contour;
[0092] Step S146: read the repaired segmentation result and the optimized region outline, and integrate all the processing results, specifically:
[0093] The optimized region contours are used to replace the corresponding regions in the repaired segmentation results; and a final set of segmented images is generated.
[0094] In this embodiment, the use of the simple linear iterative clustering (SLIC) algorithm can generate compact and uniform superpixels, providing a good basic unit for subsequent segmentation. Calculating the average color and texture features of each superpixel helps to accurately distinguish different scene elements. The construction of the adaptive growth threshold T(si) = μ(si) + α * σ(si) enables the segmentation process to adapt to changes in local image features. It is suitable for processing complex environments of substations and can effectively segment different elements such as equipment, personnel and background. Constructing a cutting graph, taking the regions in the preliminary segmentation results as nodes and the relationships between adjacent regions as edges, the relationship between regions can be fully considered. The introduction of inter-regional similarity metrics and boundary penalty terms enables the optimization process to balance the internal consistency of the region and the smoothness of the boundary. Using the α-expansion algorithm to iteratively optimize the energy function can efficiently perform global optimization on large-scale images.
[0095] The area opening operation removes the area smaller than the threshold, effectively eliminating noise and small mis-segmented areas. The reconstruction opening operation fills the internal holes to improve the continuity and integrity of the segmentation results. The conditional expansion algorithm smoothes the region boundaries, making the segmentation results more natural and accurate.
[0096] The box counting method is used to calculate the fractal dimension of each segmented region, which can effectively measure the complexity and texture characteristics of the region. The global segmentation quality index Q = Σ(wi * Di) is constructed, where wi is the area weight of the region and Di is the regional fractal dimension, taking into account the importance of different regions. By setting the quality threshold T_Q, the system can automatically identify the areas that need further optimization.
[0097] The external force field based on the gradient vector flow is constructed to make the contour fit the target edge better. The curvature constraint is introduced to prevent the contour from being over-deformed, maintaining the smoothness and rationality of the segmentation result. The iterative update process ensures the convergence and stability of the optimization result.
[0098] This embodiment can accurately segment various elements in the substation environment, such as equipment, personnel, operating tools, etc., providing a solid foundation for subsequent target identification and tracking. The optimized segmentation boundary enables the system to accurately locate the edge of the equipment, which helps to detect equipment status changes and potential failures. The automated quality assessment and optimization process ensures the consistency and reliability of the segmentation results and reduces the need for manual intervention.
[0099] Accurately identifying and tracking operators helps with behavior analysis and safety management. Accurately segmenting equipment areas provides reliable image data for equipment status monitoring and anomaly detection. High-quality scene segmentation improves the accuracy of subsequent analysis (such as abnormal behavior detection, equipment status assessment, etc.).
[0100] According to one aspect of the present application, in step S21, the process of extracting content features is specifically as follows:
[0101] Step S211, read the segmented image set, perform Gaussian pyramid decomposition on the segmented images in sequence to obtain a multi-scale image set; calculate the local variance of pixels at each scale, construct an adaptive threshold function and calculate the local binary pattern feature of each scale; use the information gain criterion to select the most discriminative scale combination; output the multi-scale local binary pattern feature vector;
[0102] Step S212, read the segmented image set, calculate the gradient amplitude and direction of the image; construct a local structure tensor and calculate its eigenvalue and eigenvector; construct a local anisotropy metric and introduce anisotropy weights in the calculation of the directional gradient histogram; calculate the weighted directional gradient histogram features to obtain fusion features;
[0103] Step S213, read the segmented image set, convert the image into LAB color space; calculate the global color contrast map and use the Otsu algorithm to adaptively segment to obtain the salient area; calculate the adaptive color moment of the salient area; construct a color contrast distribution histogram;
[0104] Step S214, read the segmented image set, construct a direction adaptive function and an adaptive Gabor filter; use a particle swarm optimization algorithm to automatically select filter parameters; apply the optimized Gabor filter group to the image to obtain a response atlas; calculate the statistical characteristics of each response map.
[0105] In this embodiment, a multi-scale image set is obtained by Gaussian pyramid decomposition, which can capture texture information of different scales. The construction of an adaptive threshold function makes the local binary pattern feature extraction more robust and adapts to the texture characteristics of different regions. The most discriminative scale combination is selected using the information gain criterion, which improves the effectiveness and computational efficiency of the feature. It is suitable for the analysis of complex textures in the substation environment, such as the detection of subtle changes on the surface of the equipment. The gradient amplitude and direction of the image are calculated, and the local structural information is fully captured by combining the eigenvalues and eigenvectors of the local structure tensor. The local anisotropy metric is constructed and the anisotropy weight is introduced in the calculation of the directional gradient histogram, which improves the sensitivity of the feature to directional and structural changes. It is suitable for analyzing the shape and posture of substation equipment, which helps to detect abnormal states or position changes of the equipment. The global color contrast map is calculated in the LAB color space, and the Otsu algorithm (OTSU) is used to adaptively segment to obtain significant areas. The adaptive color moment and color contrast distribution histogram of the significant area are calculated to fully capture the color characteristics of the image. It can effectively identify color anomalies in the substation environment, such as discoloration of insulating materials or spark discharge.
[0106] Construct directional adaptive functions and adaptive Gabor filters to adapt the filters to the local directional characteristics of the image. Use the particle swarm optimization algorithm to automatically select the filter parameters, which improves the adaptability and efficiency of feature extraction. Apply the optimized Gabor filter bank to the image to obtain a multi-directional and multi-scale response atlas. It is suitable for analyzing the texture and directional characteristics of substation equipment, such as crack detection on the surface of insulators or wire anomaly detection.
[0107] Multi-scale local binary pattern features enable the system to detect subtle changes on the surface of equipment, such as aging of the insulation layer or corrosion of the metal surface. The fusion features of the oriented gradient histogram and the local structure tensor improve the system's sensitivity to changes in the equipment's posture, which helps to detect equipment tilt or displacement in a timely manner. The color moment and color contrast distribution features enable the system to quickly identify abnormal color changes, such as oil leakage in oil-immersed transformers or aging and discoloration of insulating materials. The Gabor filter bank feature enhances the system's ability to analyze complex textures and can be used to detect surface damage to high-voltage lines or flashover of insulators.
[0108] In short, the system's anomaly detection capability in complex environments is improved. It can not only capture obvious anomalies, but also identify potential safety hazards, providing a reliable basis for preventive maintenance and timely intervention. At the same time, the adaptability and optimization of the feature extraction process ensure that the system can maintain efficient and stable performance under different environmental conditions (such as different lighting and weather conditions).
[0109] According to one aspect of the present application, the process of extracting quality features in step S22 is specifically as follows:
[0110] Step S221: read the segmented image set and construct a no-reference image quality assessment index based on natural scene statistics, specifically:
[0111] Perform local mean reduction and variance normalization on the image; calculate the generalized Gaussian distribution parameters of the normalized image; extract the pairwise product statistical features of the normalized image; calculate the local second-order statistical features, i.e., the generalized Gaussian distribution parameters of the variance field; construct and output the feature vector;
[0112] Step S222: read the segmented image set and construct a local quality map based on multi-scale structural similarity, specifically:
[0113] Decompose the image at multiple scales to obtain an image decomposition set; calculate the local structure similarity map for each scale; construct a scale weight function and calculate the weighted multi-scale local structure similarity map; apply an adaptive threshold to segment the multi-scale local structure similarity map to obtain a local quality map; extract the statistical features of the local quality map, including area ratio, mean value and standard deviation;
[0114] Step S223: read the segmented image set and construct a frequency domain quality feature based on phase consistency, specifically:
[0115] Perform discrete cosine transform on the image; calculate the amplitude and phase of discrete cosine transform coefficients; construct a phase consistency measure and a phase consistency map; calculate the directional entropy and scale entropy of the constructed phase consistency map; extract the statistical moment of the constructed phase consistency map.
[0116] In this embodiment, the image is processed by local mean subtraction and variance normalization, which can effectively remove the influence of global brightness and contrast changes. The generalized Gaussian distribution parameters of the normalized image are calculated to capture the statistical characteristics of the image. The paired product statistical features of the normalized image are extracted to reflect the local structural information of the image. The local second-order statistical features, namely the generalized Gaussian distribution parameters of the variance field, are calculated to further describe the texture characteristics of the image. The quality of the substation monitoring image can be accurately evaluated without a reference image, which is suitable for real-time monitoring scenarios.
[0117] Multi-scale decomposition of the image can simultaneously analyze the image structure at different scales. The local structure similarity map of each scale is calculated to fully capture the structural information of the image. The scale weight function is constructed and the weighted multi-scale local structure similarity map is calculated, which comprehensively considers the importance of different scales. The multi-scale local structure similarity (MS-SSIM) map is segmented by adaptive thresholding to obtain the local quality map, which intuitively shows the spatial distribution of image quality. The statistical features of the local quality map, including area ratio, mean and standard deviation, are extracted to quantify the overall quality of the image. Accurately locating areas of poor quality in substation monitoring images helps to identify image degradation that may affect safety monitoring.
[0118] The amplitude and phase of the discrete cosine transform coefficients are calculated to fully capture the frequency domain information of the image. The phase consistency metric and phase consistency map are constructed to reflect the edge and texture clarity of the image. The directional entropy and scale entropy of the phase consistency map are calculated to quantify the directional and scale information of the image. The statistical moments of the phase consistency map are extracted to further describe the frequency domain characteristics of the image. It is suitable for detecting degradation phenomena such as blur and noise in substation monitoring images.
[0119] The no-reference quality assessment method enables the system to monitor image quality in real time and promptly detect image degradation problems caused by weather, lighting or equipment failure. Multi-scale structural similarity analysis can accurately locate quality problem areas in the image, helping the system determine whether the camera needs to be adjusted or image enhancement is required. The phase consistency feature enables the system to effectively identify image blur and loss of details caused by vibration, defocus or compression, ensuring that key equipment and areas are clearly visible. It can automatically identify and mark low-quality images to avoid misjudgments or omissions caused by poor image quality. It provides precise guidance for image enhancement and repair, allowing the system to improve image quality in a targeted manner. By continuously monitoring image quality, the system can promptly detect performance degradation of camera equipment and prompt maintenance or replacement.
[0120] In this embodiment, the adaptive multi-scale collaborative filtering (AMCF) algorithm can effectively handle the complex and dynamically changing scenes of substations through adaptive sampling and dynamic tree structure optimization. The input is the image feature vector, and the output is the optimized OpenCV processing module combination strategy. The advantages include:
[0121] Adaptability: It can dynamically adjust the sampling strategy according to scene changes to adapt to different weather and lighting conditions. Robustness: Through multi-tree integration, it improves resistance to noise and abnormal data. It adopts incremental learning to achieve real-time updates to meet the real-time requirements of substation monitoring.
[0122] According to one aspect of the present application, a multi-scale spatiotemporal graph (MSTG) effectively captures the spatiotemporal interaction patterns of personnel and equipment in a substation by constructing a multi-level spatiotemporal relationship graph. The input is an optimized image dataset, and the output is spatiotemporal data, including behavior patterns, interaction information, and trend analysis data. Advantages include:
[0123] Multi-scale representation: Capture short-term (seconds), medium-term (minutes), and long-term (hours) spatiotemporal patterns simultaneously.
[0124] Relationship modeling: effectively represent the complex relationships between entities within the substation through a graph structure.
[0125] Interpretability: The generated graph structure is easy to visualize and interpret, which helps security managers understand system decisions.
[0126] In another embodiment of the present application, the process of multispectral data preprocessing, data fusion and transformation is as follows:
[0127] Image Registration: Accurately register visible, infrared, and ultraviolet images using the scale-invariant feature matching (SIFT) algorithm and affine transformation.
[0128] Noise Removal: Adaptive Wiener filtering is applied to each band image to remove sensor noise.
[0129] Based on the fusion of principal component analysis (PCA), the three band images after registration are flattened into vectors. The covariance matrix is calculated and the eigenvalue decomposition is performed. The first two principal components are selected to reconstruct the fused image.
[0130] Based on the fusion of wavelet transform, discrete wavelet transform (DWT) is performed on the three-band images. Coefficient fusion is performed in the wavelet domain, high-frequency details are retained in visible light, and low-frequency information is retained in infrared and ultraviolet. Inverse wavelet transform is performed to obtain the fused image.
[0131] Fusion based on deep learning: Construct a multi-branch convolutional neural network, with each branch processing an image of one band. Use the attention mechanism to perform adaptive fusion at the feature map level. Output the fused feature map and reconstruct the fused image.
[0132] Information entropy, structural similarity (SSIM) and other indicators are used to evaluate the fusion effect, and the optimal fusion result is selected as the input for subsequent processing.
[0133] In another embodiment of the present application, the process of optimizing image preprocessing parameters is as follows:
[0134] Adaptive non-local mean denoising, including: Adaptive search window size: dynamically adjust the search window size according to the local variance of the image. Window size W = base_size * (1 + α * local_variance), where base_size is the base window size, α is the adjustment coefficient, and local_variance is the local variance of the image.
[0135] Adaptive filter strength: The filter strength is adjusted according to the overall noise level of the image. The filter strength h = k * σ, where σ is the estimated noise standard deviation and k is the adjustment coefficient.
[0136] Similarity weight adaptation: Image gradient information is introduced, and gradient differences are considered when calculating block similarity. Similarity S = exp(-||patch_i - patch_j||² / (h² * (1 + β * ||grad_i - grad_j||²))), where patch_i and patch_j represent two image patches in the image, that is, local areas extracted from the image, β represents the adjustment coefficient that controls the influence of gradient differences on similarity, and grad_i and grad_j represent the gradient information of image patches patch_i and patch_j, respectively.
[0137] Adaptive gamma correction, including: brightness adaptation, dynamically adjusting the gamma value according to the overall brightness level of the image.
[0138] γ = a * exp(-b * level) + c, where a, b, c are preset parameters.
[0139] Contrast adaptation, introduces local contrast terms, so that low-contrast areas are more enhanced. γ_local =γ * (1 - w * local_contrast), w is the weight coefficient, local_contrast represents the local contrast. Color preservation, gamma correction is performed in the LAB color space, and correction is applied only to the L channel to maintain the original color.
[0140] In another embodiment of the present application, the process of extracting substation-specific scene features is specifically as follows:
[0141] Extract the contour features of power equipment, including: Use the Canny edge detector to extract the contour of the equipment. Apply the Hough transform to detect lines and circles, and identify the geometric features of equipment such as transformers and switches. Calculate the shape descriptors of the contour, including Hu moments, Zernike moments, etc.
[0142] Extracting the characteristics of the operator's operation posture, including: using human posture estimation algorithms such as OpenPose to extract key point coordinates. Calculating the relative position and angle between key points to construct posture feature vectors. Using time series models (such as long short-term memory networks (LSTM)) to capture action sequence characteristics.
[0143] Extract equipment status features, including: temperature mapping of infrared images to extract equipment temperature distribution features. Use image segmentation algorithms to identify equipment meter areas and extract reading features. Use optical flow algorithms to detect equipment motion states, such as switch switching, robot arm movement, etc.
[0144] In another embodiment of the present application, the process of constructing and quantifying abnormal behaviors based on the safety specifications of the power industry specifically includes:
[0145] Illegal operation distance detection, including: defining the safety distance threshold D_safe, set according to different voltage levels. Calculating the minimum distance D_min between the detected personnel and the energized equipment. If D_min < D_safe, trigger an abnormal alarm. Quantitative indicators: safety margin = (D_min - D_safe) / D_safe.
[0146] Detecting when safety equipment is not worn, including: using target detection algorithms to identify key safety equipment such as helmets and insulating gloves. Define the list of necessary safety equipment L_required. Calculate the intersection of the detected safety equipment set L_detected and L_required. If the intersection is incomplete, trigger an abnormal alarm. Quantitative indicator: Safety equipment completeness = |L_detected∩L_required| / |L_required|.
[0147] Detecting illegal operation sequences, including: defining a standard operation process sequence S_standard. Using a time series model (such as HMM) to identify the actual operation sequence S_actual. Calculating the edit distance D_edit between S_actual and S_standard. If D_edit > threshold, triggering an abnormal alarm. Quantitative indicators: Operation standardization = 1 - D_edit / len(S_standard), where len( ) represents the function of calculating the sequence length.
[0148] In another embodiment of the present application, the process of substation key indicator trend analysis is specifically as follows:
[0149] Analyze the temperature change trend of the equipment, including: extracting the time series temperature data T(t) for each key equipment. Applying wavelet transform for multi-scale decomposition to separate the trend, cycle and noise components. Performing linear regression on the trend component to obtain the slope k and intercept b. Using the ARIMA model to predict the future temperature. Output the temperature change rate k and the predicted temperature curve for the next 24 hours.
[0150] Analyze changes in personnel behavior patterns, including: encoding detected personnel behaviors into discrete state sequences. Using hidden Markov models (HMMs) to learn normal behavior patterns. Calculate likelihood probabilities for new observation sequences, where λ is the learned HMM parameter. Track the trend of likelihood probabilities. If they continue to decline, it indicates a deviation in the behavior pattern. Output a behavior pattern deviation curve and abnormal behavior warning time point.
[0151] Analyze equipment status trends, including: Extract time series data of equipment status indicators (such as switching times, load rate, etc.). Apply empirical mode decomposition (EMD) to extract trend components. Perform nonlinear regression on trend components, such as using support vector regression (SVR). Calculate prediction confidence intervals for early detection of anomalies. Output equipment status prediction curves, and the change of anomaly probability over time.
[0152] In one embodiment, in step S4, the adaptive multi-scale spatiotemporal graph construction process is as follows:
[0153] Read the optimized image dataset I opt and the time series feature F ST-AMN , construct the basic spatial relationship graph as follows: Use the improved Delaunay triangulation algorithm.
[0154] Introducing adaptive edge weights: w ij = exp(-||p i -p j || 2 / (2σ 2 )) * sim(F i , F j ), where p i Represents point i, p in space j represents a point j in space, F i and F j Represent two eigenvectors respectively, σ represents the standard deviation of the Gaussian kernel function; sim(F i , F j ) indicates that cosine similarity is used to calculate feature similarity.
[0155] Constructing adaptive time windows: W t= max(minW, α* local_motion_speed), where minW represents the minimum time window size, α represents the time window adjustment coefficient, and local_motion_speed represents the local motion speed; t Create a time edge within the range, edge weight w t = exp(-|t i -t j | / W t ), where t i and t j Indicates a point in time;
[0156] Generate a multi-scale graph structure: short-term graph Gs: time range [t, t+Ws]; medium-term graph Gm: time range [t, t+Wm], Wm = 5 * Ws; long-term graph Gl: time range [t, t+Wl], Wl = 5 * Wm, where Ws, Wm, Wl represent short-term, medium-term, and long-term time windows respectively.
[0157] Calculate the node importance score: Si = degree(i) * PageRank(i) * betweenness(i), where degree(i) represents the degree, PageRank(i) represents the web page ranking, and betweenness(i) represents the betweenness centrality; use the Top-K strategy to retain important nodes in each scale graph and output the multi-scale spatiotemporal atlas GMS = {Gs, Gm, Gl}.
[0158] In another embodiment of the present application, in step S4, the process of spatiotemporal pattern recognition and anomaly detection specifically includes:
[0159] Read the fusion graph feature F_graph and extract the spatiotemporal pattern;
[0160] Construct a multidimensional time series decomposition algorithm: TS_i = Trend_i + Seasonal_i + Residual_i, where Trend_i represents trend, Seasonal_i represents seasonality, Residual_i represents residual component, and TS_i represents the i-th time series.
[0161] Construct an adaptive time series segmentation method and calculate the sequence complexity: C_i(t) = LZ_complexity(TS_i[tw:t]), where LZ_complexity represents Lempel-Ziv complexity, which is a method to measure sequence complexity, and w represents the time window for complexity calculation; adaptive segmentation point: SP_i = {t | C_i(t) > μ_C + k * σ_C}, μ_C represents the mean complexity, k represents the adjustment coefficient of the complexity threshold, and σ_C represents the standard deviation of the complexity.
[0162] Extract segment-level statistical features and shape descriptors as follows:
[0163] Identify behavior patterns and construct a behavior dictionary: D = {B_1, B_2, ..., B_K}; build an elastic spatiotemporal pattern matching algorithm and set the elastic distance: ED(P, Q) = DTW(P, Q) + λ * EMD(P, Q); DTW is the dynamic time warping distance, EMD is the mover distance, and λ represents the weight coefficient in the elastic distance; B1, B2, ..., BK represent the behavior patterns in the dictionary;
[0164] Use K-nearest neighbor (KNN) classifier to identify behaviors, including: building a multi-scale anomaly detector,
[0165] For local anomalies, the local anomaly factor (LOF) algorithm is used to calculate the local anomaly factor. For global anomalies, the one-class support vector machine (One-class SVM) is used to detect global anomalies. For time series anomalies, an adaptive differential integrated moving average autoregression (ARIMA) model is constructed to predict anomalies.
[0166] Build an integrated anomaly scoring system, including:
[0167] Anomaly score: S_anom = w_1 * S_local + w_2 * S_global + w_3 * S_temporal; weight w_i is adaptively adjusted through reinforcement learning, w1, w2, w3 represent different anomaly detection weights, S_local, S_global, and S_temporal represent local, global, and temporal anomaly scores, respectively
[0168] Constructing explanatory decision trees, including: constructing counterfactual-based anomaly explanation generators,
[0169] Generate counterfactual samples, X' = X + δ, st f(X') ≠ f(X), where X', X and δ all represent counterfactual sample related variables; extract the minimum perturbation set, δ_min = argmin ||δ||, st f(X + δ) ≠ f(X), where argmin represents the parameter that minimizes the function.
[0170] Output the abnormal cause and severity assessment, including: behavior recognition result B_rec, abnormal detection result A_det, abnormal explanation A_exp.
[0171] Analyze multi-agent interactions, including: reading the multi-scale spatiotemporal atlas G_MS and the behavior recognition results B_rec.
[0172] Extract interaction patterns and construct an interaction graph: I_G(t) = (V, E, W), where W_ij = interaction_strength(i, j, t), interaction_strength represents the interaction strength between node i and node j at time point t, V represents the set of nodes in the graph, E represents the set of edges in the graph, W represents the set of edge weights in the graph, and W_ij represents the interaction strength;
[0173] Construct a multi-granularity interaction strength calculation method:
[0174] Spatial interaction: SI_ij = gaussian(||p_i - p_j||, σ_s); where gaussian represents the Gaussian function, p_i and p_j represent points in space, and σ_s represents the Gaussian kernel parameter of spatial interaction;
[0175] Behavior interaction: BI_ij = sim(B_i, B_j); where B_i and B_j represent two behavior feature vectors respectively;
[0176] Time series interaction: TI_ij = corr(TS_i, TS_j); where TS_i and TS_j represent two world sequences, and corr() represents the correlation function;
[0177] W_ij = α * SI_ij + β * BI_ij + γ * TI_ij; where α, β and γ represent the weights for calculating the interaction strength;
[0178] Set community similarity: CS(C_t, C_t+1) = |C_t ∩ C_t+1| / |C_t ∪ C_t+1|; CS(Ct, Ct+1) represents the community similarity at time t and t+1;
[0179] Track the community life cycle: birth, growth, merger, split, and death.
[0180] Identify key nodes, including:
[0181] Calculate the multidimensional centrality index,
[0182] Structural centrality: SC_i = PageRank(i) * betweenness(i);
[0183] Behavior centrality: BC_i = Σ_j sim(B_i, B_j) / |V|; where V represents the vertex set of the graph;
[0184] Temporal centrality: TC_i = persistence(i) * activity(i), where persistence means persistence and activity means activity.
[0185] Constructing an adaptive key node sorting algorithm
[0186] Construct an order relationship: i > j if (SC_i, BC_i, TC_i) dominates (SC_j, BC_j, TC_j); where dominates means that in the order, the centrality index of node i is better than that of node j. Use partial order set theory to calculate the Hasse graph of the nodes; extract the maximum chain of the Hasse graph as the key node sequence
[0187] Construct a method for quantifying interaction effects based on causal inference, set the treatment variable: T = interaction_level(i, j); where interaction_level represents the interaction level between nodes, the result variable: Y = performance_metric(i, j); where performance_metric represents the performance indicator of the node, and estimate the causal effect: E[Y|do(T=t)] - E[Y|do(T=0)], where E[ ] represents the expectation function.
[0188] Output interaction effect matrix, interaction pattern I_P, group dynamics G_D, key node list KN, interaction effect matrix IE.
[0189] Construct an adaptive trend extraction algorithm to calculate the local trend: LT_i(t) = median(TS_i[tw:t+w]); where median represents the median, the global trend: GT_i = LOESS(LT_i), where LOESS represents local weighted regression; and the periodicity: P_i = FFT(TS_i - GT_i), where FFT represents fast Fourier transform; extract trend features: slope, inflection point and cycle length.
[0190] Set up spatiotemporal events: E = (location, time, attribute); where location, time, attribute represent the location, time, and attribute of the event respectively, build a sequence database: SDB = {S_1, S_2, ..., S_n}; build an efficient pattern growth algorithm based on prefix tree.
[0191] In another embodiment of the present application, step S3 may also be:
[0192] S31. Initializing Adaptive Chaotic Monte Carlo Forest (ACMCF)
[0193] Construct a heterogeneous decision tree set T = {T_1, T_2, ..., T_n}; each tree T_i represents a different OpenCV processing module combination strategy;
[0194] Read the image feature vector F = [f_1, f_2, ..., f_m].
[0195] Construct a splitting strategy driven by a chaotic dynamic system for each tree, including: setting the chaotic map: x_(n+1) = r* x_n * (1 - x_n), where r is the control parameter; initializing the chaotic state x_0 ∈ (0, 1) of each node; setting the splitting condition: if x_n > threshold, split;
[0196] Initialize the prior distribution of the tree using the Dirichlet-Multinomial distribution: P(θ) = Dir(α); Dir represents the Dirichlet distribution, θ represents the parameter vector, and α represents the parameter vector of the Dirichlet distribution;
[0197] Construct the performance index Q = accuracy * efficiency; accuracy represents accuracy, efficiency represents processing efficiency, and the update rule is: r_new = r_old + η * (Q - Q_target); where r_new and r_old represent the new and old chaotic mapping parameters respectively, and η represents the chaotic mapping parameter adjustment coefficient; output the initialized ACMCF model M_init.
[0198] S32. Feature Space Self-Organizing Maps and Clustering
[0199] Read image feature set F_set = {F_1, F_2, ..., F_N};
[0200] Construct a self-organizing map (SOM) network, including: initializing a two-dimensional grid G with a size of p × q, and assigning a random weight vector w_ij to each grid node n_ij.
[0201] Training the SOM network includes:
[0202] For each input F_k: find the best matching unit (BMU): BMU = argmin_ij ||F_k - w_ij||; Update the weights of BMU and its neighborhood: w_ij_new = w_ij_old + α(t) * h(BMU, ij, t) * (F_k -w_ij_old), where α(t) is the learning rate and h() is the neighborhood function.
[0203] The improved density peak clustering (DPC) algorithm is used for clustering, including: calculating the local density ρ_i and distance δ_i; calculating the adaptive truncation distance d_c: d_c = median({d_ij}) * (1 + β * std({d_ij})); where median represents the median; identifying the cluster center: γ_i = ρ_i * δ_i, assigning the remaining points to the nearest high-density neighbors, and assigning an OpenCV module combination to each cluster.
[0204] Construct a multi-objective optimization to select the best module combination: Objective 1: maximize the processing effect; Objective 2: minimize the computational complexity. Use the fast non-dominated sorting genetic algorithm II (NSGA-II) to solve the Pareto optimal solution set.
[0205] Output clustering results C = {C_1, C_2, ..., C_K} and its corresponding module combination M = {M_1, M_2, ..., M_K}.
[0206] S33. Adaptive Monte Carlo Tree Search (AMCTS).
[0207] Read the current image feature F_cur, ACMCF model M; initialize the search tree ST, with the root node F_cur; perform AMCTS iteration:
[0208] Starting from the root node, use the UCB1 strategy to select child nodes: UCB1 = X_j + C * sqrt(2 * ln(n) / n_j); X_j: average reward of node j, n: total number of visits, n_j: number of visits to node j; update the selected path P.
[0209] If a leaf node is reached, a new child node is created; a new feature segmentation threshold is generated using a chaotic map.
[0210] Use the fast evaluation function to estimate the reward R of the new node; R = w1 * predicted image quality + w2 * predicted processing speed; update the number of visits and average rewards of all nodes on path P.
[0211] Dynamically adjust the exploration parameter C in UCB1: C_new = C_old * (1 + λ * (R_avg - R_target)); where R_avg represents the evaluation reward, R_target represents the target reward value, λ represents the adjustment coefficient, C_old represents the original exploration parameter, and selects the OpenCV module combination corresponding to the best path; outputs the selected module combination M_best.
[0212] S34. Adaptive optimization of module parameters
[0213] Read the selected module combination M_best and the current image I_cur; define the parameter search space S = {s_1, s_2, ..., s_m}; construct a parameter optimizer based on the Firefly algorithm, including: initialize the firefly population P = {p_1, p_2, ..., p_n}, where each p_i represents a set of parameters; set the attraction function β(r) = β_0 * exp(-γr²); set the objective function f(p) = image quality score (I_processed)-λ * processing time;
[0214] For each pair of fireflies (i, j):
[0215] If f(p_j) > f(p_i), update the position of p_i: p_i_new = p_i + β(r_ij) * (p_j -p_i) + α * (rand() - 0.5), where β(r_ij) represents the attraction function and rand() represents the random number generation function.
[0216] Apply adaptive step size: α_new = α_0 * (1 - iteration / max_iterations) μ . Update the global optimal solution p_best, where α_0 represents the initial step size, iteration represents the number of iterations, and max_iterations represents the maximum number of iterations. μ Indicates the adjustment factor
[0217] Perform a local search for the global optimal solution p_best, and use a pattern search algorithm to refine the search near the global optimal solution p_best; output the optimized parameter setting P_opt.
[0218] Read the processed image I_processed, ACMCF model M;
[0219] Construct a multidimensional quality assessment function, Q = w1 * clarity + w2 * contrast + w3 * information retention + w4 * processing speed; use adaptive weights: w_i = softmax(performance_history_i); where performance_history_i represents historical records and softmax represents a normalization function; calculate the quality gain ΔQ = Q(I_processed) - Q(I_cur), where I_processed represents the processed image and I_cur represents the current image.
[0220] Update the ACMCF model for each node on the selected path:
[0221] Update access count: n_j = n_j + 1; Update average reward: X_j = (X_j * (n_j - 1) + ΔQ) / n_j; Adjust chaotic mapping parameters: r_new = r_old * (1 + η * sign(ΔQ)), where r_new and r_old both represent chaotic mapping parameters, η represents the chaotic mapping parameter adjustment coefficient, and sign() represents the sign function.
[0222] Calculate the importance score of a node: $S_j = X_j * \sqrt{n_j} / n_{total}$; if $S_j < threshold$, consider pruning the node, where $n_{total}$ represents the total number of accesses and $threshold$ represents the threshold value.
[0223] Identify the K% trees with the worst performance, use the current best tree as a template, apply the genetic algorithm to generate a new tree, and output the updated ACMCF model $M_{updated}$.
[0224] Read the original image $I_{cur}$, the selected module combination $M_{best}$, and the optimized parameters $P_{opt}$; apply the selected OpenCV modules to process the image; call the modules in the order specified by $M_{best}$ and set the parameters of each module using $P_{opt}$.
[0225] Use morphological operations to repair potential processing artifacts, record the used modules, parameter settings, and processing time, and calculate various image quality metrics (peak signal-to-noise ratio (PSNR), structural similarity (SSIM), learned perceptual image patch similarity (LPIPS), etc.). Output the optimized image $I_{opt}$ and the processing report $R$.
[0226] In some embodiments of the present application, the calculation process is specifically as follows:
[0227] Adapt the gamma function $\gamma(L) = a * exp(-b * L) + c$, where $a$, $b$, and $c$ are preset parameters;
[0228] Apply gamma correction to each pixel $p$: $p_{out} = 255 * (p / 255)^{\gamma(L)}$ (1 / γ(L)) ;
[0229] Calculate the gradient magnitude map $G$ of the optical flow field: $G = \sqrt{(\frac{\partial F_x}{\partial x})^2 + (\frac{\partial F_y}{\partial y})^2}$, where $\frac{\partial}{\partial}$ represents the partial derivative; adaptively threshold $T = mean(G) + k * std(G)$ to binarize the gradient magnitude map, where $F_x$ and $F_y$ represent the components of the optical flow field in the $x$ and $y$ directions respectively.
[0230] In some embodiments, the process of multimodal image fusion is specifically as follows:
[0231] Apply wavelet transform to each frame of the image for multi-scale decomposition, use the wavelet basis to decompose the image of each modality into 3 layers, and obtain the low-frequency coefficients $LL$ and high-frequency coefficients $\{LH, HL, HH\}$ of each modality.
[0232] Construct a feature-level fusion algorithm based on the pulse-coupled neural network (PCNN), including:
[0233] Construct a PCNN network for the high-frequency coefficients of each scale, introduce the local energy function E(i, j) = Σ(W * |coef(i, j)|), as the input of PCNN, where coef represents the wavelet transform coefficient; construct an adaptive link strength β(i, j) = exp(-E(i, j) / max(E)), where exp represents the exponential function and max represents the maximization function; iteratively update PCNN until convergence to obtain the fused high-frequency coefficients; use the weighted average method to fuse the low-frequency coefficients. Apply the inverse wavelet transform to reconstruct the fused image.
[0234] Construct a superpixel adjacency graph G, where the edge weight is the similarity of the adjacent superpixel features. Construct an adaptive growth threshold T(si) = μ(si) + α * σ(si), where μ and σ are the local mean and standard deviation, and α represents the coefficient that controls the sensitivity of the growth threshold.
[0235] Inter-region similarity measure S(ri, rj) = exp(-||fi - fj||² / σ²); boundary penalty term B(ri, rj) = exp(-||∇I(ri, rj)||² / σ²); graph cut energy function E = Σ(1 - S(ri, rj)) + λ *Σ B(ri, rj). Global segmentation quality index Q = Σ(wi * Di), where wi is the area weight of the region, Di represents the fractal dimension of the region, and fi and fj represent feature vectors.
[0236] Local structure tensor T = [Σ(I_x²), Σ(I_x I_y); Σ(I_x I_y), Σ(I_y²)]; eigenvalues λ_1, λ_2 and eigenvectors v_1, v_2 of the tensor; local anisotropy measure A = (λ_1 - λ_2) / (λ_1+ λ_2); anisotropy weight: w(x, y) = 1 + α * A(x, y); weighted HOG feature: HOG_w = Σ(w(x, y) * M(x, y) * bin(θ(x, y))); fused feature F_HOG-LST = [HOG_w, λ_1, λ_2, A]. Adaptive color moment: ACM = [μ_S, σ_S, skew_S, kurt_S]. Scaling weight function w_i = log(1 + i) / Σlog(1 +j). Phase consistency measure PC(u, v) = |Σ A(u, v) * exp(jφ(u, v))| / Σ A(u, v). Inter-layer similarity measure S(l_i, l_j) = exp(-||f_i - f_j||² / σ²). Where I_x and I_y represent the gradient of the image in the x and y directions, M(x, y) represents the gradient amplitude, θ(x, y) represents the gradient direction, μ_S, σ_S, skew_S and kurt_S all represent the statistics of adaptive color moments, A(u, v) represents the amplitude of the DCT coefficient, and φ(u, v) represents the phase of the DCT coefficient.
[0237] According to another aspect of the present application, a substation safety operation monitoring system based on OpenCV is also provided, which is characterized by comprising:
[0238] at least one processor; and,
[0239] a memory communicatively connected to at least one of the processors; wherein,
[0240] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the substation safety operation monitoring method based on OpenCV described in any of the above technical solutions.
[0241] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.
Claims
1. A substation safety operation monitoring method based on OpenCV, characterized in that: The method is implemented by at least two OpenCV modules, and comprises the following steps: Step S1: collect video images of the substation operation area through a pre-configured video camera, extract video frames and perform semantic segmentation on the images to obtain a segmented image set; Step S2: extracting image features for each segmented image in the segmented image set, wherein the image features include content features, quality features, and association features; Step S3: Based on the image features, the pre-configured adaptive Monte Carlo forest module is called to select the corresponding OpenCV processing module for each segmented image, and after processing, an optimized image data set is obtained; Step S4: Based on the optimized image data set, call the pre-configured adaptive multi-scale spatiotemporal graph module for processing to obtain spatiotemporal data, including spatiotemporal behavior patterns, interaction information, and trend analysis data; based on the spatiotemporal data, identify abnormal behaviors and abnormal states and output them; The step S2 is further as follows: Step S21, reading a set of segmented images, and extracting content features for each segmented image, including: multi-scale local binary pattern features, directional gradient histogram and local structure tensor fusion features, color moment and color contrast distribution features, and Gabor filter group features; Step S22, reading the segmented image set, and extracting quality features for each segmented image, including: a reference-free image quality assessment index based on natural scene statistics, a local quality map of multi-scale structural similarity, and a frequency domain quality feature based on phase consistency; Step S23, reading the segmented image set, and extracting related features for each segmented image, including: regional relationship features, spatiotemporal cube features, and optical flow and trajectory feature fusion features; wherein the spatiotemporal cube features introduce the time dimension into feature extraction, and can capture the patterns of object movement and scene changes; Step S24, calling and configuring the feature fusion and dimension reduction module to fuse and reduce the dimension of the content features, quality features and association features, and outputting the final image feature vector set, i.e., the fusion image features; The step S3 is further as follows: Step S31, read image features, initialize the pre-configured adaptive Monte Carlo forest module, build a set of heterogeneous decision trees, each tree represents a different OpenCV processing module combination strategy, build and train a self-organizing map network; perform self-organizing mapping and clustering on image features, and output clustering results; assign an OpenCV module combination to each clustering result; Step S32: Based on the image features and the adaptive Monte Carlo forest module, perform an adaptive Monte Carlo tree search, select the OpenCV module combination corresponding to the best path, and output the selected module combination; based on the selected module combination, perform adaptive parameter optimization to obtain the optimized parameters; Step S33, constructing an image evaluation function and evaluating the image processing quality, calculating the quality gain, and outputting the optimization parameters if the quality gain exceeds a threshold; Step S34, processing the image based on the optimized adaptive Monte Carlo forest module to obtain an optimized image data set; The step S4 is further as follows: Step S41, read the optimized image data set, extract the time series features, and construct an adaptive multi-scale space-time graph module; apply the improved Delaunay triangulation algorithm to construct a basic spatial relationship graph, construct an adaptive time window to establish time edges, and generate short-term, medium-term and long-term multi-scale graph structures; perform graph compression and important node retention, and output a multi-scale space-time atlas; Step S42, read the fusion graph features, perform spatiotemporal pattern recognition and anomaly detection; apply the multidimensional time series decomposition algorithm and the adaptive time series segmentation method to extract the spatiotemporal pattern; construct a behavior dictionary and use the elastic spatiotemporal pattern matching algorithm for behavior recognition; build a multi-scale anomaly detector, including local, global and temporal anomaly detection; output the behavior recognition results, anomaly detection results and anomaly explanations through the integrated anomaly scoring system; Step S43: Based on the multi-scale spatiotemporal atlas and behavior recognition results, perform multi-agent interaction analysis; construct an interaction graph and a multi-granularity interaction intensity calculation method; apply a community detection algorithm and an incremental community evolution tracking algorithm to perform group dynamics analysis; construct a multidimensional centrality index to identify key nodes; construct an interaction effect propagation model and apply a causal inference method to quantify the interaction effect, and output the interaction pattern, group dynamics, key node list, and interaction effect matrix; Step S44, read time series features, fusion graph features and group dynamics data, perform trend analysis and prediction; apply improved wavelet transform for multi-scale trend decomposition; construct spatiotemporal sequence pattern mining algorithm and association rule analysis; construct an integrated framework for multivariate time series prediction; construct a multi-scenario simulation algorithm based on the Monte Carlo method for risk assessment, and output trend reports, prediction results and risk assessment reports.
2. The substation safety operation monitoring method based on OpenCV according to claim 1 is characterized in that: The step S1 is specifically as follows: Step S11: Obtain image data in the visible light, infrared and ultraviolet bands through a pre-configured multispectral camera and add a timestamp to each frame of the image to obtain a time-synchronized video frame data set; Step S12, obtaining a video frame data set after time synchronization, sequentially using a non-local means method to perform denoising on each video frame, using an adaptive gamma method to correct and optimize the image contrast of the video frame, and obtaining a preliminarily processed video frame set; Step S13, reading the preliminarily processed video frame set, calling the adaptive optical flow method to calculate the motion between adjacent video frames, and removing duplicate and redundant video frames according to the calculation results to obtain a screened video frame set; Step S14, read the filtered video frame set, segment each video frame using a graph cutting method and optimize the segmentation boundary, obtain a segmented video frame data set and perform segmentation quality assessment, and output a segmented image set.
3. The OpenCV-based substation safety operation monitoring method according to claim 2, characterized in that: In step S12, the process of sequentially using the non-local means method to perform denoising on each video frame, using the adaptive gamma method to correct and optimize the image contrast of the video frame, and obtaining a set of preliminarily processed video frames is further as follows: Step S121, calculate the local covariance matrix of each pixel neighborhood, use principal component analysis to search for similar blocks and extract the main noise direction; consider the main direction of the noise when searching for similar blocks, and dynamically adjust the shape of the search window; Step S122, introducing an adaptive weight factor when calculating the weighted average, and dynamically adjusting it according to the block similarity and noise intensity; outputting the denoised video frame data set; Step S123, read the denoised video frame data set, calculate the histogram of each frame image and estimate the overall brightness; construct an adaptive gamma function γ(L) = a * exp(-b * L) + c, where a, b, c are preset parameters, and L is the overall brightness; apply gamma correction to each pixel; output the contrast-optimized video frame data set, that is, the initially processed video frame set, and exp( ) represents an exponential function.
4. The substation safety operation monitoring method based on OpenCV as claimed in claim 3 is characterized in that: The step S13 is specifically as follows: Step S131, applying the Farnabeck optical flow algorithm to the contrast-optimized video frame dataset to calculate the dense optical flow field F between consecutive frames; Step S132, calculate the gradient amplitude map of the optical flow field and use the adaptive threshold T = mean(G) + k * std(G) to binarize the gradient amplitude map, G is the gradient amplitude of the optical flow field, mean() represents the average value, k represents the coefficient of controlling the threshold sensitivity, and std() represents the standard deviation; Step S133, calculating the ratio of non-zero pixels in the binarized image, and if the ratio is less than a preset threshold, discarding the current frame; The output is a video frame dataset after removing redundant frames, which is the filtered video frame set.
5. The OpenCV-based substation safety operation monitoring method according to claim 3, characterized in that: The step S14 is specifically as follows: Step S141: read the filtered video frame set, construct and perform preliminary segmentation based on the superpixel adaptive region growing algorithm, specifically: Use a simple linear iterative clustering algorithm to initialize the superpixel set, calculate the average color and texture features of each superpixel; construct a superpixel adjacency graph, with the edge weight being the similarity of adjacent superpixel features; construct an adaptive growth threshold T(si) =μ(si) + α * σ(si), where μ and σ are the local mean and standard deviation, and α represents the coefficient that controls the sensitivity of the growth threshold; perform region growth based on the superpixel adjacency graph and the adaptive growth threshold, and merge similar regions; output the preliminary segmentation result; Step S142: read the preliminary segmentation result and apply the improved graph cutting method to optimize the segmentation boundary, specifically: Construct a cutting graph, where nodes are regions in the preliminary segmentation results and edges are adjacent regions; construct similarity metrics between regions, boundary penalty terms, and energy functions for graph cutting; use the α-expansion algorithm to iteratively optimize the energy function; and obtain the optimized segmentation results; Step S143: read the optimized segmentation result and use morphological post-processing to repair small areas and holes, specifically: Apply area opening operation to remove areas smaller than the threshold; use reconstruction opening operation to fill internal holes; apply conditional dilation algorithm to smooth the region boundary; output the repaired segmentation result; Step S144: read the repaired segmentation result and construct a segmentation quality evaluation index based on fractal dimension, specifically: Use the box counting method to calculate the fractal dimension of each segmented region; calculate the global segmentation quality index Q = Σ(wi *Di), where wi is the area weight of the region and Di is the fractal dimension of the region; if the global segmentation quality index Q is lower than the threshold T_Q, mark it as a region to be optimized; obtain the quality evaluation results and the mark of the region to be optimized; Step S145, read the mark of the area to be optimized and the repaired segmentation result, and apply the active contour model to the area to be optimized, specifically: Initialize the contour as the current segmentation boundary; construct an external force field based on gradient vector flow; introduce curvature constraints to prevent excessive deformation of the contour; iteratively update the contour until convergence or the maximum number of iterations is reached; output the optimized region contour; Step S146, read the repaired segmentation result and the optimized area contour, and integrate all the processing results, specifically: The optimized region contours are used to replace the corresponding regions in the repaired segmentation results; and a final set of segmented images is generated.
6. The OpenCV-based substation safety operation monitoring method according to claim 1, characterized in that: In step S21, the process of extracting content features is specifically as follows: Step S211, read the segmented image set, perform Gaussian pyramid decomposition on the segmented images in sequence to obtain a multi-scale image set; calculate the local variance of pixels at each scale, construct an adaptive threshold function and calculate the local binary pattern feature of each scale; use the information gain criterion to select the most discriminative scale combination; output the multi-scale local binary pattern feature vector; Step S212, read the segmented image set, calculate the gradient amplitude and direction of the image; construct a local structure tensor and calculate its eigenvalue and eigenvector; construct a local anisotropy metric and introduce anisotropy weights in the calculation of the directional gradient histogram; calculate the weighted directional gradient histogram features to obtain fusion features; Step S213, reading the segmented image set, and converting the image into the LAB color space; Calculate the global color contrast map and use the Otsu algorithm to adaptively segment the salient areas; calculate the adaptive color moments of the salient areas; construct the color contrast distribution histogram; Step S214, read the segmented image set, construct a direction adaptive function and an adaptive Gabor filter; use a particle swarm optimization algorithm to automatically select filter parameters; apply the optimized Gabor filter group to the image to obtain a response atlas; calculate the statistical characteristics of each response map.
7. The OpenCV-based substation safety operation monitoring method according to claim 6, characterized in that: The process of extracting quality features in step S22 is specifically as follows: Step S221: read the segmented image set and construct a no-reference image quality assessment index based on natural scene statistics, specifically: Perform local mean reduction and variance normalization on the image; calculate the generalized Gaussian distribution parameters of the normalized image; extract the pairwise product statistical features of the normalized image; calculate the local second-order statistical features, i.e., the generalized Gaussian distribution parameters of the variance field; construct and output the feature vector; Step S222: read the segmented image set and construct a local quality map based on multi-scale structural similarity, specifically: Decompose the image at multiple scales to obtain an image decomposition set; calculate the local structure similarity map for each scale; construct a scale weight function and calculate the weighted multi-scale local structure similarity map; apply an adaptive threshold to segment the multi-scale local structure similarity map to obtain a local quality map; extract the statistical features of the local quality map, including area ratio, mean value and standard deviation; Step S223: read the segmented image set and construct a frequency domain quality feature based on phase consistency, specifically: Perform discrete cosine transform on the image; calculate the amplitude and phase of discrete cosine transform coefficients; construct a phase consistency measure and a phase consistency map; calculate the directional entropy and scale entropy of the constructed phase consistency map; extract the statistical moment of the constructed phase consistency map.
8. A substation safety operation monitoring system based on OpenCV, characterized in that: include: at least one processor; as well as, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the substation safety operation monitoring method based on OpenCV as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Substation inspection method based on cloud side system and video intelligent analysis
CN113408087A
Face augmented reality calibration method and device based on Monte Carlo tree search
CN115049806A
Image processing method and device, electronic equipment and storage medium
CN117788946A
Advanced video data stream extraction and multi-resolution video transmission
WO2018172234A2
