Traffic light color recognition method, device, equipment and roadside computing equipment
By obtaining and determining the light halo detection frame of the traffic light, combining the depth-first search algorithm and the European-style distance replacement method, the problem of misidentification in traffic light color recognition is solved, the recognition accuracy and efficiency are improved, and traffic accidents are avoided.
Patent Information
- Application Number
- CN202111165283.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-09-30
AI Technical Summary
The existing traffic light color recognition methods have misidentification problems in night data processing, especially the light halo labeling affects model detection and recognition effects, and lacks effective solutions.
By obtaining the light halo detection box in the target image, determining the corresponding traffic light detection box, using depth-first search algorithm and European-style distance replacement methods, the accuracy of the traffic light detection box is improved and the light color recognition is performed.
It improves the accuracy and efficiency of traffic light color recognition, reduces misidentification, and avoids traffic accidents caused by misidentification.
Smart Images

Figure CN113947762B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of intelligent transportation, and in particular to the field of traffic light color recognition, and specifically to a traffic light color recognition method, device, equipment, and roadside computing equipment. Background Art
[0002] At present, the common traffic light color recognition process is to first perform target detection to detect the traffic lights in the image, then cut out the traffic light image according to the position of the detection frame, and then perform the light color recognition process.
[0003] However, when using the traffic light data obtained at night for model training, the labeled data needs to be preprocessed; the clear night traffic light image can see the light frame and the light head frame, and the labeler will label it according to the color of the light frame and the light head frame; according to the principle of deep learning, the model will learn what the labeler labels. For the light frame marked as a light halo, when training the light color recognition model, because there is no way to obtain the entire traffic light frame, it will affect the model's detection and subsequent traffic light recognition.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The present disclosure provides a method, device, equipment and roadside computing equipment for traffic light color recognition.
[0006] According to one aspect of the present disclosure, a method for identifying the color of a traffic light is provided, comprising: obtaining a light halo detection frame in a target image, wherein the target image includes at least one traffic light, and the light halo detection frame is obtained by identifying a light halo annotation result of the traffic light; determining a traffic light detection frame corresponding to the light halo detection frame, wherein the traffic light detection frame is a detection frame corresponding to the annotation result of the traffic light; and performing light color recognition on the traffic light based on the traffic light detection frame to obtain a recognition result.
[0007] Optionally, obtaining the light halo detection frame in the target image includes: controlling a camera to capture the traffic lights in a predetermined area to obtain the target image; obtaining the light halo annotation result of the target image; identifying the light halo annotation result to obtain the light halo detection frame.
[0008] Optionally, the method further includes: obtaining the lamp head annotation results of the target image to obtain multiple traffic light detection frames; determining an average detection frame of the target image based on the multiple traffic light detection frames, wherein the average detection frame is used to indicate the position and number of the traffic lights in the target image.
[0009] Optionally, the above-mentioned determination of the traffic light detection frame corresponding to the above-mentioned light halo detection frame includes: obtaining the first center point of the above-mentioned light halo detection frame, and multiple second center points of the multiple average detection frames; selecting a third center point from the above-mentioned multiple second center points, wherein the Euclidean distance between the above-mentioned third center point and the above-mentioned first center point is less than a first preset distance; when the above-mentioned Euclidean distance is less than the second preset distance, replacing the above-mentioned light halo detection frame with the average detection frame including the above-mentioned third center point.
[0010] Optionally, the above-mentioned determining the average detection frame of the above-mentioned target image based on the multiple traffic light detection frames includes: converting the multiple traffic light detection frames into a graph data structure; obtaining multiple connected domains of the above-mentioned graph data structure using a depth-first search algorithm; and calculating multiple average detection frames corresponding to the multiple connected domains based on the mean data of all traffic light detection frames in each of the above-mentioned connected domains, wherein the above-mentioned mean data includes: a center point mean, a frame length mean, and a frame width mean.
[0011] Optionally, each traffic light detection box serves as a vertex in the above-mentioned graph data structure, and the center point distance value between each two of the above-mentioned traffic light detection boxes serves as an edge of the above-mentioned graph data structure; if the value of the above-mentioned edge is greater than a first preset threshold, it is determined that the above-mentioned two traffic light detection boxes are disconnected; if the value of the above-mentioned edge is less than or equal to the above-mentioned first preset threshold, it is determined that the above-mentioned two traffic light detection boxes are connected.
[0012] Optionally, before determining the traffic light detection frame corresponding to the above-mentioned light halo detection frame, the above-mentioned method also includes: determining the relative position relationship between the first center point of the above-mentioned light halo detection frame and the above-mentioned traffic light; if the above-mentioned relative position relationship meets the preset requirements, then determining the above-mentioned light halo detection frame as the light halo detection frame to be compensated, wherein, when the above-mentioned preset requirements are met, the color of the above-mentioned light halo detection frame matches the light color of the above-mentioned traffic light.
[0013] According to another aspect of the present disclosure, a device for identifying the color of a traffic light is provided, comprising: an acquisition module, used to acquire a light halo detection frame in a target image, wherein the target image includes at least one traffic light, and the light halo detection frame is obtained by identifying the light halo annotation result of the traffic light; a determination module, used to determine a traffic light detection frame corresponding to the light halo detection frame, wherein the traffic light detection frame is a detection frame corresponding to the annotation result of the traffic light; and an identification module, used to identify the color of the traffic light based on the traffic light detection frame to obtain an identification result.
[0014] Optionally, the above-mentioned acquisition module includes: a shooting unit, used to control the camera device to shoot the above-mentioned traffic lights in a predetermined area to obtain the above-mentioned target image; a first acquisition unit, used to obtain the above-mentioned light halo annotation result of the above-mentioned target image; and an identification unit, used to identify the above-mentioned light halo annotation result to obtain the above-mentioned light halo detection frame.
[0015] Optionally, the above-mentioned device also includes: a second acquisition unit, used to acquire the lamp head annotation result of the above-mentioned target image to obtain multiple traffic light detection frames; a determination unit, used to determine the average detection frame of the above-mentioned target image based on the multiple traffic light detection frames, wherein the above-mentioned average detection frame is used to indicate the position and number of the above-mentioned traffic lights in the above-mentioned target image.
[0016] Optionally, the determination unit includes: a first acquisition subunit, used to acquire the first center point of the light halo detection frame, and multiple second center points of the multiple average detection frames; a selection subunit, used to select a third center point from the multiple second center points, wherein the Euclidean distance between the third center point and the first center point is less than a first preset distance; and a replacement subunit, used to replace the light halo detection frame with an average detection frame including the third center point when the Euclidean distance is less than the second preset distance.
[0017] Optionally, the above-mentioned determination unit also includes: a conversion subunit, used to convert the multiple traffic light detection frames into a graphic data structure; a second acquisition subunit, used to adopt a depth-first search algorithm to obtain multiple connected domains of the above-mentioned graphic data structure; a calculation subunit, used to calculate the multiple average detection frames corresponding to the multiple connected domains based on the mean data of all traffic light detection frames in each of the above-mentioned connected domains, wherein the above-mentioned mean data includes: the center point mean, the frame length mean and the frame width mean.
[0018] Optionally, the above-mentioned determination module is also used to: determine the relative position relationship between the first center point of the above-mentioned light halo detection frame and the above-mentioned traffic light; if the above-mentioned relative position relationship meets the preset requirements, then determine the above-mentioned light halo detection frame as the light halo detection frame to be compensated, wherein, when the above-mentioned preset requirements are met, the color of the above-mentioned light halo detection frame matches the light color of the above-mentioned traffic light.
[0019] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the above-mentioned traffic light color recognition methods.
[0020] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the above-mentioned traffic light color recognition methods.
[0021] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements any one of the above-mentioned methods for identifying the color of a traffic light.
[0022] According to another aspect of the present disclosure, a roadside computing device is provided, comprising the above electronic device.
[0023] By automatically replacing the light halo detection frame with the traffic light detection frame, and then using the traffic light detection frame to identify the light color of the traffic light, the purpose of improving the recognition accuracy and efficiency of the light color of the traffic light is achieved, thereby achieving the technical effect of avoiding traffic accidents caused by misidentification of the light color of the traffic light, and further solving the technical problem of misidentification in the light color recognition method of the traffic light in the prior art.
[0024] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0026] Figure 1 is a schematic flow chart of steps of a method for identifying the color of a traffic light according to a first embodiment of the present disclosure;
[0027] Figure 2 is a schematic diagram of the structure of a light halo detection frame and a traffic light detection frame according to the first embodiment of the present disclosure;
[0028] Figure 3 is a schematic structural diagram of a light color recognition device for a traffic light according to a second embodiment of the present disclosure;
[0029] Figure 4 A schematic block diagram of an example electronic device 800 is shown that may be used to implement embodiments of the present disclosure. DETAILED DESCRIPTION
[0030] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0032] Example 1
[0033] According to an embodiment of the present disclosure, an embodiment of a method for identifying the color of a traffic light is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] Figure 1 FIG. 1 is a flow chart of steps of a method for identifying the color of a traffic light according to a first embodiment of the present disclosure. Figure 1 As shown, the method comprises the following steps:
[0035] Step S102, obtaining a light halo detection frame in a target image, wherein the target image includes at least one traffic light, and the light halo detection frame is obtained by identifying a light halo annotation result of the traffic light;
[0036] Step S104, determining a traffic light detection frame corresponding to the light halo detection frame, wherein the traffic light detection frame is a detection frame corresponding to the annotation result of the traffic light;
[0037] Step S106, performing light color recognition on the traffic light based on the traffic light detection frame to obtain a recognition result.
[0038] Optionally, the traffic light is a traffic signal light, for example, a traffic light installed at an intersection. The target image is a target image acquired by photographing. The shooting angle of the target image is not specifically limited. However, all traffic lights that need to be identified must be present in the target image. If only one traffic light needs to be identified, the target image contains at least one traffic light. The shape of the traffic light is not specifically limited, and the shape of the traffic light will not affect the light color recognition result of the traffic light.
[0039] In the embodiment of the present disclosure, taking a traffic light as an example, Figure 2 The light halo detection frame and the traffic light detection frame structure schematic diagram shown in FIG. 3 are red, yellow and green traffic lights in each row, and the three traffic lights in each row are used to indicate whether vehicles on different lanes pass or stop; Figure 2 As shown in the figure, the small box in the middle of each traffic light represents a traffic light. By marking the traffic light, the corresponding traffic light detection box can be obtained. Figure 2 In the figure, the traffic light is black, which means that the traffic light is in the on state, and the traffic light is white, which means that the traffic light is not in the off state; the dotted frame outside each traffic light represents the halo part of the traffic light, and when the traffic light is in the on state, the halo part is represented by the shaded part; the halo detection frame can be obtained by marking the halo part of the traffic light.
[0040] By automatically replacing the light halo detection frame with the traffic light detection frame, and then using the traffic light detection frame to identify the light color of the traffic light, the purpose of improving the recognition accuracy and efficiency of the light color of the traffic light is achieved, thereby achieving the technical effect of avoiding traffic accidents caused by misidentification of the light color of the traffic light, and further solving the technical problem of misidentification in the light color recognition method of the traffic light in the prior art.
[0041] In an optional embodiment, the step of obtaining a light halo detection frame in a target image includes:
[0042] Step S202, controlling the camera device to shoot the traffic lights in the predetermined area to obtain the target image;
[0043] Step S204, obtaining the light halo annotation result of the target image;
[0044] Step S206, identifying the light halo annotation result to obtain the light halo detection frame.
[0045] It should be noted that the above-mentioned camera equipment can be a vehicle-mounted shooting equipment, such as a driving recorder, etc., or it can be a fixed shooting equipment, such as a camera fixed on the roadside, etc.; the above-mentioned predetermined shooting area refers to the area where the traffic lights to be photographed are located; the above-mentioned light halo annotation results of the above-mentioned target image can be obtained by a variety of annotation methods, such as manual annotation, computer automatic annotation.
[0046] In the embodiment of the present disclosure, taking the roadside perception scene as an example, a sensor is used to obtain the above-mentioned target image of the traffic light. Since the sensor is deployed on the roadside and is fixed, the position of the traffic light in the image is fixed, and the annotation of the traffic lights in the image is also more accurate. The annotation results in the above-mentioned target image are identified to obtain a light halo detection frame.
[0047] In an optional embodiment, the above method further includes:
[0048] Step S302, obtaining the lamp head annotation result of the target image to obtain a plurality of traffic light detection frames;
[0049] Step S304: determining an average detection frame of the target image based on the plurality of traffic light detection frames, wherein the average detection frame is used to indicate the position and number of the traffic lights in the target image.
[0050] In the disclosed embodiment, firstly, the annotation results of all traffic lights in a camera are traversed to obtain the traffic light annotation frame of the camera, and the lamp head annotation results of the target image are obtained from the traffic light annotation frame to obtain the detection frame of the traffic light; and the average detection frame is determined based on the detection frame. Among them, a rectangular frame is used to annotate a complete traffic light, and x_left_top and y_left_top are used to represent the coordinates of the upper left corner of the rectangular frame in the pixel coordinate system, and x_right_down and y_right_down are used to represent the coordinates of the lower right corner of the rectangular frame in the pixel coordinate system; the above coordinate points can be used to calculate data such as the center point and the average value.
[0051] It should be noted that the above average detection frame is calculated by the center point, length and width of the above traffic light detection frame, and the above average detection frame is used to indicate the position and number of the above traffic lights in the above target image.
[0052] In an optional embodiment, the determining of the traffic light detection frame corresponding to the light halo detection frame includes:
[0053] Step S402, obtaining a first center point of the light halo detection frame and a plurality of second center points of a plurality of the average detection frames;
[0054] Step S404, selecting a third center point from the plurality of second center points, wherein the Euclidean distance between the third center point and the first center point is less than a first preset distance;
[0055] Step S406: When the Euclidean distance is less than the second preset distance, the light halo detection frame is replaced by an average detection frame including the third center point.
[0056] In the disclosed embodiment, the labeling results of the halo detection frames of all traffic lights under the camera are calculated to obtain a first center point; the center points of all average detection frames are calculated to obtain multiple second center points of the above average detection frames; the third center point, which is the closest to the Euclidean distance of the above first center point, is found from the above multiple second center points to determine whether the distance is less than the threshold requirement. If so, the position of the average detection frame can be used to replace the halo detection frame.
[0057] It should be noted that there are two types of light halo detection frame and traffic light detection frame. If a traffic light is very bright and the entire traffic light cannot be seen clearly, and only the lit lamp head can be seen clearly, it is marked as a light halo detection frame; if the entire traffic light can be seen clearly, it is marked as a traffic light detection frame; the marking results include the position of the frame and the color of the traffic light.
[0058] In an optional embodiment, determining the average detection frame of the target image based on the plurality of traffic light detection frames includes:
[0059] Step S502, converting the plurality of traffic light detection frames into a graphic data structure;
[0060] Step S504, using a depth-first search algorithm to obtain multiple connected domains of the above-mentioned graph data structure;
[0061] Step S506: Based on the mean data in each of the above connected domains, multiple average detection frames corresponding to the multiple connected domains are calculated, wherein the above mean data includes: a center point mean, a frame length mean, and a frame width mean.
[0062] In the disclosed embodiment, all traffic light detection frames are organized into a graph data structure, each traffic light detection frame is used as a vertex in the graph data structure, and the distance between the center points of every two traffic light detection frames is used as an edge in the graph data structure. If the value of the edge is greater than a threshold, it is considered that the two are disconnected, and if it is less than or equal to the threshold, it is considered that they are connected. A depth-first search method is used to obtain the number of connected domains of the graph, and the traffic light frames in each connected domain are considered to be the annotation results of the same real traffic light frame.
[0063] It should be noted that the above-mentioned every two traffic light detection frames refer to taking out two different traffic lights from all the traffic lights each time.
[0064] In the disclosed embodiment, for all traffic light detection frames belonging to the same connected domain, the center points of all traffic light detection frames are calculated and the average of the center points is found, all light frame lengths are taken out and the average is found, and all light frame widths are taken out and the average is found; for each connected domain, the average frame of the connected domain is calculated based on the obtained center point average, length average, and width average; for example: for all images captured by a certain camera, if it is found that there are a total of 5 connected domains, the average frame of the five connected domains is calculated, then it is determined that there are a total of 5 traffic lights at the intersection under actual conditions, and where each traffic light is located.
[0065] It should be noted that, based on the average value of the center point, the average value of the detection frame length, and the average value of the detection frame width of all traffic light detection frames in each of the above connected domains, multiple average detection frames corresponding to the above connected domains are calculated.
[0066] In an optional embodiment, each traffic light detection box serves as a vertex in the above-mentioned graph data structure, and the center point distance value between each two of the above-mentioned traffic light detection boxes serves as an edge of the above-mentioned graph data structure; if the value of the above-mentioned edge is greater than a first preset threshold, it is determined that the above-mentioned two traffic light detection boxes are disconnected; if the value of the above-mentioned edge is less than or equal to the above-mentioned first preset threshold, it is determined that the above-mentioned two traffic light detection boxes are connected.
[0067] In an optional embodiment, before determining the traffic light detection frame corresponding to the light halo detection frame, the method further includes:
[0068] Step S702, determining the relative position relationship between the first center point of the light halo detection frame and the traffic light;
[0069] Step S704: if the relative position relationship meets the preset requirements, the light halo detection frame is determined to be the light halo detection frame to be compensated, wherein, when the preset requirements are met, the color of the light halo detection frame matches the light color of the traffic light.
[0070] In the disclosed embodiment, the center point of the light halo frame is calculated to be at the upper position, middle position, or lower position of the traffic light; the traffic light pre-marked as three lamp heads is calculated, if it is at the upper position and the light halo frame is red, if it is at the middle position and the light halo frame is yellow, if it is at the lower position and the light halo frame is green, then the color of the light halo frame is considered to be correct. If it is incorrect, the data is discarded and not used for data training.
[0071] Through the disclosed embodiments, a light halo detection frame in a target image is obtained, wherein the target image includes at least one traffic light, and the light halo detection frame is obtained by identifying the light halo annotation result of the traffic light; a traffic light detection frame corresponding to the light halo detection frame is determined, wherein the traffic light detection frame is a detection frame corresponding to the annotation result of the traffic light; a method for identifying the light color of the traffic light based on the traffic light detection frame is performed to obtain an identification result; automatic detection is efficient and low-cost; and the technical problem that in the current process of identifying the light color of a traffic light, the relative position of the currently lit lamp head on the traffic light cannot be known, and misidentification may occur when identifying the light color of the traffic light is solved.
[0072] Example 2
[0073] According to an embodiment of the present disclosure, there is also provided an embodiment of a device for implementing the above-mentioned traffic light color recognition method. Figure 3 is a schematic diagram of the structure of a light color recognition device for a traffic light according to a second embodiment of the present disclosure, such as Figure 3 As shown, the above-mentioned traffic light color recognition device includes: an acquisition module 40, a determination module 42 and an identification module 44, wherein:
[0074] An acquisition module 40 is used to acquire a light halo detection frame in a target image, wherein the target image includes at least one traffic light, and the light halo detection frame is obtained by identifying a light halo annotation result of the traffic light;
[0075] A determination module 42 is used to determine a traffic light detection frame corresponding to the light halo detection frame, wherein the traffic light detection frame is a detection frame corresponding to the annotation result of the traffic light;
[0076] The recognition module 44 is used to recognize the light color of the traffic light based on the traffic light detection frame to obtain a recognition result.
[0077] In the embodiment of the present disclosure, the above-mentioned acquisition module includes: a shooting unit, used to control the camera device to shoot the above-mentioned traffic lights in a predetermined area to obtain the above-mentioned target image; a first acquisition unit, used to obtain the above-mentioned light halo annotation result of the above-mentioned target image; and an identification unit, used to identify the above-mentioned light halo annotation result to obtain the above-mentioned light halo detection frame.
[0078] In the embodiment of the present disclosure, the above-mentioned device also includes: a second acquisition unit, used to acquire the light head annotation result of the above-mentioned target image to obtain multiple traffic light detection frames; a determination unit, used to determine the average detection frame of the above-mentioned target image based on the multiple traffic light detection frames, wherein the above-mentioned average detection frame is used to indicate the position and number of the above-mentioned traffic lights in the above-mentioned target image.
[0079] In the embodiment of the present disclosure, the above-mentioned determination unit includes: a first acquisition subunit, used to acquire the first center point of the above-mentioned light halo detection frame, and multiple second center points of the multiple average detection frames; a selection subunit, used to select a third center point from the above-mentioned multiple second center points, wherein the Euclidean distance between the above-mentioned third center point and the above-mentioned first center point is less than a first preset distance; a replacement subunit, used to replace the above-mentioned light halo detection frame with an average detection frame including the above-mentioned third center point when the above-mentioned Euclidean distance is less than the second preset distance.
[0080] In the embodiment of the present disclosure, the above-mentioned determination unit also includes: a conversion subunit, which is used to convert the multiple traffic light detection frames mentioned above into a graphic data structure; a second acquisition subunit, which is used to adopt a depth-first search algorithm to obtain multiple connected domains of the above-mentioned graphic data structure; a calculation subunit, which is used to calculate the multiple average detection frames corresponding to the multiple connected domains based on the mean data of all traffic light detection frames in each of the above-mentioned connected domains, wherein the above-mentioned mean data includes: the center point mean, the frame length mean and the frame width mean.
[0081] In the embodiment of the present disclosure, the above-mentioned determination module is also used to: determine the relative position relationship between the first center point of the above-mentioned light halo detection frame and the above-mentioned traffic light; if the above-mentioned relative position relationship meets the preset requirements, then determine the above-mentioned light halo detection frame as the light halo detection frame to be compensated, wherein, when the above-mentioned preset requirements are met, the color of the above-mentioned light halo detection frame matches the light color of the above-mentioned traffic light.
[0082] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0083] It should be noted that the acquisition module 40, the determination module 42 and the identification module 44 correspond to steps S102 to S106 in Example 1, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the modules as part of the device can be run in a computer terminal.
[0084] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in Example 1, which will not be repeated here.
[0085] The above-mentioned traffic light color recognition device may also include a processor and a memory. The above-mentioned acquisition module 40, determination module 42 and recognition module 44 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0086] The processor includes a kernel, which retrieves the corresponding program unit from the memory. The kernel may be one or more. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory includes at least one memory chip.
[0087] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0088] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the above-mentioned traffic light color recognition methods.
[0089] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0090] The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the traffic light color recognition methods.
[0091] The computer program product comprises a computer program, and when the computer program is executed by a processor, any one of the above-mentioned methods for identifying the color of a traffic light is implemented.
[0092] According to an embodiment of the present disclosure, there is also provided an embodiment of a roadside computing device, including the above electronic device,
[0093] Optionally, the roadside computing device may include not only electronic devices but also communication components, and the electronic devices and communication components may be integrated as one or may be separately provided. The electronic device may acquire data from a camera device (such as a roadside camera), such as pictures and videos, to perform image and video processing and data calculation, and then transmit the processing and calculation results to the cloud control platform via the communication components. Optionally, the roadside computing device may also be an edge computing platform. Optionally, the electronic device itself may also have video and picture data acquisition and communication functions, such as an AI camera. The electronic device may directly perform image and video processing and data calculation based on the acquired perception data, and then transmit the processing and calculation results to the cloud control platform.
[0094] Optionally, the cloud control platform performs data processing in the cloud. The cloud control platform can also be called a vehicle-road collaborative management platform, a V2X platform, a cloud computing platform, a central system, a cloud server, etc.
[0095] Figure 4 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0096] like Figure 4 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0097] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0098] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the method of obtaining a light halo detection frame in a target image. For example, in some embodiments, the method of obtaining a light halo detection frame in a target image may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the method described above for obtaining a light halo detection frame in a target image may be executed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the method to obtain the light halo detection frame in the target image in any other appropriate manner (for example, by means of firmware).
[0099] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0100] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0101] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0102] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0103] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0104] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0106] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for identifying the color of a traffic light, comprising: Acquire a light halo detection frame in a target image, wherein the target image includes at least one traffic light, and the light halo detection frame is obtained by identifying a light halo annotation result of the traffic light; Determine a traffic light detection frame corresponding to the light halo detection frame, wherein the traffic light detection frame is a detection frame corresponding to the annotation result of the traffic light; Based on the traffic light detection frame, the traffic light color is recognized to obtain a recognition result; Wherein, determining a traffic light detection frame corresponding to the light halo detection frame includes: Obtaining a first center point of the light halo detection frame and a plurality of second center points of a plurality of average detection frames, wherein the average detection frame is obtained by calculating a mean value of center points, a mean value of frame lengths, and a mean value of frame widths of a plurality of the traffic light detection frames, and the average detection frame is used to indicate the position and quantity of the traffic lights in the target image; Selecting a third center point from the plurality of second center points, wherein a Euclidean distance between the third center point and the first center point is less than a first preset distance; When the Euclidean distance is less than the second preset distance, the light halo detection frame is replaced by the average detection frame including the third center point.
2. The method according to claim 1, wherein: The step of obtaining a light halo detection frame in a target image includes: Controlling a camera to capture the traffic light in a predetermined area to obtain the target image; Obtaining the light halo annotation result of the target image; The light halo annotation result is identified to obtain the light halo detection frame.
3. The method according to claim 1, wherein: The method further comprises: Obtaining the lamp head annotation result of the target image to obtain a plurality of traffic light detection frames; An average detection frame of the target image is determined according to the multiple traffic light detection frames.
4. The method according to claim 3, wherein: The step of determining an average detection frame of the target image based on the plurality of traffic light detection frames comprises: Converting a plurality of the traffic light detection frames into a graphic data structure; Using a depth-first search algorithm to obtain multiple connected domains of the graph data structure; Based on the mean data of all traffic light detection frames in each of the connected domains, multiple average detection frames corresponding to the multiple connected domains are calculated, wherein the mean data includes: a center point mean, a frame length mean, and a frame width mean.
5. The method according to claim 4, wherein: Each traffic light detection frame serves as a vertex in the graph data structure, and the center point distance value between each two traffic light detection frames serves as an edge of the graph data structure; if the value of the edge is greater than a first preset threshold, it is determined that the two traffic light detection frames are disconnected; if the value of the edge is less than or equal to the first preset threshold, it is determined that the two traffic light detection frames are connected.
6. The method according to claim 1, wherein: Before determining the traffic light detection frame corresponding to the light halo detection frame, the method further includes: Determining a relative position relationship between a first center point of the light halo detection frame and the traffic light; If the relative position relationship meets the preset requirements, the light halo detection frame is determined to be the light halo detection frame to be compensated, wherein, when the preset requirements are met, the color of the light halo detection frame matches the light color of the traffic light.
7. A device for identifying the color of a traffic light, comprising: An acquisition module, used for acquiring a light halo detection frame in a target image, wherein the target image includes at least one traffic light, and the light halo detection frame is obtained by identifying a light halo annotation result of the traffic light; A determination module, used to determine a traffic light detection frame corresponding to the light halo detection frame, wherein the traffic light detection frame is a detection frame corresponding to the annotation result of the traffic light; A recognition module, used to recognize the light color of the traffic light based on the traffic light detection frame to obtain a recognition result; Wherein, the determining module is also used for: Obtaining a first center point of the light halo detection frame and a plurality of second center points of a plurality of average detection frames, wherein the average detection frame is obtained by calculating a center point average, a length average, and a width average of a plurality of the traffic light detection frames, and the average detection frame is used to indicate the position and quantity of the traffic lights in the target image; Selecting a third center point from the plurality of second center points, wherein a Euclidean distance between the third center point and the first center point is less than a first preset distance; When the Euclidean distance is less than the second preset distance, the light halo detection frame is replaced by the average detection frame including the third center point.
8. The device according to claim 7, wherein: The acquisition module comprises: A shooting unit, used for controlling a camera to shoot the traffic lights in a predetermined area to obtain the target image; A first acquisition unit, used for acquiring the light halo annotation result of the target image; The recognition unit is used to recognize the light halo annotation result and obtain the light halo detection frame.
9. The device according to claim 7, wherein: The device also includes: A second acquisition unit is used to acquire the lamp head annotation result of the target image to obtain a plurality of traffic light detection frames; A determination unit is used to determine an average detection frame of the target image according to the multiple traffic light detection frames.
10. The device according to claim 9, wherein: The determining unit further includes: A conversion subunit, used for converting the plurality of traffic light detection frames into a graphic data structure; A second acquisition subunit is used to acquire multiple connected domains of the graph data structure by using a depth-first search algorithm; The calculation subunit is used to calculate multiple average detection frames corresponding to multiple connected domains based on the mean data of all traffic light detection frames in each of the connected domains, wherein the mean data includes: the mean of the center point, the mean of the frame length and the mean of the frame width.
11. The device according to claim 7, wherein: The determination module is also used to: determine the relative position relationship between the first center point of the light halo detection frame and the traffic light; if the relative position relationship meets the preset requirements, determine the light halo detection frame as the light halo detection frame to be compensated, wherein, when the preset requirements are met, the color of the light halo detection frame matches the light color of the traffic light.
12. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for recognizing the color of a traffic light according to any one of claims 1 to 6.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the method for recognizing the color of a traffic light according to any one of claims 1 to 6.
14. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for recognizing the color of a traffic light according to any one of claims 1 to 6 is implemented.
15. A roadside computing device, comprising the electronic device as claimed in claim 12.
Citation Information
Patent Citations
Data processing method and device, equipment and storage medium
CN113129375A
Traffic signal lamp identification method and device, cloud control platform and vehicle-road cooperation system
CN113408409A
