+

CN115424220A - Traffic light image labeling method and device, electronic equipment and storage medium - Google Patents

Traffic light image labeling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115424220A
CN115424220A CN202211257407.3A CN202211257407A CN115424220A CN 115424220 A CN115424220 A CN 115424220A CN 202211257407 A CN202211257407 A CN 202211257407A CN 115424220 A CN115424220 A CN 115424220A
Authority
CN
China
Prior art keywords
traffic light
image
light image
labeling
traffic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211257407.3A
Other languages
Chinese (zh)
Inventor
张上鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhidao Network Technology Beijing Co Ltd
Original Assignee
Zhidao Network Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhidao Network Technology Beijing Co Ltd filed Critical Zhidao Network Technology Beijing Co Ltd
Priority to CN202211257407.3A priority Critical patent/CN115424220A/en
Publication of CN115424220A publication Critical patent/CN115424220A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • G06V20/54Surveillance or monitoring of activities, e.g. for recognising suspicious objects of traffic, e.g. cars on the road, trains or boats
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/08Detecting or categorising vehicles

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Traffic Control Systems (AREA)

Abstract

本申请公开了一种交通灯图像标注方法和装置、电子设备和存储介质,该方法包括:获取当前路段的道路图像并对道路图像进行检测,得到交通灯图像和车辆检测结果;根据交通灯图像确定交通灯显示情况,以及根据交通灯图像和车辆检测结果确定车辆行驶情况;根据交通灯显示情况和车辆行驶情况,确定交通灯标注数据;利用交通灯标注数据对交通灯图像进行标注,得到交通灯图像标注结果。本申请实施例在通过图像检测确定交通灯显示情况的基础上,进一步结合基于图像检测确定的车辆行驶情况来确定交通灯的灯色,从而得到了更加准确的交通灯标注数据,并以此实现交通灯图像的自标注,减少了大量人工标注成本,提高了交通灯图像的标注效率。

Figure 202211257407

The present application discloses a traffic light image tagging method and device, electronic equipment and a storage medium. The method includes: obtaining a road image of the current road section and detecting the road image to obtain a traffic light image and vehicle detection results; according to the traffic light image Determine the traffic light display situation, and determine the vehicle driving situation according to the traffic light image and vehicle detection results; determine the traffic light labeling data according to the traffic light display situation and vehicle driving situation; use the traffic light labeling data to mark the traffic light image, and get the traffic Lamp image annotation results. In the embodiment of the present application, on the basis of determining the display status of traffic lights through image detection, the light color of traffic lights is further combined with the vehicle driving conditions determined based on image detection, thereby obtaining more accurate traffic light labeling data, and realizing The self-labeling of traffic light images reduces a lot of manual labeling costs and improves the labeling efficiency of traffic light images.

Figure 202211257407

Description

交通灯图像标注方法和装置、电子设备和存储介质Traffic light image tagging method and device, electronic device and storage medium

技术领域technical field

本申请涉及交通灯识别技术领域,尤其涉及一种交通灯图像标注方法和装置、电子设备和存储介质。The present application relates to the technical field of traffic light recognition, and in particular to a traffic light image labeling method and device, electronic equipment and a storage medium.

背景技术Background technique

目前有些交通灯设备会搭载有发送装置,可以将交通灯信号发送到路端设备或者车端设备,更多时候只能通过车端图像检测识别的方法获取当前交通灯显示的灯色,但在交通灯设备发生故障时,车端识别到的交通灯颜色是错误的,车辆若按照识别到的错误的交通灯行驶,容易引起交通事故,进而导致交通拥堵。At present, some traffic light equipment will be equipped with a sending device, which can send traffic light signals to road-side equipment or vehicle-side equipment. Most of the time, the current light color displayed by the traffic light can only be obtained through the method of vehicle-side image detection and recognition, but in When the traffic light equipment fails, the color of the traffic light recognized by the car is wrong. If the vehicle drives according to the wrong traffic light, it is easy to cause traffic accidents and lead to traffic jams.

而目前车端对于交通灯识别的流程都依赖深度学习模型,而深度学习模型则依赖大量的标注数据,需要大量的人力和物力。且车端受限于自身定位的缘故获取的交通灯图像可能有误,进而导致识别出错,或者因为角度问题导致所拍摄的交通灯图像检测错误等。At present, the process of traffic light recognition on the car side relies on deep learning models, and deep learning models rely on a large amount of labeled data, requiring a lot of manpower and material resources. Moreover, the traffic light image acquired by the vehicle end may be wrong due to its own positioning, which may lead to recognition errors, or the captured traffic light image may be detected incorrectly due to angle problems.

发明内容Contents of the invention

本申请实施例提供了一种交通灯图像标注方法和装置、电子设备和存储介质,以实现交通灯图像数据的自标注,提高标注效率和准确性。Embodiments of the present application provide a traffic light image labeling method and device, electronic equipment, and a storage medium, so as to realize self-labeling of traffic light image data and improve labeling efficiency and accuracy.

本申请实施例采用下述技术方案:The embodiment of the application adopts the following technical solutions:

第一方面,本申请实施例提供一种交通灯图像标注方法,其中,所述方法包括:In the first aspect, the embodiment of the present application provides a traffic light image labeling method, wherein the method includes:

获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果;Obtain a road image of the current road section and detect the road image to obtain a traffic light image and vehicle detection results;

根据所述交通灯图像确定交通灯显示情况,以及根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况;determining the traffic light display situation according to the traffic light image, and determining the vehicle driving situation according to the traffic light image and the vehicle detection result;

根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据;According to the display situation of the traffic light and the driving situation of the vehicle, determine the labeling data of the traffic light;

利用所述交通灯标注数据对所述交通灯图像进行标注,得到交通灯图像标注结果。Using the traffic light labeling data to label the traffic light image to obtain a traffic light image labeling result.

可选地,所述获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果包括:Optionally, the acquiring the road image of the current road section and detecting the road image to obtain the traffic light image and vehicle detection results includes:

获取当前路段对应的高精地图,以及高精地图与相机图像之间的对应关系;Obtain the high-precision map corresponding to the current road section, and the correspondence between the high-precision map and the camera image;

根据所述当前路段对应的高精地图以及所述高精地图与相机图像之间的对应关系,从所述道路图像中分割出所述交通灯图像。The traffic light image is segmented from the road image according to the high-precision map corresponding to the current road section and the corresponding relationship between the high-precision map and the camera image.

可选地,所述交通灯图像包括多帧交通灯图像,所述根据所述交通灯图像确定交通灯显示情况包括:Optionally, the traffic light image includes multiple frames of traffic light images, and the determining the traffic light display situation according to the traffic light image includes:

对多帧交通灯图像中的任意相邻两帧交通灯图像进行像素差分和处理;Perform pixel difference and processing on any two adjacent frames of traffic light images in the multi-frame traffic light images;

根据相邻两帧交通灯图像的像素差分和处理结果,确定灯色跳变情况和灯色显示时长,作为所述交通灯显示情况。According to the pixel difference of two adjacent frames of traffic light images and the processing result, the light color jumping condition and the display duration of the light color are determined as the traffic light display condition.

可选地,所述根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况包括:Optionally, the determining the vehicle driving condition according to the traffic light image and the vehicle detection result includes:

获取当前路段对应的高精地图,所述高精地图中包含车道与交通灯的对应关系;Obtain the high-precision map corresponding to the current road section, and the high-precision map includes the corresponding relationship between the lane and the traffic light;

根据所述车道与交通灯的对应关系确定所述交通灯图像中的交通灯对应的车道;determining the lane corresponding to the traffic light in the traffic light image according to the correspondence between the lane and the traffic light;

根据所述交通灯图像中的交通灯对应的车道以及所述车辆检测结果确定所述车道对应的目标车辆位置;determining the position of the target vehicle corresponding to the lane according to the lane corresponding to the traffic light in the traffic light image and the vehicle detection result;

根据所述目标车辆位置和当前路段的停止线位置确定所述车辆行驶情况。The vehicle running condition is determined according to the target vehicle position and the stop line position of the current road section.

可选地,所述根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据包括:Optionally, the determining the traffic light labeling data according to the traffic light display situation and the vehicle driving situation includes:

根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯图像是否满足预设交通灯标注条件;determining whether the traffic light image satisfies a preset traffic light labeling condition according to the traffic light display condition and the vehicle driving condition;

在所述交通灯图像满足所述预设交通灯标注条件的情况下,根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯标注数据。If the traffic light image satisfies the preset traffic light labeling condition, the traffic light labeling data is determined according to the traffic light display condition and the vehicle driving condition.

可选地,所述交通灯图像包括第一交通灯图像和第二交通灯图像,所述第二交通灯图像在所述第一交通灯图像之前得到,所述根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯图像是否满足预设交通灯标注条件包括:Optionally, the traffic light image includes a first traffic light image and a second traffic light image, the second traffic light image is obtained before the first traffic light image, and according to the traffic light display conditions and The vehicle driving condition, determining whether the traffic light image satisfies the preset traffic light labeling conditions includes:

根据所述第一交通灯图像对应的交通灯显示情况和车辆行驶情况,确定所述第一交通灯图像是否满足第一预设交通灯标注条件;Determining whether the first traffic light image satisfies a first preset traffic light labeling condition according to the traffic light display situation and the vehicle driving situation corresponding to the first traffic light image;

在所述第一交通灯图像满足第一预设交通灯标注条件的情况下,确定所述第一交通灯图像对应的灯色检测结果;If the first traffic light image satisfies a first preset traffic light labeling condition, determine a light color detection result corresponding to the first traffic light image;

根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的交通灯显示情况,确定所述第二交通灯图像对应的灯色检测结果;Determine the light color detection result corresponding to the second traffic light image according to the light color detection result corresponding to the first traffic light image and the traffic light display situation corresponding to the second traffic light image;

根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果,确定所述第一交通灯图像和所述第二交通灯图像是否满足第二预设交通灯标注条件。According to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image, determine whether the first traffic light image and the second traffic light image meet a second preset Set traffic light labeling conditions.

可选地,所述根据所述第一交通灯图像对应的交通灯显示情况和车辆行驶情况,确定所述第一交通灯图像是否满足第一预设交通灯标注条件包括:Optionally, the determining whether the first traffic light image satisfies the first preset traffic light labeling condition according to the traffic light display situation and the vehicle driving situation corresponding to the first traffic light image includes:

根据所述第一交通灯图像对应的交通灯显示情况确定交通灯的灯色是否持续多帧相同,且根据所述车辆行驶情况确定对应的多帧目标车辆位置是否位于当前路段的停止线位置以内;Determine whether the light color of the traffic light remains the same for multiple frames according to the traffic light display situation corresponding to the first traffic light image, and determine whether the corresponding multi-frame target vehicle position is within the stop line position of the current road section according to the vehicle driving situation ;

若是,则在根据所述第一交通灯图像对应的交通灯显示情况确定交通灯的灯色发生跳变之后,根据所述车辆行驶情况确定对应的多帧目标车辆位置是否位于所述停止线位置以外;If so, after determining that the light color of the traffic light jumps according to the traffic light display situation corresponding to the first traffic light image, determine whether the corresponding multi-frame target vehicle position is located at the stop line position according to the vehicle driving situation outside;

若是,则确定所述第一交通灯图像满足所述第一预设交通灯标注条件。If so, determine that the first traffic light image satisfies the first preset traffic light labeling condition.

可选地,所述根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果,确定所述第一交通灯图像和所述第二交通灯图像是否满足第二预设交通灯标注条件包括:Optionally, determining the first traffic light image and the second traffic light image according to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image Whether the image satisfies the second preset traffic light labeling condition includes:

根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果确定交通灯的灯色显示时长,所述交通灯的灯色显示时长包括红灯、绿灯和黄灯的灯色显示时长;According to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image, the light color display duration of the traffic light is determined, and the light color display duration of the traffic light includes red light, red light, The display duration of the green and yellow lights;

若红灯的灯色显示时长以及绿灯的灯色显示时长均大于黄灯的灯色显示时长,则确定所述第一交通灯图像和所述第二交通灯图像满足第二预设交通灯标注条件。If the light color display duration of the red light and the light color display duration of the green light are both longer than the light color display duration of the yellow light, then it is determined that the first traffic light image and the second traffic light image satisfy the second preset traffic light label condition.

第二方面,本申请实施例还提供一种交通灯图像标注装置,其中,所述装置包括:In the second aspect, the embodiment of the present application also provides a traffic light image tagging device, wherein the device includes:

获取单元,用于获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果;an acquisition unit, configured to acquire a road image of the current road section and detect the road image to obtain a traffic light image and a vehicle detection result;

第一确定单元,用于根据所述交通灯图像确定交通灯显示情况,以及根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况;A first determining unit, configured to determine a traffic light display condition according to the traffic light image, and determine a vehicle running condition according to the traffic light image and the vehicle detection result;

第二确定单元,用于根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据;A second determining unit, configured to determine traffic light marking data according to the traffic light display conditions and the vehicle driving conditions;

标注单元,用于利用所述交通灯标注数据对所述交通灯图像进行标注,得到交通灯图像标注结果。The labeling unit is configured to use the traffic light labeling data to label the traffic light image to obtain a traffic light image labeling result.

第三方面,本申请实施例还提供一种电子设备,包括:In a third aspect, the embodiment of the present application further provides an electronic device, including:

处理器;以及processor; and

被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行前述之任一所述方法。A memory arranged to store computer-executable instructions which, when executed, cause the processor to perform any one of the preceding methods.

第四方面,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行前述之任一所述方法。In a fourth aspect, the embodiment of the present application further provides a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs , causing the electronic device to execute any one of the aforementioned methods.

本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:本申请实施例的交通灯图像标注方法,先获取当前路段的道路图像并对道路图像进行检测,得到交通灯图像和车辆检测结果;然后根据交通灯图像确定交通灯显示情况,以及根据交通灯图像和车辆检测结果确定车辆行驶情况;之后根据交通灯显示情况和车辆行驶情况,确定交通灯标注数据;最后利用交通灯标注数据对交通灯图像进行标注,得到交通灯图像标注结果。本申请实施例的交通灯图像标注方法在通过图像检测确定交通灯显示情况的基础上,进一步结合图像中检测到的车辆行驶情况来确定交通灯的灯色,从而得到了更加准确的交通灯标注数据,并以此实现交通灯图像的自标注,减少了大量人工标注成本,提高了交通灯图像的标注效率。The above at least one technical solution adopted in the embodiment of the present application can achieve the following beneficial effects: the traffic light image labeling method of the embodiment of the present application first obtains the road image of the current road section and detects the road image to obtain the traffic light image and vehicle detection results ; Then determine the display of traffic lights according to the traffic light image, and determine the driving condition of the vehicle according to the traffic light image and vehicle detection results; then determine the traffic light labeling data according to the traffic light display and vehicle driving conditions; finally use the traffic light labeling data to Annotate the traffic light image to obtain the traffic light image annotation result. In the traffic light image labeling method of the embodiment of the present application, on the basis of determining the traffic light display situation through image detection, the light color of the traffic light is further combined with the detected vehicle driving conditions in the image, thereby obtaining more accurate traffic light labeling Data, and in this way realize the self-labeling of traffic light images, which reduces a lot of manual labeling costs and improves the labeling efficiency of traffic light images.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The schematic embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation to the application. In the attached picture:

图1为本申请实施例中一种交通灯图像标注方法的流程示意图;Fig. 1 is a schematic flow chart of a traffic light image labeling method in the embodiment of the present application;

图2为本申请实施例中一种交通灯图像标注装置的结构示意图;FIG. 2 is a schematic structural diagram of a traffic light image labeling device in an embodiment of the present application;

图3为本申请实施例中一种电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device in an embodiment of the present application.

具体实施方式detailed description

为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and corresponding drawings. Apparently, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by various embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.

本申请实施例提供了一种交通灯图像标注方法,如图1所示,提供了本申请实施例中一种交通灯图像标注方法的流程示意图,所述方法至少包括如下的步骤S110至步骤S140:The embodiment of the present application provides a traffic light image tagging method. As shown in FIG. 1 , it provides a schematic flow chart of a traffic light image tagging method in the embodiment of the present application. The method includes at least the following steps S110 to S140 :

步骤S110,获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果。Step S110, acquiring the road image of the current road segment and detecting the road image to obtain traffic light images and vehicle detection results.

本申请实施例的交通灯图像标注方法可以由路端来执行,路端检测交通灯并将结果发送给车端相对来说准确率会更高,因为对于路端相机来说,交通灯在图像中的位置和形状都相对固定,并且可以针对性加入训练数据,从而提高检测准确性,但路端对于交通灯的检测和识别同样需要依赖大量的标注数据,因此本申请实施例的交通灯图像标注方法即用来实现交通灯图像数据的自标注。The traffic light image labeling method in the embodiment of the present application can be performed by the roadside. The roadside detects the traffic light and sends the result to the vehicle side. The accuracy rate is relatively higher, because for the roadside camera, the traffic light in the image The position and shape in are relatively fixed, and training data can be added in a targeted manner to improve detection accuracy, but the detection and recognition of traffic lights at the road end also need to rely on a large amount of labeling data, so the traffic light image of the embodiment of the present application The labeling method is used to realize the self-labeling of traffic light image data.

在进行交通灯图像数据的标注时,需要先获取路端相机采集的当前路段的道路图像,然后利用预设图像检测算法对道路图像进行检测,这里的检测主要包括交通灯区域的检测和图像中所包含的车辆目标的检测,交通灯区域的检测是指从当前的道路图像中分割出交通灯所在区域的局部图像,车辆检测则可以利用现有的目标检测网络如YOLO V5等网络来实现,从而从图像中检测出车辆目标所在的位置等。When labeling traffic light image data, it is necessary to obtain the road image of the current road segment collected by the roadside camera first, and then use the preset image detection algorithm to detect the road image. The detection here mainly includes the detection of the traffic light area and the The detection of the contained vehicle target, the detection of the traffic light area refers to segmenting the local image of the area where the traffic light is located from the current road image, and the vehicle detection can be realized by using the existing target detection network such as YOLO V5 and other networks. In this way, the location of the vehicle target can be detected from the image.

步骤S120,根据所述交通灯图像确定交通灯显示情况,以及根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况。Step S120, determining the display condition of the traffic light according to the traffic light image, and determining the driving condition of the vehicle according to the traffic light image and the vehicle detection result.

基于持续检测得到的交通灯图像,可以通过图像像素的变化进行一步确定出交通灯显示情况,例如交通灯的灯色跳变情况以及灯色显示时长等。此外,由于正常情况下,不同灯色的信号灯以及信号灯的跳变变化对于车辆的行驶有较大影响,因此还可以基于交通灯图像以及对应的车辆检测结果进一步确定出车辆的行驶情况,从而根据车辆行驶情况进一步辅助交通灯灯色的识别。Based on the traffic light image obtained through continuous detection, the display status of the traffic light can be determined in one step through the change of the image pixels, such as the color jump of the traffic light and the display duration of the light color. In addition, since under normal circumstances, signal lights of different light colors and jumping changes of signal lights have a greater impact on the driving of the vehicle, it is also possible to further determine the driving conditions of the vehicle based on the traffic light image and the corresponding vehicle detection results. The driving situation of the vehicle further assists the recognition of the color of the traffic light.

步骤S130,根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据。Step S130, determining traffic light marking data according to the traffic light display conditions and the vehicle driving conditions.

交通灯显示情况能够反映出一段时间内交通灯的灯色跳变情况以及同一种灯色的显示时长,如果在交通灯正常显示的情况下,基于交通灯变化规则能够大致将红灯和绿灯与黄灯区分开,但当交通灯出现故障时,例如红灯故障闪烁,这时将导致上述交通灯显示情况所反映出的检测结果也存在错误,进而无法准确区分灯色。The traffic light display status can reflect the color jump of the traffic light and the display duration of the same light color within a period of time. If the traffic light is displayed normally, the red light and green light can be roughly compared with the traffic light change rules based on the traffic light change rules. The yellow lights are distinguished, but when the traffic lights fail, for example, the red lights fail to flicker, at this time, the detection results reflected by the above-mentioned traffic light display conditions will also have errors, and then the light colors cannot be accurately distinguished.

基于此,本申请实施例进一步结合车辆行驶情况来辅助检测交通灯的灯色和变化情况,因为在交通灯故障的情况下,大部分人为驾驶的车辆是能够作出准确判断和区分的,因此能够避免仅依靠交通灯图像进行检测时无法适用于交通灯故障闪烁等检测场景的问题。当然,即使在交通灯正常显示的场景下,通过结合车辆行驶情况也能够验证交通灯图像的检测结果,从而进一步提高交通灯灯色识别的准确性。Based on this, the embodiment of the present application further combines the driving conditions of the vehicle to assist in the detection of the light color and change of the traffic light, because in the case of a traffic light failure, most vehicles driven by humans can make accurate judgments and distinctions, so they can Avoid the problem that it cannot be applied to detection scenarios such as traffic light failure and flickering when only relying on traffic light images for detection. Of course, even in the scene where the traffic lights are normally displayed, the detection result of the traffic light image can be verified by combining the driving conditions of the vehicle, thereby further improving the accuracy of traffic light color recognition.

步骤S140,利用所述交通灯标注数据对所述交通灯图像进行标注,得到交通灯图像标注结果。Step S140, using the traffic light labeling data to label the traffic light image to obtain a traffic light image labeling result.

上述交通灯标注数据可以看作是当前检测到的交通灯图像的准确的标注数据,具体可以包括交通灯的位置和对应的灯色等信息,基于标注数据即可对交通灯图像进行自标注,从而可以作为后续路端或者车端训练交通灯灯色识别模型的样本。The above traffic light labeling data can be regarded as the accurate labeling data of the currently detected traffic light image, which can specifically include information such as the position of the traffic light and the corresponding light color, and the traffic light image can be self-labeled based on the labeling data. Therefore, it can be used as a sample for subsequent roadside or vehicle side training traffic light color recognition models.

本申请实施例的交通灯图像标注方法在通过图像检测确定交通灯显示情况的基础上,进一步结合图像中检测到的车辆行驶情况来确定交通灯的灯色,从而得到了更加准确的交通灯标注数据,并以此实现交通灯图像的自标注,减少了大量人工标注成本,提高了交通灯图像的标注效率。In the traffic light image labeling method of the embodiment of the present application, on the basis of determining the traffic light display situation through image detection, the light color of the traffic light is further combined with the detected vehicle driving conditions in the image, thereby obtaining more accurate traffic light labeling Data, and in this way realize the self-labeling of traffic light images, which reduces a lot of manual labeling costs and improves the labeling efficiency of traffic light images.

在本申请的一些实施例中,所述获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果包括:获取当前路段对应的高精地图,以及高精地图与相机图像之间的对应关系;根据所述当前路段对应的高精地图以及所述高精地图与相机图像之间的对应关系,从所述道路图像中分割出所述交通灯图像。In some embodiments of the present application, the acquiring the road image of the current road section and detecting the road image, and obtaining the traffic light image and vehicle detection results include: obtaining the high-precision map corresponding to the current road section, and the high-precision map and Correspondence between camera images: segment the traffic light image from the road image according to the high-precision map corresponding to the current road section and the correspondence between the high-precision map and the camera image.

由于本申请实施例的交通灯图像的标注方法由路端执行,而路端相机的位置通常较为固定,除非人为调节,一般不会发生较大变动,因此交通灯在路端相机所拍摄到的道路图像中的位置也基本固定。Since the labeling method of the traffic light image in the embodiment of the present application is performed by the roadside, and the position of the roadside camera is usually relatively fixed, unless it is manually adjusted, generally there will be no major changes. The position in the road image is also basically fixed.

基于此,本申请实施例可以先对高精地图与路端相机进行联合标定,从而得到相机图像与高精地图的对应关系,基于相机图像与高精地图的对应关系,可以根据高精地图中提供的当前路段的交通灯位置,在相机图像的对应位置裁剪出交通灯所在的特定区域,作为交通灯图像。Based on this, in the embodiment of the present application, the joint calibration of the high-precision map and the roadside camera can be performed first, so as to obtain the corresponding relationship between the camera image and the high-precision map. Based on the corresponding relationship between the camera image and the high-precision map, the The provided traffic light position of the current road segment is used to cut out the specific area where the traffic light is located at the corresponding position of the camera image as the traffic light image.

在本申请的一些实施例中,所述交通灯图像包括多帧交通灯图像,所述根据所述交通灯图像确定交通灯显示情况包括:对多帧交通灯图像中的任意相邻两帧交通灯图像进行像素差分和处理;根据相邻两帧交通灯图像的像素差分和处理结果,确定灯色跳变情况和灯色显示时长,作为所述交通灯显示情况。In some embodiments of the present application, the traffic light image includes multiple frames of traffic light images, and the determining the traffic light display situation according to the traffic light images includes: The light image is subjected to pixel difference and processing; according to the pixel difference and processing results of two adjacent frames of traffic light images, the light color jump and the light color display duration are determined as the traffic light display.

路端对于交通灯图像的检测是一个实时、持续进行的过程,基于检测到的多帧交通灯图像,可以对任意相邻两帧交通灯图像进行像素差分和处理,即利用当前帧交通灯图像中对应的每一个像素值分别减去上一帧交通灯图像中对应的每一个像素值,最后将得到的所有像素值差进行求和,作为相邻两帧交通灯图像的像素差分和处理结果。The detection of traffic light images at the road end is a real-time and continuous process. Based on the detected multi-frame traffic light images, pixel difference and processing can be performed on any two adjacent frames of traffic light images, that is, using the current frame of traffic light images Each corresponding pixel value in the previous frame of traffic light image is subtracted from each corresponding pixel value in the previous frame of traffic light image, and finally all the obtained pixel value differences are summed as the pixel difference and processing result of two adjacent frames of traffic light images .

像素差分和处理的目的是确定出交通灯的跳变情况,也即检测交通灯在当前帧是发生灯色变换还是正处于某种灯色的正常显示中。因为如果当前帧处于黄灯变红灯、绿灯变黄灯或者红灯变绿灯等这种灯色变换的情况,灯色变换必然会导致像素值差异较大,那么当前帧相对上一帧的像素差分和得到的数值应该很大,具体可以设置一个可调节阈值来判断。而如果当前帧和上一帧处于黄灯或者绿灯或者红灯的持续显示中,相邻帧之间的像素值基本没有变化,那么相邻帧的像素差分和的数值应该会非常小,即接近于0或者等于0。The purpose of pixel difference and processing is to determine the jump of the traffic light, that is, to detect whether the traffic light has a light color change in the current frame or is in a normal display of a certain light color. Because if the current frame is in a situation where the light color changes from yellow light to red light, green light to yellow light, or red light to green light, etc., the light color change will inevitably lead to a large difference in pixel values, then the pixel value of the current frame relative to the previous frame The value obtained by the difference sum should be very large, which can be judged by setting an adjustable threshold. And if the current frame and the previous frame are in the continuous display of yellow light, green light or red light, and the pixel values between adjacent frames basically do not change, then the value of the pixel difference sum of adjacent frames should be very small, that is, close to at or equal to 0.

因此通过上述像素差分和的处理方式,能够在交通灯图像的持续检测过程中确定出交通灯的跳变情况,也即在哪一帧发生跳变,同时根据相邻两次跳变之间的时间间隔也能够确定出单一灯色的持续显示时长。Therefore, through the processing method of the above-mentioned pixel difference sum, the jumping situation of the traffic light can be determined in the continuous detection process of the traffic light image, that is, in which frame the jumping occurs, and at the same time, according to the distance between two adjacent jumps The time interval can also determine the continuous display time of a single light color.

在本申请的一些实施例中,所述交通灯显示情况包括灯色显示时长,在根据所述交通灯图像确定交通灯显示情况之后,所述方法还包括:将所述灯色显示时长与预设时长阈值进行比较;若所述灯色显示时长超过所述预设时长阈值,则确定交通灯发生故障并向故障平台发送提醒信息。In some embodiments of the present application, the display condition of the traffic light includes the display duration of the light color, and after determining the display condition of the traffic light according to the traffic light image, the method further includes: comparing the display duration of the light color with the preset A duration threshold is set for comparison; if the display duration of the light color exceeds the preset duration threshold, it is determined that the traffic light has failed and a reminder message is sent to the failure platform.

基于前述实施例可以确定出单一灯色的持续显示时长,正常情况下,同一种灯色的持续显示时长应当在合理时长范围内,而如果交通灯出现故障,则有可能显示异常,因此本申请实施例可以将灯色显示时长与事先设置好的预设时长阈值进行比较,如果超过该阈值,则认为交通灯显示出现故障,进而可以向故障平台发送前后视频取证,以便及时进行故障处理。上述预设时长阈值的大小可以根据实际需求灵活设置,在此不作具体限定。Based on the foregoing embodiments, the continuous display duration of a single light color can be determined. Under normal circumstances, the continuous display duration of the same light color should be within a reasonable duration. However, if the traffic light fails, it may display abnormally. Therefore, this application The embodiment can compare the display duration of the light color with the pre-set preset duration threshold. If the threshold is exceeded, it is considered that the traffic light display is faulty, and then the front and back video can be sent to the fault platform for evidence collection, so as to handle the fault in time. The above-mentioned preset duration threshold can be flexibly set according to actual needs, and is not specifically limited here.

在本申请的一些实施例中,所述根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况包括:获取当前路段对应的高精地图,所述高精地图中包含车道与交通灯的对应关系;根据所述车道与交通灯的对应关系确定所述交通灯图像中的交通灯对应的车道;根据所述交通灯图像中的交通灯对应的车道以及所述车辆检测结果确定所述车道对应的目标车辆位置;根据所述目标车辆位置和当前路段的停止线位置确定所述车辆行驶情况。In some embodiments of the present application, the determining the vehicle driving condition according to the traffic light image and the vehicle detection result includes: acquiring a high-precision map corresponding to the current road segment, and the high-precision map includes lanes and traffic lights Correspondence: determining the lane corresponding to the traffic light in the traffic light image according to the correspondence between the lane and the traffic light; determining the lane according to the lane corresponding to the traffic light in the traffic light image and the vehicle detection result The corresponding target vehicle position; determining the vehicle driving condition according to the target vehicle position and the stop line position of the current road section.

由于实际道路场景下,并不是每个路口都只有一个交通灯,很多路口会有不同交通灯对应着不同的车道。而高精地图中往往会提供每个路口的交通灯与各个车道的对应关系,因此本申请实施例可以根据高精地图中的车道与交通灯的对应关系,以及高精地图的车道与路端相机图像的对应关系,确定出交通灯图像中包含的每个交通灯具体对应的车道,也即能够确定图像中哪个区域对应着哪条车道,以及该车道对应着哪个交通灯。因此本申请实施例对于交通灯的检测是车道级别的检测,同时这里得到的车道信息也是后续确定交通灯对应车道的车辆行驶情况的基础。In the actual road scene, not every intersection has only one traffic light, and many intersections have different traffic lights corresponding to different lanes. The high-precision map often provides the corresponding relationship between the traffic lights at each intersection and each lane, so the embodiment of the present application can be based on the correspondence between the lanes and the traffic lights in the high-precision map, as well as the lanes and road ends of the high-precision map The corresponding relationship of the camera images determines the specific lane corresponding to each traffic light contained in the traffic light image, that is, it can be determined which area in the image corresponds to which lane, and which traffic light corresponds to the lane. Therefore, the detection of the traffic light in the embodiment of the present application is the detection at the lane level, and the lane information obtained here is also the basis for subsequent determination of the vehicle driving conditions of the lane corresponding to the traffic light.

在本申请的一些实施例中,所述根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据包括:根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯图像是否满足预设交通灯标注条件;在所述交通灯图像满足所述预设交通灯标注条件的情况下,根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯标注数据。In some embodiments of the present application, the determining the traffic light labeling data according to the traffic light display and the vehicle driving condition includes: determining the traffic light label data according to the traffic light display and the vehicle driving condition Whether the light image satisfies the preset traffic light labeling condition; if the traffic light image satisfies the preset traffic light labeling condition, determine the traffic light labeling according to the traffic light display situation and the vehicle driving condition data.

为了保证交通灯图像标注数据的准确性,本申请实施例在根据交通灯显示情况和车辆行驶情况确定标注数据时,需要满足一定的预设交通灯标注条件,因为在一些特殊情况下,仅仅依靠交通灯显示情况和车辆行驶情况仍然无法准确确定出交通灯的灯色,例如当交通灯的显示情况由绿灯变为黄灯或者由黄灯变为红灯的过程中,此时仍然可能有部分车辆经过路口,因此根据车辆行驶情况难以准确判断出交通灯跳变前后的具体灯色。In order to ensure the accuracy of the traffic light image labeling data, the embodiment of the present application needs to meet certain preset traffic light labeling conditions when determining the labeling data according to the traffic light display and vehicle driving conditions, because in some special cases, only relying on The traffic light display and vehicle driving conditions still cannot accurately determine the light color of the traffic light. For example, when the traffic light display changes from green light to yellow light or from yellow light to red light, there may still be some The vehicle passes through the intersection, so it is difficult to accurately judge the specific light color before and after the traffic light jumps according to the driving conditions of the vehicle.

基于此,本申请实施例可先判断当前交通灯图像是否满足预设交通灯标注条件,如果满足,则可以基于交通灯显示情况和车辆行驶情况确定出交通灯标注数据,而对于未满足预设交通灯标注条件所产生的图像数据,则可以基于当前已标注的数据以及交通灯的变化规律通过倒推的方式得到。Based on this, the embodiment of the present application can first judge whether the current traffic light image satisfies the preset traffic light labeling conditions. If so, the traffic light labeling data can be determined based on the traffic light display and vehicle driving conditions. The image data generated by the traffic light labeling conditions can be obtained by inversion based on the currently marked data and the changing rules of the traffic lights.

在本申请的一些实施例中,所述交通灯图像包括第一交通灯图像和第二交通灯图像,所述第二交通灯图像在所述第一交通灯图像之前得到,所述根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯图像是否满足预设交通灯标注条件包括:根据所述第一交通灯图像对应的交通灯显示情况和车辆行驶情况,确定所述第一交通灯图像是否满足第一预设交通灯标注条件;在所述第一交通灯图像满足第一预设交通灯标注条件的情况下,确定所述第一交通灯图像对应的灯色检测结果;根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的交通灯显示情况,确定所述第二交通灯图像对应的灯色检测结果;根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果,确定所述第一交通灯图像和所述第二交通灯图像是否满足第二预设交通灯标注条件。In some embodiments of the present application, the traffic light image includes a first traffic light image and a second traffic light image, the second traffic light image is obtained before the first traffic light image, and according to the The traffic light display situation and the vehicle running situation, determining whether the traffic light image meets the preset traffic light labeling conditions includes: determining the second traffic light image according to the traffic light display situation and the vehicle running situation corresponding to the first traffic light image Whether a traffic light image satisfies the first preset traffic light labeling condition; if the first traffic light image satisfies the first preset traffic light labeling condition, determine the light color detection result corresponding to the first traffic light image ; According to the light color detection result corresponding to the first traffic light image and the traffic light display situation corresponding to the second traffic light image, determine the light color detection result corresponding to the second traffic light image; according to the first traffic light image The light color detection result corresponding to the traffic light image and the light color detection result corresponding to the second traffic light image, determine whether the first traffic light image and the second traffic light image meet the second preset traffic light labeling condition .

由于路端对于交通灯图像的检测是实时进行的,对于当前最新检测到的一部分交通灯图像即上述第一交通灯检测图像,可以先判断第一交通灯检测图像是否满足第一预设交通灯标注条件,第一预设交通灯标注条件可以理解为是基于车辆行驶情况和交通灯显示情况能够准确区分出一部分交通灯图像的具体灯色的情况,例如当交通灯的显示情况由红灯变为绿灯时,路口的车辆行驶情况往往会有较大变化,因此能够根据对应的车辆行驶动向准确识别这一情况。Since the detection of the traffic light image at the road end is carried out in real time, for a part of the newly detected traffic light images, that is, the above-mentioned first traffic light detection image, it can first be judged whether the first traffic light detection image satisfies the first preset traffic light detection image. Labeling conditions, the first preset traffic light labeling condition can be understood as the situation that the specific light color of a part of the traffic light image can be accurately distinguished based on the vehicle driving situation and the traffic light display situation, for example, when the traffic light display situation changes from red light to When the light is green, the driving conditions of the vehicles at the intersection often change greatly, so this situation can be accurately identified according to the corresponding vehicle driving movements.

因此,如果第一交通灯图像满足第一预设交通灯标注条件,此时已经能够确定出第一交通灯图像所对应的灯色检测结果,例如当前灯色跳变与上一次灯色跳变之间的交通灯图像对应的灯色应为红色,当前灯色跳变之后的交通灯图像对应的灯色应为绿色。而由于交通灯的灯色变化存在一定规律,例如通常是按照红灯-绿灯-黄灯-红灯……的顺序依次变化,因此在确定出第一交通灯图像的灯色之后,还可以基于上述第一交通灯图像所对应的灯色检测结果以及交通灯的灯色变化规律往前倒推出第二交通灯图像对应的灯色检测结果,第二交通灯图像可以是指上一次出现满足第一预设交通灯标注条件的交通灯图像之后尚未被标注的图像。Therefore, if the first traffic light image satisfies the first preset traffic light labeling condition, the light color detection result corresponding to the first traffic light image can be determined at this time, such as the current light color jump and the last light color jump The light color corresponding to the traffic light image between should be red, and the light color corresponding to the traffic light image after the current light color jump should be green. And because there is a certain rule in the change of the light color of the traffic light, for example, it usually changes in sequence according to the order of red light-green light-yellow light-red light..., so after the light color of the first traffic light image is determined, it can also be based on The light color detection result corresponding to the above first traffic light image and the light color change rule of the traffic light are backwardly deduced to the light color detection result corresponding to the second traffic light image. An image that has not been labeled after the traffic light image with preset traffic light labeling conditions.

在得到第一交通灯图像和第二交通灯图像对应的灯色检测结果后,还可以进一步确定第一交通灯图像和第二交通灯图像是否满足第二预设交通灯标注条件,第二预设交通灯标注条件主要用来判断不同交通灯的灯色显示时长是否符合正常的显示规律,当上述两个条件均满足时,则可以认为本次得到的第一交通灯图像和第二交通灯图像对应的灯色检测结果是准确的,可以作为交通灯标注数据使用。After obtaining the light color detection results corresponding to the first traffic light image and the second traffic light image, it can be further determined whether the first traffic light image and the second traffic light image meet the second preset traffic light labeling condition, the second preset The traffic light labeling condition is mainly used to judge whether the light color display duration of different traffic lights conforms to the normal display law. When the above two conditions are met, it can be considered that the first traffic light image and the second traffic light image obtained this time are The light color detection result corresponding to the image is accurate and can be used as traffic light labeling data.

在本申请的一些实施例中,所述根据所述第一交通灯图像对应的交通灯显示情况和车辆行驶情况,确定所述第一交通灯图像是否满足第一预设交通灯标注条件包括:根据所述第一交通灯图像对应的交通灯显示情况确定交通灯的灯色是否持续多帧相同,且根据所述车辆行驶情况确定对应的多帧目标车辆位置是否位于当前路段的停止线位置以内;若是,则在根据所述第一交通灯图像对应的交通灯显示情况确定交通灯的灯色发生跳变之后,根据所述车辆行驶情况确定对应的多帧目标车辆位置是否位于所述停止线位置以外;若是,则确定所述第一交通灯图像满足所述第一预设交通灯标注条件。In some embodiments of the present application, the determining whether the first traffic light image satisfies the first preset traffic light labeling condition according to the traffic light display situation and the vehicle driving situation corresponding to the first traffic light image includes: Determine whether the light color of the traffic light remains the same for multiple frames according to the traffic light display situation corresponding to the first traffic light image, and determine whether the corresponding multi-frame target vehicle position is within the stop line position of the current road section according to the vehicle driving situation If so, after determining that the light color of the traffic light jumps according to the traffic light display situation corresponding to the first traffic light image, determine whether the corresponding multi-frame target vehicle position is located at the stop line according to the vehicle driving situation If not, determine that the first traffic light image satisfies the first preset traffic light labeling condition.

本申请实施例的第一交通灯图像可以基于跳变情况划分为跳变前的第一交通灯图像和跳变后的第一交通灯图像,跳变前的第一交通灯图像对应的灯色持续多帧相同,此时判断其对应车道的车辆位置是否位于停止线以内没有驶出,如果是,则在经过经过一次灯色跳变后,跳变后的第一交通灯图像对应的车辆位置是否驶出停止线,如果是,说明跳变前的第一交通灯图像对应的交通灯图像的灯色应为红色,而跳变后的第一交通灯图像对应的交通灯图像的灯色应为绿色,继续往前追溯,跳变到红色之前的灯色应当为黄色。而如果灯色跳变与车辆行驶情况自相冲突,则认为可能出现了交通灯故障,向故障平台发送前后视频取证以便尽快维修。The first traffic light image in the embodiment of the present application can be divided into the first traffic light image before the jump and the first traffic light image after the jump based on the jump situation, and the light color corresponding to the first traffic light image before the jump If multiple frames continue to be the same, at this time, it is judged whether the vehicle position corresponding to the lane is within the stop line and has not driven out. If so, after a light color jump, the vehicle position corresponding to the first traffic light image after the jump Whether to drive out of the stop line, if yes, the light color of the traffic light image corresponding to the first traffic light image before the jump should be red, and the light color of the traffic light image corresponding to the first traffic light image after the jump should be red. is green, continue to trace forward, the light color before jumping to red should be yellow. And if the light color jump conflicts with the driving situation of the vehicle, it is considered that there may be a traffic light failure, and the front and rear video evidence is sent to the fault platform for repair as soon as possible.

上述实施例的原理在于,在红灯跳变为绿灯的过程中,对应车道的车辆行驶动向会发生较大变化,即由停止在路口停止线以前的行为转变为驶出停止线的行为,因此通过车辆行驶情况的变化能够准确区分出交通灯本次跳变前后的灯色,虽然不排除某些车辆违反交通规则闯红灯的情况,但基于大量数据的累积,大部分车辆的行驶情况是符合上述要求的。The principle of the above embodiment is that during the transition from a red light to a green light, the vehicle movement in the corresponding lane will change greatly, that is, the behavior of stopping before the stop line at the intersection will change to the behavior of driving out of the stop line. Changes in vehicle driving conditions can accurately distinguish the color of traffic lights before and after this jump. Although it is not ruled out that some vehicles violate traffic rules and run red lights, based on the accumulation of a large amount of data, the driving conditions of most vehicles are in line with the above. required.

在本申请的一些实施例中,所述根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果,确定所述第一交通灯图像和所述第二交通灯图像是否满足第二预设交通灯标注条件包括:根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果确定交通灯的灯色显示时长,所述交通灯的灯色显示时长包括红灯、绿灯和黄灯的灯色显示时长;若红灯的灯色显示时长以及绿灯的灯色显示时长均大于黄灯的灯色显示时长,则确定所述第一交通灯图像和所述第二交通灯图像满足第二预设交通灯标注条件。In some embodiments of the present application, the first traffic light image and the light color detection result corresponding to the second traffic light image are determined according to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image. Whether the second traffic light image satisfies the second preset traffic light labeling condition includes: determining the color of the traffic light according to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image The display duration of the light color, the display duration of the light color of the traffic light includes the display duration of the red light, the green light and the yellow light; display duration, it is determined that the first traffic light image and the second traffic light image satisfy a second preset traffic light labeling condition.

为了进一步提高交通灯检测的准确性,本申请实施例还可以进一步判断上述实施例得到的第一交通灯图像和第二交通灯图像的灯色检测结果是否满足第二预设交通灯标注条件。正常情况下,黄灯的显示时长一般仅有几秒,而红灯和绿灯的显示时长都会大于黄灯的显示时长,因此基于第一交通灯图像和第二交通灯图像的灯色检测结果可以对各个灯色的持续显示时长分别进行统计,如果统计得到的红灯和绿灯的显示时长都大于黄灯的显示时长,那么可以认为灯色检测结果是准确的,否则则认为交通灯可能出现故障,向故障平台发送前后视频取证以便尽快维修。In order to further improve the accuracy of traffic light detection, this embodiment of the present application may further determine whether the light color detection results of the first traffic light image and the second traffic light image obtained in the above embodiment meet the second preset traffic light labeling condition. Under normal circumstances, the display duration of a yellow light is generally only a few seconds, while the display duration of a red light and a green light are longer than that of a yellow light. Therefore, the light color detection result based on the first traffic light image and the second traffic light image can be The continuous display duration of each light color is counted separately. If the display duration of the red light and green light is greater than the display duration of the yellow light, it can be considered that the detection result of the light color is accurate, otherwise it is considered that the traffic light may be malfunctioning , Send before and after video to the faulty platform for evidence collection so as to repair as soon as possible.

本申请实施例还提供了一种交通灯图像标注装置200,如图2所示,提供了本申请实施例中一种交通灯图像标注装置的结构示意图,所述装置200包括:获取单元210、第一确定单元220、第二确定单元230以及标注单元240,其中:The embodiment of the present application also provides a traffic light image tagging device 200. As shown in FIG. 2, a schematic structural diagram of a traffic light image tagging device in the embodiment of the present application is provided. The first determination unit 220, the second determination unit 230, and the labeling unit 240, wherein:

获取单元210,用于获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果;An acquisition unit 210, configured to acquire a road image of the current road section and detect the road image to obtain a traffic light image and vehicle detection results;

第一确定单元220,用于根据所述交通灯图像确定交通灯显示情况,以及根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况;The first determining unit 220 is configured to determine the display condition of the traffic light according to the traffic light image, and determine the driving condition of the vehicle according to the traffic light image and the vehicle detection result;

第二确定单元230,用于根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据;The second determining unit 230 is configured to determine traffic light marking data according to the traffic light display conditions and the vehicle driving conditions;

标注单元240,用于利用所述交通灯标注数据对所述交通灯图像进行标注,得到交通灯图像标注结果。The labeling unit 240 is configured to use the traffic light labeling data to label the traffic light image to obtain a traffic light image labeling result.

在本申请的一些实施例中,所述获取单元210具体用于:获取当前路段对应的高精地图,以及高精地图与相机图像之间的对应关系;根据所述当前路段对应的高精地图以及所述高精地图与相机图像之间的对应关系,从所述道路图像中分割出所述交通灯图像。In some embodiments of the present application, the acquisition unit 210 is specifically configured to: acquire the high-precision map corresponding to the current road section, and the correspondence between the high-precision map and the camera image; according to the high-precision map corresponding to the current road section As well as the corresponding relationship between the high-precision map and the camera image, the traffic light image is segmented from the road image.

在本申请的一些实施例中,所述交通灯图像包括多帧交通灯图像,所述第一确定单元220具体用于:对多帧交通灯图像中的任意相邻两帧交通灯图像进行像素差分和处理;根据相邻两帧交通灯图像的像素差分和处理结果,确定灯色跳变情况和灯色显示时长,作为所述交通灯显示情况。In some embodiments of the present application, the traffic light image includes multiple frames of traffic light images, and the first determining unit 220 is specifically configured to: pixelate any two adjacent frames of traffic light images in the multiple frames of traffic light images Difference and processing: According to the pixel difference and processing results of two adjacent frames of traffic light images, determine the light color jump and the display duration of the light color as the traffic light display.

在本申请的一些实施例中,所述第一确定单元220具体用于:获取当前路段对应的高精地图,所述高精地图中包含车道与交通灯的对应关系;根据所述车道与交通灯的对应关系确定所述交通灯图像中的交通灯对应的车道;根据所述交通灯图像中的交通灯对应的车道以及所述车辆检测结果确定所述车道对应的目标车辆位置;根据所述目标车辆位置和当前路段的停止线位置确定所述车辆行驶情况。In some embodiments of the present application, the first determination unit 220 is specifically configured to: obtain a high-precision map corresponding to the current road segment, the high-precision map includes the correspondence between lanes and traffic lights; Determine the lane corresponding to the traffic light in the traffic light image according to the corresponding relationship of the lights; determine the target vehicle position corresponding to the lane according to the lane corresponding to the traffic light in the traffic light image and the vehicle detection result; The position of the target vehicle and the position of the stop line of the current road section determine the driving condition of the vehicle.

在本申请的一些实施例中,所述第二确定单元230具体用于:根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯图像是否满足预设交通灯标注条件;在所述交通灯图像满足所述预设交通灯标注条件的情况下,根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯标注数据。In some embodiments of the present application, the second determination unit 230 is specifically configured to: determine whether the traffic light image satisfies a preset traffic light labeling condition according to the traffic light display condition and the vehicle driving condition; When the traffic light image satisfies the preset traffic light labeling condition, the traffic light labeling data is determined according to the traffic light display condition and the vehicle driving condition.

在本申请的一些实施例中,所述交通灯图像包括第一交通灯图像和第二交通灯图像,所述第二交通灯图像在所述第一交通灯图像之前得到,所述第二确定单元230具体用于:根据所述第一交通灯图像对应的交通灯显示情况和车辆行驶情况,确定所述第一交通灯图像是否满足第一预设交通灯标注条件;在所述第一交通灯图像满足第一预设交通灯标注条件的情况下,确定所述第一交通灯图像对应的灯色检测结果;根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的交通灯显示情况,确定所述第二交通灯图像对应的灯色检测结果;根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果,确定所述第一交通灯图像和所述第二交通灯图像是否满足第二预设交通灯标注条件。In some embodiments of the present application, the traffic light image includes a first traffic light image and a second traffic light image, the second traffic light image is obtained before the first traffic light image, and the second determined Unit 230 is specifically configured to: determine whether the first traffic light image satisfies the first preset traffic light labeling condition according to the traffic light display situation and vehicle driving situation corresponding to the first traffic light image; When the light image satisfies the first preset traffic light labeling condition, determine the light color detection result corresponding to the first traffic light image; according to the light color detection result corresponding to the first traffic light image and the second traffic light According to the traffic light display situation corresponding to the light image, determine the light color detection result corresponding to the second traffic light image; according to the light color detection result corresponding to the first traffic light image and the light color corresponding to the second traffic light image As a result of the detection, it is determined whether the first traffic light image and the second traffic light image satisfy a second preset traffic light labeling condition.

在本申请的一些实施例中,所述第二确定单元230具体用于:根据所述第一交通灯图像对应的交通灯显示情况确定交通灯的灯色是否持续多帧相同,且根据所述车辆行驶情况确定对应的多帧目标车辆位置是否位于当前路段的停止线位置以内;若是,则在根据所述第一交通灯图像对应的交通灯显示情况确定交通灯的灯色发生跳变之后,根据所述车辆行驶情况确定对应的多帧目标车辆位置是否位于所述停止线位置以外;若是,则确定所述第一交通灯图像满足所述第一预设交通灯标注条件。In some embodiments of the present application, the second determination unit 230 is specifically configured to: determine whether the light color of the traffic light remains the same for multiple frames according to the traffic light display situation corresponding to the first traffic light image, and according to the Vehicle driving conditions determine whether the corresponding multi-frame target vehicle position is within the stop line position of the current road section; if so, after determining that the light color of the traffic light jumps according to the traffic light display situation corresponding to the first traffic light image, Determine whether the corresponding multi-frame target vehicle position is located outside the stop line position according to the vehicle driving condition; if so, determine that the first traffic light image satisfies the first preset traffic light labeling condition.

在本申请的一些实施例中,所述第二确定单元230具体用于:根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果确定交通灯的灯色显示时长,所述交通灯的灯色显示时长包括红灯、绿灯和黄灯的灯色显示时长;若红灯的灯色显示时长以及绿灯的灯色显示时长均大于黄灯的灯色显示时长,则确定所述第一交通灯图像和所述第二交通灯图像满足第二预设交通灯标注条件。In some embodiments of the present application, the second determining unit 230 is specifically configured to: determine the traffic light according to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image The light color display duration of the light, the light color display duration of the traffic light includes the light color display duration of red light, green light and yellow light; if the light color display duration of the red light and the light color display duration of the green light are greater than If the display time of the light color is long, it is determined that the first traffic light image and the second traffic light image meet the second preset traffic light labeling condition.

能够理解,上述交通灯图像标注装置,能够实现前述实施例中提供的交通灯图像标注方法的各个步骤,关于交通灯图像标注方法的相关阐释均适用于交通灯图像标注装置,此处不再赘述。It can be understood that the above-mentioned traffic light image tagging device can realize each step of the traffic light image tagging method provided in the foregoing embodiments, and relevant explanations about the traffic light image tagging method are applicable to the traffic light image tagging device, and will not be repeated here. .

图3是本申请的一个实施例电子设备的结构示意图。请参考图3,在硬件层面,该电子设备包括处理器,可选地还包括内部总线、网络接口、存储器。其中,存储器可能包含内存,例如高速随机存取存储器(Random-Access Memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少1个磁盘存储器等。当然,该电子设备还可能包括其他业务所需要的硬件。Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Please refer to FIG. 3 , at the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Wherein, the memory may include a memory, such as a high-speed random-access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Of course, the electronic device may also include hardware required by other services.

处理器、网络接口和存储器可以通过内部总线相互连接,该内部总线可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(PeripheralComponent Interconnect,外设部件互连标准)总线或EISA(Extended Industry StandardArchitecture,扩展工业标准结构)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图3中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。The processor, the network interface and the memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture, industry standard architecture) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnection standard) bus or an EISA (Extended Industry StandardArchitecture, extended industry standard architecture) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one double-headed arrow is used in FIG. 3 , but it does not mean that there is only one bus or one type of bus.

存储器,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可以包括内存和非易失性存储器,并向处理器提供指令和数据。Memory for storing programs. Specifically, the program may include program code, and the program code includes computer operation instructions. Storage, which can include internal memory and nonvolatile storage, provides instructions and data to the processor.

处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,在逻辑层面上形成交通灯图像标注装置。处理器,执行存储器所存放的程序,并具体用于执行以下操作:The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a traffic light image labeling device on a logical level. The processor executes the program stored in the memory, and is specifically used to perform the following operations:

获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果;Obtain a road image of the current road section and detect the road image to obtain a traffic light image and vehicle detection results;

根据所述交通灯图像确定交通灯显示情况,以及根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况;determining the traffic light display situation according to the traffic light image, and determining the vehicle driving situation according to the traffic light image and the vehicle detection result;

根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据;According to the display situation of the traffic light and the driving situation of the vehicle, determine the labeling data of the traffic light;

利用所述交通灯标注数据对所述交通灯图像进行标注,得到交通灯图像标注结果。Using the traffic light labeling data to label the traffic light image to obtain a traffic light image labeling result.

上述如本申请图1所示实施例揭示的交通灯图像标注装置执行的方法可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital SignalProcessor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。The method performed by the traffic light image labeling device disclosed in the above embodiment shown in FIG. 1 of the present application may be applied to or implemented by a processor. A processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. Above-mentioned processor can be general-purpose processor, comprises central processing unit (Central Processing Unit, CPU), network processor (Network Processor, NP) etc.; It can also be Digital Signal Processor (Digital Signal Processor, DSP), ASIC (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.

该电子设备还可执行图1中交通灯图像标注装置执行的方法,并实现交通灯图像标注装置在图1所示实施例的功能,本申请实施例在此不再赘述。The electronic device can also execute the method performed by the traffic light image tagging device in FIG. 1 , and realize the functions of the traffic light image tagging device in the embodiment shown in FIG. 1 , which will not be repeated in this embodiment of the present application.

本申请实施例还提出了一种计算机可读存储介质,该计算机可读存储介质存储一个或多个程序,该一个或多个程序包括指令,该指令当被包括多个应用程序的电子设备执行时,能够使该电子设备执行图1所示实施例中交通灯图像标注装置执行的方法,并具体用于执行:The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs include instructions, and when the instructions are executed by an electronic device including a plurality of application programs , the electronic device can be made to execute the method executed by the traffic light image tagging device in the embodiment shown in FIG. 1, and is specifically used to execute:

获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果;Obtain a road image of the current road section and detect the road image to obtain a traffic light image and vehicle detection results;

根据所述交通灯图像确定交通灯显示情况,以及根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况;determining the traffic light display situation according to the traffic light image, and determining the vehicle driving situation according to the traffic light image and the vehicle detection result;

根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据;According to the display situation of the traffic light and the driving situation of the vehicle, determine the labeling data of the traffic light;

利用所述交通灯标注数据对所述交通灯图像进行标注,得到交通灯图像标注结果。Using the traffic light labeling data to label the traffic light image to obtain a traffic light image labeling result.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. Memory is an example of computer readable media.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems or computer program products. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above descriptions are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims (11)

1.一种交通灯图像标注方法,其中,所述方法包括:1. A traffic light image labeling method, wherein the method comprises: 获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果;Obtain the road image of the current road section and detect the road image to obtain the traffic light image and vehicle detection results; 根据所述交通灯图像确定交通灯显示情况,以及根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况;determining the traffic light display situation according to the traffic light image, and determining the vehicle driving situation according to the traffic light image and the vehicle detection result; 根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据;According to the display situation of the traffic light and the driving situation of the vehicle, determine the labeling data of the traffic light; 利用所述交通灯标注数据对所述交通灯图像进行标注,得到交通灯图像标注结果。Using the traffic light labeling data to label the traffic light image to obtain a traffic light image labeling result. 2.如权利要求1所述方法,其中,所述获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果包括:2. The method according to claim 1, wherein said obtaining the road image of the current road section and detecting said road image, obtaining traffic light images and vehicle detection results comprises: 获取当前路段对应的高精地图,以及高精地图与相机图像之间的对应关系;Obtain the high-precision map corresponding to the current road section, and the correspondence between the high-precision map and the camera image; 根据所述当前路段对应的高精地图以及所述高精地图与相机图像之间的对应关系,从所述道路图像中分割出所述交通灯图像。The traffic light image is segmented from the road image according to the high-precision map corresponding to the current road section and the corresponding relationship between the high-precision map and the camera image. 3.如权利要求1所述方法,其中,所述交通灯图像包括多帧交通灯图像,所述根据所述交通灯图像确定交通灯显示情况包括:3. The method according to claim 1, wherein the traffic light image comprises a plurality of frames of traffic light images, and determining the traffic light display situation according to the traffic light images comprises: 对多帧交通灯图像中的任意相邻两帧交通灯图像进行像素差分和处理;Perform pixel difference and processing on any two adjacent frames of traffic light images in the multi-frame traffic light images; 根据相邻两帧交通灯图像的像素差分和处理结果,确定灯色跳变情况和灯色显示时长,作为所述交通灯显示情况。According to the pixel difference of two adjacent frames of traffic light images and the processing result, the light color jumping condition and the display duration of the light color are determined as the traffic light display condition. 4.如权利要求1所述方法,其中,所述根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况包括:4. The method according to claim 1, wherein said determining vehicle driving conditions according to said traffic light image and said vehicle detection result comprises: 获取当前路段对应的高精地图,所述高精地图中包含车道与交通灯的对应关系;Obtain the high-precision map corresponding to the current road section, and the high-precision map includes the corresponding relationship between the lane and the traffic light; 根据所述车道与交通灯的对应关系确定所述交通灯图像中的交通灯对应的车道;determining the lane corresponding to the traffic light in the traffic light image according to the correspondence between the lane and the traffic light; 根据所述交通灯图像中的交通灯对应的车道以及所述车辆检测结果确定所述车道对应的目标车辆位置;determining the position of the target vehicle corresponding to the lane according to the lane corresponding to the traffic light in the traffic light image and the vehicle detection result; 根据所述目标车辆位置和当前路段的停止线位置确定所述车辆行驶情况。The vehicle running condition is determined according to the target vehicle position and the stop line position of the current road section. 5.如权利要求1所述方法,其中,所述根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据包括:5. The method according to claim 1, wherein said determining traffic light labeling data according to said traffic light display conditions and said vehicle driving conditions comprises: 根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯图像是否满足预设交通灯标注条件;determining whether the traffic light image satisfies a preset traffic light labeling condition according to the traffic light display condition and the vehicle driving condition; 在所述交通灯图像满足所述预设交通灯标注条件的情况下,根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯标注数据。If the traffic light image satisfies the preset traffic light labeling condition, the traffic light labeling data is determined according to the traffic light display condition and the vehicle driving condition. 6.如权利要求5所述方法,其中,所述交通灯图像包括第一交通灯图像和第二交通灯图像,所述第二交通灯图像在所述第一交通灯图像之前得到,所述根据所述交通灯显示情况和所述车辆行驶情况,确定所述交通灯图像是否满足预设交通灯标注条件包括:6. The method of claim 5, wherein said traffic light image comprises a first traffic light image and a second traffic light image, said second traffic light image being obtained prior to said first traffic light image, said According to the display condition of the traffic light and the driving condition of the vehicle, determining whether the traffic light image satisfies the preset traffic light labeling condition includes: 根据所述第一交通灯图像对应的交通灯显示情况和车辆行驶情况,确定所述第一交通灯图像是否满足第一预设交通灯标注条件;Determining whether the first traffic light image satisfies a first preset traffic light labeling condition according to the traffic light display condition and the vehicle driving condition corresponding to the first traffic light image; 在所述第一交通灯图像满足第一预设交通灯标注条件的情况下,确定所述第一交通灯图像对应的灯色检测结果;If the first traffic light image satisfies a first preset traffic light labeling condition, determine a light color detection result corresponding to the first traffic light image; 根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的交通灯显示情况,确定所述第二交通灯图像对应的灯色检测结果;Determine the light color detection result corresponding to the second traffic light image according to the light color detection result corresponding to the first traffic light image and the traffic light display situation corresponding to the second traffic light image; 根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果,确定所述第一交通灯图像和所述第二交通灯图像是否满足第二预设交通灯标注条件。According to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image, determine whether the first traffic light image and the second traffic light image meet a second preset Set traffic light labeling conditions. 7.如权利要求6所述方法,其中,所述根据所述第一交通灯图像对应的交通灯显示情况和车辆行驶情况,确定所述第一交通灯图像是否满足第一预设交通灯标注条件包括:7. The method according to claim 6, wherein, according to the traffic light display conditions and vehicle driving conditions corresponding to the first traffic light image, it is determined whether the first traffic light image satisfies the first preset traffic light labeling Conditions include: 根据所述第一交通灯图像对应的交通灯显示情况确定交通灯的灯色是否持续多帧相同,且根据所述车辆行驶情况确定对应的多帧目标车辆位置是否位于当前路段的停止线位置以内;Determine whether the light color of the traffic light remains the same for multiple frames according to the traffic light display situation corresponding to the first traffic light image, and determine whether the corresponding multi-frame target vehicle position is within the stop line position of the current road section according to the vehicle driving situation ; 若是,则在根据所述第一交通灯图像对应的交通灯显示情况确定交通灯的灯色发生跳变之后,根据所述车辆行驶情况确定对应的多帧目标车辆位置是否位于所述停止线位置以外;If so, after determining that the light color of the traffic light jumps according to the traffic light display situation corresponding to the first traffic light image, determine whether the corresponding multi-frame target vehicle position is located at the stop line position according to the vehicle driving situation outside; 若是,则确定所述第一交通灯图像满足所述第一预设交通灯标注条件。If so, determine that the first traffic light image satisfies the first preset traffic light labeling condition. 8.如权利要求6所述方法,其中,所述根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果,确定所述第一交通灯图像和所述第二交通灯图像是否满足第二预设交通灯标注条件包括:8. The method according to claim 6, wherein the first traffic light is determined according to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image Whether the image and the second traffic light image meet the second preset traffic light labeling condition includes: 根据所述第一交通灯图像对应的灯色检测结果以及所述第二交通灯图像对应的灯色检测结果确定交通灯的灯色显示时长,所述交通灯的灯色显示时长包括红灯、绿灯和黄灯的灯色显示时长;According to the light color detection result corresponding to the first traffic light image and the light color detection result corresponding to the second traffic light image, the light color display duration of the traffic light is determined, and the light color display duration of the traffic light includes red light, red light, The display duration of the green and yellow lights; 若红灯的灯色显示时长以及绿灯的灯色显示时长均大于黄灯的灯色显示时长,则确定所述第一交通灯图像和所述第二交通灯图像满足第二预设交通灯标注条件。If the light color display duration of the red light and the light color display duration of the green light are both longer than the light color display duration of the yellow light, then it is determined that the first traffic light image and the second traffic light image satisfy the second preset traffic light label condition. 9.一种交通灯图像标注装置,其中,所述装置包括:9. A traffic light image labeling device, wherein the device comprises: 获取单元,用于获取当前路段的道路图像并对所述道路图像进行检测,得到交通灯图像和车辆检测结果;an acquisition unit, configured to acquire a road image of the current road section and detect the road image to obtain a traffic light image and a vehicle detection result; 第一确定单元,用于根据所述交通灯图像确定交通灯显示情况,以及根据所述交通灯图像和所述车辆检测结果确定车辆行驶情况;A first determining unit, configured to determine a traffic light display condition according to the traffic light image, and determine a vehicle running condition according to the traffic light image and the vehicle detection result; 第二确定单元,用于根据所述交通灯显示情况和所述车辆行驶情况,确定交通灯标注数据;A second determining unit, configured to determine traffic light marking data according to the traffic light display conditions and the vehicle driving conditions; 标注单元,用于利用所述交通灯标注数据对所述交通灯图像进行标注,得到交通灯图像标注结果。The labeling unit is configured to use the traffic light labeling data to label the traffic light image to obtain a traffic light image labeling result. 10.一种电子设备,包括:10. An electronic device comprising: 处理器;以及processor; and 被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行所述权利要求1~8之任一所述方法。A memory arranged to store computer-executable instructions which, when executed, cause the processor to perform the method of any one of claims 1-8. 11.一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行所述权利要求1~8之任一所述方法。11. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform The method according to any one of claims 1-8.
CN202211257407.3A 2022-10-14 2022-10-14 Traffic light image labeling method and device, electronic equipment and storage medium Pending CN115424220A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211257407.3A CN115424220A (en) 2022-10-14 2022-10-14 Traffic light image labeling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211257407.3A CN115424220A (en) 2022-10-14 2022-10-14 Traffic light image labeling method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115424220A true CN115424220A (en) 2022-12-02

Family

ID=84205503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211257407.3A Pending CN115424220A (en) 2022-10-14 2022-10-14 Traffic light image labeling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115424220A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116052119A (en) * 2023-01-09 2023-05-02 智道网联科技(北京)有限公司 Traffic light detection method, device, electronic device, and computer-readable storage medium
WO2024255801A1 (en) * 2023-06-16 2024-12-19 北京罗克维尔斯科技有限公司 End-to-end signal light recognition method and apparatus, and device, medium and vehicle

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109949594A (en) * 2019-04-29 2019-06-28 北京智行者科技有限公司 Real-time traffic light recognition method
CN112528926A (en) * 2020-12-21 2021-03-19 北京百度网讯科技有限公司 Method, device and equipment for detecting signal lamp image abnormity and storage medium
CN113920486A (en) * 2021-09-24 2022-01-11 阿波罗智联(北京)科技有限公司 Traffic light marking method, device, electronic equipment and roadside computing equipment
CN114613176A (en) * 2022-01-21 2022-06-10 北京佰才邦技术股份有限公司 Traffic information determination method, device and electronic device
CN114677657A (en) * 2022-02-17 2022-06-28 浙江大华技术股份有限公司 Signal light time-domain state detection method, model training method and related device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109949594A (en) * 2019-04-29 2019-06-28 北京智行者科技有限公司 Real-time traffic light recognition method
CN112528926A (en) * 2020-12-21 2021-03-19 北京百度网讯科技有限公司 Method, device and equipment for detecting signal lamp image abnormity and storage medium
CN113920486A (en) * 2021-09-24 2022-01-11 阿波罗智联(北京)科技有限公司 Traffic light marking method, device, electronic equipment and roadside computing equipment
CN114613176A (en) * 2022-01-21 2022-06-10 北京佰才邦技术股份有限公司 Traffic information determination method, device and electronic device
CN114677657A (en) * 2022-02-17 2022-06-28 浙江大华技术股份有限公司 Signal light time-domain state detection method, model training method and related device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116052119A (en) * 2023-01-09 2023-05-02 智道网联科技(北京)有限公司 Traffic light detection method, device, electronic device, and computer-readable storage medium
WO2024255801A1 (en) * 2023-06-16 2024-12-19 北京罗克维尔斯科技有限公司 End-to-end signal light recognition method and apparatus, and device, medium and vehicle

Similar Documents

Publication Publication Date Title
CN115424220A (en) Traffic light image labeling method and device, electronic equipment and storage medium
CN109949594A (en) Real-time traffic light recognition method
CN108520634A (en) High-speed ramp speed limit recognition method, device and electronic equipment
US20200143175A1 (en) Scenario detection apparatus and method
CN113468911B (en) Vehicle-mounted red light running detection method and device, electronic equipment and storage medium
EP3623993A1 (en) Method and device of multi-focal sensing of an obstacle and non-volatile computer-readable storage medium
CN109949573A (en) A vehicle violation monitoring method, device and system
CN114078212A (en) A method and device for accurate vehicle identification based on ETC gantry
CN115690716A (en) Lane change detection method and device, electronic equipment and storage medium
CN114494938A (en) A kind of non-motor vehicle behavior recognition method and related device
WO2024098992A1 (en) Vehicle reversing detection method and apparatus
CN112528944A (en) Image identification method and device, electronic equipment and storage medium
CN110766949A (en) Violation snapshot method and device
CN114861393B (en) Congested lane-changing simulation scenario evaluation method and related equipment
CN116168368A (en) A recognition method, system and storage medium for traffic lights
CN115042784A (en) Automobile adaptive cruise system control method, device, vehicle and storage medium
CN115206091A (en) Road condition and event monitoring system and method based on multi-camera and millimeter wave radar
CN115761670A (en) Street lamp fault detection method, device, electronic equipment, and storage medium
CN115620257A (en) Detection method, device, electronic equipment, and storage medium for road snow effects
CN116052119A (en) Traffic light detection method, device, electronic device, and computer-readable storage medium
CN116758736A (en) Method and device for detecting illegal stop and electronic equipment
CN115294216A (en) Method and device for detecting installation of road side camera, electronic equipment and storage medium
CN115861964A (en) Vehicle traffic light detection method, device, vehicle and storage medium
CN115761699A (en) Traffic signal lamp classification method and device and electronic equipment
CN115240432A (en) Traffic congestion detection method, device, electronic device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载