Traffic light color recognition method and device, storage medium, equipment and vehicle
By determining the intersection type and identifying false positives based on traffic light color recognition results in intelligent or autonomous driving, and combining historical and current recognition results, the problem of machine learning algorithms being affected by the environment is solved, achieving higher recognition accuracy and traffic safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MOMENTA (SUZHOU) TECHNOLOGY CO LTD
- Filing Date
- 2022-05-31
- Publication Date
- 2026-07-07
AI Technical Summary
Machine learning-based traffic light recognition algorithms are easily affected by environmental factors such as background color, headlights of vehicles ahead, and streetlights, leading to errors in traffic light color recognition and affecting traffic safety.
The intersection type of the target intersection is determined by judging whether each color recognition result pair in multiple color recognition result pairs in the first time period is the same color. After determining the intersection type, the preset color recognition result pair is identified as a false detection result. The true result is determined by combining the historical and current recognition results to avoid incorrect driving decisions.
This improves the accuracy of traffic light color recognition, avoids incorrect driving decisions due to false detection results, and enhances traffic safety.
Smart Images

Figure CN117218823B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of traffic technology, and more specifically, to a method, apparatus, storage medium, device, and vehicle for identifying traffic light colors. Background Technology
[0002] In intelligent driving or autonomous driving, it is usually necessary to identify the color of traffic lights in order to control the vehicle's movement based on the identification results.
[0003] In related technologies, methods for identifying traffic light colors mainly include: acquiring images containing traffic lights, and using machine learning-based traffic light recognition algorithms to identify the traffic light color, such as yellow. However, machine learning-based traffic light recognition algorithms are easily affected by environmental factors such as background color, headlights of vehicles ahead, and streetlights, leading to errors in traffic light color recognition and consequently affecting traffic safety. Summary of the Invention
[0004] This application provides a method, apparatus, storage medium, device, and vehicle for recognizing traffic light colors, which can accurately identify the false detection problem when a machine learning-based traffic light recognition algorithm recognizes traffic light colors.
[0005] The specific technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide a method for recognizing traffic light colors, the method comprising:
[0007] Obtain color recognition result pairs of target traffic lights based on traffic light images, wherein the target traffic lights include turn signals and straight-ahead lights, and the color recognition result pairs include color recognition results of turn signals and color recognition results of straight-ahead lights;
[0008] The intersection type of the target intersection is determined by judging whether each color recognition result pair in multiple color recognition result pairs within the first time period is the same color.
[0009] If a preset color recognition result pair exists in the color recognition result pair obtained after determining the intersection type, the preset color recognition result pair is determined to be a false detection result. The preset color recognition result pair includes color pairs other than the traffic light color pairs corresponding to the intersection type.
[0010] As can be seen from the above scheme, the embodiments of this application can first determine the intersection type of the target intersection by judging whether each color recognition result pair in multiple color recognition result pairs in the first time period is the same color. After determining the intersection type, if there is a preset color recognition result pair in the obtained color recognition result pairs that is other than the traffic light color pair corresponding to the intersection type, then the preset color recognition result pair is determined to be a false detection result. In this way, the color recognition result pair that cannot appear at the target intersection can be quickly and accurately identified, avoiding making wrong driving decisions based on false detection results, thereby improving traffic safety.
[0011] In the first possible implementation of the first aspect, the method further includes:
[0012] When multiple consecutive color recognition result pairs obtained after determining the intersection type are all the first color pair, and the color recognition result pair determined based on the next frame of the traffic light image is the second color pair, the color recognition result pair determined based on the next frame of the traffic light image is determined to be a false detection result. Here, the first color pair and the second color pair are different, and the first color pair and the second color pair are not adjacent in the traffic light color cycle order of the intersection type.
[0013] As can be seen from the above scheme, when the intersection type is determined, the embodiments of this application can identify false detection results by judging whether the color recognition results match the traffic light color cycle sequence, thereby further improving the accuracy of false detection identification.
[0014] In the second possible implementation of the first aspect, the intersection type of the target intersection is determined by judging whether each color recognition result pair in multiple color recognition result pairs within the first time period is the same color, including:
[0015] If there are color recognition result pairs with different colors among multiple color recognition result pairs within the first time period, the intersection type of the target intersection is determined to be the first intersection type;
[0016] If, within the first time period, each of the multiple color recognition result pairs is the same color and not all of the multiple color recognition results are red lights, then the intersection type of the target intersection is determined to be the second intersection type.
[0017] In the third possible implementation of the first aspect, the method also includes:
[0018] Based on historical target recognition results and / or current target recognition results, determine the true result corresponding to the current target recognition result. The historical target recognition result is the target color recognition result detected within a historical time period, and the current target recognition result is the target color recognition result detected at the current time. When the intersection type of the target intersection is the first intersection type, the target color recognition result is the color recognition result corresponding to the target driving direction in the color recognition result pair. When the intersection type of the target intersection is the second intersection type, the target color recognition result is any color recognition result in the color recognition result pair.
[0019] As can be seen from the above scheme, the embodiments of this application can determine the true result corresponding to the current target identification result based on the historical target identification result and / or the current target identification result, so as to make the correct driving decision based on the true result, thereby further avoiding making wrong driving decisions based on false detection results, and thus further improving traffic safety.
[0020] In the fourth possible implementation of the first aspect, the true result corresponding to the current target identification result is determined based on the historical target identification results and / or the current target identification results, including:
[0021] Starting from a historical target recognition result of yellow light, when the driving decision is to proceed, if the number of consecutive target color recognition results of red light is less than a first threshold, or the proportion of red lights in a second consecutive threshold of target color recognition results is less than a first proportion threshold, the true result corresponding to the current target recognition result is determined to be yellow light. If the number of consecutive target color recognition results of red light is less than a first threshold, or the proportion of red lights in a second consecutive threshold of target color recognition results is greater than or equal to the first proportion threshold, the true result corresponding to the current target recognition result is determined to be red light. Here, the first threshold is less than or equal to the second threshold, and both the first and second consecutive thresholds of target color recognition results include the current target recognition result and historical target recognition results; or...
[0022] Starting from a historical target recognition result of yellow light, when the current target recognition result is red light and the driving decision is to stop, the actual result corresponding to the current target recognition result is determined to be red light.
[0023] In the fifth possible implementation of the first aspect, when the target vehicle is the lead vehicle, the true result corresponding to the current target identification result is determined based on historical target identification results and / or the current target identification result, including:
[0024] Starting from a historical target recognition result of red light, when the number of consecutive target color recognition results of green light is less than the third threshold, or when the proportion of green light in the fourth consecutive threshold of target color recognition results is less than the second proportion threshold, the real result corresponding to the current target recognition result is determined to be red light. When the number of consecutive target color recognition results of green light is less than the third threshold, or when the proportion of green light in the fourth consecutive threshold of target color recognition results is greater than or equal to the second proportion threshold, the real result corresponding to the current target recognition result is determined to be green light.
[0025] Among them, the third quantity threshold is less than or equal to the fourth quantity threshold, and the target color recognition results of the third consecutive quantity threshold and the target color recognition results of the fourth consecutive quantity threshold both include the current target recognition result and the historical target recognition result.
[0026] In the sixth possible implementation of the first aspect, when the target vehicle is in a state where the lead vehicle is waiting at a red light, the method further includes:
[0027] When the speed of the lead vehicle in the target lane changes from 0 to greater than or equal to a preset speed threshold, the true result corresponding to the current target recognition result is determined to be a green light. The red light waiting state of the lead vehicle includes the target vehicle in the lead vehicle having a speed of 0, the target color recognition result being red, and the target vehicle corresponding to a target lane. The target lane is the adjacent lane that has the same travel direction as the lane to which the target vehicle belongs.
[0028] In the seventh possible implementation of the first aspect, the true result corresponding to the current target identification result is determined based on the historical target identification results and / or the current target identification results, including:
[0029] Starting from a historical target recognition result of green light, if the current target recognition result has not reached the Mth time the light goes out, the true result corresponding to the current target recognition result is determined to be green light. If the current target recognition result has reached the Mth time the light goes out, the true result corresponding to the current target recognition result is determined to be flashing green light. M is a positive integer.
[0030] In the eighth possible implementation of the first aspect, the method also includes:
[0031] When the color recognition results of two adjacent targets are green and off respectively, if the color recognition result of the target determined based on the traffic light image of the next frame is yellow, the true result corresponding to the color recognition results of the two adjacent targets is determined to be flashing green as a whole.
[0032] In the ninth possible implementation of the first aspect, obtaining the color recognition result pair of the target traffic light based on the traffic light image includes:
[0033] Starting from a preset distance from the target intersection, acquire the color recognition results of the target traffic light based on the traffic light image.
[0034] Secondly, embodiments of this application provide a traffic light color recognition device, the device comprising:
[0035] The acquisition unit is used to acquire color recognition result pairs of target traffic lights based on traffic light images, wherein the target traffic lights include turn signals and straight-ahead lights, and the color recognition result pairs include color recognition results of turn signals and color recognition results of straight-ahead lights;
[0036] The type determination unit is used to determine the intersection type of the target intersection by judging whether each color recognition result pair in multiple color recognition result pairs within the first time period is the same color.
[0037] The first result determination unit is used to determine that the preset color recognition result pair is a false detection result when there is a preset color recognition result pair among the color recognition result pairs obtained after determining the intersection type. The preset color recognition result pair includes color pairs other than the traffic light color pairs corresponding to the intersection type.
[0038] As can be seen from the above scheme, the embodiments of this application can first determine the intersection type of the target intersection by judging whether each color recognition result pair in multiple color recognition result pairs in the first time period is the same color. After determining the intersection type, if there is a preset color recognition result pair in the obtained color recognition result pairs that is other than the traffic light color pair corresponding to the intersection type, then the preset color recognition result pair is determined to be a false detection result. In this way, the color recognition result pair that cannot appear at the target intersection can be quickly and accurately identified, avoiding making wrong driving decisions based on false detection results, thereby improving traffic safety.
[0039] In a first possible implementation of the second aspect, the apparatus further includes:
[0040] The second result determination unit is used to determine that the color recognition result pair determined based on the next frame of the traffic light image is a false detection result when multiple consecutive color recognition result pairs obtained after determining the intersection type are all first color pairs, and the color recognition result pair determined based on the next frame of the traffic light image is a second color pair. The first color pair is different from the second color pair, and the first color pair and the second color pair are not adjacent in the traffic light color cycle order of the intersection type.
[0041] In a second possible implementation of the second aspect, the type determination unit includes:
[0042] The first type determination module is used to determine the intersection type of the target intersection as the first intersection type when there are color recognition result pairs with different colors among multiple color recognition result pairs within the first time period.
[0043] The second type determination module is used to determine the intersection type of the target intersection as the second intersection type when each of the multiple color recognition result pairs is the same color and not all of the multiple color recognition results are red lights during the first time period.
[0044] In a third possible implementation of the second aspect, the device further includes:
[0045] The third result determination unit is used to determine the true result corresponding to the current target recognition result based on the historical target recognition result and / or the current target recognition result. The historical target recognition result is the target color recognition result detected within a historical time period, and the current target recognition result is the target color recognition result detected at the current time. When the intersection type of the target intersection is the first intersection type, the target color recognition result is the color recognition result corresponding to the target driving direction in the color recognition result pair. When the intersection type of the target intersection is the second intersection type, the target color recognition result is any color recognition result in the color recognition result pair.
[0046] In the fourth possible implementation of the second aspect, the third result determining unit includes: a first result determining module or a second result determining module;
[0047] The first result determination module is used to determine the true result corresponding to the current target recognition result as a yellow light, starting from a historical target recognition result of yellow light, when the driving decision is to proceed, and the number of consecutive target color recognition results of red light is less than a first quantity threshold, or the proportion of red lights in a second consecutive quantity threshold of target color recognition results is less than a first proportion threshold. Conversely, when the first consecutive quantity threshold of target color recognition results are all red light, or the proportion of red lights in a second consecutive quantity threshold of target color recognition results is greater than or equal to the first proportion threshold, the true result corresponding to the current target recognition result is determined as a red light. Here, the first quantity threshold is less than or equal to the second quantity threshold, and both the first and second consecutive quantity threshold of target color recognition results include the current target recognition result and historical target recognition results; or...
[0048] The second result determination module is used to determine the true result corresponding to the current target recognition result as red light when the current target recognition result is red light and the driving decision is to stop, starting from the historical target recognition result being yellow light.
[0049] In the fifth possible implementation of the second aspect, the third result determining unit includes:
[0050] The third result determination module is used to determine the true result corresponding to the current target recognition result as red light when the target vehicle is the lead vehicle, starting from the historical target recognition result of red light. When the number of consecutive target color recognition results of green light is less than the third quantity threshold, or the proportion of green light in the fourth consecutive quantity threshold target color recognition results is less than the second proportion threshold, the module determines the true result corresponding to the current target recognition result as green light. When the third consecutive quantity threshold target color recognition results are all green light, or the proportion of green light in the fourth consecutive quantity threshold target color recognition results is greater than or equal to the second proportion threshold, the module determines the true result corresponding to the current target recognition result as green light.
[0051] Among them, the third quantity threshold is less than or equal to the fourth quantity threshold, and the target color recognition results of the third consecutive quantity threshold and the target color recognition results of the fourth consecutive quantity threshold both include the current target recognition result and the historical target recognition result.
[0052] In the sixth possible implementation of the second aspect, the device further includes:
[0053] The fourth result determination unit is used to determine the true result corresponding to the current target recognition result as green light when the speed of the leading vehicle in the target lane changes from 0 to greater than or equal to a preset speed threshold, when the target vehicle is in the red light waiting state of the leading vehicle. The red light waiting state of the leading vehicle includes the target vehicle being at a speed of 0, the target color recognition result being red light, and the target vehicle corresponding to a target lane, which is an adjacent lane with the same travel direction as the lane to which the target vehicle belongs.
[0054] In the seventh possible implementation of the second aspect, the third result determining unit includes:
[0055] The fourth result determination module is used to determine the true result corresponding to the current target recognition result as a flashing green light when the current target recognition result is the Mth time the light is off, starting from the historical target recognition result of green light. M is a positive integer.
[0056] In the eighth possible implementation of the second aspect, the apparatus further includes:
[0057] The fifth result determination unit is used to determine the true result corresponding to the two adjacent target color recognition results as the overall green flashing when the target color recognition result determined based on the traffic light image of the next frame is yellow, in cases where the two adjacent target color recognition results are green and off respectively.
[0058] In the ninth possible implementation of the second aspect, the acquisition unit is used to acquire a pair of color recognition results of the target traffic light based on the traffic light image, starting from a preset distance from the target intersection.
[0059] Thirdly, embodiments of this application provide a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any possible implementation of the first aspect.
[0060] Fourthly, embodiments of this application provide an electronic device, which includes:
[0061] One or more processors;
[0062] Storage device for storing one or more programs.
[0063] When one or more programs are executed by one or more processors, the electronic device performs the method as described in any possible implementation of the first aspect.
[0064] Fifthly, embodiments of this application provide a vehicle that includes the means as described in any possible implementation of the second aspect, or includes electronic equipment as described in the fourth aspect. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0066] Figure 1 A flowchart illustrating a traffic light color recognition method provided in an embodiment of this application;
[0067] Figure 2 An example diagram illustrating a traffic light color recognition method provided in an embodiment of this application;
[0068] Figure 3 An example diagram illustrating another method for recognizing traffic light colors provided in an embodiment of this application;
[0069] Figure 4 A block diagram illustrating the composition of a traffic light color recognition device provided in an embodiment of this application;
[0070] Figure 5 This is a block diagram illustrating the composition of a vehicle as provided in an embodiment of this application. Detailed Implementation
[0071] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0072] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The terms "comprising" and "having," and any variations thereof, in the embodiments and drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0073] Figure 1 This is a flowchart illustrating a method for recognizing traffic light colors. This method can be applied to electronic devices or computer equipment, specifically vehicles or servers, and may include the following steps:
[0074] S110: Obtain the color recognition result pair of the target traffic light based on the traffic light image.
[0075] The target traffic lights include turn signals and straight-ahead lights, and the color recognition results include the color recognition results of the turn signals and the color recognition results of the straight-ahead lights.
[0076] The specific implementation process of detecting target traffic lights and obtaining color recognition result pairs based on traffic light images can include: performing color recognition on traffic light images based on a neural network model to obtain color recognition result pairs. This neural network model can be trained on multiple historical traffic light images with added traffic light color labels.
[0077] To avoid resource waste and inaccurate long-distance detection, this embodiment of the application can acquire color recognition results of the target traffic light based on the traffic light image from a preset distance away from the target intersection. Specifically, it can acquire color recognition results of the target traffic light based on the traffic light image from a preset distance away from the stop line of the target intersection. The preset distance can be an empirical value, such as 120 meters.
[0078] It should be noted that the executing entity that detects traffic lights based on traffic light images to obtain color recognition result pairs can be the same as or different from the executing entity in this application embodiment. When they are different, the executing entity in this application embodiment can obtain color recognition result pairs from another executing entity. For example, when the executing entity in this application embodiment is the target vehicle (which can also be referred to as a self-driving vehicle), the executing entity that detects traffic lights based on traffic light images to obtain color recognition result pairs can be the target vehicle, a server, or a V2X (Vehicle-to-Everything) device other than a server (such as vehicles around the target vehicle, roadside equipment, etc.).
[0079] Furthermore, traffic light images can be captured by the target vehicle's camera, or by other vehicles or roadside equipment within a preset distance range from the target vehicle. The preset distance range can be defined by the following rule: traffic light images captured by other vehicles or roadside equipment must contain the same traffic light status as those captured by the target vehicle. For example, the preset distance range includes vehicles adjacent to the target vehicle in front, behind, to the left, and to the right, as well as roadside equipment located at a distance less than or equal to a preset distance threshold (e.g., 12 meters) from the target vehicle.
[0080] S120: Determine the intersection type of the target intersection by judging whether each color recognition result pair in multiple color recognition result pairs within the first time period is the same color.
[0081] If multiple color recognition result pairs within the first time period contain pairs of different colors, the intersection type of the target intersection is determined to be the first intersection type, i.e., an intersection where the turn signals and straight-ahead lights are not synchronized. If, within the first time period, each color recognition result pair contains the same color and not all of the multiple color recognition results are red, the intersection type of the target intersection is determined to be the second intersection type, i.e., an intersection where the turn signals and straight-ahead lights are synchronized. The light color changes for the first intersection type can be shown in Table 1, and the light color changes for the second intersection type can be shown in Table 2.
[0082] Table 1 Types of First Intersections
[0083] Phase sequence Turn left straight 1 red light red light 2 red light Green light 3 red light Green flash 4 red light Yellow light 5 Green light red light 6 Green flash red light 7 Yellow light red light
[0084] Table 2 Types of Second Intersections
[0085] Phase sequence Turn left straight 1 red light red light 2 Green light Green light 3 Green flash Green flash 4 Yellow light Yellow light 5 red light red light
[0086] S130: If a preset color recognition result pair exists in the color recognition result pair obtained after determining the intersection type, the preset color recognition result pair is determined to be a false detection result.
[0087] The preset color recognition result pairs include color pairs other than the traffic light color pairs corresponding to the intersection type. In other words, after determining the intersection type, if a color recognition result pair unique to other intersection types is identified, it indicates that the color recognition result pair unique to those other intersection types is a false detection. For example, if after determining the intersection type to be the second intersection type, the obtained color recognition result pairs include red light and green flashing, then since the second intersection type includes red light and red light, green light and green light, green flashing and green flashing, and yellow light and yellow light, but not red light and green flashing, the color recognition result pair including red and green flashing can be determined as a false detection.
[0088] This application's embodiments can be applied to both manual driving and autonomous driving scenarios. In a manual driving scenario, upon determining a false detection, a false detection prompt can be output to the driver, reminding them to check the color of the traffic light ahead. Alternatively, the false detection result can be corrected using the method for determining the true result described in the following embodiments, and the recognition result and the corrected result can be output to the driver for reference. In an autonomous driving scenario, upon determining a false detection, the false detection result can be ignored, and detection can restart. Alternatively, the color recognition result pair from the previous frame can remain unchanged. Or, the false detection result can be corrected using the method for determining the true result described in the following embodiments. Specifically, when a preset color recognition result pair is determined to be a false detection result according to step S130, the corresponding true result can be determined as the preset color recognition result pair based on the traffic light image of the previous frame.
[0089] The traffic light color recognition method provided in this application can first determine the intersection type of the target intersection by judging whether each color recognition result pair in multiple color recognition result pairs in a first time period is the same color. After determining the intersection type, if there is a preset color recognition result pair in the obtained color recognition result pairs that is a color pair other than the traffic light color pair corresponding to the intersection type, then the preset color recognition result pair is determined to be a false detection result. This allows for the rapid and accurate identification of color recognition result pairs that cannot appear at the target intersection, avoiding incorrect driving decisions based on false detection results, and thus improving traffic safety.
[0090] In one implementation, after determining the intersection type, in order to further improve the accuracy of recognition, this application embodiment can determine the color recognition result pair determined based on the next frame of traffic light image as a false detection result when multiple consecutive color recognition result pairs obtained after determining the intersection type are all first color pairs, and the color recognition result pair determined based on the next frame of traffic light image is a second color pair.
[0091] The first color pair is different from the second color pair, and the first color pair and the second color pair are not adjacent in the traffic light color cycle sequence of the intersection type. Multiple consecutive color recognition result pairs are color recognition result pairs based on multiple consecutive frames of traffic light images. In this application implementation, the next frame of traffic light image is the next frame of traffic light image adjacent to the last frame of traffic light images corresponding to the multiple consecutive color recognition result pairs.
[0092] For example, as shown in Table 1, the traffic light color cycle sequence for the first intersection type can be represented as (red light, red light) -> (red light, green light) -> (red light, flashing green light) -> (red light, yellow light) -> (green light, red light) -> (flashing green light, red light) -> (yellow light, red light), after which it switches to (red light, red light), and the cycle begins again from (red light, red light).If multiple consecutive color recognition result pairs obtained after determining the intersection type are all (red light, red light), and the color recognition result pair determined based on the next frame of the traffic light image is (red light, flashing green), (red light, yellow light), (green light, red light), (flashing green light, red light), or (yellow light, red light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result. If multiple consecutive color recognition result pairs obtained after determining the intersection type are all (red light, green light), and the color recognition result pair determined based on the next frame of the traffic light image is (red light, yellow light), (green light, red light), (flashing green light, red light), (yellow light, red light), or (red light, yellow light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as (red light, yellow light), (green light, red light), (flashing green light, red light), (yellow light, red light), or (red light, yellow light), then the color recognition result pair is determined as (red light, yellow light), (green light, red light), (flashing green light, red light), (yellow light, red light), or (yellow light, red light). If multiple consecutive color recognition result pairs obtained after determining the intersection type are (red light, flashing green), and the color recognition result pair determined based on the next frame of the traffic light image is (green light, red light), (flashing green, red light), (yellow light, red light), (red light, red light), or (red light, green light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result. If multiple consecutive color recognition result pairs obtained after determining the intersection type are (red light, yellow light), and the color recognition result pair determined based on the next frame of the traffic light image is (green light, red light), (flashing green, red light), (yellow light, red light), (red light, red light), or (red light, green light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result. If multiple consecutive color recognition result pairs obtained after determining the intersection type are all (green light, red light), and the color recognition result pair determined based on the next frame of the traffic light image is (yellow light, red light), (red light, red light), (red light, green light), (red light, flashing green light), or (red light, yellow light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result; if multiple consecutive color recognition result pairs obtained after determining the intersection type are all (green light, red light), and the color recognition result pair determined based on the next frame of the traffic light image is (yellow light, red light), (red light, red light), (red light, green light), (red light, flashing green light), or (red light, yellow light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result; if multiple consecutive color recognition result pairs obtained after determining the intersection type are all (green light, red light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result; if multiple consecutive color recognition result pairs obtained after determining the intersection type are all (yellow light, red light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result. When the intersection type is (flashing green, red light), if the color recognition result pair determined based on the next frame of the traffic light image is (red light, red light), (red light, green light), (red light, flashing green light), (red light, yellow light), or (green light, red light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result. When multiple consecutive color recognition result pairs obtained after determining the intersection type are all (yellow light, red light), if the color recognition result pair determined based on the next frame of the traffic light image is (red light, green light), (red light, flashing green light), (red light, yellow light), or (flashing green light, red light), then the color recognition result pair determined based on the next frame of the traffic light image is determined as a false detection result.
[0093] Therefore, given the type of intersection, this embodiment of the application can identify false detection results by judging whether the color recognition results match the traffic light color cycle sequence, thereby further improving the accuracy of false detection identification.
[0094] In one implementation, the present application also provides the following method:
[0095] Based on historical target recognition results and / or current target recognition results, the true result corresponding to the current target recognition result is determined. Historical target recognition results refer to the target color recognition results detected within a historical timeframe, while the current target recognition result refers to the target color recognition result detected currently. When the target intersection is of type 1, the target color recognition result is the color recognition result corresponding to the target driving direction in the color recognition result pair. When the target intersection is of type 2, the target color recognition result is any color recognition result in the color recognition result pair, where the target driving direction includes left turn or straight ahead. In other words, when the target intersection is of type 1, only the color recognition result corresponding to the target driving direction needs to be checked for false positives, without needing to consider whether color recognition results corresponding to non-target driving directions have been false positives. This simplifies the number of objects to be recognized and improves the efficiency of false positive detection. When the target intersection is of type 2, since the light colors in the color recognition result pair are the same, only one color recognition result needs to be checked for false positives.
[0096] The following descriptions address different scenarios:
[0097] Scenario 1: Yellow light mistakenly detected as red light
[0098] Starting from a historical target recognition result of yellow light, when the driving decision is to proceed, if the number of consecutive target color recognition results of red light is less than a first threshold, or the proportion of red lights in a consecutive second threshold number of target color recognition results is less than a first proportion threshold, the true result corresponding to the current target recognition result is determined to be yellow light. If the number of consecutive target color recognition results of red light is less than a first threshold, or the proportion of red lights in a consecutive second threshold number of target color recognition results is greater than or equal to the first proportion threshold, the true result corresponding to the current target recognition result is determined to be red light. Here, the first threshold is less than or equal to the second threshold, and both the consecutive first threshold number of target color recognition results and the consecutive second threshold number of target color recognition results include the current target recognition result and the historical target recognition result; or, starting from a historical target recognition result of yellow light, if the current target recognition result is red light and the driving decision is to stop, the true result corresponding to the current target recognition result is determined to be red light.
[0099] In practical applications, since the driving decision for a yellow light is already precisely calculated, there is generally no scenario where a yellow light decision to proceed turns into a red light before the vehicle has passed the target intersection. Therefore, when the driving decision during a yellow light is to proceed, if the target color recognition result is red before passing the target intersection, the probability of a false detection is relatively high. It takes six consecutive red light detections to confirm a genuine red light. If there are three red light frames + four yellow light frames + three red light frames (i.e., six red light frames out of ten consecutive frames), the four yellow light frames are considered false detections. Even if a genuine red light appears before crossing the line, based on the urban speed limit of 60 km / h, the maximum delay in braking to a stop is 8.3 meters, which will not violate traffic regulations.
[0100] The specific values of the first quantity threshold, the second quantity threshold, and the first proportion threshold can be determined to ensure that the decision delay is less than the prediction delay threshold (e.g., 500ms) and does not violate traffic rules.
[0101] For example, when the first quantity threshold is 6, the second quantity threshold is 10, and the first percentage threshold is 60%, such as Figure 2 As shown, when six consecutive color recognition results all correspond to a red light for the target color, it can be determined that the actual result corresponding to the current target recognition result is a red light, or, as... Figure 3 As shown, when the proportion of red lights in 10 consecutive color recognition result pairs is equal to 60%, the actual result corresponding to the current target recognition result can also be determined to be a red light. The target color recognition result refers to the color recognition result corresponding to the straight-ahead light; in executing this embodiment, the color recognition result corresponding to the left-turn light can be ignored.
[0102] The traffic light color recognition method provided in this application can start from a historical target recognition result of yellow. When the current target recognition result is red and the driving decision is to stop, regardless of whether a yellow light is mistakenly detected as red, since both yellow and red light decisions involve stopping, the true result corresponding to the current target recognition result can be determined to be red. However, starting from a historical target recognition result of yellow, when the driving decision is to proceed, if a red light appears later, the true result is not immediately determined to be red. Instead, the true result corresponding to the current target recognition result is determined to be red only when a first threshold number of consecutive target color recognition results are all red, or when the proportion of red lights in a second threshold number of consecutive target color recognition results is greater than or equal to a first proportion threshold. Only when the true result is red is a stopping decision made. This avoids the target vehicle's passage being affected or a collision between a following vehicle and the target vehicle due to a yellow light being mistakenly detected as red, thereby improving traffic safety.
[0103] The second scenario: A red light is mistakenly detected as a green light.
[0104] When the target vehicle is the lead vehicle, starting from the historical target recognition result of red light, when the number of consecutive target color recognition results of green light is less than the third threshold, or when the proportion of green light in the fourth consecutive threshold of target color recognition results is less than the second proportion threshold, the real result corresponding to the current target recognition result is determined to be red light. When the number of consecutive target color recognition results of green light is more than the third threshold of target color recognition results, or when the proportion of green light in the fourth consecutive threshold of target color recognition results is greater than or equal to the second proportion threshold, the real result corresponding to the current target recognition result is determined to be green light.
[0105] The "lead vehicle" refers to the vehicle in each lane closest to the target intersection. In simpler terms, it's the first vehicle in each lane heading towards the target intersection. The third threshold is less than or equal to the fourth threshold. Both consecutive third and fourth threshold target color recognition results include the current target recognition result and historical target recognition results. The values between the first and third thresholds, the second and fourth thresholds, or the first and second percentage thresholds can be the same or different to ensure low decision latency and high accuracy. Furthermore, when the actual result corresponding to the current target recognition result is determined to be a green light, the driving decision can change from a stop decision to a proceed decision.
[0106] The traffic light color recognition method provided in this application can start from a historical target recognition result of red light. When a green light appears later, it does not immediately determine that the real result is green light. Instead, it determines that the real result corresponding to the current target recognition result is green light only when the target color recognition results are all green light for a third consecutive number of threshold numbers, or when the proportion of green light in the target color recognition results of a fourth consecutive number of threshold numbers is greater than or equal to a second proportion threshold number. Only when the real result is green light will a passage decision be made. This avoids running red lights due to red lights being mistakenly detected as green lights and driving prematurely, thereby improving traffic safety.
[0107] In one implementation, when the target vehicle is in a red light waiting state (as indicated by the lead vehicle in the adjacent lane), the present invention can further determine the target vehicle's starting time by referring to the starting time of the lead vehicle in the adjacent lane (because the green light generates the passage decision). This avoids running a red light due to a red light being mistakenly detected as a green light and thus further improving traffic safety. The specific implementation process includes: when the speed of the lead vehicle in the target lane changes from 0 to greater than or equal to a preset speed threshold, the true result corresponding to the current target identification result is determined to be a green light. The red light waiting state includes the target vehicle being at a speed of 0, the target color identification result being red, and the target vehicle corresponding to a target lane, which is an adjacent lane with the same travel direction as the target vehicle's lane. Furthermore, when the target vehicle is not the lead vehicle, if a red light is mistakenly detected as a green light, the vehicle will stop because the vehicle in front has stopped, without affecting the driving decision. Therefore, in this case, the mistaken red light being mistakenly detected as a green light can be ignored.
[0108] The third scenario: a green light is mistakenly detected as a flashing green light.
[0109] Starting from a historical target recognition result of green light, if the current target recognition result has not reached the Mth time the light goes out, the true result corresponding to the current target recognition result is determined to be green light. If the current target recognition result has reached the Mth time the light goes out, the true result corresponding to the current target recognition result is determined to be flashing green light. M is a positive integer.
[0110] In practical applications, due to traffic light malfunctions or slow light color updates, a green light may be mistakenly detected as a flashing green light. To improve the accuracy of recognition, the current target recognition result may not be considered a true flashing green light until the Mth light extinguishing time has been reached. Only when the Mth light extinguishing time has been reached will it be considered a true flashing green light.
[0111] Furthermore, since the driving decision corresponding to a flashing green light is the same as that corresponding to a yellow light, the false detection between flashing green lights and yellow lights can be ignored.
[0112] In one implementation, when the recognition results of two adjacent target colors are green and off respectively, if the target color recognition result determined based on the next frame of the traffic light image is yellow, the true result corresponding to the two adjacent target color recognition results is determined to be a flashing green light as a whole. Here, the next frame of the traffic light image in this embodiment refers to the frame following the next frame of the traffic light images corresponding to the two adjacent target color recognition results. Therefore, this embodiment can avoid misdetecting a flashing green light as two independent states: green and off, thereby improving the recognition accuracy.
[0113] The following are examples illustrating the application of the above scenarios:
[0114] A1. Identify (red light, green light) after (red light, red light).
[0115] If the target vehicle turns left, it will not be affected and the straight-ahead light can be ignored; if the target vehicle goes straight, the method described in the second scenario can be executed.
[0116] A2. Identify (red light, flashing green light) after (red light, green light).
[0117] If the target vehicle turns left, it will not be affected and the straight-ahead light can be ignored; if the target vehicle goes straight, the method described in the third scenario can be executed.
[0118] A3. Identify (red light, yellow light) after (red light, flashing green light).
[0119] If the target vehicle is turning left, it will not be affected and the straight-ahead light can be ignored; if the target vehicle is going straight, since the driving decision corresponding to the green flashing light is the same as the driving decision corresponding to the yellow light, the false detection between the green flashing light and the yellow light can be ignored.
[0120] A4. Identify (green light, red light) after (red light, yellow light).
[0121] If the target vehicle turns left, the method described in the second scenario can be executed; if the target vehicle goes straight, the method described in the first scenario can be executed.
[0122] A5. Identify (flashing green, red light) after (green light, red light).
[0123] If the target vehicle turns left, the method described in the third scenario can be executed; if the target vehicle goes straight, it will not be affected and the left turn signal can be ignored.
[0124] A6. Identify (yellow light, red light) after (flashing green light, red light).
[0125] If the target vehicle turns left, the false detection between the green flashing light and the yellow light can be ignored because the driving decision corresponding to the green flashing light is the same as the driving decision corresponding to the yellow light. If the target vehicle goes straight, it is not affected and the left turn light can be ignored.
[0126] A7. Identify (red light, red light) after (yellow light, red light).
[0127] If the target vehicle turns left, the method described in the first scenario can be executed; if the target vehicle goes straight, it will not be affected and the left turn signal can be ignored.
[0128] Corresponding to the above method embodiments, another embodiment of this application provides a traffic light color recognition device, such as... Figure 4 As shown, the device includes:
[0129] The acquisition unit 20 is used to acquire color recognition result pairs of target traffic lights based on traffic light images, wherein the target traffic lights include turn signals and straight-ahead lights, and the color recognition result pairs include color recognition results of turn signals and color recognition results of straight-ahead lights;
[0130] The type determination unit 22 is used to determine the intersection type of the target intersection by judging whether each color recognition result pair in multiple color recognition result pairs within the first time period is the same color.
[0131] The first result determination unit 24 is used to determine that the preset color recognition result pair is a false detection result when there is a preset color recognition result pair in the color recognition result pair obtained after determining the intersection type. The preset color recognition result pair includes color pairs other than the traffic light color pairs corresponding to the intersection type.
[0132] In one embodiment, the apparatus further includes:
[0133] The second result determination unit is used to determine that the color recognition result pair determined based on the next frame of the traffic light image is a false detection result when multiple consecutive color recognition result pairs obtained after determining the intersection type are all first color pairs, and the color recognition result pair determined based on the next frame of the traffic light image is a second color pair. The first color pair is different from the second color pair, and the first color pair and the second color pair are not adjacent in the traffic light color cycle order of the intersection type.
[0134] In one embodiment, the type determination unit 22 includes:
[0135] The first type determination module is used to determine the intersection type of the target intersection as the first intersection type when there are color recognition result pairs with different colors among multiple color recognition result pairs within the first time period.
[0136] The second type determination module is used to determine the intersection type of the target intersection as the second intersection type when each of the multiple color recognition result pairs is the same color and not all of the multiple color recognition results are red lights during the first time period.
[0137] In one embodiment, the apparatus further includes:
[0138] The third result determination unit is used to determine the true result corresponding to the current target recognition result based on the historical target recognition result and / or the current target recognition result. The historical target recognition result is the target color recognition result detected within a historical time period, and the current target recognition result is the target color recognition result detected at the current time. When the intersection type of the target intersection is the first intersection type, the target color recognition result is the color recognition result corresponding to the target driving direction in the color recognition result pair. When the intersection type of the target intersection is the second intersection type, the target color recognition result is any color recognition result in the color recognition result pair.
[0139] In one embodiment, the third result determining unit includes: a first result determining module or a second result determining module;
[0140] The first result determination module is used to determine the true result corresponding to the current target recognition result as a yellow light, starting from a historical target recognition result of yellow light, when the driving decision is to proceed, and the number of consecutive target color recognition results of red light is less than a first quantity threshold, or the proportion of red lights in a second consecutive quantity threshold of target color recognition results is less than a first proportion threshold. Conversely, when the first consecutive quantity threshold of target color recognition results are all red light, or the proportion of red lights in a second consecutive quantity threshold of target color recognition results is greater than or equal to the first proportion threshold, the true result corresponding to the current target recognition result is determined as a red light. Here, the first quantity threshold is less than or equal to the second quantity threshold, and both the first and second consecutive quantity threshold of target color recognition results include the current target recognition result and historical target recognition results; or...
[0141] The second result determination module is used to determine the true result corresponding to the current target recognition result as red light when the current target recognition result is red light and the driving decision is to stop, starting from the historical target recognition result being yellow light.
[0142] In one embodiment, the third result determination unit includes:
[0143] The third result determination module is used to determine the true result corresponding to the current target recognition result as red light when the target vehicle is the lead vehicle, starting from the historical target recognition result of red light. When the number of consecutive target color recognition results of green light is less than the third quantity threshold, or the proportion of green light in the fourth consecutive quantity threshold target color recognition results is less than the second proportion threshold, the module determines the true result corresponding to the current target recognition result as green light. When the third consecutive quantity threshold target color recognition results are all green light, or the proportion of green light in the fourth consecutive quantity threshold target color recognition results is greater than or equal to the second proportion threshold, the module determines the true result corresponding to the current target recognition result as green light.
[0144] Among them, the third quantity threshold is less than or equal to the fourth quantity threshold, and the target color recognition results of the third consecutive quantity threshold and the target color recognition results of the fourth consecutive quantity threshold both include the current target recognition result and the historical target recognition result.
[0145] In one embodiment, the device further includes:
[0146] The fourth result determination unit is used to determine the true result corresponding to the current target recognition result as green light when the speed of the leading vehicle in the target lane changes from 0 to greater than or equal to a preset speed threshold, when the target vehicle is in the red light waiting state of the leading vehicle. The red light waiting state of the leading vehicle includes the target vehicle being at a speed of 0, the target color recognition result being red light, and the target vehicle corresponding to a target lane, which is an adjacent lane with the same travel direction as the lane to which the target vehicle belongs.
[0147] In one embodiment, the third result determination unit includes:
[0148] The fourth result determination module is used to determine the true result corresponding to the current target recognition result as a flashing green light when the current target recognition result is the Mth time the light is off, starting from the historical target recognition result of green light. M is a positive integer.
[0149] In one embodiment, the apparatus further includes:
[0150] The fifth result determination unit is used to determine the true result corresponding to the two adjacent target color recognition results as the overall green flashing when the target color recognition result determined based on the traffic light image of the next frame is yellow, in cases where the two adjacent target color recognition results are green and off respectively.
[0151] In one embodiment, the acquisition unit 20 is used to acquire a pair of color recognition results of the target traffic light based on the traffic light image, starting from a preset distance from the target intersection.
[0152] The traffic light color recognition device provided in this application embodiment can first determine the intersection type of the target intersection by judging whether each color recognition result pair in multiple color recognition result pairs in a first time period is the same color. After determining the intersection type, if there is a preset color recognition result pair in the obtained color recognition result pairs that is a color pair other than the traffic light color pair corresponding to the intersection type, then the preset color recognition result pair is determined to be a false detection result. This allows for the rapid and accurate identification of color recognition result pairs that cannot appear at the target intersection, avoiding incorrect driving decisions based on false detection results, and thus improving traffic safety.
[0153] Based on the above method embodiments, another embodiment of this application provides a storage medium storing executable instructions thereon, which, when executed by a processor, cause the processor to implement the method described in any of the above embodiments.
[0154] Based on the above method embodiments, another embodiment of this application provides an electronic device or computer device, including:
[0155] One or more processors;
[0156] Storage device for storing one or more programs.
[0157] When the one or more programs are executed by the one or more processors, the electronic device or computer device performs the method as described in any of the above embodiments.
[0158] Based on the above method embodiments, another embodiment of this application provides a vehicle that includes the device as described in any of the above embodiments, or includes the electronic device as described above.
[0159] like Figure 5 As shown, the vehicle includes a T-Box (Telematics Box) 30, an ECU (Electronic Control Unit) 32, and a camera 34. The T-Box 30 can act as a gateway to communicate with the server; the camera 34 is used to capture images of traffic lights ahead of the vehicle; the ECU 32 can execute the aforementioned traffic light color recognition method, and can also acquire the traffic light images captured by the camera 34, report the traffic light images to the server via the T-Box 30, and receive false detection results and / or true results determined by the server based on the aforementioned traffic light color recognition method.
[0160] The vehicle may also include: GPS (Global Positioning System) positioning equipment, V2X (Vehicle-to-Everything) modules, radar, etc. The GPS positioning equipment is used to obtain the vehicle's current geographical location, the V2X module is used to communicate with other vehicles, roadside equipment, etc., and the radar is used to perceive road environment information in front and / or other directions.
[0161] The above-described apparatus embodiments correspond to the method embodiments and have the same technical effects. For detailed descriptions, please refer to the method embodiments. The apparatus embodiments are derived from the method embodiments; detailed descriptions can be found in the method embodiments section, and will not be repeated here. Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application.
[0162] Those skilled in the art will understand that the modules in the apparatus of the embodiments can be distributed in the apparatus of the embodiments as described in the embodiments, or they can be located in one or more devices different from this embodiment with corresponding changes. The modules of the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for recognizing traffic light colors, characterized in that, The method includes: Obtain color recognition result pairs of target traffic lights based on traffic light images, wherein the target traffic lights include turn signals and straight-ahead lights, and the color recognition result pairs include color recognition results of the turn signals and color recognition results of the straight-ahead lights; Determining the intersection type of a target intersection by judging whether each of the multiple color recognition result pairs in the first time period is the same color includes: if there are color recognition result pairs of different colors in the multiple color recognition result pairs in the first time period, determining the intersection type of the target intersection as a first intersection type; if each of the multiple color recognition result pairs in the first time period is the same color and not all of the multiple color recognition results are red lights, determining the intersection type of the target intersection as a second intersection type. If a preset color recognition result pair exists in the color recognition result pair obtained after determining the intersection type, the preset color recognition result pair is determined to be a false detection result. The preset color recognition result pair includes color pairs other than the traffic light color pairs corresponding to the intersection type. The method further includes: Based on historical target recognition results and / or current target recognition results, the true result corresponding to the current target recognition result is determined. The historical target recognition result is the target color recognition result detected within a historical time period, and the current target recognition result is the target color recognition result currently detected. When the intersection type of the target intersection is the first intersection type, the target color recognition result is the color recognition result corresponding to the target driving direction in the color recognition result pair. When the intersection type of the target intersection is the second intersection type, the target color recognition result is any color recognition result in the color recognition result pair.
2. The method according to claim 1, characterized in that, The method further includes: When multiple consecutive color recognition result pairs obtained after determining the intersection type are all first color pairs, and the color recognition result pair determined based on the traffic light image of the next frame is a second color pair, the color recognition result pair determined based on the traffic light image of the next frame is determined to be a false detection result, wherein the first color pair is different from the second color pair, and the first color pair and the second color pair are not adjacent in the traffic light color cycle order of the intersection type.
3. The method according to claim 1, characterized in that, The step of determining the true result corresponding to the current target identification result based on historical target identification results and / or current target identification results includes: Starting from the historical target recognition result being a yellow light, when the driving decision is to proceed, if the number of consecutive target color recognition results being red is less than a first threshold, or the proportion of red lights in a second consecutive threshold of target color recognition results is less than a first proportion threshold, the actual result corresponding to the current target recognition result is determined to be a yellow light. If the first threshold of consecutive target color recognition results are all red, or the proportion of red lights in a second consecutive threshold of target color recognition results is greater than or equal to the first proportion threshold, the actual result corresponding to the current target recognition result is determined to be a red light. Here, the first threshold is less than or equal to the second threshold, and both the first threshold of consecutive target color recognition results and the second threshold of consecutive target color recognition results include the current target recognition result and the historical target recognition result; or... Starting from the historical target recognition result being a yellow light, when the current target recognition result is a red light and the driving decision is to stop, the actual result corresponding to the current target recognition result is determined to be a red light.
4. The method according to claim 1, characterized in that, When the target vehicle is the lead vehicle, determining the true result corresponding to the current target identification result based on historical target identification results and / or the current target identification result includes: Starting from the historical target recognition result being red, when the number of consecutive target color recognition results being green is less than a third threshold, or when the proportion of green lights in a fourth consecutive threshold of target color recognition results is less than a second proportion threshold, the actual result corresponding to the current target recognition result is determined to be red. When the third consecutive threshold of target color recognition results are all green, or when the proportion of green lights in a fourth consecutive threshold of target color recognition results is greater than or equal to the second proportion threshold, the actual result corresponding to the current target recognition result is determined to be green. Wherein, the third quantity threshold is less than or equal to the fourth quantity threshold, and each of the consecutive third quantity threshold target color recognition results and the consecutive fourth quantity threshold target color recognition results includes the current target recognition result and the historical target recognition result.
5. The method according to claim 1, characterized in that, When the target vehicle is in a situation where the lead vehicle is waiting at a red light, the method further includes: When the speed of the lead vehicle in the target lane changes from 0 to greater than or equal to a preset speed threshold, the true result corresponding to the current target recognition result is determined to be a green light. The red light waiting state of the lead vehicle includes the target vehicle being at a speed of 0, the target color recognition result being a red light, and the target vehicle being in the target lane. The target lane is an adjacent lane with the same travel direction as the lane to which the target vehicle belongs.
6. The method according to claim 1, characterized in that, The step of determining the true result corresponding to the current target identification result based on historical target identification results and / or current target identification results includes: Starting from the historical target recognition result being a green light, when the current target recognition result has not reached the Mth time the light goes out, the actual result corresponding to the current target recognition result is determined to be a green light; when the current target recognition result is the Mth time the light goes out, the actual result corresponding to the current target recognition result is determined to be a flashing green light, where M is a positive integer.
7. The method according to claim 1, characterized in that, The method further includes: When two adjacent target color recognition results are green and off respectively, if the target color recognition result determined based on the traffic light image of the next frame is yellow, the true result corresponding to the two adjacent target color recognition results is determined to be flashing green as a whole.
8. The method according to any one of claims 1-7, characterized in that, The step of obtaining the color recognition result pair of the target traffic light based on the traffic light image includes: Starting from a preset distance from the target intersection, acquire the color recognition result pair of the target traffic light based on the traffic light image.
9. A traffic light color recognition device, characterized in that, The device includes: An acquisition unit is configured to acquire a color recognition result pair of a target traffic light based on a traffic light image, wherein the target traffic light includes a turn signal and a straight-ahead light, and the color recognition result pair includes the color recognition result of the turn signal and the color recognition result of the straight-ahead light; The type determination unit is used to determine the intersection type of the target intersection by judging whether each of the multiple color recognition result pairs in the first time period is the same color; The first result determination unit is used to determine that the preset color recognition result pair is a false detection result when there is a preset color recognition result pair among the color recognition result pairs obtained after determining the intersection type. The preset color recognition result pair includes color pairs other than the traffic light color pairs corresponding to the intersection type. The type determination unit includes: The first type determination module is used to determine the intersection type of the target intersection as the first intersection type when there are color recognition result pairs with different colors among multiple color recognition result pairs within the first time period. The second type determination module is used to determine the intersection type of the target intersection as the second intersection type when each of the multiple color recognition result pairs is the same color and not all of the multiple color recognition results are red lights during the first time period. The device further includes: The third result determination unit is used to determine the true result corresponding to the current target recognition result based on the historical target recognition result and / or the current target recognition result. The historical target recognition result is the target color recognition result detected within a historical time period, and the current target recognition result is the target color recognition result currently detected. When the intersection type of the target intersection is the first intersection type, the target color recognition result is the color recognition result corresponding to the target driving direction in the color recognition result pair. When the intersection type of the target intersection is the second intersection type, the target color recognition result is any color recognition result in the color recognition result pair.
10. The apparatus according to claim 9, characterized in that, The device further includes: The second result determination unit is configured to determine that the color recognition result pair determined based on the traffic light image in the next frame is a false detection result when multiple consecutive color recognition result pairs obtained after determining the intersection type are all first color pairs, and the color recognition result pair determined based on the traffic light image in the next frame is a second color pair. The first color pair is different from the second color pair, and the first color pair and the second color pair are not adjacent in the traffic light color cycle sequence of the intersection type.
11. The apparatus according to claim 9, characterized in that, The third result determination unit includes: a first result determination module or a second result determination module; The first result determination module is configured to, starting from the historical target recognition result being a yellow light, and under the condition of a driving decision to proceed, determine the true result corresponding to the current target recognition result as a yellow light when the number of consecutive target color recognition results being red is less than a first quantity threshold, or the proportion of red lights in consecutive second quantity threshold target color recognition results is less than a first proportion threshold; and determine the true result corresponding to the current target recognition result as a red light when the first quantity threshold of consecutive target color recognition results are all red, or the proportion of red lights in consecutive second quantity threshold target color recognition results is greater than or equal to the first proportion threshold. Wherein, the first quantity threshold is less than or equal to the second quantity threshold, and both the consecutive first quantity threshold of target color recognition results and the consecutive second quantity threshold of target color recognition results include the current target recognition result and the historical target recognition result; or... The second result determination module is used to determine the actual result corresponding to the current target recognition result as red light when the current target recognition result is red light and the driving decision is to stop, starting from the historical target recognition result being yellow light.
12. The apparatus according to claim 9, characterized in that, The third result determination unit includes: The third result determination module is used to determine the true result corresponding to the current target recognition result as red light when the target vehicle is the lead vehicle, starting from the historical target recognition result of red light. When the number of consecutive target color recognition results that are green light is less than a third quantity threshold, or the proportion of green light in the fourth consecutive quantity threshold of target color recognition results is less than a second proportion threshold, the module determines the true result corresponding to the current target recognition result as green light. When the third consecutive quantity threshold of target color recognition results are green light, or the proportion of green light in the fourth consecutive quantity threshold of target color recognition results is greater than or equal to the second proportion threshold, the module determines the true result corresponding to the current target recognition result as green light. Wherein, the third quantity threshold is less than or equal to the fourth quantity threshold, and each of the consecutive third quantity threshold target color recognition results and the consecutive fourth quantity threshold target color recognition results includes the current target recognition result and the historical target recognition result.
13. The apparatus according to claim 9, characterized in that, The device further includes: The fourth result determination unit is used to determine the true result corresponding to the current target recognition result as green light when the speed of the leading vehicle in the target lane changes from 0 to greater than or equal to a preset speed threshold, when the target vehicle is in the state of the leading vehicle waiting at a red light. The state of the leading vehicle waiting at a red light includes the target vehicle being at a speed of 0, the target color recognition result being red light, and the target vehicle corresponding to the target lane, where the target lane is an adjacent lane with the same travel direction as the lane to which the target vehicle belongs.
14. The apparatus according to claim 9, characterized in that, The third result determination unit includes: The fourth result determination module is used to determine the true result corresponding to the current target identification result as flashing green when the current target identification result is the Mth time the light is off, starting from the historical target identification result being green. M is a positive integer.
15. The apparatus according to any one of claims 9-14, characterized in that, The device further includes: The fifth result determination unit is used to determine the true result corresponding to the two adjacent target color recognition results as the overall green flashing when the target color recognition result determined based on the traffic light image of the next frame is yellow, in cases where the two adjacent target color recognition results are green and off respectively.
16. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.
17. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the electronic device performs the method as described in any one of claims 1-8.
18. A vehicle, characterized in that, The vehicle includes the device as described in any one of claims 9-15, or the electronic device as described in claim 17.