Traffic signal light recognition method and device, computer device, and storage medium

By predicting weather type and performing image enhancement processing in the traffic light recognition method, cropping and verifying the traffic light image, the problem of inaccurate recognition in complex environments is solved, and accurate recognition under different weather and lighting conditions is achieved.

CN115953757BActive Publication Date: 2026-02-13苏州万集车联网技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211692504.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2026-02-13
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

Traffic lights suffer from poor image quality in complex natural environments, leading to inaccurate recognition results.

Method used

Image enhancement is performed by predicting the weather type score of the image, cropping the traffic light image, calculating color values ​​and brightness factors, and verifying and updating the recognition results in conjunction with the environment type. Preset conditions are used to ensure the accuracy of traffic light recognition.

Benefits of technology

It improves the recognition accuracy of traffic lights under different weather and lighting conditions, achieves anti-interference capability in complex environments, and ensures the accuracy of recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115953757B_ABST
    Figure CN115953757B_ABST
Patent Text Reader

Abstract

The application relates to a traffic signal lamp recognition method and device, computer equipment and a storage medium, which comprises the following steps: predicting a weather type evaluation score of a current frame image of any direction, and pre-processing the current frame image according to the weather type evaluation score; determining a distinguishing mark corresponding to the processed current frame image based on the luminance value of the processed current frame image; for any signal lamp group, obtaining a signal lamp image of each signal lamp based on the preset position of each signal lamp, recognizing the signal lamp image, determining an initial recognition result and a luminance factor of each signal lamp image; and checking and updating the initial recognition result based on the distinguishing mark and the luminance factor to determine a final recognition result. The processing algorithm of special weather is added in the image processing process, the anti-interference property of weather change is realized, the algorithm switching reference factor is added, images acquired in the day and night environment can be accurately recognized, and the recognition precision of the traffic signal lamp is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to a traffic signal lamp recognition method and device, computer equipment, storage medium and computer program product. BACKGROUND

[0002] Traffic signal lamps are important equipment for controlling traffic flow and maintaining traffic order, and indicate the passing state through different colors and shapes. With the development of road traffic intelligent technology, traffic signal lamp information has become a necessary data for roadside perception and single vehicle intelligence. There are various ways to obtain traffic light signals, such as accessing traffic light equipment to obtain internal electrical signals in real time, but this method involves information security and cannot be widely accessed. Cameras are essential perception devices at the road end and vehicle end and are widely used. Through camera acquisition of real-time traffic light images, traffic signal lamp recognition through traffic light image processing has become a common way, such as image segmentation, image classification, color recognition, etc. However, traffic lights work in a natural environment, and their working environment is complex and variable. The complex working environment will affect the quality of the obtained traffic light images, and thus affect the accuracy of the traffic signal lamp recognition result. SUMMARY

[0003] Therefore, it is necessary to provide an accurate and effective traffic signal lamp recognition method, device, computer equipment, computer readable storage medium and computer program product in view of the above technical problems.

[0004] In a first aspect, the present application provides a traffic signal lamp recognition method. The method comprises:

[0005] obtaining a current frame image of any direction of an intersection; the current frame image comprises at least one signal lamp group;

[0006] predicting a weather type evaluation score of the current frame image, performing image enhancement processing on the current frame image according to the weather type evaluation score to obtain a processed current frame image; the weather type evaluation score is used to indicate the weather type of the natural acquisition environment of the image;

[0007] determining a distinguishing identifier corresponding to the processed current frame image based on a luminance value of the processed current frame image; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or night;

[0008] for any signal lamp group, performing cropping on the processed current frame image based on a preset position of each signal lamp to obtain a signal lamp image of each signal lamp in any signal lamp group;

[0009] The color value and the brightness factor of each signal lamp image are calculated, and an initial recognition result of each signal lamp image is determined according to the color value of each signal lamp image;

[0010] The natural acquisition environment type of the current frame image is determined based on the distinguishing mark and the brightness factor of each signal lamp image; in the case that the natural acquisition environment of the current frame image is daytime, the initial recognition result of each signal lamp image is verified and updated according to a preset condition to determine the final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of the signal lamp at the preset position in the signal lamp group is a fixed value.

[0011] In one of the embodiments, the weather type evaluation score of the current frame image is predicted, including:

[0012] An equation of a fitting regression curve between the edge detection operator and the weather type evaluation score is obtained, and at least one edge detection operator of the current frame image is obtained;

[0013] The at least one edge detection operator of the current frame image is substituted into the equation of the fitting regression curve to obtain the weather type evaluation score of the current frame image.

[0014] In one of the embodiments, the current frame image is subjected to image enhancement processing according to the weather type evaluation score to obtain a processed current frame image, including:

[0015] The weather type corresponding to the current frame image is determined according to the weather type evaluation score of the current frame image;

[0016] The corresponding image enhancement algorithm is obtained according to the weather type corresponding to the current frame image, and the current frame image is subjected to image enhancement processing based on the corresponding image enhancement algorithm to obtain the processed current frame image.

[0017] In one of the embodiments, the color value of each signal lamp image is calculated, including:

[0018] For any signal lamp image, the color value of each pixel point in the signal lamp image is obtained;

[0019] The average value of the color values of all the pixel points with color values greater than zero is taken as the color value of the signal lamp image.

[0020] In one of the embodiments, the brightness factor of each signal lamp image is calculated, including:

[0021] For any signal lamp image, the brightness value of each pixel point in the signal lamp image is obtained;

[0022] The difference between the brightness value of each pixel point and a preset threshold value is obtained, and the average value of the differences corresponding to all the pixel points is taken as the brightness factor of the signal lamp image.

[0023] In one of the embodiments, the initial recognition result includes the signal light color and the signal light position; accordingly, the initial recognition result of each signal light image is verified and updated according to the preset condition, and the final recognition result of each signal light image is determined, including:

[0024] The preset color corresponding to the signal light position in the initial recognition result of each signal light image is obtained;

[0025] In the case that the preset color is inconsistent with the signal light color in the initial recognition result of each signal light image, the initial recognition result of each signal light image is adjusted according to the preset color, and the final recognition result of each signal light image is obtained.

[0026] In one of the embodiments, the method further includes:

[0027] The initial recognition result of any signal light group is determined according to the final recognition result of all signal light images in any signal light group;

[0028] The reference recognition result of all signal light groups except any signal light group at the intersection is obtained, and the recognition result of any signal light group is corrected and updated according to the reference recognition result, and the final recognition result of any signal light group is obtained.

[0029] In a second aspect, the application further provides a traffic signal light recognition device. The device includes:

[0030] An image acquisition module is configured to acquire a current frame image of any direction at an intersection; the current frame image includes at least one signal light group;

[0031] An image preprocessing module is configured to predict a weather type evaluation score of the current frame image, and perform image enhancement processing on the current frame image according to the weather type evaluation score to obtain a processed current frame image; the weather type evaluation score is used to indicate the weather type of the natural acquisition environment of the image;

[0032] An identification determination module is configured to determine a distinguishing identification corresponding to the processed current frame image based on the luminance value of the processed current frame image; the distinguishing identification is used to distinguish whether the natural acquisition environment of the image is daytime or nighttime;

[0033] An image cropping module is configured to crop the processed current frame image based on the preset position of each signal light for any signal light group to obtain a signal light image of each signal light in any signal light group;

[0034] An image recognition module is configured to calculate a color value and a luminance factor of each signal light image, and determine an initial recognition result of each signal light image according to the color value of each signal light image;

[0035] a result determination module configured to determine a natural acquisition environment type of the current frame image based on the distinguishing identifier and a brightness factor of each signal lamp image; in a case where the natural acquisition environment of the current frame image is daytime, check and update the initial recognition result of each signal lamp image according to a preset condition to determine a final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of a signal lamp at a preset position in the signal lamp group is a fixed value.

[0036] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0037] obtaining a current frame image of any direction of an intersection; the current frame image comprises at least one signal lamp group;

[0038] predicting a weather type evaluation score of the current frame image, performing image enhancement processing on the current frame image according to the weather type evaluation score to obtain a processed current frame image; the weather type evaluation score is used to indicate a weather type of a natural acquisition environment of the image;

[0039] determining a distinguishing identifier corresponding to the processed current frame image based on a brightness value of the processed current frame image; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or nighttime;

[0040] for any signal lamp group, performing cropping on the processed current frame image based on preset positions of the signal lamps to obtain a signal lamp image of each signal lamp in any signal lamp group;

[0041] calculating a color value and a brightness factor of each signal lamp image, and determining an initial recognition result of each signal lamp image according to the color value of each signal lamp image;

[0042] determining a natural acquisition environment type of the current frame image based on the distinguishing identifier and the brightness factor of each signal lamp image; in a case where the natural acquisition environment of the current frame image is daytime, checking and updating the initial recognition result of each signal lamp image according to a preset condition to determine a final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of a signal lamp at a preset position in the signal lamp group is a fixed value.

[0043] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0044] obtaining a current frame image of any direction of an intersection; the current frame image comprises at least one signal lamp group;

[0045] predict a weather type evaluation score of the current frame image, perform image enhancement processing on the current frame image according to the weather type evaluation score, and obtain a processed current frame image; the weather type evaluation score is used to indicate a weather type of a natural acquisition environment of the image;

[0046] determine a distinguishing identifier corresponding to the processed current frame image based on a luminance value of the processed current frame image; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or night;

[0047] for any signal lamp group, perform cropping on the processed current frame image based on preset positions of the signal lamps, and obtain a signal lamp image of each signal lamp in any signal lamp group;

[0048] calculate a color value and a luminance factor of each signal lamp image, and determine an initial recognition result of each signal lamp image according to the color value of each signal lamp image;

[0049] determine a natural acquisition environment type of the current frame image based on the distinguishing identifier and the luminance factor of each signal lamp image; in a case where the natural acquisition environment of the current frame image is daytime, verify and update the initial recognition result of each signal lamp image according to a preset condition, and determine a final recognition result of each signal lamp image; the preset condition is used to indicate that a recognition result of a signal lamp at the preset position in the signal lamp group is a fixed value.

[0050] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the following steps:

[0051] obtain a current frame image of any direction of an intersection; the current frame image comprises at least one signal lamp group;

[0052] predict a weather type evaluation score of the current frame image, perform image enhancement processing on the current frame image according to the weather type evaluation score, and obtain a processed current frame image; the weather type evaluation score is used to indicate a weather type of a natural acquisition environment of the image;

[0053] determine a distinguishing identifier corresponding to the processed current frame image based on a luminance value of the processed current frame image; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or night;

[0054] for any signal lamp group, perform cropping on the processed current frame image based on preset positions of the signal lamps, and obtain a signal lamp image of each signal lamp in any signal lamp group;

[0055] calculate a color value and a luminance factor of each signal lamp image, and determine an initial recognition result of each signal lamp image according to the color value of each signal lamp image;

[0056] determine a natural acquisition environment type of the current frame image based on the distinguishing mark and the luminance factor of each signal lamp image; in a case where the natural acquisition environment of the current frame image is daytime, verify and update the initial recognition result of each signal lamp image according to a preset condition, and determine a final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of the signal lamp at the preset position in the signal lamp group is a fixed value.

[0057] The traffic signal lamp recognition method, device, computer equipment, storage medium and computer program product, acquire a current frame image of any direction of an intersection; the current frame image includes at least one signal lamp group; predict a weather type evaluation score of the current frame image, perform image enhancement processing on the current frame image according to the weather type evaluation score, and obtain a processed current frame image; the weather type evaluation score is used to indicate the weather type of the natural acquisition environment of the image; determine a distinguishing mark corresponding to the processed current frame image based on a luminance value of the processed current frame image; the distinguishing mark is used to distinguish whether the natural acquisition environment of the image is daytime or nighttime; for any signal lamp group, crop the processed current frame image based on the preset positions of the signal lamps, and obtain a signal lamp image of each signal lamp in any signal lamp group; calculate a color value and a luminance factor of each signal lamp image, determine an initial recognition result of each signal lamp image according to the color value of each signal lamp image; determine a natural acquisition environment type of the current frame image based on the distinguishing mark and the luminance factor of each signal lamp image; in a case where the natural acquisition environment of the current frame image is daytime, verify and update the initial recognition result of each signal lamp image according to a preset condition, and determine a final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of the signal lamp at the preset position in the signal lamp group is a fixed value. By adding a special weather processing algorithm in the image processing process, the anti-interference of weather changes is realized; by adding an algorithm switching reference factor, the images acquired in both daytime and nighttime environments are accurately recognized, and the recognition accuracy of traffic signal lamps is improved. BRIEF DESCRIPTION OF DRAWINGS

[0058] Figure 1 An application environment diagram of the traffic signal lamp recognition method in one embodiment;

[0059] Figure 2 A flowchart of the traffic signal lamp recognition method in one embodiment;

[0060] Figure 3 A crossroad passing diagram in one embodiment;

[0061] Figure 4 A traffic signal lamp group diagram in one embodiment;

[0062] Figure 5Fig. 1 is a flowchart of a traffic signal recognition method according to another embodiment;

[0063] Figure 6 Fig. 2 is a flowchart of a traffic signal recognition method according to another embodiment;

[0064] Figure 7 Fig. 3 is a schematic diagram of a traffic signal phase according to an embodiment;

[0065] Figure 8 Fig. 4 is a structural block diagram of a traffic signal recognition device according to an embodiment;

[0066] Figure 9 Fig. 5 is an internal structure diagram of a computer device according to an embodiment. DETAILED DESCRIPTION

[0067] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0068] The traffic signal recognition method provided by the embodiments of the present application can be applied in the application environment as shown in Figure 1 . The terminal 102 is a device capable of acquiring a color image. The terminal 102 communicates with the server 104 through a network, and sends the acquired color image including the traffic signal to the server 104. The server 104 processes the image to complete the recognition of the signal lamp. The data storage system can store the data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.

[0069] The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0070] In an embodiment, as shown in Figure 2 , a traffic signal recognition method is provided. Taking the server 104 in Figure 1 as an example, the method includes the following steps:

[0071] In step 202, a current frame image of any direction of an intersection is acquired. The current frame image includes at least one signal lamp group.

[0072] The direction of the intersection refers to the direction of the vehicle on the lane of the intersection before the vehicle passes the intersection. It can be understood that the traffic signal lights followed by the vehicles in the same direction are generally installed on the same lamp pole, for example, see Figure 3 In a cross intersection in a due north direction, a vehicle facing south before passing the cross intersection can turn left, go straight and turn right on the lane of the intersection, and the left turn signal light, the straight signal light and the right turn signal light followed by the vehicle are generally installed in front of the vehicle before passing the intersection.

[0073] It should be noted that since the three-lane signal light group is installed close together, the current frame image obtained includes the state of the three signal light groups at the current time, but the present application does not make a specific limitation thereon, and an image of only one signal light group can also be obtained by one shooting device. The signal light group includes three lights, and only one light can be lit at a time to indicate the running state of the vehicle on the current lane. For example, in the signal light group shown in Figure 4 When the signal light 401 is lit, it must be red, and at this time the signal lights 402 and 403 are not lit, indicating that the vehicle on the lane is prohibited from passing; when the signal light 403 is lit, it must be green, and at this time the signal lights 401 and 402 are not lit, indicating that the vehicle on the lane is allowed to pass.

[0074] In step 204, the weather type evaluation score of the current frame image is predicted, the current frame image is subjected to image enhancement processing according to the weather type evaluation score, and a processed current frame image is obtained; the weather type evaluation score is used to indicate the weather type of the natural acquisition environment of the image;

[0075] The weather type evaluation score is a score of the weather type of the natural acquisition environment of the current frame image, and the natural acquisition environment refers to the natural environment in which the shooting device and the traffic signal light are located. According to the weather type evaluation score, special weather, i.e. weather that will affect the quality of the signal light recognition result determined according to the obtained image, such as rainy weather, foggy weather, haze, frost, hail, etc., can be identified. It can also be a comprehensive weather, such as a mixture of rain and snow. The weather type evaluation score is used to determine the difference between the obtained image and the image obtained in sunny weather, and then the current frame image is preprocessed to improve the quality of the image, so as to improve the accuracy of the recognition result of the traffic signal light.

[0076] Specifically, the weather type evaluation score can be determined by the characteristic parameters of the image, wherein the characteristic parameters can be instruction characteristic parameters of the image, such as hue, saturation, brightness, etc., and can also be shape parameters of the image, and the number of characteristic parameters is not specifically limited in the present application. The difference between the characteristic parameters of the current frame image and the characteristic parameters of the sunny image is determined by obtaining the characteristic parameters of the sunny image and the characteristic parameters of the current frame image, and the weather type evaluation score of the current frame image is determined.

[0077] Image enhancement is to remove or highlight certain information in the image according to specific needs, improve the visual effect of the image, and make the image more suitable for analysis. Generally, it is mainly divided into two methods, spatial domain and frequency domain. Spatial domain directly operates on image pixels, and frequency domain operates on the Fourier transform of the image. The image enhancement processing involved in the embodiments of the present application refers to processing the image pixels in the spatial domain. Specifically, the spatial domain image enhancement processing method includes various methods, such as algebraic operation, spatial domain filtering, histogram equalization, gamma transformation, etc. The embodiments of the present application do not make specific limitations on the image enhancement processing algorithm adopted, but generally the optimal image enhancement processing algorithm can be adopted according to the specific weather type.

[0078] In step 206, based on the brightness value of the processed current frame image, a distinguishing identifier corresponding to the processed current frame image is determined; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or night.

[0079] The brightness value of the current frame image, that is, the brightness of the current frame image, refers to the brightness of the image. It can be understood that for the same image acquisition device, the brightness of the image acquired in the daytime and at night is different, so the natural acquisition environment of the current frame image can be determined as daytime or nighttime according to the brightness of the current frame image, and then different processing algorithms are adopted based on different acquisition environments to realize the recognition of the traffic signal lamp. Specifically, the daytime and nighttime can be distinguished by the distinguishing identifier, for example, if the natural acquisition environment corresponding to the current frame image is daytime, the distinguishing identifier of the current frame image is 1; if the natural acquisition environment corresponding to the current frame image is nighttime, the distinguishing identifier of the current frame image is 0.

[0080] In step 208, for any signal lamp group, the processed current frame image is cropped based on the preset positions of the signal lamps, to obtain the signal lamp image of each signal lamp in any signal lamp group.

[0081] It should be noted that the image shooting device mentioned in the embodiments of the present application is fixedly installed at the roadside, so for a signal lamp group, the position in each acquired image is fixed and unchanged. The preset position of the signal lamp is the position or area where the signal lamp should be in the image obtained by shooting. A signal lamp group generally has 3 signal lamps, that is, there are 3 preset positions to determine the positions of the 3 signal lamps in the current frame image.

[0082] The area shape corresponding to the preset position can be rectangular or circular. The area size corresponding to the preset position is set according to the size of the signal lamp area in the image in the actual application scenario. It should be noted that the area size and shape corresponding to the preset position of each signal lamp should be set to meet the condition that the entire signal lamp is in the area. Specifically, in an embodiment, after setting the preset positions of the signal lamps, the positions of each signal lamp are determined by a sliding window, and the processed current frame image is cropped to obtain each signal lamp image.

[0083] In step 210, the color value and brightness factor of each signal lamp image are calculated, and the initial recognition result of each signal lamp image is determined according to the color value of each signal lamp image.

[0084] The color value refers to the color parameter value of the image in the HSV color model, including hue (H, Hue), saturation (S, Saturation) and brightness (V, Value). Among them, the hue H is measured by angle, and the value range is 0°-360°, starting from red and calculating in a counterclockwise direction, red is 0°, green is 120°, and blue is 240°. Their complementary colors are: yellow is 60°, cyan is 180°, and purple is 300°; saturation S represents the degree to which a color approaches a spectral color. A color can be regarded as the result of mixing a certain spectral color with white. The greater the proportion of spectral color, the higher the degree to which the color approaches the spectral color, and the higher the saturation of the color. High saturation, color is deep and bright. The white light component of the spectral color is 0, and the saturation reaches the highest. The value range is usually 0%-100%, and the larger the value, the more saturated the color; brightness indicates the degree of brightness of the color. For light source colors, the brightness value is related to the brightness of the light source; for object colors, this value is related to the transmission ratio or reflectivity of the object. The value range is usually 0% (black) to 100% (white).

[0085] It should be noted that the current frame image obtained by the roadside shooting device is colorful and in RGB color mode. Each signal lamp image obtained by cropping is converted from RGB color mode to HSV color value to obtain each color parameter value of the signal lamp image and determine the color of the signal lamp image. Specifically, each signal lamp image is input into the HSV algorithm to obtain the hue, saturation and brightness of each pixel in the signal lamp image; and then the color parameter value of each pixel is used to determine the color parameter value of the entire signal lamp image. Specifically, for one of the color values, such as hue H, the average value of the H values of all pixel points can be used as the H value of the entire image; or the H value of the entire image can be determined by a complex mathematical operation based on the H values of all pixel points, which is not limited in the present application.

[0086] The recognition of the signal lamp image is determined by a traffic signal lamp classification model. The traffic signal lamp classification model is essentially a classification model, which is classified according to the HSV color value of the image in the embodiment of the present application. For example, according to the simplest classification principle, the traffic light classification model processes the HSV color value of the image by a preset threshold, divides the image into four categories, including red, yellow, green and others, and obtains the classification result of the image. In an embodiment, in the HSV color model, the HSV color value range of red can be [0, 43, 46]~[10, 255, 255]∪[156, 43, 46]~[180, 255, 255].

[0087] It should be noted that the training of the traffic light classification model is completed by a large number of traffic signal lamp image samples obtained at the current intersection. The image samples can be obtained at different time periods and in different weather conditions. In the model training process, a model evaluation index can also be set to determine whether the traffic light classification model obtained by training meets the requirements.

[0088] The brightness factor of the signal lamp image is used to represent the brightness of the signal lamp image, which is determined by the brightness value of each pixel in the signal lamp image.

[0089] In step 212, based on the distinguishing identifier and the brightness factor of each signal lamp image, the natural acquisition environment type of the current frame image is determined; in the case that the natural acquisition environment of the current frame image is daytime, the initial recognition result of each signal lamp image is verified and updated according to a preset condition, to determine the final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of the signal lamp at a preset position in the signal lamp group is a fixed value.

[0090] The distinguishing identifier of the processed current frame image can represent whether the natural acquisition environment of the current frame image is daytime, which reflects the brightness of the overall environment of the traffic signal lamp. The brightness factor of the signal lamp image can represent the local brightness of the signal lamp. The natural acquisition environment of the current frame image is determined by the two factors, which improves the judgment effect. In the daytime environment, the recognition result of each signal lamp image is verified and corrected by a preset algorithm, to avoid the color distortion of the traffic signal lamp due to the strong sunlight, for example, the red color in the image is close to yellow.

[0091] The preset position in the preset condition is the position of each signal lamp in the signal lamp group. It can be understood that in the signal lamp group in the embodiment of the present application, if the signal lamp is on, its color is specific, otherwise the recognition result is empty. Specifically, the state of the three signal lamps in the signal lamp group can be limited by a position coding algorithm, which is used as a preset condition to verify the recognition result of each signal lamp image. If the verification is incorrect, the recognition result is corrected according to the preset condition.

[0092] In the method provided by the above embodiment, a current frame image of any direction of an intersection is acquired; the current frame image includes at least one signal lamp group; a weather type evaluation score of the current frame image is predicted, the current frame image is subjected to image enhancement processing according to the weather type evaluation score, and a processed current frame image is obtained; the weather type evaluation score is used to indicate a weather type of a natural acquisition environment of the image; a distinguishing mark corresponding to the processed current frame image is determined based on a brightness value of the processed current frame image; the distinguishing mark is used to distinguish whether the natural acquisition environment of the image is daytime or night; for any signal lamp group, the processed current frame image is cropped based on preset positions of signal lamps, and a signal lamp image of each signal lamp in any signal lamp group is obtained; a color value and a brightness factor of each signal lamp image are calculated, an initial recognition result of each signal lamp image is determined according to the color value of each signal lamp image; a natural acquisition environment type of the current frame image is determined based on the distinguishing mark and the brightness factor of each signal lamp image; in a case where the natural acquisition environment of the current frame image is daytime, the initial recognition result of each signal lamp image is verified and updated according to a preset condition, and a final recognition result of each signal lamp image is determined; the preset condition is used to indicate that an identification result of a signal lamp at the preset position in the signal lamp group is a fixed value. By adding a special weather processing algorithm in the image processing process, the anti-interference of weather changes is realized; by adding an algorithm switching reference factor, the images acquired in the daytime or night environment are accurately identified, and the recognition accuracy of the traffic signal lamp is improved.

[0093] In one of the embodiments, referring to Figure 5 , the weather type evaluation score of the current frame image is predicted, including:

[0094] In step 502, a fitting regression curve equation between an edge detection operator and the weather type evaluation score is acquired, and at least one edge detection operator of the current frame image is acquired.

[0095] In step 504, the at least one edge detection operator of the current frame image is substituted into the fitting regression curve equation, and the weather type evaluation score of the current frame image is obtained.

[0096] The edge detection operator refers to a parameter configured to achieve edge detection in a small field of pixels in an image. Common edge detection operators include a Sobel operator, a Roberts Cross operator, a Prewitt operator, a Canny operator, a Laplacian operator, and the like. The fitting regression curve equation is used to calculate the weather type evaluation score. The equation parameters are determined by a large number of images obtained in special weather and reference images obtained in sunny weather. Specifically, the edge detection operators of the images are calculated, the differences between the images are determined, data fitting regression is performed, and the parameters are determined. For example, in an embodiment, the Sobel operator and the Laplacian operator are used to process the images. Then, the following fitting regression curve equation can be determined by a large number of sample images:

[0097] y = k1x + k2x + b sobel laplacian

[0098] wherein y is the weather type evaluation score, k1, k2, and b are parameters of the fitting regression curve equation, x sobel is the Sobel operator of the current frame image, and x laplacian is the Laplacian operator of the current frame image.

[0099] It should be noted that the calculation method of the edge detection operator of the current frame image is not specifically limited in the embodiments of the present application. In addition, the number of edge detection operators used is not specifically limited. However, it should be emphasized that the edge detection operator of the current frame image should be consistent with the type of edge detection operator involved in the fitting regression curve equation, and the calculation method should be consistent.

[0100] In the method provided in the above embodiments, the weather type of the natural acquisition environment of the current frame image is judged by performing edge detection on the image through the edge detection operator, and the current frame image is preprocessed to avoid the information of the traffic signal lamp being disturbed, thereby improving the recognition effect of the traffic signal lamp.

[0101] In one of the embodiments, the current frame image is subjected to image enhancement processing according to the weather type evaluation score, to obtain a processed current frame image, including:

[0102] determining the weather type corresponding to the current frame image according to the weather type evaluation score of the current frame image;

[0103] obtaining a corresponding image enhancement algorithm according to the weather type corresponding to the current frame image, and performing image enhancement processing on the current frame image based on the corresponding image enhancement algorithm to obtain a processed current frame image.

[0104] ​​The weather type refers to a weather type of a natural acquisition environment of the image, for example, a rainy day, a foggy day, haze, frost, hail, and the like, and can also be a comprehensive weather, for example, a sleet. Due to the weather of the natural environment, useful information in the acquired image is not prominent enough, and the image needs to be processed by image enhancement to strengthen the recognition effect of the image, for example, in a heavy fog weather, the visibility is poor, and the acquired traffic light image also contains fog, so that the traffic signal lamp part is not clear enough. According to different weather types, a suitable image enhancement algorithm is selected to process the image, to improve the image quality and improve the recognition effect of the signal lamp.

[0105] Specifically, in one embodiment, if the recognized weather type is a rainy day, the current frame image can be processed by gamma transformation, and each pixel point of the current frame image is transformed as follows:

[0106] O(r,c)=(c,r) γ ;

[0107] Wherein, O(r,c) is the gray value of the pixel point output by the gamma transformation, I(c,r) γ is the gray value of the pixel point input by the gamma transformation, and c and γ are gamma transformation constants.

[0108] In another embodiment, if the recognized weather type is a foggy day, the current frame image can be processed by a dark channel defogging algorithm, and the principle is as follows:

[0109] I(x)=(x)t(x)+A(1-t());

[0110] Wherein, I(x) is the current frame image (to be defogged), J(x) is the processed current frame image (defogged), A is the global atmospheric light component, and t(x) is the transmittance.

[0111] In the method provided in the above embodiments, different image enhancement processing algorithms are selected according to the weather type, to improve the processing effect of the image in each weather environment, and further improve the recognition effect of the signal lamp.

[0112] In one of the embodiments, the color value of each signal lamp image is calculated, including:

[0113] For any signal lamp image, the color value of each pixel point in any signal lamp image is acquired;

[0114] The mean value of the color values of all pixel points with color values greater than zero is taken as the color value of any signal lamp image.

[0115] It can be known that in the HSV color model, the value of any color parameter is greater than 0, therefore, the pixel points with HSV color values less than 0 in the signal lamp image are regarded as errors, and the HSV color values of the signal lamp image are determined according to the remaining pixel points. Taking the hue of the image as an example: the hue of the signal lamp image is The calculation formula is:

[0116]

[0117] Wherein, m is the number of pixel points with hue greater than 0 in the signal lamp image; h i is the hue of the i-th pixel point with hue greater than 0.

[0118] In one of the embodiments, the luminance factor of each signal lamp image is calculated, including:

[0119] For any signal lamp image, the luminance value of each pixel point in any signal lamp image is obtained;

[0120] The difference between the luminance value of each pixel point and the preset threshold value is obtained, and the average value of the difference corresponding to all pixel points is taken as the luminance factor of any signal lamp image.

[0121] Wherein, the setting of the preset threshold value is related to the gray scale of the image, for example, when the image has 256 gray scales, that is, the pixel value is between 0 and 255, the luminance factor of any signal lamp image is The calculation formula can be as follows:

[0122]

[0123] Wherein, g i is the luminance value of the i-th pixel point; M is the total number of pixel points of the signal lamp image; 128 is the middle value of the pixel value 0-255.

[0124] In the method provided in the above embodiments, the HSV color value and the luminance factor of the signal lamp image are determined by each pixel point through a simple average method, which improves the processing efficiency while ensuring the accuracy of the parameters of the signal lamp image.

[0125] In one of the embodiments, the initial recognition result includes the signal lamp color and the signal lamp position; accordingly, the initial recognition result of each signal lamp image is checked and updated according to the preset condition to determine the final recognition result of each signal lamp image, including:

[0126] The preset color corresponding to the signal lamp position in the initial recognition result of each signal lamp image is obtained;

[0127] In a case where the preset color is inconsistent with the signal light color in the initial recognition result of each signal light image, the initial recognition result of each signal light image is adjusted according to the preset color to obtain the final recognition result of each signal light image.

[0128] The preset color refers to a color that should be included in the recognition result of a signal light at a preset position in a signal light group when the signal light is on, that is, has a recognition result, otherwise the recognition result of the signal light should be empty when the signal light is off. Referring to the signal light group in Figure 4 , for example, the signal light 401, the preset color corresponding to the first preset position thereof is red, and in a case where the signal light color in the initial recognition result of each signal light image is not red, the signal light color in the initial recognition result of each signal light image is corrected to red; in a case where the signal light color in the initial recognition result of each signal light image is red, the correction is verified.

[0129] In the method provided by the above embodiment, the recognition result of each signal light image is verified and corrected by the preset color, thereby improving the accuracy of the recognition result of the traffic signal light.

[0130] In one of the embodiments, referring to Figure 6 , the method further includes:

[0131] In step 602, the initial recognition result of any signal light group is determined according to the final recognition result of all signal light images in any signal light group.

[0132] In step 604, the reference recognition result of all signal light groups except the any signal light group is obtained, and the recognition result of the any signal light group is corrected and updated according to the reference recognition result to obtain the final recognition result of the any signal light group.

[0133] It can be understood that the communication state of a signal light group is determined by three signal lights therein, therefore, the initial recognition result of any signal light group is determined by integrating the final recognition result of all signal light images in the any signal light group. Meanwhile, the final recognition results of the three signal lights can also be verified by integration, and in a case where the final recognition results of the three signal lights cannot determine a unique communication state, the initial recognition result of the any signal light group can be determined according to the priority level of the three signal lights. For example, the recognition result of the first signal light in the signal light group is a light (red light), the recognition result of the second signal light is a light (yellow light), and the recognition result of the third signal light is empty (not light), then the first signal light and the second signal light are lit at the same time, and at this time, the red light is considered as the main light for traffic safety.

[0134] Generally, there are more than one lane directions at an intersection, i.e. more than one signal group, and the traffic light phases of the intersection are determined by all the signal groups, which follow certain rules to ensure the safety of the intersection, thus the initial recognition result of any signal group can be checked and corrected by presetting the phase combination or setting the relationship between the recognition results of the signal groups of the associated directions.

[0135] For example, in one embodiment, taking a crossroad scene as an example, all the signal groups of the opposite directions (south and north, east and west) should be consistent, see Figure 7 For example, taking the signal group of the left-turn lane in the north direction as an example, in the case that the initial recognition result of the signal group is inconsistent with the initial recognition result of the signal group of the left-turn lane in the south direction, the initial recognition results of all the signal groups of the east and west directions are used for judgment, if the initial recognition result of the signal group of the left-turn lane in the south direction and the initial recognition results of all the signal groups of the east and west directions meet the signal light phase condition, the recognition result of the signal group of the left-turn lane in the north direction is changed to be consistent with the initial recognition result of the signal group of the left-turn lane in the south direction; similarly for other scenarios, except for the case that cannot be corrected, which indicates that the traffic signal recognition method has a fault and cannot output the correct recognition result, the signal light can be recognized by other methods.

[0136] In the method provided by the above embodiment, the initial recognition results of all the signal groups of the intersection are checked according to the constraint relationship between the initial recognition results, so as to improve the effectiveness of the signal light recognition result.

[0137] It should be understood that, although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0138] Based on the same inventive concept, the embodiments of the present application also provide a traffic signal lamp recognition device for implementing the traffic signal lamp recognition method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more traffic signal lamp recognition device embodiments provided below can refer to the limitations of the traffic signal lamp recognition method described above, which will not be described here.

[0139] In one embodiment, as shown in Figure 8 A traffic signal lamp recognition device is provided, comprising: an image acquisition module 801, an image preprocessing module 802, an identification determination module 803, an image cropping module 804, an image recognition module 805 and a result determination module 806, wherein:

[0140] The image acquisition module 801 is configured to acquire a current frame image of any direction of an intersection; the current frame image includes at least one signal lamp group;

[0141] The image preprocessing module 802 is configured to predict a weather type evaluation score of the current frame image, perform image enhancement processing on the current frame image according to the weather type evaluation score, and obtain a processed current frame image; the weather type evaluation score is used to indicate the weather type of the natural acquisition environment of the image;

[0142] The identification determination module 803 is configured to determine a distinguishing identification corresponding to the processed current frame image based on a brightness value of the processed current frame image; the distinguishing identification is used to distinguish whether the natural acquisition environment of the image is daytime or night;

[0143] The image cropping module 804 is configured to crop the processed current frame image based on a preset position of each signal lamp for any signal lamp group, and obtain a signal lamp image of each signal lamp in any signal lamp group;

[0144] The image recognition module 805 is configured to calculate a color value and a brightness factor of each signal lamp image, and determine an initial recognition result of each signal lamp image according to the color value of each signal lamp image;

[0145] The result determination module 806 is configured to determine a natural acquisition environment type of the current frame image based on the distinguishing identification and the brightness factor of each signal lamp image; in a case where the natural acquisition environment of the current frame image is daytime, the initial recognition result of each signal lamp image is verified and updated according to a preset condition, and a final recognition result of each signal lamp image is determined; the preset condition is used to indicate that the recognition result of the signal lamp at the preset position in the signal lamp group is a fixed value.

[0146] In one embodiment, the image preprocessing module 802 is further configured to:

[0147] obtaining a fitting regression curve equation between the edge detection operator and the weather type evaluation score, and at least one edge detection operator of the current frame image;

[0148] substituting the at least one edge detection operator of the current frame image into the fitting regression curve equation to obtain the weather type evaluation score of the current frame image.

[0149] In one of the embodiments, the image preprocessing module 802 is further configured to:

[0150] determining the weather type corresponding to the current frame image according to the weather type evaluation score of the current frame image;

[0151] obtaining the corresponding image enhancement algorithm according to the weather type corresponding to the current frame image, and performing image enhancement processing on the current frame image based on the corresponding image enhancement algorithm to obtain the processed current frame image.

[0152] In one of the embodiments, the image recognition module 805 is further configured to:

[0153] for any signal lamp image, obtaining the color value of each pixel point in the any signal lamp image;

[0154] taking the mean value of the color values of all the pixel points with color values greater than zero as the color value of the any signal lamp image.

[0155] In one of the embodiments, the image recognition module 805 is further configured to:

[0156] for any signal lamp image, obtaining the brightness value of each pixel point in the any signal lamp image;

[0157] obtaining the difference between the brightness value of each pixel point and a preset threshold, and taking the mean value of the difference values corresponding to all the pixel points as the brightness factor of the any signal lamp image.

[0158] In one of the embodiments, the result determination module 806 is further configured to:

[0159] obtaining the preset color corresponding to the signal lamp position in the initial recognition result of each signal lamp image;

[0160] in the case where the preset color is inconsistent with the signal lamp color in the initial recognition result of each signal lamp image, adjusting the initial recognition result of each signal lamp image according to the preset color to obtain the final recognition result of each signal lamp image.

[0161] In one of the embodiments, the traffic signal lamp recognition device further comprises a result verification module configured to:

[0162] determining the initial recognition result of any signal lamp group according to the final recognition result of all the signal lamp images in the any signal lamp group.

[0163] The reference recognition result of all signal light groups except any signal light group of the intersection is acquired, the recognition result of any signal light group is corrected and updated according to the reference recognition result, and the final recognition result of any signal light group is obtained.

[0164] The modules in the traffic signal light recognition device can be realized by software, hardware, or a combination thereof, in whole or in part. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.

[0165] In an embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 9 The computer device includes a processor, a memory, and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store image data. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a traffic signal light recognition method.

[0166] Those skilled in the art can understand that Figure 9 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0167] In an embodiment, a computer device is provided, which includes a memory and a processor. The memory stores a computer program. The processor executes the computer program to implement the following steps:

[0168] A current frame image of any direction of the intersection is acquired. The current frame image includes at least one signal light group.

[0169] A weather type evaluation score of the current frame image is predicted. The current frame image is subjected to image enhancement processing according to the weather type evaluation score, and a processed current frame image is obtained. The weather type evaluation score is used to indicate a weather type of a natural acquisition environment of the image.

[0170] Determine a distinguishing identifier corresponding to the processed current frame image based on the brightness value of the processed current frame image; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or night;

[0171] For any signal lamp group, crop the processed current frame image based on the preset positions of the signal lamps to obtain a signal lamp image of each signal lamp in any signal lamp group;

[0172] Calculate a color value and a brightness factor of each signal lamp image, and determine an initial recognition result of each signal lamp image according to the color value of each signal lamp image;

[0173] Determine a natural acquisition environment type of the current frame image based on the distinguishing identifier and the brightness factor of each signal lamp image; in the case that the natural acquisition environment of the current frame image is daytime, verify and update the initial recognition result of each signal lamp image according to a preset condition to determine a final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of the signal lamp at the preset position in the signal lamp group is a fixed value.

[0174] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0175] Obtain a fitting regression curve equation between an edge detection operator and a weather type evaluation score, and at least one edge detection operator of the current frame image;

[0176] Substitute the at least one edge detection operator of the current frame image into the fitting regression curve equation to obtain the weather type evaluation score of the current frame image.

[0177] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0178] Determine a weather type corresponding to the current frame image according to the weather type evaluation score of the current frame image;

[0179] Obtain a corresponding image enhancement algorithm according to the weather type corresponding to the current frame image, and perform image enhancement processing on the current frame image based on the corresponding image enhancement algorithm to obtain the processed current frame image.

[0180] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0181] For any signal lamp image, obtain a color value of each pixel point in any signal lamp image;

[0182] Take the mean value of the color values of all pixel points with color values greater than zero as the color value of any signal lamp image.

[0183] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0184] For any signal lamp image, obtain the brightness value of each pixel point in the signal lamp image;

[0185] Obtain the difference between the brightness value of each pixel point and the preset threshold, and take the average of the difference values of all pixel points as the brightness factor of the signal lamp image.

[0186] In one embodiment, the processor executing the computer program also implements the following steps:

[0187] Obtain the preset color corresponding to the signal lamp position in the initial recognition result of each signal lamp image;

[0188] In the case where the preset color is inconsistent with the signal lamp color in the initial recognition result of each signal lamp image, adjust the initial recognition result of each signal lamp image according to the preset color to obtain the final recognition result of each signal lamp image.

[0189] In one embodiment, the processor executing the computer program also implements the following steps:

[0190] According to the final recognition result of all signal lamp images in any signal lamp group, determine the initial recognition result of any signal lamp group;

[0191] Obtain the reference recognition result of all signal lamp groups except any signal lamp group at the intersection, and correct and update the recognition result of any signal lamp group according to the reference recognition result to obtain the final recognition result of any signal lamp group.

[0192] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0193] Obtain the current frame image of any direction of the intersection; the current frame image includes at least one signal lamp group;

[0194] Predict the weather type evaluation score of the current frame image, and perform image enhancement processing on the current frame image according to the weather type evaluation score to obtain the processed current frame image; the weather type evaluation score is used to indicate the weather type of the natural acquisition environment of the image;

[0195] Based on the brightness value of the processed current frame image, determine the distinguishing identifier corresponding to the processed current frame image; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or night;

[0196] For any signal lamp group, based on the preset positions of the signal lamps, the processed current frame image is cropped to obtain the signal lamp image of each signal lamp in any signal lamp group;

[0197] The color value and the brightness factor of each signal lamp image are calculated, and an initial recognition result of each signal lamp image is determined according to the color value of each signal lamp image;

[0198] The natural acquisition environment type of the current frame image is determined based on the distinguishing mark and the brightness factor of each signal lamp image; in the case that the natural acquisition environment of the current frame image is daytime, the initial recognition result of each signal lamp image is verified and updated according to a preset condition to determine the final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of the signal lamp at the preset position in the signal lamp group is a fixed value.

[0199] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0200] A fitting regression curve equation between the edge detection operator and the weather type evaluation score is obtained, and at least one edge detection operator of the current frame image is obtained;

[0201] The at least one edge detection operator of the current frame image is substituted into the fitting regression curve equation to obtain the weather type evaluation score of the current frame image.

[0202] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0203] The weather type corresponding to the current frame image is determined according to the weather type evaluation score of the current frame image;

[0204] The corresponding image enhancement algorithm is obtained according to the weather type corresponding to the current frame image, and the current frame image is subjected to image enhancement processing based on the corresponding image enhancement algorithm to obtain a processed current frame image.

[0205] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0206] For any signal lamp image, the color value of each pixel point in the any signal lamp image is obtained;

[0207] The mean value of the color values of all pixel points with color values greater than zero is taken as the color value of the any signal lamp image.

[0208] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0209] For any signal lamp image, the brightness value of each pixel point in the any signal lamp image is obtained;

[0210] The difference between the brightness value of each pixel point and a preset threshold value is obtained, and the mean value of the difference values corresponding to all pixel points is taken as the brightness factor of the any signal lamp image.

[0211] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0212] A preset color corresponding to the signal lamp position in the initial recognition result of each signal lamp image is obtained.

[0213] In a case where the preset color is inconsistent with the signal lamp color in the initial recognition result of each signal lamp image, the initial recognition result of each signal lamp image is adjusted according to the preset color, to obtain the final recognition result of each signal lamp image.

[0214] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0215] The initial recognition result of any signal lamp group is determined according to the final recognition result of all signal lamp images in any signal lamp group.

[0216] The reference recognition result of all signal lamp groups except any signal lamp group at the intersection is obtained, and the recognition result of any signal lamp group is corrected and updated according to the reference recognition result, to obtain the final recognition result of any signal lamp group.

[0217] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by the processor, implements the following steps:

[0218] A current frame image of any direction at the intersection is obtained; the current frame image includes at least one signal lamp group;

[0219] A weather type evaluation score of the current frame image is predicted, and the current frame image is subjected to image enhancement processing according to the weather type evaluation score, to obtain a processed current frame image; the weather type evaluation score is used to indicate the weather type of the natural acquisition environment of the image;

[0220] Based on the luminance value of the processed current frame image, a distinguishing identifier corresponding to the processed current frame image is determined; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or nighttime;

[0221] For any signal lamp group, the processed current frame image is cropped based on the preset positions of the signal lamps, to obtain a signal lamp image of each signal lamp in any signal lamp group;

[0222] A color value and a luminance factor of each signal lamp image are calculated, and an initial recognition result of each signal lamp image is determined according to the color value of each signal lamp image;

[0223] Determine the type of natural acquisition environment of the current frame image based on the distinguishing identifier and the luminance factor of each signal lamp image; in the case that the natural acquisition environment of the current frame image is daytime, check and update the initial recognition result of each signal lamp image according to a preset condition to determine the final recognition result of each signal lamp image; the preset condition is used to indicate that the recognition result of the signal lamp at the preset position in the signal lamp group is a fixed value.

[0224] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0225] Obtain a fitting regression curve equation between the edge detection operator and the weather type evaluation score, and at least one edge detection operator of the current frame image;

[0226] Substitute the at least one edge detection operator of the current frame image into the fitting regression curve equation to obtain the weather type evaluation score of the current frame image.

[0227] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0228] Determine the weather type corresponding to the current frame image according to the weather type evaluation score of the current frame image;

[0229] Obtain the corresponding image enhancement algorithm according to the weather type corresponding to the current frame image, and perform image enhancement processing on the current frame image based on the corresponding image enhancement algorithm to obtain the processed current frame image.

[0230] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0231] For any signal lamp image, obtain the color value of each pixel point in the signal lamp image;

[0232] Take the average of the color values of all pixel points with color values greater than zero as the color value of the signal lamp image.

[0233] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0234] For any signal lamp image, obtain the luminance value of each pixel point in the signal lamp image;

[0235] Obtain the difference between the luminance value of each pixel point and a preset threshold, and take the average of the difference values corresponding to all pixel points as the luminance factor of the signal lamp image.

[0236] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0237] a preset color corresponding to the signal lamp position in the initial recognition result of each signal lamp image is obtained;

[0238] In a case where the preset color is inconsistent with the signal lamp color in the initial recognition result of each signal lamp image, the initial recognition result of each signal lamp image is adjusted according to the preset color, and a final recognition result of each signal lamp image is obtained.

[0239] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0240] According to the final recognition result of all signal lamp images in any signal lamp group, an initial recognition result of any signal lamp group is determined;

[0241] Reference recognition results of all signal lamp groups except any signal lamp group at the intersection are obtained, and the recognition result of any signal lamp group is corrected and updated according to the reference recognition result, and a final recognition result of any signal lamp group is obtained.

[0242] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0243] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0244] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A traffic light recognition method, characterized in that, The method includes: Acquire the current frame image of the intersection in any direction; the current frame image includes at least one traffic light group; The weather type score of the current frame image is predicted, and the current frame image is enhanced based on the weather type score to obtain the processed current frame image; the weather type score is used to indicate the weather type of the natural acquisition environment of the image; Based on the brightness value of the processed current frame image, a distinction identifier corresponding to the processed current frame image is determined; the distinction identifier is used to distinguish whether the natural acquisition environment of the image is daytime or nighttime. For any traffic light group, the processed current frame image is cropped based on the preset position of each traffic light to obtain the traffic light image of each traffic light in the traffic light group. Calculate the color value and luminance factor of each traffic light image, and determine the initial recognition result of each traffic light image based on the color value of each traffic light image; the initial recognition result includes the traffic light color and the traffic light position; Based on the distinguishing identifier and the brightness factor of each traffic light image, the natural acquisition environment type of the current frame image is determined; if the natural acquisition environment of the current frame image is daytime, the preset color corresponding to the traffic light position in the initial recognition result of each traffic light image is obtained; if the preset color is inconsistent with the traffic light color in the initial recognition result of each traffic light image, the initial recognition result of each traffic light image is adjusted according to the preset color to obtain the final recognition result of each traffic light image; the preset color refers to the color of the recognition result of the traffic light at a preset position in the traffic light group when it is lit.

2. The method according to claim 1, characterized in that, The predicted weather type score for the current frame image includes: Obtain the fitted regression curve equation between the edge detection operator and the weather type evaluation score, as well as at least one edge detection operator for the current frame image; Substitute at least one edge detection operator of the current frame image into the fitted regression curve equation to obtain the weather type evaluation score of the current frame image.

3. The method according to claim 1, characterized in that, The step of performing image enhancement processing on the current frame image based on the weather type assessment score to obtain the processed current frame image includes: The weather type corresponding to the current frame image is determined based on the weather type score of the current frame image; Based on the weather type corresponding to the current frame image, obtain the corresponding image enhancement algorithm, and perform image enhancement processing on the current frame image based on the corresponding image enhancement algorithm to obtain the processed current frame image.

4. The method according to claim 1, characterized in that, The calculation of the color value of each traffic light image includes: For any traffic light image, obtain the color value of each pixel in the traffic light image; The average of the color values ​​of all pixels with color values ​​greater than zero is taken as the color value of any given traffic light image.

5. The method according to claim 1, characterized in that, The calculation of the brightness factor for each traffic light image includes: For any traffic light image, obtain the brightness value of each pixel in the traffic light image; The difference between the brightness value of each pixel and a preset threshold is obtained, and the average of the differences corresponding to all pixels is used as the brightness factor of any traffic light image.

6. The method according to claim 1, characterized in that, The method further includes: Based on the final recognition results of all traffic light images in any traffic light group, determine the initial recognition result of any traffic light group; Obtain reference recognition results for all traffic light groups at the intersection except for any one of the traffic light groups. Correct and update the recognition results of any one of the traffic light groups based on the reference recognition results to obtain the final recognition result of any one of the traffic light groups.

7. A traffic signal light recognition device, characterized in that, The device includes: An image acquisition module is used to acquire the current frame image of the intersection in any direction; the current frame image includes at least one traffic light group; An image preprocessing module is used to predict the weather type assessment score of the current frame image, and perform image enhancement processing on the current frame image based on the weather type assessment score to obtain the processed current frame image; the weather type assessment score is used to indicate the weather type of the natural acquisition environment of the image; The identifier determination module is used to determine the distinguishing identifier corresponding to the processed current frame image based on the brightness value of the processed current frame image; the distinguishing identifier is used to distinguish whether the natural acquisition environment of the image is daytime or nighttime. The image cropping module is used to crop the processed current frame image based on the preset position of each traffic light for any traffic light group, so as to obtain the traffic light image of each traffic light in the any traffic light group. The image recognition module is used to calculate the color value and brightness factor of each traffic light image, and determine the initial recognition result of each traffic light image based on the color value of each traffic light image; the initial recognition result includes the traffic light color and the traffic light position. The result determination module is used to determine the natural acquisition environment type of the current frame image based on the distinguishing identifier and the brightness factor of each traffic light image; when the natural acquisition environment of the current frame image is daytime, it acquires the preset color corresponding to the traffic light position in the initial recognition result of each traffic light image; when the preset color is inconsistent with the traffic light color in the initial recognition result of each traffic light image, it adjusts the initial recognition result of each traffic light image according to the preset color to obtain the final recognition result of each traffic light image; the preset color refers to the color of the recognition result of the traffic light at a preset position in the traffic light group when it is lit.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Identification method and identification device of state of signal lamps

    CN103324957A

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

    CN114862974A