Signal lamp detection method and device

Through the combination of YoloV5 detection algorithm and HSV color algorithm, the signal lights are detected quickly and accurately, solving the problem of inaccurate signal light detection in the prior art, and improving the safety of autonomous driving.

CN114067291BActive Publication Date: 2025-06-27ZHIDAO NETWORK TECH (BEIJING) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111401192.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2025-06-27
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

The existing signal light detection algorithm cannot meet the real-time and accuracy of autonomous driving at the same time, resulting in the vehicle being unable to accurately identify signal lights, affecting safe driving.

Method used

The YoloV5 detection algorithm is used to quickly detect the signal light area in the environmental picture, and filter the signal light area based on the HSV color algorithm, adjust the color channel value to filter the interfering color, and improve the detection accuracy.

Benefits of technology

It realizes rapid and accurate detection of signal lights, meets the real-time and accuracy requirements of autonomous driving, and improves the safe driving performance of the vehicle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114067291B_ABST
    Figure CN114067291B_ABST
Patent Text Reader

Abstract

The present application relates to a signal light detection method and device. The method includes: obtaining an environmental picture, detecting the signal lights in the environmental picture through the YoloV5 detection algorithm to obtain the signal light areas in the environmental picture, and filtering the signal light areas based on the HSV color algorithm, wherein the HSV color algorithm adjusts the color channel values corresponding to the signal light areas according to the difference in color component values between a preset interference color and a preset signal light color, wherein the preset signal light color is determined according to the color types of the signal lights, and the color component values include at least one of the H component value, the S component value, and the V component value. The solution provided by the present application can accurately and quickly detect signal lights, meet the requirements of real-time performance and accuracy of autonomous driving, enable the vehicle to stop in time or not stop, and improve the safety of vehicle driving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of photogrammetry, and particularly to a signal light detection method and device. Background Art

[0002] Signal lights command traffic operation through different signal light colors. In autonomous driving, the images of signal lights collected are detected through a signal light detection algorithm, and the detection results are recognized to obtain the colors of the signal lights, so as to control the driving of the vehicle according to the colors of the signal lights, improving the safety of autonomous driving. It can be seen that the signal light detection algorithm plays a decisive role in autonomous driving, directly determining whether the vehicle can operate effectively and playing a crucial role.

[0003] In related technologies, the signal light detection algorithms mainly include a segmentation algorithm and an object detection algorithm. The segmentation algorithm has good effects but slow speed, and cannot meet the real-time requirements of autonomous driving. The object detection algorithm has fast speed but poor effects, and often has false detections. The vehicle cannot accurately identify the signal lights during driving, resulting in the vehicle not stopping when it should stop and stopping when it should not stop, seriously affecting the safe driving of the vehicle. Among them, false detection means identifying an object that should not be recognized as a signal light. Neither of the two signal light detection algorithms can effectively solve the problem of signal light detection and cannot accurately and quickly detect the signal lights. This application processes data obtained from photography. Summary of the Invention

[0004] To solve or partially solve the problems existing in related technologies, this application provides a signal light detection method and device, which can accurately and quickly detect signal lights, meet the real-time and accuracy requirements of autonomous driving, enable the vehicle to stop or not stop in time, and improve the safety of vehicle driving.

[0005] The first aspect of this application provides a signal light detection method, which includes

[0006] Obtain an environmental image;

[0007] Detect the signal lights in the environmental image through the YoloV5 detection algorithm to obtain the signal light areas in the environmental image;

[0008] Filter the signal light areas based on the HSV color algorithm, where the HSV color algorithm adjusts the color channel values corresponding to the signal light areas according to the color component value differences between a preset interference color and a preset signal light color, where the preset signal light color is determined according to the color types of the signal lights, and the color component values include at least one of the H component value, the S component value, and the V component value.

[0009] In one embodiment, after obtaining the signal light area in the environmental picture, the following steps are further included:

[0010] Cropping the signal light area to obtain a regional picture;

[0011] And filtering the regional picture based on the HSV color algorithm to obtain a signal light picture.

[0012] In one embodiment, the step of cropping the signal light area to obtain a regional picture includes:

[0013] Performing ROI extraction according to the signal light area to obtain the regional picture.

[0014] In one embodiment, the YoloV5 detection algorithm performs detection according to the position and size of the signal light in the environmental picture; and / or,

[0015] The ROI extraction is performed according to the position and size of the signal light area in the environmental picture.

[0016] In one embodiment, adjusting the color channel value corresponding to the signal light area includes:

[0017] Within a preset adjustment range, adjusting the color channel value corresponding to the regional picture, where the preset adjustment range is determined according to the color component values of the preset signal light color.

[0018] In one embodiment, filtering the signal light area based on the HSV color algorithm includes:

[0019] Adjusting the V channel value for filtering the regional picture according to the V component value corresponding to the preset interference color; and / or,

[0020] Adjusting the H channel value for filtering the regional picture according to the H component value corresponding to the preset interference color; and / or,

[0021] Adjusting the S channel value for filtering the regional picture according to the S component value corresponding to the preset interference color.

[0022] In one embodiment, filtering the signal light area based on the HSV color algorithm further includes:

[0023] Comparing the color channel value of the signal light picture with the color component values of the preset signal light color to identify the color of the signal light.

[0024] The second aspect of the present application provides a traffic signal light detection device, which includes

[0025] A picture acquisition module for acquiring an environmental picture;

[0026] A target detection module, configured to detect traffic lights in the environmental image of the image acquisition module through the YoloV5 detection algorithm, so as to obtain the traffic light area in the environmental image;

[0027] A color filtering module, configured to filter the traffic light area of the target detection module based on the HSV color algorithm, where the HSV color algorithm adjusts the color channel value corresponding to the traffic light area according to the difference in color component values between a preset interference color and a preset traffic light color, where the preset traffic light color is determined according to the color type of the traffic light, and the color component value includes at least one of an H component value, an S component value, and a V component value.

[0028] The third aspect of the present application provides an electronic device, including:

[0029] A processor; and

[0030] A memory, on which executable code is stored, and when the executable code is executed by the processor, the processor is caused to execute the method described above.

[0031] The fourth aspect of the present application provides a computer-readable storage medium, on which executable code is stored, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the method described above.

[0032] The technical solution provided by the present application may include the following beneficial effects:

[0033] The signal light detection method of the present application obtains an environmental image, detects the signal light in the environmental image through the YoloV5 detection algorithm to quickly obtain the signal light area, and then filters the signal light area based on the HSV color algorithm. The HSV color algorithm adjusts the color channel value corresponding to the signal light area according to the difference in the color component values between the preset interference color and the preset signal light color. The preset signal light color is determined according to the color type of the signal light, and the color component value includes at least one of the H component value, the S component value, and the V component value. Such a design can quickly detect the position of the signal light in the acquired environmental image through the YoloV5 detection algorithm to obtain the signal light area, and then filter the signal light area based on the HSV color algorithm. The HSV color algorithm adjusts the color channel value corresponding to the signal light area according to the difference in the color component values between the preset interference color and the preset signal light color. The preset signal light color is determined according to the color type of the signal light, and the color component value includes at least one of the H component value, the S component value, and the V component value. Thus, the interference color is filtered out from the signal light area, and the object interfering with the signal light detection is filtered out, so that the filtered signal light area shows the signal light, avoiding the display of the object interfering with the signal light detection in the signal light area, avoiding false detection, improving the accuracy of signal light detection, and thus achieving accurate and rapid detection of the signal light, meeting the requirements of real-time and accuracy of autonomous driving, enabling the vehicle to stop or not stop in time, and improving the safety of vehicle driving.

[0034] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Brief Description of the Drawings

[0035] By describing the exemplary embodiments of the present application in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present application will become more obvious. Among them, in the exemplary embodiments of the present application, the same reference numerals generally represent the same components.

[0036] Figure 1 is a flowchart of the signal light detection method shown in the embodiment of the present application;

[0037] Figure 2 is a flowchart of the signal light detection method shown in another embodiment of the present application;

[0038] Figure 3 is an environmental image before detection by the object detection algorithm shown in the embodiment of the present application;

[0039] Figure 4 is an environmental image after detection by the object detection algorithm shown in the embodiment of the present application;

[0040] Figure 5 is the environmental picture after being detected by the object detection algorithm shown in another embodiment of the present application;

[0041] Figure 6 is the schematic flow chart of the traffic signal detection method shown in another embodiment of the present application;

[0042] Figure 7 is the schematic structural diagram of the traffic signal detection device shown in the embodiment of the present application;

[0043] Figure 8 is the schematic structural diagram of the traffic signal detection device shown in another embodiment of the present application;

[0044] Figure 9 is the schematic structural diagram of the electronic device shown in the embodiment of the present application.

[0045] Reference numerals: Bounding box A; Traffic signal area B. Detailed implementation manners

[0046] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0047] The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The singular forms "a", "the" and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0048] It should be understood that although the terms "first", "second", "third", etc. may be used in the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, "a plurality" means two or more unless otherwise specifically defined.

[0049] In the related art, the signal light detection algorithms mainly include the segmentation algorithm and the object detection algorithm. The segmentation algorithm has good results but is slow, and cannot meet the real-time requirements of autonomous driving. The object detection algorithm is fast but has poor results, and the vehicle cannot accurately identify the signal light during driving. Neither of the two signal light detection algorithms can effectively solve the problem of signal light detection and cannot accurately and quickly detect the signal light.

[0050] In view of the above problems, the embodiments of the present application provide a signal light detection method, which can accurately and quickly detect the signal light, meet the real-time and accuracy requirements of autonomous driving, enable the vehicle to stop in time or not stop, and improve the safety of vehicle driving.

[0051] The technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0052] Figure 1 It is a flowchart showing the signal light detection method shown in the embodiments of the present application.

[0053] See Figure 1 , the signal light detection method of the present application includes:

[0054] Step S110, obtain an environmental picture.

[0055] Among them, the environmental picture can be any picture collected by the client, or can be obtained according to the position of the signal light to be detected, so that the environmental picture records the signal light to be detected. For example, if the signal light is in front of the vehicle, then an environmental picture in front of the vehicle will be obtained, so that the signal light in front of the vehicle can be recorded in the environmental picture. In one embodiment, in order to obtain the environmental picture, an environmental picture is obtained by taking a picture with an image acquisition device, and / or a video is obtained by recording with an image acquisition device, and the environmental picture is intercepted according to the video.

[0056] Step S120, detect the signal light in the environmental picture through the YoloV5 detection algorithm to obtain the signal light area in the environmental picture.

[0057] Among them, the environmental picture not only records the signal light, but also records the environmental objects in the surrounding environment of the signal light, such as traffic signs, other vehicles and vegetation. In order to avoid the interference of the environmental objects in the surrounding environment of the signal light on the detection of the signal light, the environmental picture is detected through the YoloV5 detection algorithm, so as to detect the signal light area in the environmental picture, so as to filter the signal light area subsequently and avoid the interference of the environmental objects on the detection. Compared with the environmental picture, the environmental objects in the surrounding environment of the signal light recorded in the signal light area are less, reducing the interference on the detection of the signal light.

[0058] Step S130, filter the signal light area based on the HSV color algorithm, where the HSV color algorithm adjusts the color channel value corresponding to the signal light area according to the difference in color component values between the preset interference color and the preset signal light color. The preset signal light color is determined according to the color type of the signal light, and the color component value includes at least one of the H component value, the S component value, and the V component value.

[0059] Among them, the YoloV5 detection algorithm may not only detect the signal lights that need to be detected, but also may detect signal lights that do not need to be detected, environmental objects near the signal lights that need to be detected, and the lamp housing of the signal lights. The colors of these objects, such as signal lights that do not need to be detected, environmental objects near the signal lights that need to be detected, and the lamp housing, will interfere with the color recognition of the signal lights. According to the difference in the HSV color space between the colors of these objects and the colors displayed by the signal lights, the signal light area is filtered by the HSV color algorithm. The HSV color algorithm adjusts the color channel value corresponding to the signal light area according to the difference in color component values between the preset interference color and the preset signal light color. The preset signal light color is determined according to the color type of the signal light, and the color component value includes at least one of the H component value, the S component value, and the V component value. In this way, the colors of these objects are filtered from the signal light area to avoid the colors of these objects interfering with the detection of the signal lights, thereby improving the detection accuracy of the signal lights.

[0060] In summary, the signal light detection method of the present application can quickly detect the position of the signal light in the acquired environmental image through the YoloV5 detection algorithm, thereby obtaining the signal light area. Then, the signal light area is filtered based on the HSV color space to filter out the interference color from the signal light area. The HSV color algorithm adjusts the color channel value corresponding to the signal light area according to the difference in color component values between the preset interference color and the preset signal light color. The preset signal light color is determined according to the color type of the signal light, and the color component value includes at least one of the H component value, the S component value, and the V component value. In this way, the objects interfering with the signal light detection are filtered, so that the filtered signal light area displays the signal light, avoiding the display of objects interfering with the signal light detection in the signal light area, avoiding false detection, and improving the accuracy of interfering with the signal light detection, so as to accurately and quickly detect the signal light, meet the requirements of real-time and accuracy of autonomous driving, enable the vehicle to stop or not stop in time, and improve the safety of vehicle driving.

[0061] Figure 2 It is a schematic flowchart of the signal light detection method shown in another embodiment of the present application.

[0062] See Figure 2 , the signal light detection method of the present application includes:

[0063] Step 210, acquire an environmental image.

[0064] In one embodiment, the signal lamp includes at least one of a motor vehicle signal lamp, a non-motor vehicle signal lamp, a crosswalk signal lamp, a direction indicator lamp, a lane signal lamp, a flashing warning signal lamp, and a road-rail level crossing signal lamp. To obtain an environmental picture, in one embodiment, an environmental picture of a preset azimuth centered on the vehicle is collected by an in-vehicle image acquisition device, or an environmental picture is collected by an externally-connected image acquisition device of the vehicle. For example, an environmental picture in front of the vehicle can be collected by a front-view camera of the vehicle, and an environmental picture can also be collected by an externally-connected camera.

[0065] Step 220, detecting the signal lamp in the environmental picture through the YoloV5 detection algorithm to obtain the signal lamp area in the environmental picture.

[0066] Among them, the YoloV5 detection algorithm can detect the area corresponding to the signal lamp in the environmental picture, that is, the signal lamp area. The signal lamp area records the signal lamp to be detected, and records fewer objects other than the signal lamp than the environmental picture. For example, the signal lamp area does not record other vehicles, while other vehicles are recorded in the environmental picture. The signal lamp area is a part of the environmental picture, the area of the signal lamp area is less than or equal to the area of the environmental picture, and the objects recorded in the signal lamp area are fewer than the objects recorded in the environmental picture, avoiding misidentifying objects other than the signal lamp as the signal lamp, and further avoiding misidentifying the color of objects other than the signal lamp as the color of the signal lamp in subsequent color recognition.

[0067] See Figure 3 and Figure 5 , establish a positioning coordinate system according to the environmental picture, take the width direction of the environmental picture as the X axis, the height direction of the environmental picture as the Y axis, and the vertex at the upper left corner of the environmental picture as the origin O of the positioning coordinate system, thereby establishing a positioning coordinate system for positioning the signal lamp area B in the environmental picture. When the YoloV5 detection algorithm detects the signal lamp area B from the environmental picture, four positioning parameters x1, y1, w1, and h1 can be obtained according to the signal lamp area B. x1 represents the coordinate value of the vertex at the upper left corner of the signal lamp area B on the X axis, y1 represents the coordinate value of the vertex at the upper left corner of the signal lamp area B on the Y axis, w1 represents the width of the signal lamp area B, and h1 represents the height of the signal lamp area B. Among them, (x1, y1) represents the position of the vertex at the upper left corner of the signal lamp area B in the environmental picture. Among them, when the YoloV5 detection algorithm detects the signal lamp area B, a class label lable can also be obtained. The class label lable is used to distinguish the color of the signal lamp. For example, the class label lable being 0 represents a red light, and the class label lable being 1 represents a green light.

[0068] Compared with the YoloV4 detection algorithm or the segmentation algorithm such as Mask RCNN, under the condition of achieving the same detection accuracy, the YoloV5 detection algorithm has a faster detection speed and can detect the signal light area from the environmental image faster, so as to detect the signal light and identify its color in time, meet the real-time requirements of autonomous driving, and improve the safety of autonomous driving.

[0069] Step 230, crop the signal light area to obtain a regional image.

[0070] In order to filter the signal light area, it is necessary to extract the signal light area in the environmental image to obtain a regional image for filtering. Among them, after the YoloV5 detection algorithm detects the environmental image, the signal light area can be detected and determined in the environmental image through the bounding box, and the positioning parameters of the signal light area can be obtained. Among them, the bounding box plays a role in detecting the signal light in the related technology. The signal light area in the bounding box is the region of interest and is the region that needs to be filtered. This region can be cropped and extracted according to the bounding box. See Figure 3 and Figure 5 , for example, when the positioning parameters of the signal light area B are x1, y1, w1, and h1, then the bounding box A of the signal light area B is the bounding box A surrounded by the four points (x1, y1), (x1, y1+h1), (x1+w1, y1+h1), and (x1+w1, y1) in the positioning coordinate system. Then, it can be cropped according to the bounding box A, so that a regional image corresponding to the signal light area B can be obtained. The regional image records the signal light, and the environmental objects recorded are fewer than those recorded by the environmental image. Therefore, when filtering in the subsequent steps, compared with directly filtering the environmental image, the area to be filtered of the regional image is smaller than the area to be filtered of the environmental image, so the time required to filter the regional image is shorter, which speeds up the detection speed of the signal light. Further, the signal light area B is cropped through OpenCV to obtain a regional image. In one embodiment, cropping the signal light area to obtain a regional image includes performing ROI extraction according to the signal light area to obtain a regional image.

[0071] In order to more accurately detect the signal lights, in one embodiment, the YoloV5 detection algorithm detects based on the position and size of the signal lights in the environmental image; and / or, the ROI extraction is performed according to the position and size of the signal light area in the environmental image. The YoloV5 detection algorithm detects the signal lights recorded in the environmental image through a bounding box. The larger the bounding box, the easier it is to detect the signal lights; the closer the position of the bounding box is to the signal light object, the easier it is to detect the signal light object. However, the larger the detection box, the more data needs to be processed accordingly, and the slower the detection speed, which is not conducive to the real-time requirements of autonomous driving; the farther the distance between the bounding box and the signal light, the larger area of the bounding box is required to determine the signal light, or it is easy to cause incomplete detection of the signal light by the bounding box, and the signal light does not completely fall within the bounding box, affecting the accuracy of subsequent color recognition. Therefore, the YoloV5 detection algorithm determines the bounding box according to the size and position of the signal light, so that the signal light can be detected faster and more accurately by the bounding box. When the size of the bounding box is fixed, the larger the proportion of the signal light in the bounding box, the interference of other objects is reduced, and the detection accuracy is improved. Further, in order to improve the detection accuracy, the ROI extraction is performed according to the size and position of the signal light area, so that the extracted regional image is the same as the signal light area and both record the signal light. When the signal light area records the entire signal light, the corresponding extracted regional image also records the entire signal light.

[0072] Step 240, filter the regional image based on the HSV color algorithm to obtain the signal light image.

[0073] Different colors have different color component values in the HSV color space, where the color component values in the HSV color space include the H component value regarding the color hue, the S component value regarding the color saturation, and the V component value regarding the color lightness. Different colors can be distinguished by at least one of the color component values of the H component value, the S component value, and the V component value. The signal light image has corresponding color channel values, namely the H channel value regarding the hue, the S channel value regarding the saturation, and the V channel value regarding the lightness. Compare the H channel value with the H component value of the HSV color space, the S channel value with the S component value of the HSV color space, and the V channel value with the V component value of the HSV color space to determine the colors corresponding to the H channel value, the S channel value, and the V channel value of the regional image.

[0074] For example, the following settings are made for the colors and the corresponding maximum and minimum values of the color component values (hereinafter referred to as the color component range table). It should be noted that the specific values in the following table are only one case listed for easy understanding and do not specifically limit the maximum and minimum values of the color component values of the colors.

[0075]

[0076] In the color component range table, Hmin represents the minimum value of the H component value of the corresponding color, Hmax represents the maximum value of the H component value of the corresponding color, Smin represents the minimum value of the S component value of the corresponding color, Smax represents the maximum value of the S component value of the corresponding color, Vmin represents the minimum value of the V component value of the corresponding color, and Vmax represents the maximum value of the V component value of the corresponding color.

[0077] If the H channel value of the region image is 160, the S channel value is 200, and the V channel value is 50, according to the color component range table, the color of this pixel can be determined to be red. If the colors of two objects recorded in the region image are different, then the color channel values of the regions where the two objects are located are different, and at least one of the color channel values of the regions where the two objects are located is different in the H channel value, V channel value, and S channel value.

[0078] When the detection accuracy of the YoloV5 detection algorithm for traffic lights is insufficient, resulting in objects other than traffic lights being recorded in the traffic light region determined by the YoloV5 detection algorithm, objects other than traffic lights will also be recorded in the region image. If color recognition is directly performed on the region image, then the colors of the objects other than traffic lights recorded in the region image will interfere with color recognition, resulting in a low color recognition accuracy. In addition, since there is at least one lamp panel in the same traffic light, some lamp panels are in the lit state and some lamp panels are in the unlit state. The lit lamp panels can display different preset traffic light colors according to the color types of the traffic lights. For example, if the color types of the traffic lights are red, green, and yellow, then the preset traffic light colors are red, green, and yellow, and a single lit lamp panel can display one preset traffic light color at the same time point. When the lamp panel is in the unlit state, the lamp panel appears black, and the H channel value and S channel value of the region of the black lamp panel have a large range, making it difficult to distinguish black from the preset traffic light colors based on the H channel value and S channel value, which is not conducive to subsequent color recognition.

[0079] The preset interference color is a color other than the preset signal light color, which can be colors such as black, cyan, blue, and purple. The preset interference color is set according to the actual situation. For example, when many lamp panels of signal lights in the area where one is located are in the unlit state, the areas corresponding to the unlit lamp panels in the area picture will appear black, and it is not easy to identify and distinguish black from the preset signal light color. At this time, the preset interference color includes at least black. According to the color component range table, in terms of the V component value, compared with red, yellow, and green respectively, the range of the V component value of black is different from the component values of red, yellow, and green, with a large difference. The brightness of black is lower than that of red, yellow, and green. Therefore, the V channel value corresponding to the area picture can be adjusted outside the range of the V component value of black. For example, taking the color component range table as an example, the V channel value of the area picture is adjusted to be above 46, increasing the gap between the V channel value of the area picture and the V component value of black, filtering the color of the unlit lamp panels in the area picture, and avoiding the color of the unlit lamp panels from interfering with subsequent color recognition. In the signal light picture obtained by filtering the area picture by color, the area of the signal light picture corresponding to the unlit lamp panel does not display black, so that when performing color recognition on the signal light picture, the preset interference color can be avoided from interfering with color recognition.

[0080] Since the preset interference colors are different in different regions, interference objects of different colors cause interference to color recognition at different color channel values. For example, in some regions, many signal lights are unlit, and the lamp panels showing black in the area picture. At this time, the brightness of the unlit lamp panels and the lit lamp panels is different, and adjusting the V channel value of the pixel points of the area picture is the most effective. The actual situations in different regions are different, and there are differences in the surrounding environment of the region and the quality of the area picture. In order to flexibly adapt to the influence of different regions, different interference objects, or different preset interference colors, in one embodiment, filtering the signal light area based on the HSV color algorithm includes: adjusting the V channel value for filtering the area picture according to the V component value corresponding to the preset interference color; and / or, adjusting the H channel value for filtering the area picture according to the H component value corresponding to the preset interference color; and / or, adjusting the S channel value for filtering the area picture according to the S component value corresponding to the preset interference color. Thus, increasing the gap between the V channel value of the area picture and the V component value of the preset interference color, the gap between the H channel value and the H component value of the preset interference color, and the gap between the S channel value and the S component value of the preset interference color to filter the preset interference color and obtain the signal light picture.

[0081] In order to avoid accidentally filtering the preset signal light color during the process of adjusting the color channel values, in one embodiment, adjusting the color channel values corresponding to the signal light area includes: within a preset adjustment range, adjusting the color channel values corresponding to the area picture, where the preset adjustment range is determined according to the color component values of the preset signal light color. For example, when the preset signal light color is red and the V component value of red is above 180, and the preset interference color is black with the V component value of black below 100, then the color channel value corresponding to the area picture, that is, the V channel value, should be adjusted within the preset adjustment range above 100 and below 180 to avoid filtering the light red signal light panel and affecting subsequent color recognition.

[0082] In order to improve the detection speed of the signal light to meet the real-time requirements of autonomous driving, in one embodiment, adjusting the color channel values corresponding to the signal light area includes: adjusting the color channel values corresponding to the area picture to a preset adjustment threshold, where the preset adjustment threshold is determined according to the color component values of the preset interference color and / or the color component values of the preset signal light color. For example, the V component value of the preset signal light color is above 180, the V component value of the preset interference color is below 100, and the preset adjustment threshold is 170. Then the V channel value of the area picture is adjusted to 170, rather than adjusting the V channel value of the area picture to 170 in stages, so as to shorten the filtering time of the area picture and timely provide the signal light picture for subsequent color recognition, and then obtain the color recognition result in time to provide a decision-making basis for autonomous driving. To make the adjustment more timely, further, the color channel values corresponding to the area picture are adjusted to the preset adjustment threshold at one time.

[0083] Step 250, comparing the color channel values of the signal light picture with the color component values of the preset signal light color to identify the color of the signal light.

[0084] Different preset signal light colors have different color component values in the HSV color space. Therefore, the color channel values of the signal light picture can be compared with the color component values in the HSV color space to determine the color in the HSV color space corresponding to the signal light picture. Taking the color component range table as an example, red and green are the same in the range of S component values and also the same in the range of V component values, but different in the range of H component values. The range of H component values for red is 0 to 10 and 156 to 180, and the range of H component values for green is 35 to 77. When the H channel value of the signal light picture is 50, it falls within the range of H component values for green, indicating that the signal light picture is green, and the color of the corresponding signal light is green, thus realizing the judgment of the signal light color. Since the main difference between different preset signal light colors lies in the H component value, in one embodiment, the H channel value of the signal light picture is compared with the H component value of the preset signal light color to speed up the speed of identifying the color of the signal light. When the color of the signal light can be identified through the H channel value of the signal light picture, the process of separately comparing the S channel value and the V channel value of the signal light picture with the color component values in the HSV color space can be reduced, the computational amount of data processing can be reduced, and the identification time can be shortened.

[0085] See Figure 6 For the signal light detection method of the present application, by obtaining an environmental picture and detecting the environmental picture through the YoloV5 detection algorithm, the signal light area in the environmental picture is determined. A positioning coordinate system is established in the width direction and height direction of the environmental picture. According to the position of the signal light area in the environmental picture, the position (x1, y1) of the signal light area, the width w1, the height h1 of the signal light area, and the category label label of the signal light area are determined. According to the position of the signal light area in the environmental picture and based on the signal light area for ROI extraction to obtain a regional picture, and the regional picture is filtered based on the HSV color space to filter out the preset interference colors, avoiding the interference of the preset interference colors on color recognition, and the color of the signal light picture obtained after filtering is recognized to re-obtain the category label label of the signal light. The category label label obtained by the YoloV5 detection algorithm is not accurate enough, while the category label label obtained after filtering is more accurate. Using this category label as the basis for judging the signal light color can improve the accuracy of signal light color recognition.

[0086] In summary, for the traffic signal detection method of the present application, an environmental image is obtained through the vehicle's camera. The traffic signal detection algorithm of YoloV5 is used to quickly detect the traffic signal area corresponding to the traffic signal from the environmental image. ROI extraction is performed on the environmental image according to the traffic signal area to obtain a regional image, avoiding excessive environmental objects recorded in the regional image from affecting subsequent color recognition, narrowing the range that needs to be color-filtered, and shortening the color filtering time. According to the difference between the preset interference color and the preset traffic signal color, the color channel values corresponding to the regional image are adjusted to increase the gap between the color channel values of the regional image and the color component values of the preset interference color, so as to filter the preset interference color. To meet the real-time requirements of autonomous driving, the color channel values of the regional image are adjusted to the preset adjustment threshold at one time to quickly filter the preset interference color. Different preset interference colors have differences from the preset traffic signal color at different color component values. It is necessary to adjust different color channel values of the regional image accordingly according to the different differences between the preset interference color and the preset traffic signal color, so as to filter different preset interference colors to obtain a traffic signal image, avoiding interference from objects other than the lit lamp panel in the regional image to subsequent color recognition. Finally, according to the differences in color component values of different preset traffic signal colors, the color channel values of the traffic signal image are compared with the color component values of different colors in the HSV color space, so as to confirm the color of the traffic signal image, and further confirm the color of the traffic signal.

[0087] Corresponding to the foregoing method embodiments for implementing application functions, the present application also provides a traffic signal detection device, an electronic device, and corresponding embodiments.

[0088] Figure 7 It is a schematic structural diagram of the traffic signal detection device shown in the embodiments of the present application.

[0089] See Figure 7 , the traffic signal detection device 70 in this embodiment includes:

[0090] An image acquisition module 710, configured to acquire an environmental image.

[0091] Among them, the environmental image can be acquired through an in-vehicle image acquisition device or through an external image acquisition device of the vehicle.

[0092] A target detection module 720, configured to detect the traffic signal in the environmental image of the image acquisition module 710 through the YoloV5 detection algorithm to obtain the traffic signal area in the environmental image.

[0093] Compared with the YoloV4 detection algorithm or the segmentation algorithm such as Mask RCNN, under the condition of achieving the same detection accuracy, the YoloV5 detection algorithm has a faster detection speed and can detect the traffic signal area from the environmental image faster.

[0094] A color filtering module 730 is configured to filter the signal light area of the target detection module 720 based on the HSV color algorithm. The HSV color algorithm adjusts the color channel value corresponding to the signal light area according to the difference in the color component values between the preset interference color and the preset signal light color. The preset signal light color is determined according to the color type of the signal light, and the color component value includes at least one of the H component value, the S component value, and the V component value.

[0095] In summary, for the signal light detection device 70 of the present application, the picture acquisition module 710 acquires an environmental picture. The target detection module 720 quickly detects the position of the signal light in the environmental picture from the environmental picture through the YoloV5 detection algorithm, thereby obtaining the signal light area. The color filtering module 730 filters the signal light area based on the HSV color space. The HSV color algorithm adjusts the color channel value corresponding to the signal light area according to the difference in the color component values between the preset interference color and the preset signal light color. The preset signal light color is determined according to the color type of the signal light, and the color component value includes at least one of the H component value, the S component value, and the V component value. The preset interference color is filtered out from the signal light area, and the objects interfering with the signal light detection are filtered, so that the filtered signal light area displays the signal light, avoiding the display of the objects interfering with the signal light detection in the signal light area, avoiding false detection, improving the accuracy of signal light detection, thereby achieving accurate and fast detection of the signal light, meeting the requirements of real-time and accuracy of autonomous driving, enabling the vehicle to stop or not stop in time, and improving the safety of vehicle driving.

[0096] Figure 8 It is a schematic structural diagram of a signal light detection device shown in another embodiment of the present application.

[0097] See Figure 8 , the signal light detection device 70 of this embodiment includes:

[0098] A picture acquisition module 710 is configured to acquire an environmental picture.

[0099] A target detection module 720 is configured to detect the signal light in the environmental picture of the picture acquisition module 710 through the YoloV5 detection algorithm to obtain the signal light area in the environmental picture.

[0100] A picture clipping module 740 is configured to clip the signal light area of the target detection module 720 to obtain a regional picture.

[0101] A color filtering module 730 is configured to filter the regional picture of the picture clipping module 740 based on the HSV color algorithm to obtain a signal light picture.

[0102] A color recognition module 750 is configured to compare the color channel values of the signal lamp picture of the color filtering module 730 with the color component values of a preset signal lamp color, so as to recognize the color of the signal lamp.

[0103] Among them, the YoloV5 detection algorithm detects according to the position and size of the signal lamp in the environmental picture; and / or, the ROI extraction is performed according to the position and size of the signal lamp area in the environmental picture.

[0104] Among them, the color filtering module 730 adjusts the color channel values corresponding to the area picture within a preset adjustment range, and the preset adjustment range is determined according to the color component values of the preset signal lamp color. In one embodiment, the color channel values corresponding to the area picture are adjusted to a preset adjustment threshold, and the preset adjustment threshold is determined according to the color component values of the preset interference color and / or the color component values of the preset signal lamp color. In one embodiment, according to the V component value corresponding to the preset interference color, the V channel value used to filter the area picture is adjusted; and / or, according to the H component value corresponding to the preset interference color, the H channel value used to filter the area picture is adjusted; and / or, according to the S component value corresponding to the preset interference color, the S channel value used to filter the area picture is adjusted.

[0105] The color recognition module 750 compares the H channel value of the signal lamp picture with the H component value of the preset signal lamp color, so as to accelerate the speed of recognizing the color of the signal lamp.

[0106] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0107] Figure 9 It is a schematic structural diagram of an electronic device shown in an embodiment of the present application.

[0108] See Figure 9 , the electronic device 900 includes a memory 910 and a processor 920.

[0109] The processor 920 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0110] The memory 910 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, the ROM can store static data or instructions required by the processor 920 or other modules of the computer. The permanent storage device can be a read-write storage device. The permanent storage device can be a non-volatile storage device that does not lose the stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device employs a mass storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In some other embodiments, the permanent storage device can be a removable storage device (such as a floppy disk, optical drive). The system memory can be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. The system memory can store some or all of the instructions and data required by the processor during operation. In addition, the memory 910 can include any combination of computer-readable storage media, including various types of semiconductor storage chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic disks and / or optical disks can also be used. In some embodiments, the memory 910 can include a removable storage device that is readable and / or writable, such as a compact disc (CD), read-only digital versatile disc (such as DVD-ROM, dual-layer DVD-ROM), read-only Blu-ray disc, super density disc, flash memory card (such as SD card, min SD card, Micro-SD card, etc.), magnetic floppy disk, etc. A computer-readable storage medium does not include carrier waves and instantaneous electronic signals transmitted wirelessly or wiredly.

[0111] Executable code is stored on the memory 910, and when the executable code is processed by the processor 920, it can cause the processor 920 to execute some or all of the methods described above.

[0112] In addition, the method according to the present application can also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the above steps of the method according to the present application.

[0113] Alternatively, the present application can also be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium), on which executable code (or a computer program or computer instruction code) is stored. When the executable code (or the computer program or computer instruction code) is executed by a processor of an electronic device (or a server, etc.), it causes the processor to execute some or all of the steps of the above method according to the present application.

[0114] The embodiments of the present application have been described above. The above description is exemplary and not exhaustive, and is also not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, the practical application, or the improvement of the technology in the market, or to enable other ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A signal lamp detection method, characterized in that, Including: Obtain an environmental picture; Detect the traffic lights in the environmental picture through the YoloV5 detection algorithm to obtain the traffic light area in the environmental picture; Filter the traffic light area based on the HSV color algorithm to filter out the interfering colors from the traffic light area, where the HSV color algorithm adjusts the color channel values corresponding to the traffic light area according to the difference in the color component values between the preset interfering colors and the preset traffic light colors, where the preset traffic light colors are determined according to the color types of the traffic lights, and the color component values include at least one of the H component value, the S component value, and the V component value; The adjusting the color channel values corresponding to the traffic light area includes: Within a preset adjustment range, adjust the color channel values corresponding to the area picture, where the preset adjustment range is determined according to the color component values of the preset traffic light colors.

2. The signal lamp detection method according to claim 1, wherein After obtaining the traffic light area in the environmental picture, it further includes: Crop the traffic light area to obtain an area picture; And filter the area picture based on the HSV color algorithm to obtain a traffic light picture.

3. The signal lamp detection method according to claim 2, characterized in that The cropping the traffic light area to obtain an area picture includes: Perform ROI extraction according to the traffic light area to obtain the area picture.

4. The traffic light detection method according to claim 3, characterized in that: The YoloV5 detection algorithm detects according to the position and size of the traffic lights in the environmental picture; and / or, The ROI extraction is performed according to the position and size of the traffic light area in the environmental picture.

5. The signal lamp detection method according to claim 2, wherein, The filtering the traffic light area based on the HSV color algorithm includes: Adjust the V channel value for filtering the area picture according to the V component value corresponding to the preset interfering color; and / or, Adjust the H channel value for filtering the area picture according to the H component value corresponding to the preset interfering color; and / or, Adjust the S channel value for filtering the area picture according to the S component value corresponding to the preset interfering color.

6. The signal lamp detection method according to claim 1, wherein The filtering the traffic light area based on the HSV color algorithm further includes: Compare the color channel values of the traffic light picture with the color component values of the preset traffic light colors to identify the color of the traffic light.

7. An electronic device, characterized in that, Including: A processor; And A memory, on which executable code is stored, and when the executable code is executed by the processor, the processor executes the method according to any one of claims 1-6.

8. A computer-readable storage medium, on which executable code is stored, and when the executable code is executed by the processor of an electronic device, the processor executes the method according to any one of claims 1-6.

9. A signal lamp detection device, characterized in that, Including: A picture acquisition module for acquiring an environmental picture; A target detection module for detecting the traffic lights in the environmental picture of the picture acquisition module through the YoloV5 detection algorithm to obtain the traffic light area in the environmental picture; A color filtering module, which is used to filter the signal light area of the target detection module based on the HSV color algorithm, and filter out the interfering colors from the signal light area, where the HSV color algorithm adjusts the color channel values corresponding to the signal light area according to the color component value differences between the preset interfering colors and the preset signal light colors, where the preset signal light colors are determined according to the color types of the signal lights, and the color component values include at least one of the H component value, the S component value, and the V component value; it is also used to adjust the color channel values corresponding to the regional pictures within a preset adjustment range, where the preset adjustment range is determined according to the color component values of the preset signal light colors.

Citation Information

Patent Citations

  • Traffic-Light Detection and Classification Using Computer Vision and Deep Learning

    CN108090411A

  • Traffic light detection method, intelligent driving method and device, vehicle and electronic equipment

    CN110660254A

  • Oil level instrument identification method based on multi-scene feature information fusion

    CN113496161A