A method for judging the brightness of indicator lights in a distribution room without parameterization

By adaptively determining the threshold T with the brightness value of the entire indicator image and the brightness value of all indicator lights, the problem of misjudgment caused by lighting changes in the prior art is solved, and the accuracy and stability of the light light judgment are improved.

CN114186895BActive Publication Date: 2025-07-01GUANGDONG KEYSTAR INTELLIGENCE ROBOT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111558185.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-07-01
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

The existing method of judging lights on and off is easy to misjudgment in a light change environment, lacks accuracy and stability, and requires manual setting of threshold T, which cannot adapt to external light changes.

Method used

By combining the brightness value of the entire indicator light picture and the brightness value of all indicator lights, the threshold value T is adaptively determined for judging the lights to be turned off, and the brightness value relationship between adjacent indicator lights is used to avoid manually setting the threshold.

Benefits of technology

It significantly improves the accuracy and robustness of the light-off judgment in the light-changing environment, adapts to the light-changing scene, ensures the accuracy and stability of the light-changing judgment in the light-dynamic judgment, and meets the identification performance requirements of the distribution room inspection machine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114186895B_ABST
    Figure CN114186895B_ABST
Patent Text Reader

Abstract

A method for judging the brightness and darkness of indicator lights in a distribution room without parameterization, including step A: obtaining pictures of indicator lights; step B: training an indicator light detection model based on the pictures of indicator lights; step C: graying the picture of the indicator light to be detected and obtaining the average brightness value of the picture of the indicator light to be detected; step D: inputting the picture of the indicator light to be detected into the indicator light detection model to obtain all single indicator lights and cropping out all single indicator light pictures; step E: sequentially obtaining the brightness values of the grayscale pictures of all single indicator light pictures and the brightness value of the entire picture of the indicator light to be detected; step F: obtaining the brightness and darkness threshold; step G: comparing the brightness value of the grayscale picture of the single indicator light picture with the brightness and darkness threshold to judge the brightness and darkness state of the indicator light. The present invention adaptively determines the brightness and darkness threshold by using the brightness values of the entire picture of the indicator light and each indicator light, without the need for manual setting, ensuring the accuracy of judging the brightness and darkness of the indicator light in the scene of light change.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of indicator light detection, and particularly to a method for judging the brightness and dimness of indicator lights in a distribution room without parameterization. Background Art

[0002] Indicator lights are a common type of equipment in power grid distribution rooms. Staff can quickly judge whether the working state of the instrument equipment associated with the indicator lights is normal based on the brightness and dimness of the indicator lights. With the rapid development of smart grids, distribution room inspection robots based on computer vision technology have gradually replaced manual daily inspection and maintenance of distribution rooms, and at the same time, a large number of image processing technologies are also used to achieve the detection, identification, and judgment of various instrument equipment.

[0003] As an essential indicating device in the distribution room, there are currently many mature methods to accurately judge its brightness and dimness. The most common method is to first detect a single indicator light, then grayscale and binarize the image of the single indicator light, and finally count the number of pixels N with a brightness value of 255 in the binarized image. Finally, the brightness and dimness of the indicator light are judged by comparing the value of N with a fixed threshold T.

[0004] There are generally two deficiencies in the existing methods for judging the brightness and dimness of indicator lights: First, only based on the pixel value of each individual indicator light as the basis for judging its brightness and dimness, ignoring the reference value of the brightness values of other adjacent indicator lights; Second, it is necessary to manually set the threshold T for judging the brightness and dimness of the indicator light, and this threshold T cannot be adaptively updated with the change of external light. Due to the above two deficiencies, the existing methods for judging the brightness and dimness of indicator lights are prone to misjudgment due to light changes, lacking the accuracy and stability of judgment. Summary of the Invention

[0005] The purpose of the present invention is to propose a method for judging the brightness and dimness of indicator lights in a distribution room without parameterization in view of the defects in the background art. The present invention adaptively determines the threshold T for judging the on and off of the indicator light by combining the brightness value of the entire indicator light image and the brightness values of all indicator lights in the image, and solves the problem that the threshold T for judging the brightness and dimness of the indicator light is manually set and cannot be adaptively updated with the change of external light.

[0006] While considering the external light, the present invention also utilizes the relationship between the brightness values of adjacent indicator lights without manually setting the threshold T, significantly improving the accuracy and robustness of judging the on and off of the indicator light in an environment with light changes, having better adaptability to light-changing scenarios, ensuring the accuracy and stability of judging the brightness and dimness of the indicator light, and being able to meet the recognition performance requirements of distribution room inspection machines.

[0007] To achieve this purpose, the present invention adopts the following technical solutions:

[0008] A method for judging the brightness and darkness of indicator lights in a distribution room without parameterization, comprising the following steps:

[0009] Step A: Obtain all indicator light pictures taken by the robot;

[0010] Step B: Train an indicator light detection model based on all the taken indicator light pictures;

[0011] Step C: Grayscale the picture of the indicator light to be detected, and obtain the average brightness value of the picture of the indicator light to be detected;

[0012] Step D: Input the picture of the indicator light to be detected into the indicator light detection model to detect all the indicator lights in the picture of the indicator light to be detected, and crop out all single indicator light pictures from the indicator light picture according to the detected position rectangular frame;

[0013] Step E: Sequentially obtain the brightness values of the grayscale pictures of all single indicator light pictures and the brightness value of the entire picture of the indicator light to be detected;

[0014] Step F: Obtain the brightness and darkness threshold according to the brightness values of the grayscale pictures of all single indicator light pictures obtained in Step D and the brightness value of the entire picture of the indicator light to be detected;

[0015] Step G: Compare the brightness value of the grayscale picture of the single indicator light picture with the brightness and darkness threshold to judge the brightness and darkness state of the indicator light.

[0016] Preferably, in Step B, training an indicator light detection model based on all the taken indicator light pictures includes the following steps:

[0017] Step B1: Obtain all indicator light pictures taken by the robot under different illuminations and angles;

[0018] Step B2: Mark the position and type name of each indicator light in each indicator light picture;

[0019] Step B3: Save the annotation result information of each indicator light picture into the annotation file corresponding to the indicator light picture, and establish a training data set containing all indicator light pictures and all annotation files;

[0020] Step B4: Input the training data set into the training network;

[0021] Step B5: Set the parameters of the training network;

[0022] Step B6: Use the training network to train the training data set to obtain an indicator light detection model.

[0023] Preferably, in the step B2, the positions and type names of each indicator light in each indicator light picture are marked, including:

[0024] When marking each indicator light picture, the detection position rectangle of each indicator light is represented by four coordinate values (x1, y1, x2, y2, label);

[0025] Among them:

[0026] x1 represents the abscissa of the upper left vertex of the detection position rectangle;

[0027] y1 represents the ordinate of the upper left vertex of the detection position rectangle;

[0028] x2 represents the abscissa of the upper right vertex of the detection position rectangle;

[0029] y2 represents the ordinate of the upper right vertex of the detection position rectangle;

[0030] label represents the type name of each indicator light, and label is uniformly set to "light".

[0031] Preferably, in the step B4, the training data set is divided into training data and test data according to a preset rule and input into the training network.

[0032] Preferably, in the step B5, parameter settings are performed on the training network, including:

[0033] The input size of the training network is set to 192x256;

[0034] The number of batch training samples batch is set to 128;

[0035] The learning rate l_rate is set to 0.024;

[0036] The value of the number of detection classes classes in the two yolo layers is set to 1, and the number of convolution kernels filters in the corresponding layer is set to 18.

[0037] Preferably, in the step B6, the training data set is trained using the training network to obtain an indicator light detection model, including:

[0038] The training data set is trained using the training network until the change value of the loss function value of the training network is within a preset interval, and the intermediate weight model at this time is saved as the indicator light detection model.

[0039] Preferably, in the step C, the picture of the indicator light to be detected is grayscaled, and the average brightness value of the picture of the indicator light to be detected is obtained, including obtaining the average brightness value according to Formula 1;

[0040]

[0041] Among them:

[0042] I represents the average brightness value;

[0043] H represents the height of the indicator light picture to be detected;

[0044] W represents the width of the indicator light picture to be detected;

[0045] g(r, c) represents the pixel gray value at the position of the r-th row and c-th column of the indicator light picture to be detected.

[0046] Preferably, in the step E, before obtaining the brightness values of the grayscale images of all single indicator light pictures in sequence, the widths and heights of all single indicator light pictures are set in pixels, and after the pixel setting, grayscale processing is performed to obtain the grayscale images of all single indicator light pictures;

[0047] In the step E, it includes obtaining the brightness values of the grayscale images of all indicator light pictures and the brightness value of the entire indicator light picture to be detected according to Formula 1 in sequence.

[0048] Preferably, in the step F, it includes obtaining the bright-dark threshold according to Formula 2;

[0049]

[0050] Among them:

[0051] T represents the bright-dark threshold;

[0052] λ represents the weight control coefficient;

[0053] I represents the average brightness value of the entire indicator light picture to be detected;

[0054] N represents the total number of single indicator lights detected in the indicator light picture to be detected;

[0055] L i represents the brightness value of the i-th indicator light.

[0056] Preferably, in the step G, judging the bright-dark state of the indicator light includes:

[0057] Comparing the brightness value of a single indicator light with the bright-dark threshold. If the brightness value of a single indicator light is greater than the bright-dark threshold, it is judged that the indicator light is in a bright state; if the brightness value of a single indicator light is less than or equal to the bright-dark threshold, it is judged that the indicator light is in a dark state.

[0058] The beneficial effects produced by the technical solution of this application:

[0059] 1. The present invention adaptively determines the threshold T for judging the on / off state of the indicator lights by combining the brightness value of the entire indicator light picture and the brightness values of all the indicator lights in the picture, solving the problem that the threshold T set manually for judging the brightness of the indicator lights cannot be adaptively updated with the change of the external light.

[0060] 2. While considering the external light, the present invention also utilizes the relationship of the brightness values between adjacent indicator lights, without the need for manual setting of the threshold T, significantly improving the accuracy and robustness of the on / off judgment of the indicator lights in an environment with changing light, having better adaptability to the scene of changing light, ensuring the accuracy and stability of the on / off judgment of the indicator lights, and being able to meet the recognition performance requirements of the power distribution room inspection robot. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 is a flowchart of a parameter-free method for judging the on / off state of the indicator lights in the power distribution room according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0062] The technical solution of the present invention will be further described below with reference to the drawings and through specific embodiments.

[0063] During the operation of the power distribution room robot, the robot basically relies on its own supplementary light to take supplementary light photos in the dark environment. Therefore, due to reasons such as the size of the supplementary light value, the supplementary light angle, and the shooting angle, there are large changes in the light on the indicator light picture, and some indicator lights even have a reflective situation, resulting in two deficiencies in the existing method for judging the on / off state of the indicator lights: First, only based on the pixel value size of each individual indicator light as the basis for judging its on / off state, ignoring the reference value of the brightness values of other adjacent indicator lights; Second, it is necessary to set the threshold T for judging the on / off state of the indicator lights manually, and this threshold T cannot be adaptively updated with the change of the external light. Due to the above two deficiencies, the existing method for judging the on / off state of the indicator lights is prone to misjudgment due to the change of light, lacking the accuracy and stability of the judgment.

[0064] To solve the above problems, the present application proposes a parameter-free method for judging the on / off state of the indicator lights in the power distribution room, as Figure 1 shown, including the following steps:

[0065] Step A: Obtain all the indicator light pictures taken by the robot;

[0066] In this embodiment, all the indicator light pictures are taken according to the camera carried by the power distribution room robot, and the width and height of all the indicator light pictures are set in pixels. For example, the width of the indicator light picture is set to 400 pixels, and the height is set to 200 pixels.

[0067] Step B: Train an indicator light detection model based on all the captured indicator light pictures;

[0068] To ensure the accuracy and stability of the indicator light detection, this application trains an indicator light detection model using all the indicator light pictures. The process of obtaining the indicator light detection model includes:

[0069] Step B1: Obtain all the indicator light pictures captured by the robot under different illuminations and angles;

[0070] In this embodiment, the 3000 indicator light pictures collected by the power distribution room robot include various illuminations and angles;

[0071] Step B2: Mark the position and type name of each indicator light in each indicator light picture;

[0072] Preferably, in the step B2, marking the position and type name of each indicator light in each indicator light picture includes:

[0073] When marking each indicator light picture, the position is represented by four coordinate values for the detection position rectangle of each indicator light (x1, y1, x2, y2, label);

[0074] Where:

[0075] x1 represents the abscissa of the upper left vertex of the detection position rectangle;

[0076] y1 represents the ordinate of the upper left vertex of the detection position rectangle;

[0077] x2 represents the abscissa of the upper right vertex of the detection position rectangle;

[0078] y2 represents the ordinate of the upper right vertex of the detection position rectangle;

[0079] label represents the type name of each indicator light, and label is uniformly set to "light".

[0080] In this embodiment, it includes using a third-party annotation software LabelImage to mark the position and type name of each indicator light in each indicator light picture, and the position during annotation is represented by a position rectangle (x1, y1, x2, y2, label) with four coordinate values.

[0081] Step B3: Save the annotation result information of each indicator light picture into the annotation file corresponding to that picture, and establish a training data set containing all the indicator light pictures and all the annotation files;

[0082] In this embodiment, the annotation result information in step B2 is saved in an xml annotation file corresponding to each picture, and finally a training data set including 3000 indicator light pictures and 3000 xml standard files is established.

[0083] Step B4: Input the training data set into the training network;

[0084] Preferably, in step B4, the training data set is divided into training data and test data according to a preset rule and input into the training network.

[0085] In this embodiment, before executing step B4, it also includes configuring the training and test environments on the training server, copying 3000 xml annotation files to the newly created Annotations folder; similarly, copying 3000 indicator light pictures to the newly created JPEGImages folder;

[0086] Further, the training data set is divided into training data and test data according to the rule of 9:1, that is, the training data accounts for 2700 pictures and the test data accounts for 300 pictures.

[0087] Step B5: Set parameters for the training network;

[0088] Preferably, in step B5, setting parameters for the training network includes:

[0089] Set the input size of the training network to 192x256;

[0090] Set the number of batch training samples batch to 128;

[0091] Set the learning rate l_rate to 0.024;

[0092] Set the value of the number of detection classes classes in the two yolo layers to 1, and set the number of convolution kernels filters in the corresponding layer to 18.

[0093] Step B6: Use the training network to train the training data set to obtain an indicator light detection model.

[0094] Preferably, in step B6, using the training network to train the training data set to obtain an indicator light detection model includes:

[0095] Use the training network to train the training data set until the change value of the loss function value of the training network is within a preset interval, and save the intermediate weight model at this time as the indicator light detection model.

[0096] In this embodiment, after 15,000 times of training, when the loss function value of the training network is within a preset interval (the loss function value within the preset interval can be understood as the loss function value of the training network no longer changing significantly), the intermediate weight model saved at this time is the indicator light detection model finally used for indicator light detection.

[0097] Step C: Grayscale the image of the indicator light to be detected, and obtain the average brightness value of the image of the indicator light to be detected;

[0098] Preferably, in the step C, grayscaling the image of the indicator light to be detected and obtaining the average brightness value of the image of the indicator light to be detected includes obtaining the average brightness value according to Formula 1;

[0099]

[0100] Where:

[0101] I represents the average brightness value;

[0102] H represents the height of the image of the indicator light to be detected;

[0103] W represents the width of the image of the indicator light to be detected;

[0104] g(r, c) represents the pixel grayscale value at the position of the r-th row and c-th column of the image of the indicator light to be detected.

[0105] Step D: Input the image of the indicator light to be detected into the indicator light detection model to detect all the indicator lights in the image of the indicator light to be detected, and crop all the single indicator light images from the indicator light image according to the detected position rectangular frame;

[0106] In this embodiment, inputting the image of the indicator light to be detected into the indicator light detection model to obtain the detection result of each indicator light in the image, that is, the detected position rectangular frame (x1, y1, x2, y2, label). Crop the single indicator light images from the image of the indicator light to be detected according to the coordinates of the detected position rectangular frame corresponding to each indicator light.

[0107] Preferably, in the step E, before sequentially obtaining the brightness values of the grayscale images of all the single indicator light images, set the width and height of all the single indicator light images in terms of pixels. In this embodiment, setting the pixels can be understood as setting the width and height of the single indicator light images to 40 pixels and 40 pixels respectively. After pixel setting, perform grayscaling processing to obtain the grayscale images of all the single indicator light images;

[0108] Step E: Sequentially obtain the brightness values of the grayscale images of all the single indicator light images and the brightness value of the entire image of the indicator light to be detected;

[0109] In the said step E, it includes obtaining the brightness values of the grayscale images of all indicator lights and the brightness value of the entire indicator light image to be detected successively according to Formula 1.

[0110] For example, if 3 indicator lights are detected from an indicator light image to be detected and 3 single indicator light images are cropped, then the grayscale images of these 3 indicator light images are obtained successively, and then the brightness values L1, L2, and L3 of the grayscale images of these 3 indicator light images are obtained successively.

[0111] Similarly, the average brightness value I of the entire indicator light image to be detected can be obtained according to Formula 1.

[0112] Preferably, in the said step F, it includes obtaining the bright-dark threshold according to Formula 2;

[0113]

[0114] Where:

[0115] T represents the bright-dark threshold;

[0116] λ represents the weight control coefficient;

[0117] I represents the average brightness value of the entire indicator light image to be detected;

[0118] N represents the total number of single indicator lights detected in the indicator light image to be detected;

[0119] L i represents the brightness value of the i-th indicator light.

[0120] Step F: Obtain the bright-dark threshold according to the brightness values of the grayscale images of all single indicator light images obtained in step D and the brightness value of the entire indicator light image to be detected;

[0121] Step G: Compare the brightness value of the grayscale image of the single indicator light with the bright-dark threshold to judge the bright-dark state of the indicator light.

[0122] Preferably, in the said step G, judging the bright-dark state of the indicator light includes:

[0123] Compare the brightness value of the single indicator light with the bright-dark threshold. If the brightness value of the single indicator light is greater than the bright-dark threshold, then judge that the indicator light is in the bright state; if the brightness value of the single indicator light is less than or equal to the bright-dark threshold, then judge that the indicator light is in the dark state.

[0124] In this embodiment, for example, three indicator lights are detected from an indicator light picture to be detected, the brightness values ​​of the grayscale images of the three indicator light pictures are L1, L2, and L3, and the brightness threshold of the entire indicator light picture to be detected is T. Then, the sizes of L1 and T, L2 and T, and L3 and T are compared in turn. If L1>T, the first indicator light is in a bright state. Similarly, if L2>T, the second indicator light is in a bright state. If L3<T, the third indicator light is in a dark state.

[0125] The technical principle of the present invention is described above in conjunction with specific embodiments. These descriptions are only for explaining the principle of the present invention and cannot be interpreted as limiting the scope of protection of the present invention in any way. Based on the explanations herein, those skilled in the art can associate other specific implementations of the present invention without paying creative labor, and these methods will fall within the scope of protection of the present invention.

Claims

1. A method for judging the brightness of the indicator light in the distribution room without parameterization, characterized in that: It includes the following steps: Step A: Obtain all the indicator light pictures taken by the robot; Step B: Train an indicator light detection model based on all the taken indicator light pictures; Step C: Grayscale the picture of the indicator light to be detected and obtain the average brightness value of the picture of the indicator light to be detected; Step D: Input the picture of the indicator light to be detected into the indicator light detection model to detect all the indicator lights in the picture of the indicator light to be detected, and crop out all the single indicator light pictures from the indicator light picture according to the detected position rectangular frame; Step E: Sequentially obtain the brightness values of the grayscale pictures of all the single indicator light pictures and the brightness value of the whole picture of the indicator light to be detected; Step F: Obtain the bright-dark threshold according to the brightness values of the grayscale pictures of all the single indicator light pictures obtained in Step D and the brightness value of the whole picture of the indicator light to be detected; It includes obtaining the bright-dark threshold according to Formula Two; Wherein: T represents the bright-dark threshold; λ represents the weight control coefficient; I represents the average brightness value of the whole picture of the indicator light to be detected; N represents the total number of single indicator lights detected in the picture of the indicator light to be detected; L i represents the brightness value of the i-th indicator light; Step G: Compare the brightness value of the grayscale picture of the single indicator light with the bright-dark threshold to judge the bright-dark state of the indicator light.

2. The method for judging the bright-dark state of the distribution room indicator light without parameterization according to Claim 1, wherein: In Step B, training the indicator light detection model based on all the taken indicator light pictures includes the following steps: Step B1: Obtain all the indicator light pictures taken by the robot under different illuminations and angles; Step B2: Mark the position and type name of each indicator light in each indicator light picture; Step B3: Save the annotation result information of each indicator light picture into the annotation file corresponding to the indicator light picture, and establish a training data set including all the indicator light pictures and all the annotation files; Step B4: Input the training data set into the training network; Step B5: Set the parameters of the training network; Step B6: Use the training network to train the training data set to obtain the indicator light detection model.

3. The method for judging the bright-dark state of the distribution room indicator light without parameterization according to Claim 2, wherein: In Step B2, marking the position and type name of each indicator light in each indicator light picture includes: When annotating each indicator light picture, the position is represented by four coordinate values to represent the detection position rectangular frame of each indicator light (x1, y1, x2, y2, label); Wherein: x1 represents the abscissa of the upper left vertex of the detection position rectangular frame; y1 represents the ordinate of the upper left vertex of the detection position rectangular frame; x2 represents the abscissa of the upper right vertex of the detection position rectangular frame; y2 represents the ordinate of the upper right vertex of the detection position rectangular frame; label represents the type name of each indicator light, and label is uniformly set to "light".

4. The method for judging the bright-dark state of the distribution room indicator light without parameterization according to Claim 2, wherein: In Step B4, divide the training data set into training data and test data according to a preset rule and input them into the training network.

5. The method for judging the brightness and darkness of the indicator light in the distribution room without parameterization according to claim 2, characterized in that: In the step B5, parameter settings are performed on the training network, including: Set the input size of the training network to 192x256; Set the number of batch training samples batch to 128; Set the learning rate l_rate to 0.024; Set the value of the number of detection categories classes in the two yolo layers to 1, and set the number of convolution kernels filters in the corresponding layer to 18.

6. The method for judging the brightness and darkness of the indicator light in the distribution room without parameterization according to claim 2, characterized in that: In the step B6, use the training network to train the training data set to obtain an indicator light detection model, including: Use the training network to train the training data set until the change value of the loss function value of the training network is within the preset interval, and save the intermediate weight model at this time as the indicator light detection model.

7. The method for judging the brightness and darkness of the indicator light in the distribution room without parameterization according to claim 1, characterized in that: In the step C, grayscale the image of the indicator light to be detected, and obtain the average brightness value of the image of the indicator light to be detected, including obtaining the average brightness value according to formula one; Where: I represents the average brightness value; H represents the height of the image of the indicator light to be detected; W represents the width of the image of the indicator light to be detected; g(r, c) represents the pixel grayscale value at the position of the r-th row and c-th column of the image of the indicator light to be detected.

8. The method for judging the brightness and darkness of the indicator light in the distribution room without parameterization according to claim 1, characterized in that: In the step E, before obtaining the brightness values of the grayscale images of all single indicator light images in sequence, set the width and height of all single indicator light images in pixels, and perform grayscale processing after pixel setting to obtain the grayscale images of all single indicator light images; In the step E, include obtaining the brightness values of the grayscale images of all indicator light images and the average brightness value of the entire image of the indicator light to be detected in sequence according to formula one.

9. The method for judging the brightness and darkness of the indicator light in the distribution room without parameterization according to claim 1, characterized in that: In the step G, judge the brightness and darkness state of the indicator light, including: Compare the brightness value of a single indicator light with the brightness and darkness threshold. If the brightness value of a single indicator light is greater than the brightness and darkness threshold, it is judged that the indicator light is in the bright state; if the brightness value of a single indicator light is less than or equal to the brightness and darkness threshold, it is judged that the indicator light is in the dark state.

Citation Information

Patent Citations

  • Method for automatically detecting equipment state operation

    CN112395928A