Method, device and equipment for detecting contamination of a camera, and storage medium
By acquiring images of power equipment and utilizing image classification and difference matrix algorithms, the system automatically detects the dirt status of the shooting device, solving the problem of decreased recognition accuracy caused by dirt on the camera lens, and achieving efficient dirt detection and equipment status recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG POWER GRID CO LTD
- Filing Date
- 2023-09-22
- Publication Date
- 2026-07-07
Smart Images

Figure CN117315228B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more particularly to a method, apparatus, device, and storage medium for detecting dirt in an imaging device. Background Technology
[0002] The substation is equipped with numerous smart cameras to capture images of the equipment, identify the open / closed positions of disconnect switches based on these images, and then push the identification results to staff. The identification results of these disconnect switches are crucial for power distribution safety and substation operation; therefore, a high degree of accuracy is required. When the camera lenses become dirty, the accuracy of the identification results will decrease, necessitating manual inspection of the cameras. Compared to the large number of cameras, manual inspection is less efficient and less timely. Summary of the Invention
[0003] This invention provides a method, apparatus, device, and storage medium for detecting dirt in a camera, thereby improving the real-time performance and efficiency of dirt detection in a camera.
[0004] According to one aspect of the present invention, a method for detecting dirt in a photographing device is provided, the method comprising:
[0005] Acquire equipment images of power equipment captured by the target imaging device, and determine the target area image in the equipment image, wherein the target area image includes the disconnecting switch module of the power equipment, and the disconnecting switch module includes the disconnecting switch mechanism;
[0006] Determine the target operating state corresponding to the disconnect switch module, and determine the target difference matrix corresponding to the target operating state. The operating state includes the open state and the closed state. The target difference matrix is determined based on the target area image and the reference image corresponding to the target operating state.
[0007] The dirt status of the target imaging device is determined based on the target difference matrix.
[0008] According to another aspect of the present invention, a dirt detection device for a photographing apparatus is provided, the device comprising:
[0009] The target area image determination module is used to acquire equipment images of power equipment captured by the target imaging device and determine the target area image in the equipment image, wherein the target area image includes the disconnecting switch module of the power equipment, and the disconnecting switch module includes the disconnecting switch mechanism;
[0010] The target difference matrix determination module is used to determine the target operating state corresponding to the disconnecting switch module and to determine the target difference matrix corresponding to the target operating state. The operating state includes an open state and a closed state. The target difference matrix is determined based on the target area image and the reference image corresponding to the target operating state.
[0011] The dirt status determination module is used to determine the dirt status of the target imaging device based on the target difference matrix.
[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0013] At least one processor; and
[0014] A memory that is communicatively connected to at least one processor; wherein,
[0015] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the dirt detection method of the imaging device according to any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the dirt detection method of the imaging device of any embodiment of the present invention.
[0017] The technical solution of this invention involves acquiring an image of a power equipment captured by a target imaging device, determining a target area image within the equipment image, wherein the target area image includes a disconnecting switch module of the power equipment, and the disconnecting switch module includes a disconnecting switch mechanism. The disconnecting switch module in the equipment image can be easily, quickly, and effectively identified. A target operating state corresponding to the disconnecting switch module is determined, and a target difference matrix corresponding to the target operating state is also determined. The operating state includes an on state and a off state. The target difference matrix is determined based on the target area image and a reference image corresponding to the target operating state, effectively distinguishing the operating states of the disconnecting switch module. Determining the target operating state and the target difference matrix simultaneously based on the equipment image accelerates the determination of the dirt state. The dirt state of the target imaging device is determined based on the target difference matrix, addressing the problems of low efficiency and poor timeliness of manual dirt detection of imaging devices, thus improving the real-time performance and efficiency of dirt detection.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a dirt detection method for an imaging device according to an embodiment of the present invention;
[0021] Figure 2 This is a flowchart of a dirt detection method for another imaging device provided according to an embodiment of the present invention;
[0022] Figure 3 This is a structural block diagram of a dirt detection device for an imaging apparatus according to an embodiment of the present invention;
[0023] Figure 4 This is a structural block diagram of an electronic device provided according to an embodiment of the present invention. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first" and "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] Figure 1This is a flowchart of a dirt detection method for an imaging device according to an embodiment of the present invention. This embodiment is applicable to scenarios where dirt detection is performed based on device images. It can be performed by a dirt detection device of the imaging device. The dirt detection device of the imaging device can be implemented in hardware and / or software and configured in the processor of the electronic device.
[0027] like Figure 1 As shown, the method for detecting dirt on the imaging device includes the following steps:
[0028] S110. Obtain the equipment image of the power equipment captured by the target imaging device, and determine the target area image in the equipment image, wherein the target area image includes the disconnecting switch module of the power equipment.
[0029] Disconnecting switch modules are used to change the circuit connection of electrical equipment or control the current flow of electrical equipment. A disconnecting switch module includes a disconnecting switch mechanism, such as a knife switch or an air switch.
[0030] Specifically, in order to detect the operating status of power equipment, a target imaging device can be set up near the power equipment, and a video can be taken of the power equipment using the target imaging device. The image of each frame of the video is determined to obtain the equipment image. The disconnecting switch module in the equipment image is determined by image classification, semantic segmentation, target detection or instance segmentation to obtain the target area image.
[0031] Optionally, the target shooting device can be a camera, which is controlled to shoot video of the power equipment to obtain equipment images. Furthermore, the video can be sampled at set time intervals to obtain equipment images of the power equipment taken at set times; for example, a first equipment image of the power equipment could be taken at 10:00 AM and a second equipment image of the power equipment could be taken at 8:00 PM each day.
[0032] S120. Determine the target operating state corresponding to the disconnecting switch module, and determine the target difference matrix corresponding to the target operating state.
[0033] The operating states include an open state and a closed state. It can be understood that the operating state of the switch can be changed by altering the external shape of the disconnector module. For example, the external shape of the disconnector is determined by the state of the crank arm of the disconnector's transmission mechanism. Based on the external shape of the disconnector, it is determined whether the disconnector is closed. If the disconnector is closed, it is in the closed position, and its operating state is open. If the disconnector is open, it is in the open position, and its operating state is closed. The target difference matrix is determined based on the target region image and a reference image corresponding to the target operating state.
[0034] The reference image is an image of the electrical equipment taken by a camera in a clean state. For example, the reference image is an image of the area corresponding to the disconnector module of the electrical equipment taken by a camera in a clean state. It is understood that a corresponding reference image is provided for each operating state of the disconnector module.
[0035] Optionally, corresponding reference images are also set for different time points. Specifically, the light intensity varies at different time points, resulting in different pixel values for the device images. Reference images with different lighting conditions are set to correspond to the device images at different time points. Specifically, reference images at the same time point as the device image are determined based on the device image's capture time. Optionally, the device image's capture time is determined, and a set of reference images for different working states within the same time period corresponding to that capture time is determined based on the device image's capture time.
[0036] Optionally, corresponding reference images are also set for different light intensities. Specifically, the camera is set to a flash mode, or a fill light is placed nearby that automatically turns on when weak light is detected. Therefore, the reference image corresponding to the light intensity can also be determined by detecting whether the flash is on.
[0037] Optionally, the target region image is classified based on an image classification algorithm to determine the target working state corresponding to the isolation switch module. The image classification algorithm includes at least one of Convolutional Neural Networks (CNN), Support Vector Machine (SVM) algorithm, K-Nearest Neighbor (KNN) algorithm, Back Propagation Neural Network (BPNN) algorithm, and Transfer Learning.
[0038] Specifically, images of disconnector modules in various working states are used as samples, and the working states of the disconnector modules are used as labels to train a neural network, resulting in a trained image classification model. The target region image is then input into the trained image classification model to extract and classify features, thereby obtaining the working state of the disconnector module in the target region image. Finally, the target difference matrix between the target region image and the reference image corresponding to the target working state is determined based on the image difference algorithm.
[0039] The image difference algorithm includes at least one of histogram, mean squared error, structural similarity index (SSIM), peak signal-to-noise ratio (PSNR), histogram comparison, and perceptual hash (PHash). For example, based on the histogram, the image difference is determined by performing grayscale processing on the target region image to obtain a grayscale image of the target region; determining the reference grayscale histogram corresponding to the reference grayscale image, and determining the target grayscale histogram corresponding to the target region image; and determining the difference between the target region image and the reference image corresponding to the target working state based on the histogram comparison algorithm to obtain the target difference matrix. The histogram comparison algorithm includes at least one of correlation comparison, chi-square comparison, cross-multiplication, and Bhattacharyya distance.
[0040] In one specific embodiment, determining the target operating state corresponding to the disconnect switch module and determining the target difference matrix corresponding to the target operating state includes: performing character recognition on the target area image to obtain the disconnect switch marker character of the disconnect switch module; determining the target operating state of the disconnect switch module in the target area image based on the disconnect switch marker character, wherein the disconnect switch marker character includes a disconnect switch position indicator character; obtaining a reference image corresponding to the target operating state; determining a reference difference matrix between the target area image and the reference image; and using the reference difference matrix as the target difference matrix corresponding to the target operating state.
[0041] The disconnect switch marking characters are used to determine the working status of the disconnect switch module.
[0042] The reference difference matrix is used to represent the difference between the target region image and the reference image.
[0043] Optionally, the disconnect switch marking characters can be set near the disconnect switch module, and can be "0" and "1".
[0044] Optionally, the disconnector marking character can be a disconnector position indicator character used to indicate the position of the disconnector. In one embodiment, the disconnector marking character is set on the disconnector position indicator plate.
[0045] Optionally, the target area image may also include only the isolation switch marker character.
[0046] For example, during the opening and closing of the disconnect switch, a label is installed at the associated structure of the disconnect switch's mechanical structure. This label displays a disconnect switch marking character, with a corresponding marking character assigned to each operating state. When the disconnect switch is in the open position, the label at this associated structure displays the disconnect switch marking character "Open"; when the disconnect switch is in the closed position, the label displays the disconnect switch marking character "Closed".
[0047] Optionally, a character recognition algorithm is used to perform character recognition on the target region image to obtain the isolation switch marker character of the isolation switch module. The character recognition algorithm includes at least one of the following: Convolutional Recurrent Neural Network (CRNN), An Attentional Scene Text Recognizer with Flexible Rectification (ASTER), Spatial Transformer Networks Optical Character Recognition (STN-OCR), Fast Oriented Text Spotting With a Unified Network (FOTS), Adaptive Bezier Curve Network (ABCnet), and Multi-Object Rectified Attention Network (MORAN). The advantage of this approach is that the target operating state corresponding to the isolation switch module can be quickly determined based on the character recognition algorithm, further improving the speed of dirt detection.
[0048] Optionally, the similarity between the target region image and the reference image can be determined based on an image similarity algorithm, then the image difference can be determined based on the image similarity, and finally the difference matrix between the target region image and the reference image can be determined based on the image difference.
[0049] Specifically, disconnect switch marker characters are pre-set near the disconnect switch module. A character recognition algorithm is used to recognize characters in the target area image to obtain the disconnect switch marker characters of the disconnect switch module. Based on the correspondence between the disconnect switch marker characters and the working state, the working state corresponding to the disconnect switch marker characters is determined, thus obtaining the target working state of the disconnect switch module in the target area image. Based on the target working state of the disconnect switch module in the target area image, a reference image corresponding to the same working state is determined. The difference matrix between the target area image and the reference image is determined to obtain the reference difference matrix. This reference difference matrix is used as the target difference matrix corresponding to the target working state of the disconnect switch module in the target area image.
[0050] For example, a target difference matrix (A) corresponding to the position of the disconnector is as follows:
[0051]
[0052] A target difference matrix (B) corresponding to the closed position of the disconnect switch is as follows:
[0053]
[0054] S130. Determine the dirt status of the target imaging device based on the target difference matrix.
[0055] Understandably, when the camera is dirty, the difference between the target area image and the reference image corresponding to the target's working state is large, and the value in the target difference matrix is also large. Therefore, a preset dirt threshold can be set. When there is at least one value in the target difference matrix that is greater than the preset dirt threshold, the target shooting device is determined to be dirty. When there is no value in the target difference matrix that is greater than or equal to the preset dirt threshold, the target shooting device is determined to be not dirty.
[0056] Furthermore, if the target difference matrix contains at least one value greater than the preset dirt threshold, it could also be another object (e.g., a flying insect / person) that the camera just happened to capture passing by the power equipment. Therefore, to eliminate false detections caused by this situation, it is necessary to acquire images captured after the device image. If the difference matrix of the images captured after the device image also contains at least one value greater than the preset dirt threshold, the target imaging device is determined to be dirty. If the target difference matrix does not contain any value greater than or equal to the preset dirt threshold, the target imaging device is determined to be dirty. In this embodiment of the invention, optionally, if the difference matrix of a first set number of images captured after the device image contains at least one value greater than the preset dirt threshold for more than a second set number (the second set number is less than the first set number), the target imaging device is determined to be dirty. The advantage of this is that the dirt status can be determined simply and quickly, achieving real-time detection of the dirt status.
[0057] In one specific embodiment, determining the dirt status of the target imaging device based on the target difference matrix includes: identifying one or more pixel difference values with larger values from multiple pixel difference values in the target difference matrix as center difference values; for each center difference value, determining the range of the detection matrix corresponding to the target difference value; identifying pixel difference values greater than a preset value within the detection matrix range as target difference values; and determining the dispersion corresponding to the target difference value; if the dispersion exceeds a set dispersion range, identifying the target pixel corresponding to the target difference value as a dirty pixel; determining the image region corresponding to the dirty pixel to obtain at least one dirty region image; and if the area of at least one dirty region image exceeds a set area range, determining that the target imaging device is dirty.
[0058] Each value in the target difference matrix corresponds to a pixel difference.
[0059] The center difference is determined based on the pixel difference values in the target difference matrix.
[0060] The range of the matrix to be detected is determined based on the center difference, and is a range that includes the differences of multiple pixels.
[0061] The target difference is determined based on the numerical value of the difference between pixels within the range of the detection matrix.
[0062] Discreteness is used to determine the degree of dispersion of pixel differences within the range of the matrix to be detected.
[0063] Dirty pixels are used to represent pixels in a device image or target area image that correspond to dirt spots on the target imaging device.
[0064] Optionally, the centrality can be determined by comparing the values in the target dissimilarity matrix and obtaining a preset number of larger values as the centrality.
[0065] Optionally, determine the largest value in the target difference matrix to obtain a central difference; determine the largest value among the remaining values in the target difference matrix to obtain a second central difference; that is, determine the largest value among the differences of other pixels in the target difference matrix besides the central difference, and use it as the central difference, until a preset number of central differences are obtained.
[0066] Optionally, the values in the target difference matrix are compared with a preset pixel difference threshold, and the pixel differences that are greater than the preset pixel difference threshold are all taken as the center difference.
[0067] Furthermore, the preset pixel difference threshold can be determined based on the value in the target difference matrix. The preset pixel difference threshold can be adjusted based on the maximum value in the target difference matrix so that the preset pixel difference threshold is less than the maximum value in the target difference matrix, thus avoiding the situation where the preset pixel difference threshold is greater than the maximum value in the target difference matrix.
[0068] Optionally, the pixel differences in the target difference matrix are sorted from largest to smallest to obtain a pixel difference ranking result. Based on the pixel difference ranking result, one or more pixel differences are determined from front to back as the center difference. For example, based on the pixel difference ranking result, the top 10 pixel differences in the ranking result are determined as the center difference.
[0069] Optionally, a defined region is determined based on the central difference, including the central difference and the pixel differences surrounding it. In the target difference matrix, the pixel differences corresponding to this defined region serve as the range of the detection matrix. This defined region can be a regular or irregular region. Optionally, the range of the detection matrix can be the neighborhood (4-neighborhood or 8-neighborhood) of the central difference in the target difference matrix, or a circular region centered on the central difference.
[0070] Optionally, the numerical values of the difference between all pixels within the range of the detection matrix are determined, and those values greater than a preset value are taken as the target difference. Furthermore, the preset value can also be adjusted based on the values in the target difference matrix; for example, it can be adjusted based on a preset pixel difference threshold.
[0071] Optionally, the dispersion is the degree of dispersion of pixel difference values within the range of the detection matrix corresponding to the target difference matrix.
[0072] Optionally, determining the dispersion corresponding to the target difference includes: determining it through at least one of the quantile difference, variance, standard deviation, and dispersion coefficient of the difference values of all pixels in the range to be detected. Optionally, if the dispersion corresponding to the target difference exceeds the set dispersion range, all pixels in the range to be detected corresponding to the target difference are regarded as dirty pixels.
[0073] Optionally, if the dispersion corresponding to the target difference is greater than the set dispersion threshold, all pixels in the range of the matrix to be detected corresponding to the target difference are regarded as dirty pixels.
[0074] Optionally, the image region corresponding to all dirty pixels in the target region image is determined to obtain the dirty region image.
[0075] Optionally, a connected component containing dirty pixels is determined in the target region image, and the image region corresponding to the connected component is taken as the dirty region image.
[0076] In some embodiments, the area of the dirty region and the degree of dirtiness may be positively correlated in some scenarios. Therefore, a set area range is set. When the area of the dirty region image exceeds the set area range, the target shooting device is determined to be dirty. When the area of the dirty region image is less than or equal to the set area range, the target shooting device is determined to be not dirty.
[0077] Optionally, the area and value of all dirty area images are determined. When the area and value of all dirty area images exceed a set area range, the target imaging device is determined to be dirty. When the area and value of all dirty area images are less than or equal to the set area range, the target imaging device is determined to be dirty.
[0078] For example, the range of the detection matrix is a circular area with a set radius centered on the center difference degree. For the target difference degree matrix (B) corresponding to the knife switch closing position in formula (2), the value of one of the center difference degrees is determined to be 12, and a circular area with a set radius centered on the center difference degree is determined to obtain the range of the detection matrix; for each center difference degree in the target difference degree matrix, based on the preset size of the range of the detection matrix, the difference degree of all pixels within the range of the detection matrix that are greater than the preset value is determined with the center difference degree as the center, to obtain the target difference degree; when the number of target difference degrees exceeds the set number, the standard deviation of the difference degree of all pixels within the range of the detection matrix is determined, and if the standard deviation exceeds the set standard deviation range, the target pixel corresponding to the target difference degree is taken as a dirty pixel; the image area corresponding to the dirty pixel is determined to obtain at least one dirty area image; if the area of at least one dirty area image exceeds the set area range, the dirty state of the target imaging device is determined to be dirty.
[0079] The technical solution of this embodiment performs character recognition on the target area image to obtain the disconnect switch marking character of the disconnect switch module. Based on the disconnect switch marking character, the target working state of the disconnect switch module in the target area image is determined, which reduces the amount of data in the reference difference matrix, speeds up the determination of the target working state, and further speeds up the detection of dirt.
[0080] Figure 2 This is a flowchart of another dirt detection method for an imaging device according to an embodiment of the present invention. This embodiment can be applied to scenarios where dirt detection is performed based on device images. This embodiment and the dirt detection method for the imaging device in the above embodiment belong to the same inventive concept. Based on the above embodiment, the process of determining the target working state corresponding to the isolating switch module and determining the target difference matrix corresponding to the target working state is further described.
[0081] like Figure 2 As shown, the dirt detection method of the imaging device includes:
[0082] S210. Obtain the equipment image of the power equipment captured by the target imaging device, and determine the target area image in the equipment image, wherein the target area image includes the disconnecting switch module of the power equipment.
[0083] S220. Obtain the reference image corresponding to each reference working state of the disconnecting switch module, and determine the reference difference matrix between the target area image and the reference image for each reference working state.
[0084] Understandably, in order to determine the operating state of the disconnector module, a corresponding reference image is set for each reference operating state. Specifically, a reference image set is pre-set, which includes reference images corresponding to all reference operating states; the reference image corresponding to each reference operating state in the reference image set is obtained; and for each reference operating state, a reference difference matrix between the target area image and the reference image is determined.
[0085] For example, the open position of the disconnect switch corresponds to the open state, and the closed position of the disconnect switch corresponds to the closed state. A corresponding reference image is set for each open and closed state, forming a reference image set. The reference image corresponding to the open position of the disconnect switch and the reference image corresponding to the closed position of the disconnect switch are obtained from the reference image set. Based on the image similarity algorithm, the difference matrix between the target area image and the reference image corresponding to the open position of the disconnect switch is determined to obtain the position difference matrix. The difference matrix between the target area image and the reference image corresponding to the closed position of the disconnect switch is determined to obtain the closed position difference matrix.
[0086] S230. Determine the target operating state of the disconnecting switch module based on the reference difference matrix, and use the reference difference matrix corresponding to the target operating state as the target difference matrix corresponding to the target operating state.
[0087] Specifically, for each reference difference matrix, the dispersion of all values in the reference difference matrix is determined to obtain the matrix dispersion; the working state of the reference image corresponding to the reference difference matrix corresponding to the minimum value of the matrix dispersion is determined to obtain the target working state of the isolation switch module in the target area image; the reference difference matrix with the minimum dispersion is used as the target difference matrix corresponding to the target working state.
[0088] For example, the range of all values in the alignment difference matrix between the target area image and the reference image corresponding to the closed position of the disconnector is determined to obtain the alignment range value; the range of all values in the quantile difference matrix between the target area image and the reference image corresponding to the open position of the disconnector is determined to obtain the quantile range value; if the alignment range value is less than the quantile range value, the target operating state of the disconnector is determined to be the closed position, and the alignment difference matrix between the target area image and the reference image corresponding to the closed position of the disconnector is used as the target difference matrix corresponding to the target operating state; if the alignment range value is greater than the quantile range value, the target operating state of the disconnector is determined to be the open position, and the quantile difference matrix between the target area image and the reference image corresponding to the open position of the disconnector is used as the target difference matrix corresponding to the target operating state. Further, if the alignment range value is equal to the quantile range value, a further judgment is made based on the standard deviation and / or the mean deviation.
[0089] In one specific embodiment, determining the target operating state of the disconnecting switch module based on the reference difference matrix includes: determining the standard deviation of all differences in each reference difference matrix, and taking the reference operating state corresponding to the minimum value of the standard deviation as the target operating state of the disconnecting switch module.
[0090] Specifically, for each reference difference matrix, the standard deviation of all values in the reference difference matrix is determined, resulting in the standard deviation corresponding to each reference difference matrix. The minimum value among all standard deviations is then determined, and the reference working state corresponding to the reference image of the reference difference matrix corresponding to this minimum value is identified. This reference working state is then used as the target working state of the isolation switch module. The advantage of this approach is that it reduces the complexity of the image difference algorithm, decreases the amount of data required for dirt detection, and further accelerates the dirt detection process.
[0091] For example, the standard deviation of all values in the position difference matrix between the target area image and the reference image corresponding to the closed position of the disconnector is determined to obtain the position standard deviation; the standard deviation of all values in the quantile difference matrix between the target area image and the reference image corresponding to the open position of the disconnector is determined to obtain the quantile standard deviation; if the quantile standard deviation is less than the position standard deviation, the reference working state corresponding to the reference image corresponding to the reference difference matrix corresponding to the quantile standard deviation is determined to obtain the quantile state, and the quantile state is used as the working state of the disconnector; if the position standard deviation is less than the quantile standard deviation, the reference working state corresponding to the reference image corresponding to the reference difference matrix corresponding to the position standard deviation is determined to obtain the position state, and the position state is used as the working state of the disconnector.
[0092] In one specific embodiment, determining the reference difference matrix between the target region image and the reference image includes: determining the target pixel in the target region image and determining the reference pixel in the reference image that is located at the same position as the target pixel; and determining the reference difference matrix between the target region image and the reference image based on the pixel values of the target pixel and the reference pixel.
[0093] Specifically, each pixel in the target region image is designated as the target pixel; for each target pixel in the target region image, a pixel in the reference image located at the same position is identified as the reference pixel; the pixel difference is determined based on the pixel values of the target pixel and the reference pixel; the pixel difference is then arranged according to the position of its corresponding target pixel in the target region image to obtain a reference difference matrix between the target region image and the reference image. The advantage of this approach is that it enables pixel-level difference determination, further improving the accuracy of dirt detection.
[0094] Optionally, the pixel differences can be arranged in a row / column according to the position of the corresponding target pixel in the target region image, in a row-first-column-second order, to obtain a reference difference matrix with 1 row / column.
[0095] In a specific embodiment, determining the reference difference matrix between the target region image and the reference image based on the pixel values of the target pixel and the reference pixel includes: for each color channel of the target region image and the reference image, determining the difference between the channel pixel values of the target pixel and the reference pixel as the single-channel difference corresponding to the target pixel; for each target pixel, determining the average value of the single-channel differences corresponding to all color channels, and using the average value as the pixel difference between the target pixel and the reference pixel; and constructing the reference difference matrix between the target region image and the reference image based on the pixel difference and the position of the target pixel corresponding to the pixel difference.
[0096] Here, color channels refer to the color channels corresponding to a color image, including three color channels: red (R), green (G), and blue (B). Optionally, for each target pixel, the average value of the single-channel differences of the three color channels is determined, and this average value is used as the pixel difference between the target pixel and the reference pixel.
[0097] Optionally, for each target pixel, the root mean square average / geometric mean of the single-channel differences of the three color channels is determined as the pixel difference between the target pixel and the reference pixel.
[0098] Specifically, both the target region image and the reference image include three color channels: red (R), green (G), and blue (B). The target channel pixel value for each target pixel is determined in each color channel, and the reference channel pixel value for each reference pixel is determined in each color channel. For each color channel, the difference between the target channel pixel value and the reference channel pixel value is determined as the single-channel difference corresponding to the target pixel. The pixel differences are arranged according to the position of their corresponding target pixels in the target region image (or according to the position of their corresponding reference pixels in the reference image), resulting in a reference difference matrix between the target region image and the reference image. The advantage of this approach is that determining pixel differences based on color information improves the accuracy of the reference difference matrix, further enhancing the accuracy of dirt detection and the identification of the working status of the disconnect switch module.
[0099] S240. Determine the dirt status of the target imaging device based on the target difference matrix.
[0100] The technical solution of this embodiment determines the target working state of the disconnector module based on a reference image, and at the same time determines the dirt status based on pixel differences, which can achieve pixel-level dirt detection and improve the accuracy of dirt detection; while identifying the working state of the disconnector module during dirt detection, the efficiency of substation management is improved and the speed of dirt detection is further improved.
[0101] Figure 3 This is a structural block diagram of a dirt detection device for an imaging apparatus according to an embodiment of the present invention. This embodiment is applicable to scenarios where dirt detection is performed based on device images. The device can be implemented in hardware and / or software and integrated into the processor of an electronic device with application development capabilities.
[0102] like Figure 3 As shown, the dirt detection device of the imaging device includes: a target area image determination module 301, a target difference matrix determination module 302, and a dirt status determination module 303.
[0103] The system includes a target area image determination module 301, which acquires an image of the power equipment captured by the target imaging device and determines the target area image within that image. The target area image includes the disconnecting switch module of the power equipment, and the disconnecting switch module includes a disconnecting switch mechanism. A target difference matrix determination module 302 determines the target operating state corresponding to the disconnecting switch module and determines the target difference matrix corresponding to that operating state. The operating state includes an on state and a off state. The target difference matrix is determined based on the target area image and a reference image corresponding to the target operating state. A dirt state determination module 303 determines the dirt state of the target imaging device based on the target difference matrix. This system solves the problems of low efficiency and poor timeliness in manually detecting dirt in imaging devices, improving the real-time performance and efficiency of dirt detection.
[0104] Optionally, the target difference matrix determination module 302 is used for:
[0105] Character recognition is performed on the target area image to obtain the disconnect switch marking characters of the disconnect switch module. The target working state of the disconnect switch module in the target area image is determined based on the disconnect switch marking characters. The disconnect switch marking characters include disconnect switch position indication characters.
[0106] Obtain a reference image corresponding to the target working state, determine the reference difference matrix between the target region image and the reference image, and use the reference difference matrix as the target difference matrix corresponding to the target working state.
[0107] Optionally, the target difference matrix determination module 302 is also used for:
[0108] Obtain the reference image corresponding to each reference working state of the disconnect switch module, and determine the reference difference matrix between the target area image and the reference image for each reference working state.
[0109] The target operating state of the disconnecting switch module is determined based on the reference difference matrix, and the reference difference matrix corresponding to the target operating state is used as the target difference matrix corresponding to the target operating state.
[0110] Optionally, the target difference matrix determination module 302 further includes a target operating state determination submodule, which is specifically used to: determine the standard deviation of all differences in each reference difference matrix, and take the reference operating state corresponding to the minimum value of the standard deviation as the target operating state of the disconnecting switch module.
[0111] Optionally, the target difference matrix determination module 302 further includes a reference difference matrix determination submodule, which is specifically used for:
[0112] Identify the target pixel in the target region image and identify the reference pixel in the reference image that is located at the same position as the target pixel;
[0113] The reference difference matrix between the target region image and the reference image is determined based on the pixel values of the target pixel and the reference pixel.
[0114] Optionally, the reference difference matrix determination submodule further includes a reference difference matrix determination unit, which is specifically used for:
[0115] For each color channel of the target region image and the reference image, the difference between the channel pixel values of the target pixel and the reference pixel is determined as the single-channel difference corresponding to the target pixel.
[0116] For each target pixel, determine the average value of the single-channel difference corresponding to all color channels, and use the average value as the pixel difference between the target pixel and the reference pixel.
[0117] Based on the pixel difference and the position of the target pixel corresponding to the pixel difference, a reference difference matrix is constructed between the target region image and the reference image.
[0118] Optionally, the dirt status determination module 303 is also used for:
[0119] One or more pixels with larger values are selected from the multiple pixel differences in the target difference matrix and used as the center difference.
[0120] For each center difference, determine the range of the detection matrix corresponding to the target difference, determine the pixel difference within the detection matrix range that is greater than a preset value as the target difference, and determine the dispersion corresponding to the target difference.
[0121] If the dispersion exceeds the set dispersion range, the target pixel corresponding to the target difference will be regarded as a dirty pixel.
[0122] Determine the image region corresponding to the dirty pixel to obtain at least one dirty region image;
[0123] If the area of at least one dirty region in the image exceeds a set area range, the target imaging device is determined to be dirty.
[0124] The dirt detection device of the shooting device provided in the embodiments of the present invention can execute the dirt detection method of the shooting device provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0125] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0126] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0127] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0128] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the dirt detection method of the imaging device.
[0129] In some embodiments, the dirt detection method of the imaging device can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the dirt detection method of the imaging device described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the dirt detection method of the imaging device by any other suitable means (e.g., by means of firmware).
[0130] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0131] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0132] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0133] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0134] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0135] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0136] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0137] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for detecting dirt on a photographing device, characterized in that, include: Acquire equipment images of power equipment captured by the target imaging device, and determine the target area image in the equipment image, wherein the target area image includes the disconnecting switch module of the power equipment, and the disconnecting switch module includes a disconnecting switch mechanism; Determine the target operating state corresponding to the isolating switch module, and determine the target difference matrix corresponding to the target operating state, wherein the operating state includes an on state and an off state, and the target difference matrix is determined based on the target region image and a reference image corresponding to the target operating state; Determining the dirt status of the target imaging device based on the target difference matrix includes: One or more pixel differences with larger values are determined from the multiple pixel differences in the target difference matrix and used as the center difference. For each center difference, a set region is determined that includes the center difference and the differences of pixels around the center difference. In the target difference matrix, the pixel differences corresponding to the set region are taken as the range of the matrix to be detected. The pixel differences within the range of the matrix to be detected that are greater than a preset value are taken as the target difference. And the dispersion corresponding to the target difference is determined. If the dispersion exceeds the set dispersion range, the target pixel corresponding to the target difference is regarded as a dirty pixel. Determine the image region corresponding to the dirty pixel to obtain at least one dirty region image; If the area of at least one dirty area in the image exceeds a set area range, the target imaging device is determined to be dirty.
2. The method according to claim 1, characterized in that, The step of determining the target operating state corresponding to the disconnecting switch module and determining the target difference matrix corresponding to the target operating state includes: Character recognition is performed on the target area image to obtain the disconnect switch marking character of the disconnect switch module. The target working state of the disconnect switch module in the target area image is determined based on the disconnect switch marking character. The disconnect switch marking character includes a disconnect switch position indicator character. Obtain a reference image corresponding to the target working state, determine a reference difference matrix between the target region image and the reference image, and use the reference difference matrix as the target difference matrix corresponding to the target working state.
3. The method according to claim 1, characterized in that, The step of determining the target operating state corresponding to the disconnecting switch module and determining the target difference matrix corresponding to the target operating state includes: Obtain a reference image corresponding to each reference operating state of the disconnect switch module, and for each reference image corresponding to the reference operating state, determine a reference difference matrix between the target region image and the reference image; The target operating state of the disconnecting switch module is determined based on the reference difference matrix, and the reference difference matrix corresponding to the target operating state is used as the target difference matrix corresponding to the target operating state.
4. The method according to claim 3, characterized in that, Determining the target operating state of the disconnector module based on the reference difference matrix includes: The standard deviation of all differences in each of the reference difference matrices is determined, and the reference operating state corresponding to the minimum value of the standard deviation is taken as the target operating state of the disconnecting switch module.
5. The method according to claim 2 or 3, characterized in that, Determining the reference difference matrix between the target region image and the reference image includes: Determine the target pixel in the target region image, and determine the reference pixel in the reference image that is located at the same position as the target pixel; A reference difference matrix between the target region image and the reference image is determined based on the pixel values of the target pixel and the reference pixel.
6. The method according to claim 5, characterized in that, Determining the reference difference matrix between the target region image and the reference image based on the pixel values of the target pixel and the reference pixel includes: For each color channel of the target region image and the reference image, the difference between the channel pixel values of the target pixel and the reference pixel is determined as the single-channel difference corresponding to the target pixel. For each target pixel, the average value of the single-channel difference corresponding to all color channels is determined, and the average value is used as the pixel difference degree between the target pixel and the reference pixel. Based on the pixel difference and the position of the target pixel corresponding to the pixel difference, a reference difference matrix is constructed between the target region image and the reference image.
7. A dirt detection device for a photographing apparatus, characterized in that, include: The target area image determination module is used to acquire equipment images of power equipment captured by the target imaging device, and determine the target area image in the equipment image, wherein the target area image includes the disconnecting switch module of the power equipment, and the disconnecting switch module includes a disconnecting switch mechanism; The target difference matrix determination module is used to determine the target operating state corresponding to the disconnecting switch module and to determine the target difference matrix corresponding to the target operating state. The operating state includes an on state and a off state. The target difference matrix is determined based on the target area image and a reference image corresponding to the target operating state. A dirt / contamination determination module is used to determine the dirt / contamination status of the target imaging device based on the target difference matrix. The dirt status determination module is specifically used for: One or more pixel differences with larger values are determined from the multiple pixel differences in the target difference matrix and used as the center difference. For each center difference, a set region is determined that includes the center difference and the differences of pixels around the center difference. In the target difference matrix, the pixel differences corresponding to the set region are taken as the range of the matrix to be detected. The pixel differences within the range of the matrix to be detected that are greater than a preset value are taken as the target difference. And the dispersion corresponding to the target difference is determined. If the dispersion exceeds the set dispersion range, the target pixel corresponding to the target difference is regarded as a dirty pixel. Determine the image region corresponding to the dirty pixel to obtain at least one dirty region image; If the area of at least one dirty area in the image exceeds a set area range, the target imaging device is determined to be dirty.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the dirt detection method of the imaging device according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the dirt detection method of the imaging device according to any one of claims 1-6.