Traffic light identification method and device, electronic equipment and vehicle

By calculating the angle between the road end point and the vehicle and the angle between each traffic light and the vehicle, the target traffic light is screened out, and the problem of the inaccurate identification of the traffic lights to be referenced in the prior art is solved, and the accurate identification and safe passage of traffic lights when the vehicle is driving is achieved.

CN119682754AInactive Publication Date: 2025-03-25HAOMO TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311246815.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2025-03-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify the traffic lights to which a vehicle wants to refer to when driving on the road where it is currently located. Especially when there are multiple traffic lights at the same intersection, it is difficult to pre-associate the road and traffic lights, and association errors are prone to occur.

Method used

By calculating the angle between the road end point and the vehicle (first angle) and the angle between each traffic light and the vehicle (second angle) and the first angle is used to screen out the target second angle, thereby determining the target traffic light that the vehicle can refer to.

Benefits of technology

Accurate identification of the traffic lights to be referred to when the vehicle is driving on the current road, avoiding association errors, and improving the safety of the vehicle when passing through the intersection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119682754A_ABST
    Figure CN119682754A_ABST
Patent Text Reader

Abstract

The invention provides a traffic light recognition method and device, electronic equipment and a vehicle, and the method comprises the steps: determining that a plurality of traffic lights exist at a passing intersection when the vehicle is about to pass through the passing intersection, and obtaining the coordinates of a road end point of a road where the vehicle is currently located and the coordinates of all traffic lights at the passing intersection; the first included angle is used for indicating the range of the included angle between the traffic light and the vehicle which can be referenced by the vehicle, so that the first included angle is used for screening the plurality of second included angles, and the first included angle is used for indicating the range of the included angle between the traffic light and the vehicle which can be referenced by the vehicle; and determining a target traffic light from the plurality of traffic lights according to the traffic light coordinates corresponding to the target second included angle, so as to control the vehicle to pass through the traffic intersection according to the traffic information indicated by the target traffic light. The method can achieve the accurate recognition of the traffic light which the vehicle needs to refer to when the vehicle runs on the current road.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle control technology, and in particular to a traffic light recognition method, device, electronic equipment and vehicle. Background Art

[0002] When there are multiple traffic lights at the same intersection, it is necessary to identify the traffic light that the vehicle should refer to when traveling on the current road from among the traffic lights at the intersection.

[0003] However, related technologies often require pre-association of each road with the traffic lights to be referenced when driving on the corresponding road, so as to determine the traffic lights to be referenced according to the road on which the vehicle is traveling. However, it is difficult to pre-associate each road with the traffic lights to be referenced when driving on the corresponding road, and association errors are prone to occur, resulting in the inability to accurately identify the traffic lights to be referenced when the vehicle is driving on the current road. Summary of the invention

[0004] In view of this, the purpose of the present application is to propose a traffic light recognition method, device, electronic device and vehicle to solve the problem in the prior art that the traffic light to be referenced by the vehicle when traveling on the current road cannot be accurately identified.

[0005] Based on the above purpose, the first aspect of the present application provides a traffic light recognition method, comprising:

[0006] When the vehicle is about to pass through an intersection, determining that there are multiple traffic lights at the intersection, and obtaining the road endpoint coordinates of the road where the vehicle is currently located and the coordinates of each traffic light at the intersection;

[0007] Calculating the angle between the road endpoint and the vehicle using a preset first angle function based on the road endpoint coordinates to obtain a first angle, where the first angle is used to indicate a range of angles between a traffic light that the vehicle can refer to and the vehicle;

[0008] Calculating the angles between each traffic light and the vehicle by using a preset second angle function according to the coordinates of each traffic light to obtain a plurality of second angles;

[0009] The first angle is used to filter the multiple second angles to obtain a target second angle, and a target traffic light is determined from the multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light.

[0010] Optionally, the road endpoint coordinates include a first road endpoint coordinate and a second road endpoint coordinate;

[0011] The calculating the angle between the road endpoint and the vehicle using a preset first angle function based on the road endpoint coordinates to obtain the first angle includes:

[0012] Calculating the angle between the first road endpoint and the vehicle using a preset first angle function according to the first road endpoint coordinates to obtain a first sub-angle;

[0013] Calculating the angle between the second road endpoint and the vehicle using the preset first angle function based on the coordinates of the second road endpoint to obtain a second sub-angle;

[0014] The first sub-angle and the second sub-angle are used as the first angle.

[0015] Optionally, the traffic light coordinates are coordinates of a center point of the traffic light in an image taken by the vehicle;

[0016] The step of calculating the angles between each traffic light and the vehicle by using a preset second angle function according to the coordinates of each traffic light to obtain a plurality of second angles includes:

[0017] Based on the coordinates of the center points of the traffic lights in the image taken by the vehicle, the angles between the traffic lights and the vehicle are calculated by a preset second angle function to obtain a plurality of second angles.

[0018] Optionally, the calculating the angles between each traffic light and the vehicle by a preset second angle function based on the coordinates of the center points of each traffic light in the image taken by the vehicle to obtain a plurality of second angles includes:

[0019] Obtaining the focal length of the camera used to shoot the image, the width of the image, and the horizontal coordinates of the center points of each traffic light in the image;

[0020] Performing a product calculation using the width of the captured image and a preset parameter to obtain a product calculation result;

[0021] Performing difference calculation on the horizontal coordinate of each of the center points of the traffic lights in the image and the product calculation result to obtain a plurality of difference calculation results;

[0022] Performing ratio calculation on the multiple difference calculation results and the focal length of the camera used to shoot the image, to obtain multiple ratio calculation results;

[0023] An arc tangent operation is performed on the multiple ratio calculation results to obtain multiple second angles.

[0024] Optionally, the using the first angle to screen the plurality of second angles to obtain a target second angle includes:

[0025] Second angles larger than the first angle are eliminated from the plurality of second angles, and the second angles after eliminating the angles larger than the first angle are used as target second angles.

[0026] Optionally, the using the first angle to screen the plurality of second angles to obtain a target second angle includes:

[0027] The plurality of second angles are screened by a clustering algorithm based on the first angle to obtain a target second angle.

[0028] Optionally, the screening the plurality of second angles by using a clustering algorithm based on the first angle to obtain a target second angle includes:

[0029] Using the first angle as the cluster center calculated by the clustering algorithm;

[0030] Calculating the distance between each of the second angles and the cluster center to obtain a plurality of distances;

[0031] The second angles corresponding to the distances greater than the preset distance threshold are eliminated from the multiple distances, and the second angles corresponding to the distances greater than the preset distance threshold are eliminated as the target second angle.

[0032] Based on the same inventive concept, the second aspect of the present application provides a traffic light recognition device, comprising:

[0033] A coordinate acquisition module, used for determining, when a vehicle is about to pass through an intersection, that there are multiple traffic lights at the intersection, and acquiring the road end point coordinates of the road where the vehicle is currently located and the coordinates of each traffic light at the intersection;

[0034] A first angle calculation module, used to calculate the angle between the road endpoint and the vehicle using a preset first angle function based on the road endpoint coordinates to obtain a first angle, wherein the first angle is used to indicate a range of angles between the traffic light that the vehicle can refer to and the vehicle;

[0035] A second angle calculation module, used for calculating the angle between each traffic light and the vehicle according to the coordinates of each traffic light by using a preset second angle function to obtain a plurality of second angles;

[0036] A screening module is used to use the first angle to screen the multiple second angles to obtain a target second angle, and determine a target traffic light from the multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light.

[0037] Based on the same inventive concept, the third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method described in the first aspect is implemented when the processor executes the program.

[0038] Based on the same inventive concept, the fourth aspect of the present application provides a vehicle, comprising the traffic light recognition device described in the second aspect or the electronic device described in the third aspect.

[0039] As can be seen from the above, the traffic light recognition method, device, electronic device and vehicle provided by the present application, when the vehicle is about to pass through an intersection, determine that there are multiple traffic lights at the intersection, obtain the road endpoint coordinates of the road where the vehicle is currently located and the coordinates of each traffic light at the intersection, and calculate the angle between the road endpoint and the vehicle based on the road endpoint coordinates using a preset first angle function to obtain a first angle. The first angle can accurately know the range of angles between the traffic lights and the vehicle that the vehicle can refer to, and then calculate the angles between each traffic light and the vehicle according to the coordinates of each traffic light through a preset second angle function to obtain multiple second angles. The multiple second angles can It is able to accurately know the angles between all traffic lights and vehicles at the intersection. Since the first angle is used to indicate the range of angles between the traffic lights and the vehicle that the vehicle can refer to, the first angle is used to screen multiple second angles. The multiple second angles are screened by the range of angles between the traffic lights and the vehicle that the vehicle can refer to, so that the screened target second angle is more accurate. The target traffic light is determined from the multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so that the vehicle can be controlled to pass through the intersection according to the traffic information indicated by the target traffic light, and the traffic light to be referenced by the vehicle when traveling on the current road can be accurately identified. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 A flow chart of a traffic light recognition method according to an embodiment of the present application;

[0042] Figure 2A A schematic diagram of a traffic intersection according to an embodiment of the present application;

[0043] Figure 2B A schematic diagram of a traffic intersection according to another embodiment of the present application;

[0044] Figure 2C A schematic diagram of calculating the angle between a traffic light and a vehicle according to an embodiment of the present application;

[0045] Figure 2D A schematic diagram of a traffic light recognition framework according to an embodiment of the present application;

[0046] Figure 3 A schematic diagram of the structure of a traffic light recognition device according to an embodiment of the present application;

[0047] Figure 4 A schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0049] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0050] In the related art, since the positions and directions of traffic lights at actual intersections are not set according to a certain rule, there are multiple traffic lights indicating different traffic information at the same intersection.

[0051] The method of pre-associating each road with the traffic lights to be referenced when driving on the corresponding road to determine the traffic lights to be referenced according to the road the vehicle is traveling on is time-consuming. In addition, for complex intersections, it is difficult to pre-associate each road with the traffic lights to be referenced when driving on the corresponding road, and association errors are prone to occur, resulting in the inability to accurately identify the traffic lights to be referenced when the vehicle is traveling on the current road.

[0052] A traffic light recognition method proposed in this embodiment uses a first angle to screen multiple second angles, and screens multiple second angles by using the range of angles between traffic lights and vehicles that can be referenced by vehicles, so that the screened target second angle is more accurate, and determines the target traffic light from multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light, and can realize accurate recognition of the traffic light to be referenced by the vehicle when driving on the current road, such as Figure 1 As shown, including:

[0053] Step 101, when a vehicle is about to pass through an intersection, it is determined that there are multiple traffic lights at the intersection, and the road end point coordinates of the current road where the vehicle is located and the coordinates of each traffic light at the intersection are obtained.

[0054] In this step, the road endpoint is the intersection of the left side isolation strip of the road where the vehicle is currently located and the stop line at the intersection, and / or the intersection of the right side road edge line of the road where the vehicle is currently located and the stop line at the intersection.

[0055] When a vehicle is about to pass through an intersection, it is determined that there are multiple traffic lights at the intersection. The road endpoint coordinates can be obtained from a high-precision map, or from a Street Directory Profession Map (SDPro). The method for obtaining the road endpoint coordinates is not specifically limited here.

[0056] The pre-trained semantic segmentation model is used to identify the traffic lights at the intersection, and then the pre-trained target detection model is used to obtain the coordinates of the traffic lights at the intersection, so that the obtained traffic light coordinates are more accurate, thereby improving the accuracy of traffic light recognition.

[0057] Step 102, based on the coordinates of the road endpoint, a preset first angle function is used to calculate the angle between the road endpoint and the vehicle to obtain a first angle, wherein the first angle is used to indicate a range of angles between a traffic light that the vehicle can refer to and the vehicle.

[0058] In this step, if Figure 2A As shown, the first angle represents the angle between the road endpoint and the vehicle. The road endpoint can be the intersection of the left isolation belt of the road where the vehicle is currently located and the stop line at the intersection, or it can be the intersection of the right road edge line of the road where the vehicle is currently located and the stop line at the intersection.

[0059] The angle between the road endpoint and the vehicle is calculated using a preset first angle function, wherein the first angle is the angle between any road endpoint and the vehicle.

[0060] By calculating the angle between the road endpoint and the vehicle using a preset first angle function, the range of the angle between the traffic light that the vehicle can refer to and the vehicle can be accurately obtained.

[0061] Step 103: Calculate the angle between each traffic light and the vehicle according to the coordinates of each traffic light by using a preset second angle function to obtain a plurality of second angles.

[0062] In this step, the second angle represents the angle between the traffic light and the vehicle, or the angle between the vertical projection of the traffic light to the ground and the vehicle.

[0063] The preset second angle function is used to calculate the angle between each traffic light and the vehicle. By calculating the angle between each traffic light and the vehicle, the angle between all traffic lights and the vehicle at the intersection can be accurately known, which can further avoid the omission of traffic light recognition and the problem of not being able to recognize reference traffic lights, thereby improving the safety of vehicle driving.

[0064] Step 104, using the first angle to filter the multiple second angles to obtain a target second angle, and determining a target traffic light from the multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light.

[0065] In this step, the target second angle represents the angle between the vehicle and the traffic light that can be used as a reference on the current road.

[0066] Since the first angle is used to indicate the range of angles between the traffic lights that the vehicle can refer to and the vehicle, and the multiple second angles represent the angles between all the traffic lights at the intersection and the vehicle, the target second angle can be screened from the multiple second angles based on the first angle to determine the target second angle that falls within the range of angles between the traffic lights that the vehicle can refer to and the vehicle, and then the target traffic light is determined from the multiple traffic lights at the intersection based on the traffic light coordinates corresponding to the target second angle, so that the vehicle can pass through the intersection according to the traffic information indicated by the target traffic light.

[0067] In this way, it is possible to accurately select the traffic lights that the vehicle needs to refer to when driving on the current road from multiple traffic lights at the intersection, thereby ensuring the driving safety of the vehicle.

[0068] Through the above scheme, when a vehicle is about to pass through an intersection, it is determined that there are multiple traffic lights at the intersection, the road endpoint coordinates of the current road where the vehicle is located and the coordinates of each traffic light at the intersection are obtained, and the angle between the road endpoint and the vehicle is calculated based on the road endpoint coordinates using a preset first angle function to obtain a first angle. The first angle can be used to accurately know the range of angles between the traffic lights that the vehicle can refer to and the vehicle, and then the angles between each traffic light and the vehicle are calculated based on the coordinates of each traffic light using a preset second angle function to obtain multiple second angles. The multiple second angles can accurately know all the angles at the intersection. The angle between the traffic light and the vehicle. Since the first angle is used to indicate the range of the angle between the traffic light and the vehicle that the vehicle can refer to, the first angle is used to screen multiple second angles. The multiple second angles are screened by the range of the angle between the traffic light and the vehicle that the vehicle can refer to, so that the screened target second angle is more accurate, and the target traffic light is determined from the multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light, so as to realize accurate identification of the traffic light to be referenced by the vehicle when traveling on the current road.

[0069] In some embodiments, the road endpoint coordinates include first road endpoint coordinates and the second road endpoint coordinates;

[0070] In step 102, the angle between the road endpoint and the vehicle is calculated based on the road endpoint coordinates using a preset first angle function to obtain a first angle, including:

[0071] Step 1021: Calculate the angle between the first road endpoint and the vehicle according to the coordinates of the first road endpoint using a preset first angle function to obtain a first sub-angle.

[0072] Step 1022: Calculate the angle between the second road endpoint and the vehicle based on the coordinates of the second road endpoint using the preset first angle function to obtain a second sub-angle.

[0073] Step 1023: Use the first sub-angle and the second sub-angle as the first angle.

[0074] In the above scheme, if Figure 2B As shown, the first road endpoint represents the intersection of the left isolation zone of the road where the vehicle is currently located and the stop line at the intersection, the second road endpoint represents the intersection of the right road edge line of the road where the vehicle is currently located and the stop line at the intersection, the first sub-angle and the second sub-angle are both first angles, and the first angle and the second angle are the range of angles between the traffic light and the vehicle that the vehicle can refer to.

[0075] The preset first angle function is specifically:

[0076]

[0077] Wherein, x represents the abscissa of the road endpoint, y represents the ordinate of the road endpoint, and θ represents the first angle.

[0078] The coordinates of the first road endpoint are (x l ,y l , z l ), x l Indicates the horizontal coordinate of the first road endpoint, y l Indicates the ordinate of the first road endpoint, Z l Indicates the vertical coordinate of the first road endpoint.

[0079] The coordinates of the second road endpoint are (x r ,y r , z r ), X r Indicates the horizontal coordinate of the second road endpoint, y r Indicates the ordinate of the second road endpoint, Z r Indicates the vertical coordinate of the second road endpoint.

[0080] The first road endpoint coordinates and the second road endpoint coordinates are both coordinates of the own vehicle in the same coordinate system, and the vehicle body coordinate system is preferred.

[0081] Therefore, the first road endpoint coordinate (x l ,y l , z l ) Substitute into the preset first angle function The first sub-angle is obtained

[0082] The coordinates of the second road endpoint (x r ,y r , z r ) Substitute into the preset first angle function The second sub-angle is obtained

[0083] Through the above solution, the first angle function can be used to accurately determine the range of the angle between the traffic light that the vehicle can refer to and the vehicle.

[0084] In some embodiments, the traffic light coordinates are the coordinates of the center point of the traffic light in the image captured by the vehicle;

[0085] In step 103, the angles between each traffic light and the vehicle are calculated by a preset second angle function according to the coordinates of each traffic light to obtain a plurality of second angles, including:

[0086] Step A1, based on the coordinates of the center points of the traffic lights in the image taken by the vehicle, the angles between the traffic lights and the vehicle are calculated by a preset second angle function to obtain a plurality of second angles.

[0087] In the above scheme, the camera or camera installed on the vehicle can capture the current front road condition images including the traffic lights, and the traffic light coordinates are the coordinates of the center point of the traffic light in the image captured by the vehicle.

[0088] The second angle represents the angle between the traffic light and the vehicle, or the angle between the vertical projection of the traffic light to the ground and the vehicle.

[0089] The angle between each traffic light and the vehicle is calculated according to the coordinates of the center point of each traffic light in the image taken by the vehicle through a preset second angle function.

[0090] Through the above scheme, by calculating the angle between each traffic light and the vehicle, the angle between all traffic lights within the field of vision of the vehicle at the intersection and the vehicle can be determined, thereby avoiding omissions in traffic light recognition and the problem of being unable to recognize reference traffic lights, thereby improving the safety of vehicle driving.

[0091] In some embodiments, step A1 includes:

[0092] Step A11, obtaining the focal length of the camera used to shoot the image, the width of the image, and the horizontal coordinates of the center points of each traffic light in the image.

[0093] Step A12, performing product calculation using the width of the captured image and a preset parameter to obtain a product calculation result.

[0094] Step A13, performing difference calculation on the horizontal coordinate of each of the traffic light center points in the image and the product calculation result to obtain a plurality of difference calculation results.

[0095] Step A14, performing ratio calculation on the multiple difference calculation results and the focal length of the camera used to shoot the image, to obtain multiple ratio calculation results.

[0096] Step A15, performing an arc tangent operation on the multiple ratio calculation results to obtain multiple second angles.

[0097] In the above solution, the preset second angle function is specifically:

[0098]

[0099] Wherein, f represents the focal length of the camera used to capture the image, w represents the width of the image captured, and θ tlIt is represented as the second angle, and X is represented as the horizontal coordinate of the center point of the traffic light in the image.

[0100] like Figure 2C As shown, P(X c , Y c , Z c ) represents the coordinates of the traffic light in the world coordinate system, p = (x, y) represents the coordinates of the center point of the traffic light in the image taken by the vehicle, and the coordinates of the traffic light in the world coordinate system P (X c , Y c , Z c ) is converted into the coordinates p = (x, y) in the image taken by the vehicle, so the second angle function can be preset The angle between each traffic light and the vehicle is calculated in this way.

[0101] Through the above scheme, the angles between all traffic lights within the vehicle's line of sight at the intersection and the vehicle can be accurately determined, which can further avoid omissions in traffic light recognition and the problem of being unable to recognize reference traffic lights, thereby improving the safety of vehicle driving.

[0102] In some embodiments, in step 104, the using the first angle to screen the plurality of second angles to obtain a target second angle includes:

[0103] Step B1, eliminating second angles greater than the first angle from multiple second angles, and using the second angles after eliminating the second angles greater than the first angle as the target second angle.

[0104] In the above solution, the target second angle represents the angle between the vehicle and the traffic light that can be used as a reference on the current road.

[0105] Since the first angle is used to indicate the range of angles between the traffic lights that the vehicle can refer to and the vehicle, when the value of the second angle is greater than the first angle, that is, the second angle is not within the range of the first angle, it means that the traffic light corresponding to the second angle is a traffic light that the vehicle does not need to refer to on the current road.

[0106] Therefore, with the magnitude of the first angle as a reference, the second angles whose values ​​are greater than the first angle are eliminated from the plurality of second angles. The remaining second angles after elimination are within the range of the first angle, indicating that the traffic light corresponding to the remaining second angle is the traffic light that the vehicle can refer to on the current road.

[0107] At this time, during the vehicle control process, the vehicle can determine the target traffic light from multiple traffic lights at the intersection according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light, thereby achieving safe vehicle control.

[0108] Through the above scheme, by eliminating the second angle greater than the first angle from the multiple second angles, the target second angle is accurately determined to ensure the driving safety of the vehicle.

[0109] In some embodiments, in step 104, the using the first angle to screen the plurality of second angles to obtain a target second angle includes:

[0110] Step B1: Screening the plurality of second angles by using a clustering algorithm based on the first angle to obtain a target second angle.

[0111] In the above solution, the target second angle represents the angle between the vehicle and the traffic light that can be used as a reference on the current road.

[0112] The clustering algorithm can be a K-means clustering algorithm (K-means clustering algorithm), a K-center point algorithm, a GMM (Gaussian Mixed Model) Gaussian mixture model clustering algorithm, a Mean shift clustering algorithm, or a density-based DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm. The K-means clustering algorithm is preferred here.

[0113] Through the above scheme, the K-means clustering algorithm can minimize the square error of the second angle of the screened target, thereby improving the accuracy of traffic light recognition. At the same time, it can perform efficient screening processing, shorten the time of traffic light recognition, and thus improve the safety of vehicle driving.

[0114] In some embodiments, step B1 includes:

[0115] Step B11: using the first angle as the cluster center calculated by a clustering algorithm.

[0116] Step B12, calculating the distance between each second angle and the cluster center to obtain multiple distances.

[0117] Step B13, eliminating the second angles corresponding to the distances greater than the preset distance threshold from the multiple distances, and taking the second angles corresponding to the distances greater than the preset distance threshold after eliminating them as the target second angle.

[0118] In the above scheme, if Figure 2B As shown, each first angle (first sub-angle and second sub-angle) is used as a cluster center calculated by a clustering algorithm.

[0119] A clustering algorithm is used to calculate the distance between each second angle and the first sub-angle to obtain multiple distances, and the second angle with a large difference from the first sub-angle is eliminated from the multiple distances. The difference between the second angle and the first sub-angle is measured by a preset distance threshold. The preset distance threshold can be set according to the specific situation and is not specifically limited here.

[0120] Similarly, a clustering algorithm is used to calculate the distance between each second angle and the second sub-angle to obtain multiple distances, and the second angle with a large difference from the second sub-angle is eliminated from the multiple distances. The difference between the second angle and the second sub-angle is measured by a preset distance threshold. The preset distance threshold can be set according to the specific situation and is not specifically limited here.

[0121] The second angle corresponding to the second angle after eliminating the angles greater than the preset distance threshold is used as the target second angle.

[0122] Through the above scheme, the accuracy of traffic light recognition is improved. At the same time, the clustering algorithm can be used for efficient screening and processing, which shortens the time of traffic light recognition and thus improves the safety of vehicle driving.

[0123] Based on the same inventive concept, the application scenarios corresponding to the traffic light recognition method of the above embodiment are described in detail. Figure 2D As shown, the details are as follows:

[0124] Estimate the direction angle between the road endpoint and the vehicle: obtain the coordinates of the road endpoint (i.e. the coordinates of the road endpoint of the road the vehicle is currently on), and calculate the angle based on the inverse tangent function (i.e. the preset first angle function).

[0125] Estimate the direction angle between the traffic light and the vehicle: obtain the coordinates of the traffic light in the image (i.e. the coordinates of each traffic light at the intersection where the vehicle is about to pass), and calculate the angle based on the inverse tangent function (i.e. the preset second angle function).

[0126] Then, according to the estimated direction angle between the road endpoint and the vehicle (i.e., the first angle) and the estimated direction angle between the traffic light and the vehicle (i.e., the second angle), rule-based traffic light screening is performed, wherein the rule-based traffic light screening is performed by comparing the direction angles and then outputting the relationship binding result (i.e., the target traffic light).

[0127] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.

[0128] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0129] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a traffic light recognition device.

[0130] refer to Figure 3 , the traffic light recognition device comprises:

[0131] A coordinate acquisition module 301 is used to determine, when a vehicle is about to pass through an intersection, that there are multiple traffic lights at the intersection, and to acquire the road endpoint coordinates of the road where the vehicle is currently located and the coordinates of each traffic light at the intersection;

[0132] A first angle calculation module 302, configured to calculate the angle between the road endpoint and the vehicle using a preset first angle function based on the road endpoint coordinates to obtain a first angle, wherein the first angle is used to indicate a range of angles between the traffic light that the vehicle can refer to and the vehicle;

[0133] A second angle calculation module 303, configured to calculate the angle between each traffic light and the vehicle according to the coordinates of each traffic light by using a preset second angle function to obtain a plurality of second angles;

[0134] The screening module 304 is used to use the first angle to screen the multiple second angles to obtain a target second angle, and determine the target traffic light from the multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light.

[0135] In some embodiments, the road endpoint coordinates include first road endpoint coordinates and the second road endpoint coordinates;

[0136] The first angle calculation module 302 is specifically configured as follows:

[0137] Calculating the angle between the first road endpoint and the vehicle using a preset first angle function according to the first road endpoint coordinates to obtain a first sub-angle;

[0138] Calculating the angle between the second road endpoint and the vehicle using the preset first angle function based on the coordinates of the second road endpoint to obtain a second sub-angle;

[0139] The first sub-angle and the second sub-angle are used as the first angle.

[0140] In some embodiments, the traffic light coordinates are the coordinates of the center point of the traffic light in the image captured by the vehicle;

[0141] The second angle calculation module 303 includes:

[0142] The second angle calculation submodule is used to calculate the angles between each traffic light and the vehicle based on the coordinates of the center points of each traffic light in the image taken by the vehicle by using a preset second angle function to obtain multiple second angles.

[0143] In some embodiments, the second angle calculation submodule is specifically used to:

[0144] Obtaining the focal length of the camera used to shoot the image, the width of the image, and the horizontal coordinates of the center points of each traffic light in the image;

[0145] Performing a product calculation using the width of the captured image and a preset parameter to obtain a product calculation result;

[0146] Performing difference calculation on the horizontal coordinate of each of the center points of the traffic lights in the image and the product calculation result to obtain a plurality of difference calculation results;

[0147] Performing ratio calculation on the multiple difference calculation results and the focal length of the camera used to shoot the image, to obtain multiple ratio calculation results;

[0148] An arc tangent operation is performed on the multiple ratio calculation results to obtain multiple second angles.

[0149] In some embodiments, the screening module 304 is specifically configured to:

[0150] Second angles larger than the first angle are eliminated from the plurality of second angles, and the second angles after eliminating the angles larger than the first angle are used as the target second angle.

[0151] In some embodiments, the screening module 304 includes:

[0152] The clustering screening unit is configured to screen the plurality of second angles by a clustering algorithm based on the first angle to obtain a target second angle.

[0153] In some embodiments, the cluster screening unit is specifically configured to:

[0154] Using the first angle as the cluster center calculated by the clustering algorithm;

[0155] Calculating the distance between each of the second angles and the cluster center to obtain a plurality of distances;

[0156] The second angles corresponding to the distances greater than the preset distance threshold are eliminated from the multiple distances, and the second angles corresponding to the distances greater than the preset distance threshold are eliminated as the target second angle.

[0157] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0158] The device of the above embodiment is used to implement the corresponding traffic light recognition method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0159] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the traffic light recognition method described in any of the above embodiments is implemented.

[0160] Figure 4 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 401, a memory 402, an input / output interface 403, a communication interface 404, and a bus 405. The processor 401, the memory 402, the input / output interface 403, and the communication interface 404 are connected to each other in communication within the device through the bus 405.

[0161] The processor 401 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0162] The memory 402 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 402 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 402 and called and executed by the processor 401.

[0163] The input / output interface 403 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0164] The communication interface 404 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0165] The bus 405 comprises a pathway for transmitting information between the various components of the device (eg, the processor 401 , the memory 402 , the input / output interface 403 , and the communication interface 404 ).

[0166] It should be noted that, although the above device only shows the processor 401, the memory 402, the input / output interface 403, the communication interface 404 and the bus 405, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0167] The electronic device of the above embodiment is used to implement the corresponding traffic light recognition method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0168] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the traffic light recognition method as described in any of the above embodiments.

[0169] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0170] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the traffic light recognition method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0171] Based on the same inventive concept, this embodiment provides a vehicle corresponding to the traffic light recognition device or electronic device or storage medium of any of the above-mentioned embodiments, on which a traffic light recognition device or electronic device or storage medium capable of implementing the traffic light recognition method of any of the above-mentioned embodiments is installed.

[0172] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0173] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0174] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0175] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A traffic light recognition method, characterized in that: include: When the vehicle is about to pass through an intersection, determining that there are multiple traffic lights at the intersection, and obtaining the road endpoint coordinates of the road where the vehicle is currently located and the coordinates of each traffic light at the intersection; Calculating the angle between the road endpoint and the vehicle using a preset first angle function based on the road endpoint coordinates to obtain a first angle, where the first angle is used to indicate a range of angles between a traffic light that the vehicle can refer to and the vehicle; Calculating the angles between each traffic light and the vehicle by using a preset second angle function according to the coordinates of each traffic light to obtain a plurality of second angles; The first angle is used to filter the multiple second angles to obtain a target second angle, and a target traffic light is determined from the multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light.

2. The method according to claim 1, characterized in that The road endpoint coordinates include a first road endpoint coordinate and a second road endpoint coordinate; The calculating the angle between the road endpoint and the vehicle using a preset first angle function based on the road endpoint coordinates to obtain the first angle includes: Calculating the angle between the first road endpoint and the vehicle using a preset first angle function according to the first road endpoint coordinates to obtain a first sub-angle; Calculating the angle between the second road endpoint and the vehicle using the preset first angle function based on the coordinates of the second road endpoint to obtain a second sub-angle; The first sub-angle and the second sub-angle are used as the first angle.

3. The method according to claim 1, characterized in that The traffic light coordinates are the coordinates of the center point of the traffic light in the image taken by the vehicle; The step of calculating the angles between each traffic light and the vehicle by using a preset second angle function according to the coordinates of each traffic light to obtain a plurality of second angles includes: Based on the coordinates of the center points of the traffic lights in the image taken by the vehicle, the angles between the traffic lights and the vehicle are calculated by a preset second angle function to obtain a plurality of second angles.

4. The method according to claim 3, characterized in that The calculating the angles between each traffic light and the vehicle based on the coordinates of the center points of each traffic light in the image taken by the vehicle by using a preset second angle function to obtain a plurality of second angles includes: Obtaining the focal length of the camera used to shoot the image, the width of the image, and the horizontal coordinates of the center points of each traffic light in the image; Performing a product calculation using the width of the captured image and a preset parameter to obtain a product calculation result; Performing difference calculation on the horizontal coordinate of each of the center points of the traffic lights in the image and the product calculation result to obtain a plurality of difference calculation results; Performing ratio calculation on the multiple difference calculation results and the focal length of the camera used to shoot the image, to obtain multiple ratio calculation results; An arc tangent operation is performed on the multiple ratio calculation results to obtain multiple second angles.

5. The method according to claim 1, characterized in that The using the first angle to screen the plurality of second angles to obtain a target second angle includes: Second angles larger than the first angle are eliminated from the plurality of second angles, and the second angles after eliminating the angles larger than the first angle are used as the target second angle.

6. The method according to claim 1, characterized in that The using the first angle to screen the plurality of second angles to obtain a target second angle includes: The plurality of second angles are screened by a clustering algorithm based on the first angle to obtain a target second angle.

7. The method according to claim 6, characterized in that The step of screening the plurality of second angles by using a clustering algorithm based on the first angle to obtain a target second angle includes: Using the first angle as the cluster center calculated by the clustering algorithm; Calculating the distance between each of the second angles and the cluster center to obtain a plurality of distances; The second angles corresponding to the distances greater than the preset distance threshold are eliminated from the multiple distances, and the second angles corresponding to the distances greater than the preset distance threshold are eliminated as the target second angle.

8. A traffic light recognition device, characterized in that: include: A coordinate acquisition module, used for determining, when a vehicle is about to pass through an intersection, that there are a plurality of traffic lights at the intersection, and acquiring the road end point coordinates of the road where the vehicle is currently located and the coordinates of each traffic light at the intersection; A first angle calculation module, used to calculate the angle between the road endpoint and the vehicle using a preset first angle function based on the road endpoint coordinates to obtain a first angle, wherein the first angle is used to indicate a range of angles between the traffic light that the vehicle can refer to and the vehicle; A second angle calculation module, used for calculating the angle between each traffic light and the vehicle according to the coordinates of each traffic light by using a preset second angle function to obtain a plurality of second angles; A screening module is used to use the first angle to screen the multiple second angles to obtain a target second angle, and determine a target traffic light from the multiple traffic lights according to the traffic light coordinates corresponding to the target second angle, so as to control the vehicle to pass through the intersection according to the traffic information indicated by the target traffic light.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A vehicle, characterized in that: It includes the traffic light recognition device according to claim 8 or the electronic device according to claim 9.

Citation Information

Patent Citations

  • Traffic light identification method and device, electronic equipment and storage medium

    CN114419602A

  • Traffic signal lamp detection method and device, and traffic signal lamp training method and device

    CN115841661A

  • Signal lamp identification method and device, vehicle control unit and storage medium

    CN115937815A