CN113469173A - Signal lamp shielding detection method and device, terminal and computer readable medium - Google Patents
Signal lamp shielding detection method and device, terminal and computer readable medium Download PDFInfo
- Publication number
- CN113469173A CN113469173A CN202010245117.1A CN202010245117A CN113469173A CN 113469173 A CN113469173 A CN 113469173A CN 202010245117 A CN202010245117 A CN 202010245117A CN 113469173 A CN113469173 A CN 113469173A
- Authority
- CN
- China
- Prior art keywords
- signal lamp
- image
- area
- shielded
- signal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 88
- 238000000034 method Methods 0.000 claims abstract description 38
- 238000004891 communication Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 8
- 238000012549 training Methods 0.000 claims description 7
- 230000002159 abnormal effect Effects 0.000 abstract description 9
- 230000006378 damage Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 230000005856 abnormality Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G08—SIGNALLING
- G08B—SIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
- G08B21/00—Alarms responsive to a single specified undesired or abnormal condition and not otherwise provided for
- G08B21/18—Status alarms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Business, Economics & Management (AREA)
- Emergency Management (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to a signal lamp shielding detection method, a signal lamp shielding detection device, a terminal and a computer readable medium, wherein the method comprises the following steps: acquiring a region image of a region where a signal lamp on equipment is located; if the signal lamp exists in the area image, determining the area of the signal lamp image in the area image; determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp; and if the signal lamp is shielded, sending an alarm prompt. The invention can facilitate managers to find the shielded signal lamp in time and clear shielding objects around the signal lamp in time, thereby finding the abnormal color condition of the signal lamp in time and avoiding damaging equipment.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a signal lamp shielding detection method, a signal lamp shielding detection device, a signal lamp shielding detection terminal and a computer readable medium.
Background
At present, at a production site, a manager in a first line must know whether an operator and equipment are working and operating normally at any time, and a signal light is a tool for notifying the manager when an abnormality occurs in a process. Under general conditions, a manager can know the current running state of the equipment only by checking the field monitoring video in the centralized control center, when parts run out or bad articles and equipment fault lamp abnormality occurs, a signal lamp on the equipment can light a red lamp, and after the operator handles the abnormality, the equipment runs normally, and the signal lamp can display a green lamp.
However, in actual work, often there is the operation personnel to pile up the material to equipment on, can cause the signal lamp of equipment to be sheltered from, if the circumstances such as bad articles for use and equipment trouble lamp are unusual appear, managers can't look over the signal lamp that is sheltered from at centralized control center, can not in time discover the abnormal conditions, and then, can not in time handle the abnormal conditions, can cause the harm to equipment.
Disclosure of Invention
The invention provides a signal lamp shielding detection method, a signal lamp shielding detection device, a terminal and a computer readable medium, and aims to solve the technical problem of detecting whether a signal lamp is shielded.
In a first aspect, the present invention provides a signal lamp shielding detection method, including:
acquiring a region image of a region where a signal lamp on equipment is located;
if the signal lamp exists in the area image, determining the area of the signal lamp image in the area image;
determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp;
and if the signal lamp is shielded, sending an alarm prompt.
Optionally, the method further includes:
acquiring a plurality of regional images of a region where a signal lamp is located on equipment by using a camera;
detecting a signal lamp in the area image to obtain a signal lamp detection frame surrounding the signal lamp image;
determining coordinate information of two end points of a diagonal line of the signal lamp detection frame;
and training a target detection algorithm model by using the area image and the coordinate information until the target detection algorithm model is converged.
Optionally, the method further includes:
acquiring an initial area image of an area where the signal lamp is located by using the same image acquisition parameter;
detecting a signal lamp image of the signal lamp in the initial area image;
inputting the signal lamp image into the target detection algorithm model to obtain reference position information of the signal lamp;
and obtaining the reference area of the signal lamp based on the reference position information.
Optionally, if there is a signal lamp in the region image, determining an area of the signal lamp image in the region image includes:
if a signal lamp exists in the area image, inputting the area image into the target detection algorithm model to obtain the position information of the signal lamp;
and obtaining the area of the signal lamp based on the position information.
Optionally, determining whether the signal lamp is blocked according to the area of the signal lamp image and a reference area of a signal lamp image in a reference region image containing the signal lamp, which is acquired by using the same image acquisition parameter in advance, includes:
calculating a quotient value between the area of the signal lamp image and a reference area;
judging whether the quotient value is smaller than or equal to a preset area threshold value or not;
and if the quotient is smaller than or equal to a preset area threshold value, determining that the signal lamp is shielded.
Optionally, determining whether the signal lamp is blocked according to the area of the signal lamp image and a reference area of a signal lamp image in a reference region image containing the signal lamp, which is acquired by using the same image acquisition parameter in advance, further includes:
the method comprises the steps of acquiring a regional image of a region where a signal lamp is located within a first preset time period;
and if the signal lamp is determined to be shielded again according to the area of the signal lamp image and the reference area when the first preset time period is over, determining that the signal lamp is shielded.
Optionally, the method further includes:
if no signal lamp exists in the area image, the step of collecting the area image of the area where the signal lamp is located is executed in a second preset time period;
and if the signal lamp is not detected within the second preset time period, sending an alarm prompt.
In a second aspect, the present invention provides a signal lamp shielding detection apparatus, including:
the acquisition module is used for acquiring a regional image of a region where a signal lamp on the equipment is located;
the first determining module is used for determining the area of a signal lamp image in the area image if the signal lamp exists in the area image;
the second determining module is used for determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp;
and the alarm module is used for sending an alarm prompt if the signal lamp is shielded.
In a third aspect, the present invention provides a terminal, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory has stored therein a computer program operable on the processor, which when executed by the processor performs the steps of the method of the first aspect.
In a fourth aspect, the invention provides a computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the method of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the invention has the following advantages:
the method provided by the embodiment of the invention comprises the steps of collecting a regional image of a region where a signal lamp on equipment is located; if the signal lamp exists in the area image, determining the area of the signal lamp image in the area image; determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp; and if the signal lamp is shielded, sending an alarm prompt.
Because the signal lamp image in the reference region image containing the signal lamp and acquired by using the same image acquisition parameter in advance has a corresponding relation with the signal lamp image in the region image, whether the signal lamp is shielded or not can be determined according to the area of the signal lamp image in the region image and the reference area of the signal lamp image in the reference region image, if the signal lamp is shielded, an alarm prompt is sent, so that managers can find the shielded signal lamp in time and clear shielding objects around the signal lamp in time, further, the abnormal color condition of the signal lamp can be found in time, and the damage to equipment is avoided.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a signal lamp shielding detection method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a signal lamp shielding detection method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a signal lamp shielding detection method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a signal lamp shielding detection method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a signal lamp shielding detection method according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a signal lamp shielding detection method according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of a signal lamp shielding detection method according to an embodiment of the present invention;
fig. 8 is a structural diagram of a signal lamp shielding detection apparatus according to another embodiment of the present invention;
fig. 9 is a block diagram of a terminal according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
Because when actual work, often there is the operation personnel to pile up the material to equipment on, can cause the signal lamp of equipment to be sheltered from, if the circumstances such as bad articles for use and equipment trouble lamp are unusual appear, managers can't look over the signal lamp that is sheltered from at centralized control center, can not in time discover the abnormal conditions, and then, can not in time handle the abnormal conditions, can cause the harm to equipment. To this end, the method, the apparatus, the terminal and the computer-readable medium for detecting signal lamp occlusion provided in the embodiments of the present invention may be applied in a terminal, as shown in fig. 1, where the method for detecting signal lamp occlusion may include the following steps:
s101, acquiring a region image of a region where a signal lamp on equipment is located;
in the embodiment of the invention, the area image can be acquired through a camera and the like, for example, the range 1 and the range 2 of the acquired area image are determined according to the camera, and then the area image of the area where the signal lamp on the equipment is located in the range 1 and the range 2 is acquired; or after the range of acquiring the regional images is determined according to the camera, the monitoring video in the range is obtained, and the image frames are extracted from the monitoring video according to the preset time interval to obtain the regional images and the like.
Illustratively, an area image 1 of an area where the signal lamp 1 is located on the device in the area 1 and an area image 2 of an area where the signal lamp 2 and the signal lamp 3 are located on the device in the area 2 are acquired.
In this step, images of the area of the plurality of devices in which the signal lamps are located may be acquired.
Step S102, if a signal lamp exists in the area image, determining the area of the signal lamp image in the area image;
in this step, if there is a signal lamp in the area image, the area of each signal lamp image in the area image may be determined.
Illustratively, an area 1 of the signal light image 1 in the region image 1, and an area 2 of the signal light image 2 and an area 3 of the signal light image 3 in the region image 2 are determined.
Step S103, determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp;
in this step, since the reference region image including the signal lamp has been acquired in advance using the same image acquisition parameters, it can be determined whether the signal lamp is occluded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image.
Illustratively, it is determined whether the signal lamp 1 is occluded according to an area 1 of the signal lamp image 1 and a reference area of the signal lamp image 1 in the reference region image, it is determined whether the signal lamp 2 is occluded according to an area 2 of the signal lamp image 2 and a reference area of the signal lamp image 2 in the reference region image, and it is determined whether the signal lamp 3 is occluded according to an area 3 of the signal lamp image 3 and a reference area of the signal lamp image 3 in the reference region image.
And step S104, if the signal lamp is shielded, sending an alarm prompt.
In the embodiment of the present invention, the alarm prompt refers to alarm information, and for example, the alarm prompt may be a playing prompt tone, or a text-form warning popup window, or the like.
Exemplarily, if the signal lamp 1 is blocked, an alarm prompt corresponding to the signal lamp 1 is sent out; and if the signal lamp 2 is shielded, sending an alarm prompt corresponding to the signal lamp 2.
In the step, if the signal lamp is shielded, an alarm prompt corresponding to the shielded signal lamp is sent.
The method provided by the embodiment of the invention comprises the steps of collecting a regional image of a region where a signal lamp on equipment is located; if the signal lamp exists in the area image, determining the area of the signal lamp image in the area image; determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp; and if the signal lamp is shielded, sending an alarm prompt.
Because the signal lamp image in the reference region image containing the signal lamp and acquired by using the same image acquisition parameter in advance has a corresponding relation with the signal lamp image in the region image, whether the signal lamp is shielded or not can be determined according to the area of the signal lamp image in the region image and the reference area of the signal lamp image in the reference region image, if the signal lamp is shielded, an alarm prompt is sent, so that managers can find the shielded signal lamp in time and clear shielding objects around the signal lamp in time, further, the abnormal color condition of the signal lamp can be found in time, and the damage to equipment is avoided.
On the basis of the above embodiment, the present invention further provides a signal lamp shielding detection method, as shown in fig. 2, the method further includes:
step S201, a camera is used for collecting a plurality of regional images of a region where a signal lamp on equipment is located;
in the step, the range of different acquisition area images is determined through a plurality of cameras, and a plurality of area images of the area where the signal lamp is located on the equipment are acquired by the cameras in the corresponding range.
Exemplarily, the range determined by the camera includes a range 3 and a range 4, in the range 3, the camera is used for collecting a region image 3 of a region where a signal lamp is located on the equipment, the region image 3 includes a signal lamp image 4 and a signal lamp image 5, the signal lamp image 4 is not blocked, and the signal lamp image 5 is partially blocked; in the range 4, a camera is used for acquiring a region image 4 of a region where a signal lamp is located on the equipment, the region image 4 comprises a signal lamp image 6 and a signal lamp image 7, and the signal lamp image 6 and the signal lamp image 7 are not shielded.
Step S202, detecting a signal lamp in the area image to obtain a signal lamp detection frame surrounding the signal lamp image;
in the embodiment of the present invention, the signal lamp detection frame may refer to a detection frame surrounding a signal lamp, and exemplarily, the signal lamp detection frame may be a rectangular detection frame or a square detection frame, or the like; the method for obtaining the signal lamp detection frame comprises the use of a picture marking tool and the like.
Exemplarily, a picture marking tool is used for detecting a signal lamp in the area image 3 within the range 3, and the signal lamp image 4 is detected to be free from occlusion, so that a signal lamp detection frame 1 surrounding the signal lamp image 4 is obtained; and detecting a signal lamp in the area image 4 within the range 4 by using a picture marking tool, and obtaining a signal lamp detection frame 2 surrounding the signal lamp image 6 and a signal lamp detection frame 3 surrounding the signal lamp image 7 by detecting that neither the signal lamp image 6 nor the signal lamp image 7 is blocked.
In the step, a picture marking tool is used for detecting signal lamps in the area image, and when the signal lamps without shielding are detected, a rectangular detection frame is drawn on the signal lamps without shielding.
Step S203, determining coordinate information of two end points of a diagonal line of the signal lamp detection frame;
in this step, the diagonal line of the traffic light detection box is determined, and then the coordinate information of two end points of the diagonal line is determined.
Illustratively, the diagonal line L1 of the beacon detection box 1 is determined, and then the coordinate information of two end points of the diagonal line L1 is determined: (x1, y1, x2, y 2);
the diagonal line L2 of the beacon detection box 2 is determined, and then the coordinate information of two end points of the diagonal line L2 is determined: (x3, y3, x4, y 4);
the diagonal line L3 of the beacon detection box 3 is determined, and then the coordinate information of two end points of the diagonal line L3 is determined: (x5, y5, x6, y 6).
And step S204, training a target detection algorithm model by using the area image and the coordinate information until the target detection algorithm model converges.
Illustratively, training the target detection algorithm model by using the area image and the coordinate information, that is, training based on a plurality of area images such as the area image 3 and the area image 4 and a plurality of coordinate information such as (x1, y1, x2, y2) may obtain (x1, y1, | x2-x1|, | y2-y1|) from (x1, y1, x2, y2), that is, (x, y, w, h), where x represents an abscissa of one end of a diagonal line of the signal detection box, y represents an ordinate of one end of the diagonal line of the signal detection box, that is, x and y represent an abscissa and an ordinate of the same end of the diagonal line of the signal detection box, that is, an abscissa and an ordinate representing an angle of the same end of the diagonal line of the signal detection box, and when the signal detection box is a rectangular detection box, there are 4 angles, for example, x1, y 1; w represents the width of the signal light detection box, e.g., w ═ x2-x1 |; h represents the height of the traffic light detection box, e.g., h ═ y2-y1 |.
The method provided by the embodiment of the invention utilizes the camera to collect a plurality of regional images of the region where the signal lamp is located on the equipment; detecting a signal lamp in the area image to obtain a signal lamp detection frame surrounding the signal lamp image; determining coordinate information of two end points of a diagonal line of the signal lamp detection frame; and training a target detection algorithm model by using the region images and the coordinate information until the target detection algorithm model converges, so that the target detection algorithm model can be obtained by training through a plurality of collected region images and coordinate information.
On the basis of the above embodiment, the present invention further provides a signal lamp shielding detection method, as shown in fig. 3, the method further includes:
s301, acquiring an initial area image of an area where the signal lamp is located by using the same image acquisition parameters;
in the embodiment of the present invention, the image acquisition parameters may refer to the range and pixels of the image of the acquisition area; the initial area image can refer to an area image which is not blocked by a signal lamp before the equipment runs.
Illustratively, an initial area image 5 of the area in which the signal lamp 1 is located is acquired within the same range 1; an initial area image 6 of the area in which the signal lamp 2 and the signal lamp 3 are located is acquired within the same range 2.
In this step, the same image acquisition parameters are used to acquire an initial area image of the area where the signal lamp is located, wherein the signal lamp is not occluded.
Step S302, detecting a signal lamp image of the signal lamp in the initial area image;
in this step, a signal light image of a signal light in the initial area image is detected, and when the signal light image is detected, the signal light image may be numbered according to a preset rule.
Exemplarily, two equipment lines are arranged in the initial area image, 2 equipment lines are arranged on each equipment line, the equipment is numbered from top to bottom according to the left-to-right, and the equipment numbers on the 1 st equipment line are respectively 1-1 and 1-2; the equipment numbers on the 2 nd equipment line are respectively 2-1 and 2-2.
Detecting a signal lamp 1 image of the signal lamp 1 in the initial area image 5, wherein the signal lamp image 1 is numbered as (1-1) because the signal lamp image 1 is not shielded; the signal light image 2 of the signal light 2 and the signal light image 3 of the signal light 3 in the initial area image 6 are detected, and since both the signal light image 2 and the signal light image 3 are not shielded, the signal light image 2 is numbered as (2-1), and the signal light image 3 is numbered as (2-2).
Step S303, inputting the signal lamp image into the target detection algorithm model to obtain reference position information of the signal lamp;
in this step, since the correspondence between the area image and the coordinate information of the signal lamp image in the area image is already established when the target detection algorithm model is trained, the reference position information of the signal lamp can be obtained by inputting the signal lamp image into the target detection algorithm model.
Illustratively, the signal light image 1 is input into the target detection algorithm model, and the reference position information of the signal light 1 is obtained (m1, n1, m2, n 2); inputting the signal lamp image 2 into the target detection algorithm model to obtain reference position information (m3, n3, m4, n4) of the signal lamp 2; the signal light image 3 is input to the target detection algorithm model, and the reference position information of the signal light 3 is obtained (m5, n5, m6, n 6).
And step S304, obtaining the reference area of the signal lamp based on the reference position information.
In this step, the reference area of the traffic light may be calculated based on the reference position information, and when there are a plurality of traffic lights, the reference area of the corresponding traffic light may be calculated based on the reference position information.
Illustratively, from the reference position information (m1, n1, m2, n2) of the signal lamp 1, (m1, n1, | m2-m1|, | n2-n1|), wherein | m2-m1| is the width of the signal lamp 1 and | n2-n1| is the height of the signal lamp 1, so the reference area of the signal lamp 1 is S (1) ═ w × h | (| m2-m1|) (| n2-n1 |);
from the reference position information (m3, n3, m4, n4) of the signal lamp 2, (m3, n3, | m4-m3|, | n4-n3|), wherein | m4-m3| is the width of the signal lamp 2 and | n4-n3| is the height of the signal lamp 2, so the reference area of the signal lamp 2 is S (2) ═ w ═ h | (| m4-m3|) (| n4-n3 |);
thus, the reference area of the correspondingly numbered signal lamp is obtained.
The method provided by the embodiment of the invention uses the same image acquisition parameters to acquire the initial area image of the area where the signal lamp is located; detecting a signal lamp image of the signal lamp in the initial area image; inputting the signal lamp image into the target detection algorithm model to obtain reference position information of the signal lamp; the reference area of the signal lamp is obtained based on the reference position information, so that the reference area can be accurately calculated according to the reference position information.
On the basis of the above embodiment, the present invention further provides a signal lamp shielding detection method, as shown in fig. 4, step S102 includes:
step S401, if a signal lamp exists in the area image, inputting the area image into the target detection algorithm model to obtain position information of the signal lamp;
in the step, if a signal lamp exists in the area image, the area image is directly input into the target detection algorithm model, so that the position information of the signal lamp image can be obtained, and the position information of the signal lamp corresponding to the signal lamp image is obtained.
Exemplarily, determining an area 1 of the signal light image 1 in the region image 1, an area 2 of the signal light image 2 in the region image 2, and an area 3 of the signal light image 3 includes:
the area image 1 is directly input into a target detection algorithm model, so that the position information of the signal lamp 1 can be obtained (a1, b1, a2 and b 2); the region image 2 is directly input to the object detection algorithm model, and the position information (a3, b3, a4, b4) of the traffic light 2 and the position information (a5, b5, a6, b6) of the traffic light 3 can be obtained.
And step S402, obtaining the area of the signal lamp based on the position information.
In this step, the area of the signal lamp can be calculated from the position information.
Exemplarily, (a1, b1, | a2-a1|, | b2-b1|) can be obtained from the position information (a1, b1, a2, b2) of the signal lamp 1, wherein | a2-a1| is the width of the signal lamp 1 and | b2-b1| is the height of the signal lamp 1, so that the area of the signal lamp 1: S (3) ═ w ═ h (| a2-a1|) (|) b2-b1 |);
from the position information (a3, b3, a4, b4) of the signal lamp 2, (a3, b3, | a4-a3|, | b4-b3|), wherein | a4-a3| is the width of the signal lamp 2 and | b4-b3| is the height of the signal lamp 2, so that the area of the signal lamp 2: S (4) ═ w ═ h (| a4-a3|) (| b4-b3 |).
According to the method provided by the embodiment of the invention, if the signal lamp exists in the area image, the area image is input into the target detection algorithm model to obtain the position information of the signal lamp, and the area of the signal lamp is obtained based on the position information, so that the area of the signal lamp can be accurately obtained through the obtained position information of the signal lamp.
On the basis of the above embodiment, the present invention further provides a signal lamp shielding detection method, as shown in fig. 5, step S103 includes:
step S501, calculating a quotient value between the area of the signal lamp image and a reference area;
in the step, a corresponding relation exists between the signal lamp image and the reference area of the signal lamp image, the reference area of the corresponding signal lamp image can be determined according to the signal lamp image, and then the area of the signal lamp image is divided by the reference area to calculate a quotient value between the area of the signal lamp image and the reference area.
According to the above description, the reference area of the signal lamp 1 is S (1) ═ w ═ (| m2-m1|) (| n2-n1 |); reference area of the signal lamp 2, S (2) ═ w h (| m4-m3|) (| n4-n3 |); area of traffic light image 1, S (3) ═ w ═ h (| a2-a1|) (| b2-b1|), area of traffic light image 2: s (4) ═ w × h (| a4-a3|) (| b4-b3|), exemplarily, a reference area of the signal lamp 1, S (1) ═ 6 (square centimeters), a reference area of the signal lamp 2, S (2) ═ 5 (square centimeters), an area of the signal lamp image 1, S (3) ═ 3 (square centimeters), an area of the signal lamp image 2: s (4) ═ 2 (square centimeter),
therefore, the quotient obtained by dividing the area of the traffic light image 1 by the reference area of the traffic light 1 is 3/6 ═ 0.5; the quotient obtained by dividing the area of the traffic light image 2 by the reference area of the traffic light 2 is 2/5-0.4.
Step S502, judging whether the quotient value is less than or equal to a preset area threshold value;
in the embodiment of the present invention, the preset area threshold is a value set by a system, and exemplarily, the preset area threshold is 2.
Illustratively, the quotient 0.5 between the area of the signal light image 1 and the reference area is less than 2, it is determined that the signal light 1 is occluded; the quotient 0.4 between the area of the signal light image 2 and the reference area is less than 2, it is determined that the signal light 2 is occluded.
Step S503, if the quotient is less than or equal to a preset area threshold, it is determined that the signal lamp is shielded.
According to the method provided by the embodiment of the invention, a quotient value between the area of the signal lamp image and the reference area is calculated; judging whether the quotient value is smaller than or equal to a preset area threshold value or not; if the quotient value is smaller than or equal to the preset area threshold value, the signal lamp is determined to be shielded, and therefore when the quotient value between the area of the signal lamp image and the reference area is smaller than or equal to the preset area threshold value, the signal lamp can be determined to be shielded.
On the basis of the foregoing embodiment, the present invention further provides a signal lamp shielding detection method, as shown in fig. 6, step S103 further includes:
step S601, the step of collecting the regional image of the region where the signal lamp is located is executed in a first preset time period;
in the embodiment of the present invention, the first preset time period is a time period set by a system, for example, the first preset time period is 5 minutes, and when it is determined that the signal lamp is blocked, the step of acquiring the area image of the area where the signal lamp is located may be continuously performed within the first preset time period.
In the step, the step of collecting the area images of the area where the signal lamp is located is executed within a first preset time period, and a plurality of new area images are obtained.
Step S602, if the signal lamp is determined to be shielded again according to the area of the signal lamp image and the reference area when the first preset time period is over, the signal lamp is determined to be shielded.
In the step, whether a quotient between the area of the signal lamp image and the reference area changes in a first preset time period is judged, and if the quotient between the area of the signal lamp image and the reference area is still smaller than or equal to a preset area threshold value at the end of the first preset time period, the signal lamp is determined to be shielded.
According to the method provided by the embodiment of the invention, the step of collecting the regional image of the region where the signal lamp is located is executed within a first preset time period; if the signal lamp is determined to be shielded again according to the area of the signal lamp image and the reference area when the first preset time period is over, the signal lamp is determined to be shielded, so that the signal lamp can be further determined to be shielded in the first preset time period.
On the basis of the above embodiment, the present invention further provides a signal lamp shielding detection method, as shown in fig. 7, the method further includes:
step S701, if no signal lamp exists in the area image, acquiring the area image of the area where the signal lamp is located in a second preset time period;
in the embodiment of the present invention, the second preset time period is a time period set by a system, and the second preset time period may be the same as or different from the first preset time period in the above embodiment, and exemplarily, the second preset time period is 5 minutes, or 6 minutes, and the like.
In this step, if there is no signal lamp in the area image, the step of collecting the area image of the area where the signal lamp is located is performed within a second preset time period, so as to obtain a plurality of new area images.
And step S702, if the signal lamp is not detected in the second preset time period, sending an alarm prompt.
In the step, if the signal lamp is not detected in the plurality of new area images within the second preset time period, the signal lamp is determined to be shielded, and an alarm prompt is sent.
According to the method provided by the embodiment of the invention, if no signal lamp exists in the area image, the step of collecting the area image of the area where the signal lamp is located is executed in a second preset time period; and if the signal lamp is not detected within the second preset time period, sending an alarm prompt, and therefore, sending the alarm prompt to remind a manager in time when the signal lamp is determined not to be detected within the area where the signal lamp is located.
On the basis of the above embodiment, the present invention further provides a signal lamp shielding detection apparatus, as shown in fig. 8, including:
the acquisition module 81 is used for acquiring an area image of an area where a signal lamp on the equipment is located;
a first determining module 82, configured to determine, if a signal lamp exists in the region image, an area of the signal lamp image in the region image;
a second determining module 83, configured to determine whether the signal lamp is occluded according to the area of the signal lamp image and a reference area of a signal lamp image in a reference area image that includes the signal lamp and is acquired in advance using the same image acquisition parameter;
and the alarm module 84 is used for sending out an alarm prompt if the signal lamp is shielded.
The device provided by the embodiment of the invention collects the regional image of the region where the signal lamp on the equipment is located; if the signal lamp exists in the area image, determining the area of the signal lamp image in the area image; determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp; and if the signal lamp is shielded, sending an alarm prompt.
Because the signal lamp image in the reference region image containing the signal lamp and acquired region image which are acquired by using the same image acquisition parameter in advance have a corresponding relation, whether the signal lamp is shielded or not can be determined according to the area of the signal lamp image in the region image and the reference area of the signal lamp image in the reference region image, if the signal lamp is shielded, an alarm prompt is sent, therefore, managers can find the shielded signal lamp in time and clear shielding objects around the signal lamp in time, further, the abnormal color condition of the signal lamp can be found in time, and the damage to equipment is avoided.
In another embodiment of the present invention, there is also provided a terminal including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; the memory stores a computer program that can be run on the processor, and the processor executes the computer program to implement the steps of the method of the above-mentioned method embodiments.
According to the terminal provided by the embodiment of the invention, the processor acquires the area image of the area where the signal lamp is located on the equipment by executing the program stored in the memory; if the signal lamp exists in the area image, determining the area of the signal lamp image in the area image; determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp; if the signal lamp is sheltered from, send the warning suggestion, realize that the managers of being convenient for in time discover the signal lamp that is sheltered from, in time clear up the shelter around the signal lamp, and then, can in time discover the colour abnormal conditions of signal lamp, avoid causing the harm to equipment.
The communication bus 1140 mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 1140 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The communication interface 1120 is used for communication between the terminal and other devices.
The memory 1130 may include a Random Access Memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The processor 1110 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the integrated circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the method of the method embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (ssd)), among others.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
It is noted that, in this document, 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.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A signal lamp shielding detection method is characterized by comprising the following steps:
acquiring a region image of a region where a signal lamp on equipment is located;
if the signal lamp exists in the area image, determining the area of the signal lamp image in the area image;
determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp;
and if the signal lamp is shielded, sending an alarm prompt.
2. The signal lamp occlusion detection method of claim 1, further comprising:
acquiring a plurality of regional images of a region where a signal lamp is located on equipment by using a camera;
detecting a signal lamp in the area image to obtain a signal lamp detection frame surrounding the signal lamp image;
determining coordinate information of two end points of a diagonal line of the signal lamp detection frame;
and training a target detection algorithm model by using the area image and the coordinate information until the target detection algorithm model is converged.
3. The signal lamp occlusion detection method of claim 1, further comprising:
acquiring an initial area image of an area where the signal lamp is located by using the same image acquisition parameter;
detecting a signal lamp image of the signal lamp in the initial area image;
inputting the signal lamp image into the target detection algorithm model to obtain reference position information of the signal lamp;
and obtaining the reference area of the signal lamp based on the reference position information.
4. The method for detecting signal lamp occlusion according to claim 1, wherein the determining the area of the signal lamp image in the area image if the signal lamp exists in the area image comprises:
if a signal lamp exists in the area image, inputting the area image into the target detection algorithm model to obtain the position information of the signal lamp;
and obtaining the area of the signal lamp based on the position information.
5. The method for detecting signal lamp occlusion according to claim 1, wherein determining whether the signal lamp is occluded according to the area of the signal lamp image and a reference area of a signal lamp image in a reference area image containing the signal lamp acquired in advance using the same image acquisition parameters comprises:
calculating a quotient value between the area of the signal lamp image and a reference area;
judging whether the quotient value is smaller than or equal to a preset area threshold value or not;
and if the quotient is smaller than or equal to a preset area threshold value, determining that the signal lamp is shielded.
6. The signal lamp occlusion detection method of claim 5, wherein determining whether the signal lamp is occluded according to the area of the signal lamp image and a reference area of a signal lamp image in a reference area image containing the signal lamp, which is acquired in advance using the same image acquisition parameters, further comprises:
the method comprises the steps of acquiring a regional image of a region where a signal lamp is located within a first preset time period;
and if the signal lamp is determined to be shielded again according to the area of the signal lamp image and the reference area when the first preset time period is over, determining that the signal lamp is shielded.
7. The signal lamp occlusion detection method of claim 1, further comprising:
if no signal lamp exists in the area image, the step of collecting the area image of the area where the signal lamp is located is executed in a second preset time period;
and if the signal lamp is not detected within the second preset time period, sending an alarm prompt.
8. The utility model provides a signal lamp shelters from detection device which characterized in that includes:
the acquisition module is used for acquiring a regional image of a region where a signal lamp on the equipment is located;
the first determining module is used for determining the area of a signal lamp image in the area image if the signal lamp exists in the area image;
the second determining module is used for determining whether the signal lamp is shielded or not according to the area of the signal lamp image and the reference area of the signal lamp image in the reference region image which is acquired by using the same image acquisition parameters in advance and contains the signal lamp;
and the alarm module is used for sending an alarm prompt if the signal lamp is shielded.
9. A terminal, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; stored in the memory is a computer program that can be run on the processor, wherein the steps of the method according to any of the claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable medium having non-volatile program code executable by a processor, wherein the program code causes the processor to perform the method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010245117.1A CN113469173A (en) | 2020-03-31 | 2020-03-31 | Signal lamp shielding detection method and device, terminal and computer readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010245117.1A CN113469173A (en) | 2020-03-31 | 2020-03-31 | Signal lamp shielding detection method and device, terminal and computer readable medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113469173A true CN113469173A (en) | 2021-10-01 |
Family
ID=77865501
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010245117.1A Pending CN113469173A (en) | 2020-03-31 | 2020-03-31 | Signal lamp shielding detection method and device, terminal and computer readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113469173A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000150624A (en) * | 1998-11-16 | 2000-05-30 | Yamatake Corp | Wafer detecting device |
CN103139547A (en) * | 2013-02-25 | 2013-06-05 | 昆山南邮智能科技有限公司 | Method of judging shielding state of pick-up lens based on video image signal |
CN107341490A (en) * | 2017-07-17 | 2017-11-10 | 华中科技大学 | A kind of shielding automobile detection method and system based on convex closure analysis |
CN108197571A (en) * | 2018-01-02 | 2018-06-22 | 联想(北京)有限公司 | A kind of mask occlusion detection method and electronic equipment |
CN108319953A (en) * | 2017-07-27 | 2018-07-24 | 腾讯科技(深圳)有限公司 | Occlusion detection method and device, electronic equipment and the storage medium of target object |
CN110070056A (en) * | 2019-04-25 | 2019-07-30 | 腾讯科技(深圳)有限公司 | Image processing method, device, storage medium and equipment |
CN110647818A (en) * | 2019-08-27 | 2020-01-03 | 北京易华录信息技术股份有限公司 | Identification method and device for shielding target object |
CN112116551A (en) * | 2019-06-20 | 2020-12-22 | 腾讯科技(深圳)有限公司 | Camera shielding detection method and device, electronic equipment and storage medium |
-
2020
- 2020-03-31 CN CN202010245117.1A patent/CN113469173A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000150624A (en) * | 1998-11-16 | 2000-05-30 | Yamatake Corp | Wafer detecting device |
CN103139547A (en) * | 2013-02-25 | 2013-06-05 | 昆山南邮智能科技有限公司 | Method of judging shielding state of pick-up lens based on video image signal |
CN107341490A (en) * | 2017-07-17 | 2017-11-10 | 华中科技大学 | A kind of shielding automobile detection method and system based on convex closure analysis |
CN108319953A (en) * | 2017-07-27 | 2018-07-24 | 腾讯科技(深圳)有限公司 | Occlusion detection method and device, electronic equipment and the storage medium of target object |
CN108197571A (en) * | 2018-01-02 | 2018-06-22 | 联想(北京)有限公司 | A kind of mask occlusion detection method and electronic equipment |
CN110070056A (en) * | 2019-04-25 | 2019-07-30 | 腾讯科技(深圳)有限公司 | Image processing method, device, storage medium and equipment |
CN112116551A (en) * | 2019-06-20 | 2020-12-22 | 腾讯科技(深圳)有限公司 | Camera shielding detection method and device, electronic equipment and storage medium |
CN110647818A (en) * | 2019-08-27 | 2020-01-03 | 北京易华录信息技术股份有限公司 | Identification method and device for shielding target object |
Non-Patent Citations (1)
Title |
---|
周良毅等: "基于动态遮挡阈值的多视角多目标协作追踪", 《计算机研究与发展》, vol. 52, no. 4, 15 April 2014 (2014-04-15), pages 813 - 823 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110000783B (en) | Visual grabbing method and device for robot | |
JP6325520B2 (en) | Unevenness inspection system, unevenness inspection method, and unevenness inspection program | |
CN112232279B (en) | Personnel interval detection method and device | |
JP2014533349A (en) | Measurement of belt wear by edge detection of raster images. | |
CN111445467A (en) | Lighting defect detection method and device, electronic equipment and storage medium | |
JP2009159448A (en) | Object detecting apparatus, and object detecting method | |
CN113408479A (en) | Flame detection method and device, computer equipment and storage medium | |
CN108419045B (en) | Monitoring method and device based on infrared thermal imaging technology | |
CN114078124A (en) | Camera detection method, detection device, computer equipment and storage medium | |
CN112216073B (en) | Ladder violation operation warning method and device | |
CN111465045B (en) | AP monitoring method, monitoring server and monitoring system | |
CN113469173A (en) | Signal lamp shielding detection method and device, terminal and computer readable medium | |
CN113838003A (en) | Speckle detection method, device, medium, and computer program product for image | |
JP5792671B2 (en) | Abnormality detection method and abnormality detection device | |
CN116846768A (en) | Display method and device for network topology structure and electronic equipment | |
JP5710230B2 (en) | Monitoring system and monitoring method | |
JP2016099633A (en) | Maintenance inspection system using a portable terminal | |
CN110147765A (en) | A kind of image processing method and device | |
JP3888528B2 (en) | Liquid level recognition processing apparatus and liquid level monitoring system | |
CN105141904A (en) | Method and device for security monitoring and identity identification | |
CN114820526A (en) | Detection management method, device and system for construction hidden danger of power transmission line | |
CN111091024B (en) | Small target filtering method and system based on video recognition result | |
JP6376742B2 (en) | Monitoring program, monitoring method and monitoring apparatus | |
CN107845103B (en) | Alarm method and device based on texture information and computer readable storage medium | |
JP2011061651A (en) | Suspicious object detection system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |