Disclosure of Invention
The invention aims to provide an automatic detection method, system, equipment and storage medium for panel lamps of an exchanger, so that the panel lamps of the exchanger can be effectively detected, the cost is reduced, and the panel lamps are convenient to deploy.
In order to solve the technical problems, the invention provides the following technical scheme:
an automatic detection method for panel lamps of an exchanger comprises the following steps:
sending an instruction carrying the number and the lighting color of a target panel lamp to a switch so that the switch controls the target panel lamp to light according to the lighting color;
receiving a lighting image of the target panel lamp shot by an image acquisition device;
determining the color of the target panel lamp in the lighting image through a machine vision recognition algorithm, and judging whether the color is consistent with the lighting color in the instruction;
if so, determining that the detection result of the lighting color of the target panel lamp is pass;
and if not, determining that the detection result of the lighting color of the target panel lamp is failed.
Preferably, the method further comprises the following steps:
after the detection of each lighting color of the target panel lamp is carried out in sequence, judging whether the detection results of each lighting color of the target panel lamp pass or not;
if yes, determining that the target panel lamp is not abnormal;
if not, determining that the target panel lamp is abnormal in lighting.
Preferably, the determining the color of the target panel light in the lighting image through a machine vision recognition algorithm includes:
constructing a Cartesian coordinate system of the lighting image, and determining coordinates of a preset reference object in the Cartesian coordinate system;
determining the coordinates of the target panel lamp in the Cartesian coordinate system according to the relative position relationship between the target panel lamp and the reference object;
and determining the color of the target panel lamp in the lighting image based on the coordinates of the target panel lamp in the Cartesian coordinate system.
Preferably, the determining, by a machine vision recognition algorithm, the color of the target panel lamp in the lighting image, and determining whether the color of the target panel lamp is consistent with the lighting color in the instruction includes:
determining the RGB color value of the target panel lamp in the lighting image through a machine vision recognition algorithm;
judging whether the determined errors between the RGB color values of the target panel lamp and the RGB lighting color values in the instruction are within a preset range or not;
if so, determining that the RGB color value of the target panel lamp is consistent with the RGB lighting color value in the instruction;
and if not, determining that the RGB color value of the target panel lamp is inconsistent with the RGB lighting color value in the instruction.
Preferably, after determining that the detection result of the lighting color of the target panel lamp is passed, the method further includes:
sending a light-out instruction carrying the number of a target panel lamp to a switch so that the switch controls the target panel lamp to be turned off;
receiving a light-out image shot by an image acquisition device;
determining the color of the target panel lamp in the light-out image through a machine vision recognition algorithm, and judging whether the color is consistent with a preset light-out color or not;
if so, determining that the light-out detection result of the target panel light is passed;
if not, determining that the light-out detection result of the target panel light is failed.
Preferably, the method further comprises the following steps:
after the detection results of the lighting colors of the panel lamps of the switch and the light-out detection results of the panel lamps are obtained, when all the detection results pass, outputting first prompt information indicating that the panel lamps of the switch are normal; and when any detection result is that the lamp passes through the first detection result, outputting second prompt information indicating that the panel lamp of the switch is abnormal.
Preferably, the method further comprises the following steps:
after the detection result of any lighting color of any panel lamp of the switch is determined, storing a lighting image used for determining the detection result into a preset database;
and when a retrieval instruction is received, reading corresponding bright light images from the database according to the retrieval instruction.
An automatic detection system for panel lights of a switch, comprising:
the lighting instruction issuing module is used for sending an instruction carrying the number of a target panel lamp and the lighting color to the switch so that the switch controls the target panel lamp to light according to the lighting color;
the lighting image receiving module is used for receiving the lighting image of the target panel lamp shot by the image acquisition device;
the machine vision recognition module is used for determining the color of the target panel lamp in the lighting image through a machine vision recognition algorithm and judging whether the color is consistent with the lighting color in the instruction;
if yes, executing a first result output module for determining that the detection result of the lighting color of the target panel lamp is passed;
and if not, executing a second result output module for determining that the detection result of the lighting color of the target panel lamp is failed.
An automatic inspection apparatus of a panel light of a switch, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the method for automatically detecting a panel light of a switch as described in any one of the above.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for automatic detection of panel lights of a switch of any of the above.
By applying the technical scheme provided by the embodiment of the invention, the panel light of the switch is automatically detected based on a machine vision identification mode. Specifically, the instruction carrying the number of the target panel lamp and the lighting color can be sent to the switch, so that the switch controls the target panel lamp to be lit according to the lighting color. Then, receiving a lighting image of the target panel lamp shot by the image acquisition device, determining the color of the target panel lamp in the lighting image through a machine vision recognition algorithm, and judging whether the color is consistent with the lighting color in the instruction; if so, determining that the detection result of the lighting color of the target panel lamp is a pass; if not, determining that the detection result of the lighting color of the target panel lamp is failed. It can be seen that, because the panel light of the switch is automatically detected based on the machine vision recognition, the scheme of the application does not need to be wired in a large amount as in the conventional scheme, and therefore the scheme of the application is convenient to deploy. Simultaneously, through the bright lamp image of shooting, can be convenient according to machine vision recognition algorithm, determine the testing result of the bright lamp colour of target panel lamp fast to, need not adopt special sensor and support, make this application scheme application scope wide, and the cost is lower.
To sum up, the scheme of this application can be fast, carries out the panel light's of switch detection effectively, and can reduce cost, is convenient for arrange.
Detailed Description
The core of the invention is to provide an automatic detection method for the panel lamp of the switch, which can quickly and effectively detect the panel lamp of the switch, reduce the cost and facilitate the deployment.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a method for automatically detecting a panel light of an exchange according to the present invention, where the method for automatically detecting a panel light of an exchange may include the following steps:
step S101: and sending an instruction carrying the number of the target panel lamp and the lighting color to the switch so that the switch controls the target panel lamp to light according to the lighting color.
Specifically, each step of the present application may be executed by a server, and of course, other devices may also be selected to execute in other embodiments, and each step of the present application may be implemented. The following description will be made by taking a server as an example.
The server may send an instruction to the switch carrying the number of the target panel light and the color of the light. A plurality of panel lights are generally provided in the switch, and in practical applications, these panel lights are generally arranged on the front panel of the switch, and thus may also be referred to as individual front panel lights of the switch.
The specific type of each panel light can also be set and adjusted according to the needs, and in practical application, the panel light can be a widely used LED light. Moreover, a monochromatic lamp or a multicolor lamp can be selected, and the specific type of each panel lamp depends on actual needs.
The target panel light may be any one of the panel lights of the switch, and in practical applications, the panel lights of the switch are usually detected automatically in sequence, and the automatic detection processes of the other panel lights may refer to the description of the target panel light in this application.
The server sends an instruction to the switch, wherein the instruction carries the number of the target panel lamp, so that the current specific detection object is specified from each panel lamp, and the instruction also carries the lighting color, so that the current specific detection color is specified from each displayable color of the target panel lamp.
After the switch receives the instruction, the switch controls the target panel lamp to light according to the lighting color required by the instruction according to the requirement of the instruction.
Step S102: and receiving a lighting image of the target panel lamp shot by the image acquisition device.
The image capturing device may be a video camera, a still camera, or the like, and in practical applications, the image capturing device may be generally fixed right in front of the front panel of the switch, so that each panel light of the switch is included in an image captured by the image capturing device.
Step S103: and determining the color of the target panel lamp in the lighting image through a machine vision recognition algorithm, and judging whether the color is consistent with the lighting color in the instruction.
If so, step S104 may be performed: determining that the detection result of the lighting color of the target panel lamp is passed;
if not, step S105 is executed: and determining that the detection result of the lighting color of the target panel lamp is failed.
When the color of the target panel lamp in the lighting image is determined through the machine vision recognition algorithm, various machine vision recognition algorithms can be specifically adopted, and the implementation of the method is not influenced.
In an embodiment of the present invention, the determining, by the machine vision recognition algorithm, the color of the target panel light in the lighting image in step S103 may specifically include:
constructing a Cartesian coordinate system of the lighting image, and determining the coordinates of a preset reference object in the Cartesian coordinate system;
determining the coordinates of the target panel lamp in a Cartesian coordinate system according to the relative position relationship between the target panel lamp and the reference object;
and determining the color of the target panel lamp in the lighting image based on the coordinates of the target panel lamp in the Cartesian coordinate system.
Specifically, in practical application, before the cartesian coordinate system is constructed, in order to ensure the accuracy of the coordinates of the subsequently determined target panel lamp in the cartesian coordinate system, the graying processing and the binarization processing of the lighting image can be performed first, and the cartesian coordinate system is constructed after the processing is finished, so that the noise can be reduced, and the accuracy of the coordinates of the determined target panel lamp in the cartesian coordinate system can be ensured.
The predetermined reference object may be predetermined, and is usually selected to be capable of being quickly, clearly and accurately identified, for example, as a right angle position of the edge of the switch. Furthermore, a pre-set reference can be generally used as the origin of the constructed cartesian coordinate system.
The relative positional relationship between the target panel lamp and the reference object may be predetermined, and thus, after the coordinates of the reference object in the cartesian coordinate system are determined, the coordinates of the target panel lamp in the cartesian coordinate system may be determined according to the relative positional relationship.
And the bright light image of the target panel lamp that utilizes to shoot can obtain the colour value of every pixel point of this bright light image, then combines the aforesaid coordinate in the cartesian coordinate system of the target panel lamp who determines, alright in order to obtain the colour of the target panel lamp in the bright light image.
After the color of the target panel lamp in the lighting image is determined through the machine vision recognition algorithm, the server can judge whether the color is consistent with the lighting color in the instruction.
In practical applications, considering that the color can be generally expressed by RBG color, in an embodiment of the present invention, step S103 may include:
determining the RGB color value of a target panel lamp in the lighting image through a machine vision recognition algorithm;
judging whether the errors between the determined RGB color values of the target panel lamp and the RGB lighting color values in the instruction are within a preset range or not;
if so, determining that the RGB color value of the target panel lamp is consistent with the RGB lighting color value in the instruction;
and if not, determining that the RGB color value of the target panel lamp is inconsistent with the RGB lighting color value in the instruction.
The RGB color values of the target panel light in the lighted image are determined by a machine vision recognition algorithm, which in this embodiment is compared to the RGB lighted color values in the command. And as long as the error is within the preset range, the determined RGB color value of the target panel lamp is considered to be consistent with the RGB lighting color value in the command.
There are also various methods for determining the error between two RGB color values, for example, comparing the R, G, B values of the two RGB color values, and selecting the largest difference as the error between the two RGB color values. For another example, the R, G, and B values of the two are compared to obtain 3 error values, and only if the 3 error values are all within the corresponding preset range, the determined RGB color value of the target panel lamp is considered to be consistent with the RGB lighting color value in the command.
When the color of the target panel lamp in the lighting image determined by the machine vision recognition algorithm is consistent with the lighting color in the command, it may be determined that the detection result of the lighting color of the target panel lamp is pass, for example, it may be determined that the detection result of green of panel lamp No. 1 is pass. Otherwise, if the detected light color of the target panel light is inconsistent, the detection result of the lighting color of the target panel light is determined to be failed.
In an embodiment of the present invention, the method may further include:
after the detection of each lighting color of the target panel lamp is carried out in sequence, judging whether the detection results of each lighting color of the target panel lamp pass;
if yes, determining that the lighting of the target panel lamp is not abnormal;
if not, the lighting of the target panel lamp is determined to be abnormal.
In this embodiment, the lighting colors of the target panel light are detected in sequence, so that whether the lighting function of the target panel light is abnormal or not can be determined.
Further, in an embodiment of the present invention, after step S104, the method may further include:
sending a light-out instruction carrying the number of the target panel lamp to the switch so that the switch controls the target panel lamp to be turned off;
receiving a light-out image shot by an image acquisition device;
determining the color of a target panel lamp in the lamp-out image through a machine vision recognition algorithm, and judging whether the color is consistent with a preset lamp-out color or not;
if so, determining that the light-out detection result of the target panel light is passed;
if not, determining that the light-out detection result of the target panel light is failed.
The foregoing embodiment is also a main detection content, but in this embodiment, it is considered that, in a small part of cases, the lighting of each color of the target panel lamp may be normal, but a case that the lighting cannot be turned off may occur, and therefore, in this embodiment, the lighting-off condition of the target panel lamp is detected to determine whether the lighting-off detection result of the target panel lamp passes or not, and specific implementation steps and principles are the same as above, and a description thereof will not be repeated.
In an embodiment of the present invention, the method may further include:
after the detection results of the lighting colors of the panel lamps of the switch and the light-out detection results of the panel lamps are obtained, when all the detection results pass, outputting first prompt information indicating that the panel lamps of the switch are normal; and when any one detection result is failed, outputting second prompt information indicating that the panel lamp of the switch is abnormal.
As described above, in practical applications, each panel light of the switch is usually detected in sequence, and therefore, in this embodiment, after the detection result of each lighting color of each panel light of the switch and the detection result of the lighting-out of each panel light are obtained, when each detection result passes, it indicates that the panel light of the switch is normal, and therefore, first prompt information indicating that the panel light of the switch is normal may be output, so that a worker notices this condition and finishes the detection. And when any detection result is failed, the abnormality of at least one panel lamp of the switch is indicated, so that second prompt information indicating that the panel lamp of the switch is abnormal is output, and the second prompt information can usually carry the serial number of each panel lamp which has the condition that the detection result fails, so that the subsequent positioning and maintenance are facilitated.
In an embodiment of the present invention, the method may further include:
after the detection result of any lighting color of any panel lamp of the switch is determined, storing a lighting image used for determining the detection result into a preset database;
and when a retrieval instruction is received, reading corresponding bright light images from the database according to the retrieval instruction.
In this embodiment, after the detection result of the lighting color of any one of the panel lights of the switch is determined, the lighting image used for determining the detection result is stored in the preset database, so that when the retrieval instruction is received, the corresponding lighting images can be read from the database according to the retrieval instruction, and the later-stage tracing of the staff is facilitated.
By applying the technical scheme provided by the embodiment of the invention, the panel light of the switch is automatically detected based on a machine vision identification mode. Specifically, the instruction carrying the number of the target panel lamp and the lighting color can be sent to the switch, so that the switch controls the target panel lamp to be lit according to the lighting color. Then, receiving a lighting image of the target panel lamp shot by the image acquisition device, determining the color of the target panel lamp in the lighting image through a machine vision recognition algorithm, and judging whether the color is consistent with the lighting color in the instruction; if so, determining that the detection result of the lighting color of the target panel lamp is a pass; if not, determining that the detection result of the lighting color of the target panel lamp is failed. It can be seen that, because the panel light of the switch is automatically detected based on the machine vision recognition, the scheme of the application does not need to be wired in a large amount as in the conventional scheme, and therefore the scheme of the application is convenient to deploy. Simultaneously, through the bright lamp image of shooting, can be convenient according to machine vision recognition algorithm, determine the testing result of the bright lamp colour of target panel lamp fast to, need not adopt special sensor and support, make this application scheme application scope wide, and the cost is lower.
To sum up, the scheme of this application can be fast, carries out the panel light's of switch detection effectively, and can reduce cost, is convenient for arrange.
Corresponding to the above method embodiment, the embodiment of the present invention further provides an automatic detection system for a panel light of an exchange, which can be referred to in correspondence with the above.
Referring to fig. 3, a schematic structural diagram of an automatic detection system for panel lights of an exchange according to the present invention includes:
the lighting instruction issuing module 301 is configured to send an instruction carrying the number of the target panel lamp and the lighting color to the switch, so that the switch controls the target panel lamp to light according to the lighting color;
a lighting image receiving module 302, configured to receive a lighting image of a target panel light captured by an image capturing device;
the machine vision recognition module 303 is configured to determine the color of the target panel lamp in the lighting image through a machine vision recognition algorithm, and determine whether the color is consistent with the lighting color in the instruction;
if yes, executing a first result output module 304 for determining that the detection result of the lighting color of the target panel lamp is pass;
if not, executing a second result output module 305 for determining that the detection result of the lighting color of the target panel lamp is failed.
In one embodiment of the present invention, the method further comprises:
the judging module is used for judging whether the detection results of all the lighting colors of the target panel lamp pass or not after the detection of all the lighting colors of the target panel lamp is carried out in sequence;
if yes, executing a third result output module for determining that the lighting of the target panel lamp is abnormal;
and if not, executing a fourth result output module for determining that the lighting of the target panel is abnormal.
In an embodiment of the present invention, the machine vision recognition module 303 determines the color of the target panel light in the lighting image through a machine vision recognition algorithm, and is specifically configured to:
constructing a Cartesian coordinate system of the lighting image, and determining the coordinates of a preset reference object in the Cartesian coordinate system;
determining the coordinates of the target panel lamp in a Cartesian coordinate system according to the relative position relationship between the target panel lamp and the reference object;
and determining the color of the target panel lamp in the lighting image based on the coordinates of the target panel lamp in the Cartesian coordinate system.
In an embodiment of the present invention, the machine vision recognition module 303 is specifically configured to:
determining the RGB color value of a target panel lamp in the lighting image through a machine vision recognition algorithm;
judging whether the errors between the determined RGB color values of the target panel lamp and the RGB lighting color values in the instruction are within a preset range or not;
if so, determining that the RGB color value of the target panel lamp is consistent with the RGB lighting color value in the instruction;
and if not, determining that the RGB color value of the target panel lamp is inconsistent with the RGB lighting color value in the instruction.
In a specific embodiment of the present invention, after the first result output module 304 determines that the detection result of the lighting color of the target panel light passes, the lighting instruction issuing module 301 is further configured to send a light-off instruction carrying the number of the target panel light to the switch, so that the switch controls the target panel light to be turned off;
the lighting image receiving module 302 is further configured to receive a lighting-out image captured by the image capturing device;
the machine vision recognition module 303 is further configured to determine the color of the target panel lamp in the light-out image through a machine vision recognition algorithm, and determine whether the color is consistent with a preset light-out color;
if yes, executing the first result output module 304, where the first result output module 304 is further configured to determine that the light-out detection result of the target panel light is passed;
if not, executing a second result output module 305, where the second result output module 305 is further configured to determine that the light-out detection result of the target panel light is failed.
In one embodiment of the present invention, the method further comprises:
the prompt information output module is used for outputting first prompt information indicating that the panel lamps of the switch are normal when all detection results pass after the detection results of the lighting colors of all the panel lamps of the switch and the lighting-out detection results of all the panel lamps are obtained; and when any one detection result is failed, outputting second prompt information indicating that the panel lamp of the switch is abnormal.
In one embodiment of the present invention, the method further comprises:
the data storage module is used for storing a lighting image used for determining the detection result into a preset database after determining the detection result of any lighting color of any panel lamp of the switch;
and the retrieval feedback module is used for reading corresponding bright light images from the database according to the retrieval instruction when receiving the retrieval instruction.
Corresponding to the above method and system embodiments, the present invention further provides an automatic detection device for a panel light of a switch and a computer readable storage medium, where a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the automatic detection method for a panel light of a switch in any of the above embodiments are implemented. A computer-readable storage medium as referred to herein may include Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The automatic detection apparatus of the panel light of the switch may include:
a memory for storing a computer program;
a processor for executing a computer program to implement the steps of the method for automatically detecting a panel light of a switch in any of the above embodiments.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The principle and the implementation of the present invention are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.