CN114638860A - Method, device and readable storage medium for tracking traffic signal - Google Patents
Method, device and readable storage medium for tracking traffic signal Download PDFInfo
- Publication number
- CN114638860A CN114638860A CN202210291109.XA CN202210291109A CN114638860A CN 114638860 A CN114638860 A CN 114638860A CN 202210291109 A CN202210291109 A CN 202210291109A CN 114638860 A CN114638860 A CN 114638860A
- Authority
- CN
- China
- Prior art keywords
- area
- traffic
- information
- determining
- traffic image
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/246—Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20048—Transform domain processing
- G06T2207/20056—Discrete and fast Fourier transform, [DFT, FFT]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30248—Vehicle exterior or interior
- G06T2207/30252—Vehicle exterior; Vicinity of vehicle
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Traffic Control Systems (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域technical field
本申请涉及图像处理技术领域,尤其涉及一种交通信号灯的跟踪方法、装置及可读存储介质。The present application relates to the technical field of image processing, and in particular, to a traffic signal tracking method, device and readable storage medium.
背景技术Background technique
交通信号灯作为一种信号标识,对交通的调控起到重要作用。为建设智慧城市,一般会在正对交通信号灯的设置区域内,设置一台电警摄像机,用于抓取车辆闯红灯等不规范行驶的图像(帧)。电警摄像机在抓取到图像后,需要首先判断图像中信号灯的状态才能进一步确定图像中车辆是否为不规范行驶状态。而电警摄像机抓取的图像(帧)分辨率大降低信号灯状态的判断效率,不能满足信号灯状态判断的实时性要求。那么,在进行信号灯状态判断之前,需要设置一个较小的感兴趣区域,用于电警摄像机判断信号灯状态。然而,由于电警摄像机和交通信号灯长期暴露在露天环境中,易受到大风或其它自然现象的影响,而发生偏移,这导致电警摄像机根据设置规则所选取的感兴趣区域中不包含信号灯,致使不能准确甚至无法进行信号灯状态判断。As a signal sign, traffic lights play an important role in the regulation of traffic. In order to build a smart city, an electric police camera is generally set up in the setting area facing the traffic lights to capture images (frames) of irregular driving such as vehicles running through red lights. After the electric police camera captures the image, it needs to first judge the status of the signal lights in the image to further determine whether the vehicle in the image is in an irregular driving state. However, the resolution of the images (frames) captured by the electric police camera greatly reduces the judgment efficiency of the signal light state, and cannot meet the real-time requirements of the signal light state judgment. Then, before judging the status of the signal light, a small area of interest needs to be set for the electric police camera to judge the status of the signal light. However, because the electric police cameras and traffic lights are exposed to the open air for a long time, they are easily affected by strong winds or other natural phenomena, and then shift, which leads to the fact that the area of interest selected by the electric police cameras according to the setting rules does not include signal lights. As a result, it cannot be accurately or even impossible to judge the status of the signal light.
因此,现有技术中存在,电警摄像机判断信号灯状态准确性低的问题。Therefore, in the prior art, there is a problem that the electric police camera has low accuracy in judging the state of the signal light.
发明内容SUMMARY OF THE INVENTION
本发申请提供了一种交通信号灯的跟踪方法、装置及可读存储介质,用以解决现有技术中判断信号灯状态准确性低的问题。The present application provides a traffic signal tracking method, device and readable storage medium, which are used to solve the problem of low accuracy in judging the status of the signal light in the prior art.
第一方面,本申请提供一种交通信号灯的跟踪方法,包括:In a first aspect, the present application provides a method for tracking traffic lights, including:
确定第一交通图像中交通信号灯所在第一区域的位置参数和第一特征参数;其中,所述第一区域包括第一交通图像中交通信号灯的中心点坐标,所述第一特征参数指示所述第一区域内像素点的灰度特征和梯度特征;Determine the position parameter and the first characteristic parameter of the first area where the traffic signal light is located in the first traffic image; wherein, the first area includes the coordinates of the center point of the traffic signal in the first traffic image, and the first characteristic parameter indicates the Grayscale features and gradient features of pixels in the first region;
基于所述第一特征参数,确定所述第一交通图像中第一区域的第一信息;其中,所述第一信息指示所述第一交通图像中,所述第一区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征;Based on the first characteristic parameter, determine the first information of the first area in the first traffic image; wherein, the first information indicates that each pixel in the first area in the first traffic image Grayscale features, gradient features, and the relationship between the grayscale of each pixel point and the grayscale of other pixel points;
基于所述第一区域的位置参数,确定第二交通图像中的第二区域,以及所述第二区域的第二信息;其中,所述第二区域包括所述中心点坐标,所述第二信息指示所述第二区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征;A second area in the second traffic image and second information of the second area are determined based on the location parameters of the first area; wherein the second area includes the coordinates of the center point, the second area The information indicates the grayscale feature and gradient feature of each pixel in the second area, and the relationship feature between the grayscale of each pixel and the grayscale of other pixels;
将所述第一信息作为模板,确定所述模板与所述第二信息的相关性,并确定所述相关性最大值对应像素点的所在位置为所述第二交通图像中信号灯的中心位置;其中,所述相关性指示所述第一交通图像中第一区域中所有像素点与所述第二交通图像中第二区域中所有像素点之间的相关性。Using the first information as a template, determine the correlation between the template and the second information, and determine that the position of the pixel corresponding to the maximum correlation value is the center position of the signal light in the second traffic image; Wherein, the correlation indicates the correlation between all the pixels in the first area in the first traffic image and all the pixels in the second area in the second traffic image.
上述方法通过预先提取第一交通图像中的位置参数以及第一特征参数得到第一信息作为模板,并将该模板与后续获取到的第二交通图像中第二区域的第二信息求相关性,进而确定了第二交通信号灯的中心坐标,达到了跟踪交通信号灯,以及时发现交通信号灯位置发生偏移的目的;从而避免了对交通信号灯状态判断失误或者无法判断的情况出现。The above method obtains the first information as a template by pre-extracting the position parameter and the first feature parameter in the first traffic image, and obtains the correlation between the template and the second information of the second area in the second traffic image obtained subsequently, Further, the center coordinates of the second traffic signal are determined, so as to track the traffic signal and find out the deviation of the position of the traffic signal in time, thereby avoiding the occurrence of misjudgment or inability to judge the status of the traffic signal.
一种可能的实施方式,所述确定所述模板与所述第二信息的相关性,包括:A possible implementation manner, the determining the correlation between the template and the second information includes:
基于目标跟踪算法和信号相关性原理,确定所述模板与所述第二信息的相关性;determining the correlation between the template and the second information based on the target tracking algorithm and the signal correlation principle;
将所述相关性中的最大值与设定阈值对比,当所述相关性中的最大值大于设定阈值,则确定交通信号灯跟踪成功。The maximum value in the correlation is compared with the set threshold, and when the maximum value in the correlation is greater than the set threshold, it is determined that the traffic signal tracking is successful.
一种可能的实施方式,所述确定第一交通图像中交通信号灯所在第一区域的位置参数和第一特征参数包括:A possible implementation manner, the determining the position parameter and the first characteristic parameter of the first area where the traffic signal light is located in the first traffic image includes:
将交通信号灯的外接矩形作为选择框,框选出所述第一交通图像中的所述第一区域;Using the circumscribed rectangle of the traffic light as a selection frame, frame the first area in the first traffic image;
确定所述第一区域的标准位置信息;其中,所述标准位置信息包括所述第一区域的中心点坐标;determining the standard location information of the first area; wherein the standard location information includes the coordinates of the center point of the first area;
提取设定数量的所述第一交通图像,在每一张所述第一交通图像中确定至少一个第一区域,并确定所述至少一个第一区域的位置信息是否与所述标准位置信息一致;Extracting a set number of the first traffic images, determining at least one first area in each of the first traffic images, and determining whether the location information of the at least one first area is consistent with the standard location information ;
若是,则将任一张所述第一交通图像中所述第一区域的位置信息作为所述第一区域的位置参数;并确定所述任一张第一交通图像中所述第一区域内所有像素点的灰度值、梯度值,得到所述第一区域的第一特征参数。If yes, take the position information of the first area in any one of the first traffic images as the location parameter of the first area; and determine the location within the first area in any of the first traffic images The gray value and gradient value of all pixel points are obtained to obtain the first characteristic parameter of the first region.
上述方法通过将第一交通图像中第一区域的位置信息与标准位置信息进行对比,可以确保在第一交通图像中所框选的第一区域为目标位置上的第一区域,从而提升了成功跟踪交通信号灯的概率。By comparing the position information of the first area in the first traffic image with the standard position information, the above method can ensure that the first area selected in the first traffic image is the first area on the target position, thereby improving the success of the method. Probability of tracking traffic lights.
一种可能的实施方式,所述第一信息M为:A possible implementation manner, the first information M is:
其中,λ为预设常数,σ为预设标准差参数,☉为点乘运算,F(·)为傅里叶变换,F-1(·)为傅里叶反变换,X为所述第一特征参数,X′为X的转置,w为所述第一区域的长,h为所述第一区域的宽,(i,j)为所述第一区域内的像素点坐标,(ic,jc)为所述第一区域内的中心像素点坐标。in, λ is a preset constant, σ is the preset standard deviation parameter, ☉ is the dot multiplication operation, F(·) is the Fourier transform, F −1 (·) is the inverse Fourier transform, X is the first characteristic parameter, and X′ is X The transpose of , w is the length of the first area, h is the width of the first area, (i, j) is the pixel coordinates in the first area, ( ic , j c ) is the The coordinates of the center pixel point in the first area.
一种可能的实施方式,所述确定所述相关性最大值对应像素点的所在位置为所述第二交通图像中信号灯的中心位置之后,包括:A possible implementation manner, after determining that the location of the pixel point corresponding to the maximum correlation value is the center position of the signal light in the second traffic image, the method includes:
利用所述第一交通图像中第一区域的长、宽,在所述第二交通图像中确定以所述第二交通图像中信号灯的中心位置为区域中心的第三区域;Using the length and width of the first area in the first traffic image, determine a third area in the second traffic image with the center position of the signal light in the second traffic image as the center of the area;
确定所述第三区域的第三信息;其中所述第三信息指示所述第三区域内每一个像素点灰度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征;Determine third information of the third area; wherein the third information indicates the grayscale feature of each pixel in the third area, and the relationship between the grayscale of each pixel and the grayscale of other pixels ;
分别将所述模板和所述第三信息与对应权重相乘并求和,得到第四信息,并基于所述第四信息更新所述模板用于下一帧交通图像中信号灯的跟踪。The template and the third information are respectively multiplied and summed with corresponding weights to obtain fourth information, and the template is updated based on the fourth information for the tracking of signal lights in the next frame of traffic images.
第二方面,本申请提供一种交通信号灯的跟踪装置,包括:In a second aspect, the present application provides a tracking device for a traffic signal, comprising:
参数单元:用于确定第一交通图像中交通信号灯所在第一区域的位置参数和第一特征参数;其中,所述第一区域包括第一交通图像中交通信号灯的中心点坐标,所述第一特征参数指示所述第一区域内像素点的灰度特征和梯度特征;Parameter unit: used to determine the position parameter and the first characteristic parameter of the first area where the traffic light is located in the first traffic image; wherein, the first area includes the coordinates of the center point of the traffic signal in the first traffic image, and the first The feature parameter indicates the grayscale feature and gradient feature of the pixel in the first region;
信息单元:用于基于所述第一特征参数,确定所述第一交通图像中第一区域的第一信息;其中,所述第一信息指示所述第一交通图像中,所述第一区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征;Information unit: used to determine the first information of the first area in the first traffic image based on the first characteristic parameter; wherein, the first information indicates that in the first traffic image, the first area The grayscale feature and gradient feature of each pixel, and the relationship feature between the grayscale of each pixel and the grayscale of other pixels;
确定单元:用于基于所述第一区域的位置参数,确定第二交通图像中的第二区域,以及所述第二区域的第二信息;其中,所述第二区域包括所述中心点坐标,所述第二信息指示所述第二区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征;Determining unit: for determining a second area in the second traffic image and second information of the second area based on the position parameter of the first area; wherein, the second area includes the coordinates of the center point , the second information indicates the grayscale feature and gradient feature of each pixel in the second area, and the relationship feature between the grayscale of each pixel and the grayscale of other pixels;
中心单元:用于将所述第一信息作为模板,确定所述模板与所述第二信息的相关性,并确定所述相关性最大值对应像素点的所在位置为所述第二交通图像中信号灯的中心位置;其中,所述相关性指示所述第一交通图像中第一区域中所有像素点与所述第二交通图像中第二区域中所有像素点之间的相关性。Central unit: used to use the first information as a template, determine the correlation between the template and the second information, and determine that the location of the pixel corresponding to the maximum correlation value is in the second traffic image. The center position of the signal light; wherein the correlation indicates the correlation between all the pixels in the first area in the first traffic image and all the pixels in the second area in the second traffic image.
一种可能的实施方式,所述中心单元具体用于基于目标跟踪算法和信号相关性原理,确定所述模板与所述第二信息的相关性;将所述相关性中的最大值与设定阈值对比,当所述相关性中的最大值大于设定阈值,则确定交通信号灯跟踪成功。A possible implementation manner, the central unit is specifically configured to determine the correlation between the template and the second information based on the target tracking algorithm and the signal correlation principle; Threshold value comparison, when the maximum value in the correlation is greater than the set threshold value, it is determined that the traffic signal tracking is successful.
一种可能的实施方式,所述参数单元具体用于将交通信号灯的外接矩形作为选择框,框选出所述第一交通图像中的所述第一区域;确定所述第一区域的标准位置信息;其中,所述标准位置信息包括所述第一区域的中心点坐标;提取设定数量的所述第一交通图像,在每一张所述第一交通图像中确定至少一个第一区域,并确定所述至少一个第一区域的位置信息是否与所述标准位置信息一致;若是,则将任一张所述第一交通图像中所述第一区域的位置信息作为所述第一区域的位置参数;并确定所述任一张第一交通图像中所述第一区域内所有像素点的灰度值、梯度值,得到所述第一区域的第一特征参数。A possible implementation manner, the parameter unit is specifically configured to use the circumscribed rectangle of the traffic signal as a selection box to select the first area in the first traffic image; determine the standard position of the first area information; wherein, the standard location information includes the coordinates of the center point of the first area; extracting a set number of the first traffic images, and determining at least one first area in each of the first traffic images, and determine whether the location information of the at least one first area is consistent with the standard location information; if so, use the location information of the first area in any one of the first traffic images as the location information of the first area. position parameters; and determine the grayscale values and gradient values of all pixels in the first area in any of the first traffic images to obtain the first feature parameters of the first area.
一种可能的实施方式,所述第一信息M为:A possible implementation manner, the first information M is:
其中,λ为预设常数,σ为预设标准差参数,☉为点乘运算,F(·)为傅里叶变换,F-1(·)为傅里叶反变换,X为所述第一特征参数,X′为X的转置,w为所述第一区域的长,h为所述第一区域的宽,(i,j)为所述第一区域内的像素点坐标,(ic,jc)为所述第一区域内的中心像素点坐标。in, λ is a preset constant, σ is the preset standard deviation parameter, ☉ is the dot multiplication operation, F(·) is the Fourier transform, F −1 (·) is the inverse Fourier transform, X is the first characteristic parameter, and X′ is X The transpose of , w is the length of the first area, h is the width of the first area, (i, j) is the pixel coordinates in the first area, ( ic , j c ) is the The coordinates of the center pixel point in the first area.
一种可能的实施方式,所述装置还包括更新单元,具体用于利用所述第一交通图像中第一区域的长、宽,在所述第二交通图像中确定以所述第二交通图像中信号灯的中心位置为区域中心的第三区域;确定所述第三区域的第三信息;其中所述第三信息指示所述第三区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征;分别将所述模板和所述第三信息与对应权重相乘并求和,得到第四信息,并基于所述第四信息更新所述模板用于下一帧交通图像中信号灯的跟踪。In a possible implementation manner, the device further includes an update unit, which is specifically configured to use the length and width of the first area in the first traffic image to determine the second traffic image in the second traffic image. The center position of the signal light in the middle is the third area in the center of the area; the third information of the third area is determined; wherein the third information indicates the grayscale characteristics, gradient characteristics of each pixel in the third area, and all Describe the relationship between the grayscale of each pixel point and the grayscale of other pixel points; multiply and sum the template and the third information and the corresponding weight respectively to obtain the fourth information, and update based on the fourth information The template is used for the tracking of traffic lights in the next frame of traffic images.
第三方面,本申请提供一种可读存储介质,包括,In a third aspect, the present application provides a readable storage medium, comprising,
存储器,memory,
所述存储器用于存储指令,当所述指令被处理器执行时,使得包括所述可读存储介质的装置完成如第一方面及任一种可能的实施方式所述的方法。The memory is used to store instructions that, when executed by a processor, cause an apparatus including the readable storage medium to perform the method according to the first aspect and any possible implementation manner.
附图说明Description of drawings
图1为本申请实施例提供的一种交通信号灯的跟踪方法的流程图;1 is a flowchart of a method for tracking traffic lights provided by an embodiment of the present application;
图2为本申请实施例提供的针对第一交通图像框选第一区域时,所使用的第一深度学习模型的示意图;2 is a schematic diagram of a first deep learning model used when a first area is framed for a first traffic image according to an embodiment of the present application;
图3位本申请实施例提供的使用交通信号灯的跟踪方法,对新的交通图像进行信号灯跟踪的示意图;FIG. 3 is a schematic diagram of tracking a signal light on a new traffic image by using a tracking method for a traffic signal provided by an embodiment of the present application;
图4为本申请实施例提供的一种交通信号灯的跟踪装置的结构示意图。FIG. 4 is a schematic structural diagram of a traffic signal light tracking device according to an embodiment of the present application.
具体实施方式Detailed ways
针对现有技术中电警摄像机判断信号灯状态准确性低的问题,本申请提出一种交通信号灯的跟踪方法:基于目标跟踪算法和信号相关性原理,通过追踪交通图像中交通信号灯中心的坐标,跟踪交通信号灯;从而解决了电警摄像机未察觉出交通信号灯偏移,仍然基于交通信号灯原始坐标进行信号灯状态判断,导致判断失误的问题。In view of the problem of low accuracy in judging the status of signal lights by electric police cameras in the prior art, the present application proposes a tracking method for traffic lights: based on target tracking algorithm and signal correlation principle, by tracking the coordinates of the center of traffic lights in traffic images, tracking Traffic lights; thus solving the problem that the electric police camera does not detect the deviation of the traffic lights, and still judges the status of the lights based on the original coordinates of the traffic lights, resulting in errors in judgment.
为了更好的理解上述技术方案,下面通过附图以及具体实施例对本申请技术方案做详细的说明,应当理解本申请实施例以及实施例中的具体特征是对本申请技术方案的详细的说明,而不是对本申请的技术方案的限定,在不冲突的情况下,本申请实施例以及实施例中的技术特征可以相互组合。In order to better understand the above technical solutions, the technical solutions of the present application will be described in detail below through the accompanying drawings and specific embodiments. It is not a limitation on the technical solutions of the present application, and the embodiments of the present application and the technical features in the embodiments may be combined with each other under the condition of no conflict.
请参考图1,本申请实施例提供一种交通信号灯的跟踪方法,解决现有技术中电警摄像机判断信号灯状态准确性低的问题,该方法具体包括以下实现步骤:Referring to FIG. 1 , an embodiment of the present application provides a method for tracking traffic lights, which solves the problem of low accuracy in judging the state of a signal light by an electric police camera in the prior art. The method specifically includes the following implementation steps:
步骤101:确定第一交通图像中交通信号灯所在第一区域的位置参数和第一特征参数。Step 101: Determine the position parameter and the first feature parameter of the first area where the traffic signal light is located in the first traffic image.
其中,第一区域包括第一交通图像中交通信号灯的中心点坐标,第一特征参数指示第一区域内像素点的灰度特征和梯度特征。Wherein, the first area includes the coordinates of the center point of the traffic signal in the first traffic image, and the first feature parameter indicates the grayscale feature and gradient feature of the pixel in the first area.
具体地,为了加快图像处理效率,在获取第一交通图像后,可以通过第一深度学习模型先框选出包括交通信号灯中心点的第一区域,再对第一区域进行处理。第一深度学习模型可以为单阶段的目标检测模型,该模型包括骨干网络、增强网络和检测网络。如图2所示,在骨干网络中,可以设置CSP(Cross Stage Partial Network,跨阶段部分网络)残差结构提取第一交通图像的高维特征。在CSP结构中可以设置5个阶段,每个阶段均对第一交通图像进行采样,并且比上一阶段的分辨率减小一倍,通道数扩充一倍;直到第5阶段,对第一交通图像采样的分辨率减小至13倍,同时通道扩展到512倍。在增强网络中,可以设置PAN(Path Aggregation Network,路径聚合网络)结构,在PAN结构中,设置自上而下和自下而上两条路径进行特征提取以及特征聚合,通过第一函数、第二函数、第三函数将抽象的高层特征和具体的底层特征进行深度融合,这样可以进一步提高骨干网络所表达图像特征的准确性。进一步地,可以将增强网络中所获取到的,第一交通图像特征输入到检测网络中,检测网络中包括第一数据头、第二数据头、第三数据头,通过检测网络得到第一区域的特征参数,该特征参数可以是第一区域的位置坐标;该位置坐标可以包括但不限于以下信息:第一区域的中心坐标、第一区域的宽高、信号灯状态以及置信度;其中置信度指示所判断出的信号灯状态的准确率。进一步地,将上述位置坐标作为位置参数,并根据该第一区域的位置参数就可以达到在第一交通图像中框选第一区域的目的。Specifically, in order to speed up the image processing efficiency, after the first traffic image is acquired, the first area including the center point of the traffic signal can be framed and selected by the first deep learning model, and then the first area is processed. The first deep learning model may be a single-stage object detection model, which includes a backbone network, an augmentation network, and a detection network. As shown in Figure 2, in the backbone network, a CSP (Cross Stage Partial Network) residual structure can be set to extract high-dimensional features of the first traffic image. In the CSP structure, 5 stages can be set, each stage samples the first traffic image, and the resolution is doubled compared to the previous stage, and the number of channels is doubled; until the fifth stage, the first traffic image is sampled. The resolution of image sampling is reduced by a factor of 13, while the channels are expanded by a factor of 512. In the enhanced network, a PAN (Path Aggregation Network) structure can be set. In the PAN structure, two paths, top-down and bottom-up, are set for feature extraction and feature aggregation. The second function and the third function deeply fuse the abstract high-level features with the specific low-level features, which can further improve the accuracy of the image features expressed by the backbone network. Further, the first traffic image features obtained in the enhanced network can be input into the detection network, the detection network includes the first data header, the second data header, and the third data header, and the first area is obtained through the detection network. The characteristic parameters of the first area, the characteristic parameters may be the position coordinates of the first area; the position coordinates may include but are not limited to the following information: the center coordinates of the first area, the width and height of the first area, the status of the signal lights, and the confidence level; the confidence level Indicates the accuracy of the judged signal status. Further, the above-mentioned position coordinates are used as position parameters, and the purpose of frame selection of the first area in the first traffic image can be achieved according to the position parameters of the first area.
进一步地,在对第一区域进行特征提取之前,可以对第一深度学习模型进行训练,以避免第一深度学习模型出现错误,导致在第一交通图像中框选出错误的第一区域。本申请实施例中提供一种训练方法为:首先,将交通信号灯的外接矩形作为选择框,框选出所述第一交通图像中的所述第一区域。然后,确定所述第一区域的标准位置信息;其中,所述标准位置信息包括所述第一区域的中心点坐标。该标准位置信息可以是框选出的设定数量的,第一交通图像中的第一区域的平均值。需要说明的是,对于第一交通图像的提取,可以是连续提取,也可以是每隔设置时间提取,直到提取够设定数量的第一交通图像。例如,例如,设置该设定数量为200,使用第一深度学习模型,针对这200张第一交通图像,框选第一区域并求取第一区域宽长比平均值为1.0;同时,对每一个第一区域的中心点坐标中的横、纵坐标分别求平均值,确定第一区域的中心点坐标为(50,40)。那么,就可以在标准位置信息中设置宽长比区间为(0.8~1.2),中心点坐标为(50,40)。最后,连续提取设定数量的所述第一交通图像,在所述设定数量的第一交通图像中确定至少一个第一区域,并确定所述至少一个第一区域的位置信息是否与所述标准位置信息一致。若否,则表示该第一深度学习模型的参数还需要进一步调整、优化。若是,则将任一张第一交通图像中所述第一区域的位置信息作为所述第一区域的位置参数;并确定所述任一张第一交通图像中所述第一区域内所有像素点的灰度值、梯度值,得到所述第一区域的第一特征参数。其中,确定该至少一个第一区域的位置信息是否与标准位置信息一致时,所采用的方法可以是直接对比中心点坐标是否满足误差要求;也可以通过求交并比,并将交并比与设置阈值进行对比确定。Further, before the feature extraction is performed on the first area, the first deep learning model may be trained to avoid errors in the first deep learning model, resulting in frame selection of the wrong first area in the first traffic image. A training method provided in the embodiment of the present application is as follows: first, the circumscribing rectangle of a traffic signal light is used as a selection frame, and the first area in the first traffic image is selected. Then, the standard location information of the first area is determined; wherein, the standard location information includes the coordinates of the center point of the first area. The standard location information may be the average value of the first area in the first traffic image of a set number selected by the box. It should be noted that, the extraction of the first traffic images may be continuous extraction, or may be extracted every set time until a set number of first traffic images are extracted. For example, for example, set the set number to 200, use the first deep learning model, select the first area in a box for these 200 first traffic images, and calculate the average width to length ratio of the first area as 1.0; The horizontal and vertical coordinates in the coordinates of the center point of each first region are averaged respectively, and the coordinates of the center point of the first region are determined to be (50, 40). Then, the width-length ratio interval can be set as (0.8-1.2) in the standard position information, and the coordinates of the center point are (50, 40). Finally, a set number of the first traffic images are continuously extracted, at least one first area is determined in the set number of first traffic images, and it is determined whether the location information of the at least one first area is consistent with the The standard location information is consistent. If not, it means that the parameters of the first deep learning model need to be further adjusted and optimized. If yes, use the location information of the first area in any first traffic image as the location parameter of the first area; and determine all the pixels in the first area in the any first traffic image The gray value and gradient value of the point are obtained to obtain the first characteristic parameter of the first region. Wherein, when determining whether the position information of the at least one first area is consistent with the standard position information, the method used may be to directly compare whether the coordinates of the center point meet the error requirements; or to calculate the intersection and ratio, and compare the intersection ratio with Set a threshold for comparison determination.
值得注意的是,上述第一交通图像中框选包括交通信号灯的第一区域适用但不局限于交通信号灯中红、绿、黄中的任一种颜色灯的第一区域的框选。对于交通信号灯颜色的识别,可以在上述检测网络中设置识别规则,即将骨干网络中所获取到的图像特征通过识别规则映射为分类信息以及对应的置信度,将置信度最大且置信度超过阈值的分类信息确定为第一区域中交通信号灯的类型。其中,分类信息指交通信号灯的颜色信息。这样确定交通信号灯的类型(颜色类型),可以提升辅助电警摄像机进行车辆闯红灯等违规违法行为的照片取证的效率和准确性。It is worth noting that the frame selection in the above-mentioned first traffic image includes the first area of the traffic signal light, but is not limited to the frame selection of the first area of the red, green and yellow lights in the traffic signal. For the identification of the color of traffic lights, identification rules can be set in the above detection network, that is, the image features obtained in the backbone network are mapped to classification information and corresponding confidence levels through the identification rules, and the confidence level is the largest and the confidence level exceeds the threshold. The classification information is determined as the type of traffic lights in the first area. The classification information refers to color information of traffic lights. Determining the type (color type) of the traffic light in this way can improve the efficiency and accuracy of photo forensics of the auxiliary electric police camera for illegal acts such as vehicle running through a red light.
进一步地,在框选出正确的第一区域以后,就可以确定第一区域的位置参数和第一特征参数。其中,第一区域的位置参数的表示方法可以基于第一区域的形状确定。当第一区域的形状为圆形时,则位置参数可以基于中心点坐标和半径表示。当第一区域的形状为正方形时,则位置参数可以基于四个顶点的坐标表示,也可以基于中心点坐标以及该中心点到四个顶点的距离表示。而第一特征参数指示第一区域内像素点的灰度特征和梯度特征;此处梯度特征可以通过第一区域内像素点之间的差值特征表示。以下提供第一区域内像素点灰度特征、梯度特征的确定方法:Further, after the correct first region is selected by the box, the position parameter and the first characteristic parameter of the first region can be determined. Wherein, the representation method of the position parameter of the first region may be determined based on the shape of the first region. When the shape of the first area is a circle, the position parameter may be expressed based on the coordinates of the center point and the radius. When the shape of the first area is a square, the position parameter may be expressed based on the coordinates of the four vertices, or may be expressed based on the coordinates of the center point and the distance from the center point to the four vertices. The first feature parameter indicates the grayscale feature and the gradient feature of the pixel points in the first region; here, the gradient feature can be represented by the difference feature between the pixel points in the first region. The following provides methods for determining the grayscale features and gradient features of pixels in the first region:
假设第一区域中任一像素点的坐标为(i,j),则坐标为(i,j)的像素点的灰度特征I的计算方法为:Assuming that the coordinate of any pixel in the first area is (i, j), the calculation method of the grayscale feature I of the pixel whose coordinate is (i, j) is:
其中,floor()为向下取整函数,r、g、b分别对应于图像的三个通道数据。Among them, floor() is a round-down function, and r, g, and b correspond to the three channel data of the image, respectively.
梯度特征G的计算方法为:The calculation method of gradient feature G is:
Gi(i,j)=I(i+1,j)-I(i-1,j);G i (i,j)=I(i+1,j)-I(i-1,j);
Gj(i,j)=I(i,j+1)-I(i,j-1);G j (i,j)=I(i,j+1)-I(i,j-1);
其中,Gi为行方向上的梯度,Gj为列方向上的梯度,G为第一区域中坐标为(i,j)像素点梯度值。Among them, Gi is the gradient in the row direction, Gj is the gradient in the column direction, and G is the gradient value of the pixel point whose coordinates are (i, j) in the first region.
由此可见,梯度特征可以用于表示第一区域中灰度的变化特征。灰度特征和梯度特征均由第一区域中所有像素点的灰度特征、梯度特征组成,即第一区域的灰度特征和梯度特征均表现为矩阵形式。It can be seen that the gradient feature can be used to represent the change feature of the gray level in the first region. Both the grayscale feature and the gradient feature are composed of grayscale features and gradient features of all pixels in the first region, that is, the grayscale features and gradient features of the first region are both expressed in matrix form.
根据灰度特征和梯度特征,就可以确定像素点(i,j)的第一特征参数X为:According to the grayscale feature and the gradient feature, the first feature parameter X of the pixel point (i, j) can be determined as:
X(i,j)=I(i,j)+G(i,j);X(i,j)=I(i,j)+G(i,j);
同理,通过上式可以计算出第一区域的中每个像素点第一特征参数,则第一区域中所有像素点的第一特征参数所构成的矩阵即可以表示第一区域的第一特征参数。In the same way, the first characteristic parameter of each pixel in the first area can be calculated by the above formula, and the matrix formed by the first characteristic parameter of all the pixels in the first area can represent the first characteristic of the first area. parameter.
步骤102:基于所述第一特征参数,确定所述第一交通图像中第一区域的第一信息。Step 102: Determine the first information of the first area in the first traffic image based on the first characteristic parameter.
其中,所述第一信息指示所述第一交通图像中,所述第一区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征。The first information indicates, in the first traffic image, the grayscale feature and gradient feature of each pixel in the first area, and the relationship between the grayscale of each pixel and the grayscales of other pixels feature.
具体地,本申请实施例中设置第一信息为目标模板,第一信息M为:Specifically, in the embodiment of the present application, the first information is set as the target template, and the first information M is:
其中,λ为预设常数,σ为预设标准差参数,☉为点乘运算,F(·)为傅里叶变换,F-1(·)为傅里叶反变换,X为所述第一特征参数,X′为X的转置,w为所述第一区域的长,h为所述第一区域的宽,(i,j)为所述第一区域内的像素点坐标,(ic,jc)为所述第一区域内的中心像素点坐标。上式中使用傅里叶变换可以起到提升计算效率的效果。in, λ is a preset constant, σ is the preset standard deviation parameter, ☉ is the dot multiplication operation, F(·) is the Fourier transform, F −1 (·) is the inverse Fourier transform, X is the first characteristic parameter, and X′ is X The transpose of , w is the length of the first area, h is the width of the first area, (i, j) is the pixel coordinates in the first area, ( ic , j c ) is the The coordinates of the center pixel point in the first area. The use of Fourier transform in the above formula can improve the computational efficiency.
步骤103:基于所述第一区域的位置参数,确定第二交通图像中的第二区域,以及所述第二区域的第二信息。Step 103: Determine a second area in the second traffic image and second information of the second area based on the location parameter of the first area.
其中,所述第二区域包括所述中心点坐标,所述第二信息指示所述第二区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征。Wherein, the second area includes the coordinates of the center point, and the second information indicates the grayscale characteristics and gradient characteristics of each pixel in the second area, as well as the grayscale of each pixel and other pixels in the second area. Grayscale relational features.
具体地,根据第一区域的位置参数,可以在第二交通图像中定位同样位置的第二区域,并参考步骤102的方法,提取第二区域的特征参数,基于第二区域的特征参数,就可以确定第二区域的第二信息M2。Specifically, according to the position parameters of the first area, a second area at the same position can be located in the second traffic image, and referring to the method of
步骤104:将所述第一信息作为模板,确定所述模板与所述第二信息的相关性,并确定所述相关性最大值对应像素点的所在位置为所述第二交通图像中信号灯的中心位置。Step 104: Using the first information as a template, determine the correlation between the template and the second information, and determine that the location of the pixel corresponding to the maximum correlation value is the position of the signal light in the second traffic image. Central location.
其中,所述相关性指示所述第一交通图像中第一区域中所有像素点与所述第二交通图像中第二区域中所有像素点之间的相关性。Wherein, the correlation indicates the correlation between all the pixels in the first area in the first traffic image and all the pixels in the second area in the second traffic image.
具体地,本申请实施例中,可以通过目标跟踪算法和信号相关性原理,确定模板和第二信息的相关性。基于目标跟踪算法和信号相关性原理,相关性的响应可以使用以下公式:Specifically, in this embodiment of the present application, the correlation between the template and the second information can be determined by using the target tracking algorithm and the principle of signal correlation. Based on the target tracking algorithm and the principle of signal correlation, the response of the correlation can use the following formula:
其中,为第二区域的第二特征参数,为相关性响应图所对应的高斯分布矩阵。in, is the second characteristic parameter of the second region, is the Gaussian distribution matrix corresponding to the correlation response map.
根据高斯分布信号从交通信号灯中心处开始向四周衰减的原理;以及目标跟踪算法和信号相关性:使用高斯核计算相邻两帧之间的相关性,取响应最大的点,即相关性最大值对应的像素点为预测的目标中心的原理。本申请实施例中,将第一交通图像中的第一区域作为模板,在该模板中交通信号灯中心与第一区域的中心点重合。那么,确定第一区域与第二交通图像中第二区域响应最大的点,实际上是在第二区域中确定这样一个像素点:该像素点与第一区域中点(即交通信号灯中点)像素特征、梯度特征一致,并且该像素点的特征强度与区域内其他像素点特征强度之间的衰减关系,与第一区域中位于中心位置上像素点与区域内其它像素点特征强度关系一致。进一步地,在第二区域的高斯分布矩阵中值最大的元素为相关性最大值;若该值大于设定阈值,则确定交通信号灯跟踪成功。那么,该值所对应的像素点的所在位置为所述第二交通图像中信号灯的中心位置。若该值不大于设定阈值,则确定交通信号灯跟踪失败,第二区域中不包括交通信号灯的中心,则重新调整第一深度学习模型,以获取包括交通信号灯中心的第二区域。According to the principle that the Gaussian distribution signal starts to decay from the center of the traffic light to the surrounding area; as well as the target tracking algorithm and signal correlation: use the Gaussian kernel to calculate the correlation between two adjacent frames, and take the point with the largest response, that is, the maximum correlation value The principle that the corresponding pixel point is the predicted target center. In the embodiment of the present application, the first area in the first traffic image is used as a template, and in the template, the center of the traffic signal coincides with the center point of the first area. Then, to determine the point with the largest response between the first area and the second area in the second traffic image, it is actually to determine such a pixel point in the second area: the pixel point and the midpoint of the first area (that is, the midpoint of the traffic signal) The pixel features and gradient features are consistent, and the attenuation relationship between the feature intensity of the pixel and the feature intensities of other pixels in the region is consistent with the feature intensity relationship between the pixel at the center position in the first region and other pixels in the region. Further, the Gaussian distribution matrix in the second region The element with the largest median value is the maximum correlation value; if the value is greater than the set threshold, it is determined that the traffic light tracking is successful. Then, the position of the pixel corresponding to this value is the center position of the signal light in the second traffic image. If the value is not greater than the set threshold, it is determined that the traffic signal tracking fails, and the center of the traffic signal is not included in the second area, and the first deep learning model is readjusted to obtain the second area including the center of the traffic signal.
进一步地,当交通信号灯跟踪成功,且确定该交通信号灯发生偏移,则可以更新上述模板(即第一信息),从而达到避免电警摄像机因为交通信号灯的偏移出现判断不准确的问题。本申请实施例中提出更新模板的方式为:首先,利用所述第一交通图像中第一区域的长、宽,在所述第二交通图像中确定以所述第二交通图像中信号灯的中心位置为区域中心的第三区域。Further, when the traffic light is tracked successfully and it is determined that the traffic light is deviated, the above template (ie, the first information) can be updated, thereby avoiding the problem of inaccurate judgment by the electric police camera due to the deviation of the traffic light. The method proposed in the embodiment of the present application for updating the template is as follows: first, using the length and width of the first area in the first traffic image, determine the center of the signal light in the second traffic image in the second traffic image The location is the third area in the center of the area.
然后,确定所述第三区域的第三信息;其中所述第三信息指示所述第三区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征。接着,分别将上述模板和所述第三信息与对应权重相乘并求和,得到第四信息,并基于所述第四信息更新上述模板,该更新的模板就可以用于下一帧交通图像中信号灯的跟踪。Then, determine the third information of the third area; wherein the third information indicates the grayscale feature and gradient feature of each pixel in the third area, and the grayscale of each pixel and other pixels in the third area Grayscale relational features. Next, multiply and sum the above template and the third information and the corresponding weights respectively to obtain fourth information, and update the above template based on the fourth information, and the updated template can be used for the next frame of traffic images Tracking of traffic lights.
例如,假设第二交通图像中交通信号灯的中心坐标为(iy,jy),则第三信息M*为:For example, assuming that the center coordinates of the traffic lights in the second traffic image are (i y , j y ), the third information M * is:
其中,λ为预设常数,σ为预设标准差参数,☉为点乘运算,F(·)为傅里叶变换,F-1(·)为傅里叶反变换,X*为所述第一特征参数,X*′为X*的转置,w为所述第三区域的长,h为第三区域的宽。此处第三区域的长和宽与第一区域、第二区域的长、宽一致。in, λ is a preset constant, σ is the preset standard deviation parameter, ☉ is the dot product operation, F( ) is the Fourier transform, F -1 ( ) is the inverse Fourier transform, X * is the first characteristic parameter, X * ' is the transpose of X * , w is the length of the third region, and h is the width of the third region. Here, the length and width of the third area are consistent with the length and width of the first area and the second area.
则更新的第一特征参数为:X=(1-β)*X+β*X*;Then the updated first characteristic parameter is: X=(1-β)*X+β*X * ;
更新的第一信息为:M=(1-β)*M+β*M*。The updated first information is: M=(1-β)*M+β*M * .
进一步地,基于步骤101~104所描述的交通信号灯的跟踪方法,以下针对新的交通图像中信号灯的跟踪进行举例描述,请参考图3:Further, based on the method for tracking traffic lights described in
假设在溪谷十字路口交通信号灯的正对面,设置一电警摄像机,该电警摄像机用于针对交通信号灯进行跟踪,并确定跟踪到的交通信号灯的状态,从而确定车辆的违规/违章行为进行取证。本申请实施例中第一交通图像的第一信息(模板)可以是,基于第一区域确定的相关滤波器,用于和新的目标做相关后,确定响应最高的点为目标位置,即相关性最大值所对应的像素点为目标的中心点。那么,在获取到新的交通图像以后,首先需要确定深度学习模型所框选出的检测区域是否正确。该确定方法包括但不限于,将检测区域的位置信息、状态参数和标准位置信息,标准状态信息做对比。即对比检测区域中交通信号灯的颜色是否和标准状态信息一致,以及对比检测区域中交通信号灯的中心坐标、检测区域长宽比和标准位置信息一致。若不一致,则重新提取下一帧图像进行确定,若仍然不一致,则确定需要调整深度学习模型和/或标准位置信息,即在确定深度学习模型的模型参数后,重新确定标准位置信息、标准状态信息;即执行步骤101~103。若一致,则进行初始化,提取检测区域的第二信息(基于当前跟踪器的形状参数、特征参数,确定当前跟踪器的相关滤波器),和之前交通图像的第一区域的模板(即第一信息)求相关性,以确定检测区域中的交通信号灯的中心位置,进而确定交通信号灯是否发生偏移。即基于目标跟踪算法和信号相关性原理,将第一区域的相关滤波器作为模板,使用该区域信息和第一区域的相关滤波器求相关性,就可以确定最大响应位置,即相关性最大值所对应的像素点为新的交通图像中信号灯的中心点。那么,基于该最大响应位置就可以更新矩形框的位置,即信号灯所在区域的位置参数。该新的矩形框位置可以用于获取到的下一帧的交通图像信息,并准确获取信号灯的状态变化,避免交通信号灯溢出目标区域,造成交通信号灯状态判断失误或者无法判断的情况出现。Assume that an electric police camera is set directly opposite the traffic light at the intersection of the valley. The electric police camera is used to track the traffic light and determine the status of the tracked traffic light, so as to determine the violation/violation of the vehicle for evidence collection. . The first information (template) of the first traffic image in the embodiment of the present application may be a correlation filter determined based on the first area, which is used to determine the point with the highest response as the target position after correlating with the new target, that is, the correlation filter The pixel corresponding to the maximum value is the center point of the target. Then, after acquiring a new traffic image, it is first necessary to determine whether the detection area framed by the deep learning model is correct. The determination method includes, but is not limited to, comparing the location information, state parameters, and standard location information and standard state information of the detection area. That is, whether the color of the traffic lights in the detection area is consistent with the standard status information, and whether the center coordinates of the traffic lights in the detection area, the aspect ratio of the detection area, and the standard location information are consistent. If it is inconsistent, re-extract the next frame of image for determination. If it is still inconsistent, it is determined that the deep learning model and/or standard position information need to be adjusted, that is, after the model parameters of the deep learning model are determined, the standard position information and standard state are re-determined. information; that is, steps 101 to 103 are executed. If they are consistent, perform initialization to extract the second information of the detection area (determine the correlation filter of the current tracker based on the shape parameters and feature parameters of the current tracker), and the template of the first area of the previous traffic image (that is, the first information) to correlate to determine the center position of the traffic light in the detection area, and then to determine whether the traffic light is offset. That is, based on the target tracking algorithm and the principle of signal correlation, the correlation filter of the first area is used as a template, and the information of this area and the correlation filter of the first area are used to obtain the correlation, and the maximum response position, that is, the maximum correlation value, can be determined. The corresponding pixel is the center point of the signal light in the new traffic image. Then, based on the maximum response position, the position of the rectangular frame, that is, the position parameter of the area where the signal light is located, can be updated. The new rectangular frame position can be used to obtain the traffic image information of the next frame, and accurately obtain the state change of the signal light, so as to avoid the traffic light overflowing the target area, resulting in the error or inability to judge the status of the traffic signal.
基于同一发明构思,本申请实施例中提供一种交通信号灯的跟踪装置,该装置与前述图1所示交通信号灯的跟踪方法对应,该装置的具体实施方式可参见前述方法实施例部分的描述,重复之处不再赘述,参见图4,该装置包括:Based on the same inventive concept, an embodiment of the present application provides a traffic signal light tracking device, which corresponds to the aforementioned traffic signal light tracking method shown in FIG. Repeated places will not be repeated. Referring to Figure 4, the device includes:
参数单元401:用于确定第一交通图像中交通信号灯所在第一区域的位置参数和第一特征参数;其中,所述第一区域包括第一交通图像中交通信号灯的中心点坐标,所述第一特征参数指示所述第一区域内像素点的灰度特征和梯度特征。Parameter unit 401: used to determine the position parameter and the first characteristic parameter of the first area where the traffic light is located in the first traffic image; wherein, the first area includes the coordinates of the center point of the traffic light in the first traffic image, and the first A feature parameter indicates grayscale features and gradient features of pixels in the first region.
具体地,将交通信号灯的外接矩形作为选择框,框选出所述第一交通图像中的所述第一区域;确定所述第一区域的标准位置信息;其中,所述标准位置信息包括所述第一区域的中心点坐标;提取设定数量的所述第一交通图像,在每一张所述第一交通图像中确定至少一个第一区域,并确定所述至少一个第一区域的位置信息是否与所述标准位置信息一致;若是,则将任一张所述第一交通图像中所述第一区域的位置信息作为所述第一区域的位置参数;并确定所述任一张第一交通图像中所述第一区域内所有像素点的灰度值、梯度值,得到所述第一区域的第一特征参数。Specifically, the circumscribed rectangle of the traffic signal light is used as a selection box, and the first area in the first traffic image is selected; standard location information of the first area is determined; wherein, the standard location information includes all the coordinates of the center point of the first area; extract a set number of the first traffic images, determine at least one first area in each of the first traffic images, and determine the position of the at least one first area Whether the information is consistent with the standard location information; if so, take the location information of the first area in any one of the first traffic images as the location parameter of the first area; The gray values and gradient values of all pixels in the first area in a traffic image are used to obtain the first characteristic parameters of the first area.
信息单元402:用于基于所述第一特征参数,确定所述第一交通图像中第一区域的第一信息;其中,所述第一信息指示所述第一交通图像中,所述第一区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征。Information unit 402: used to determine first information of a first area in the first traffic image based on the first feature parameter; wherein the first information indicates that in the first traffic image, the first The grayscale feature and gradient feature of each pixel in the area, and the relationship feature between the grayscale of each pixel and the grayscale of other pixels.
具体地,第一信息M为:Specifically, the first information M is:
其中,λ为预设常数,σ为预设标准差参数,☉为点乘运算,F(·)为傅里叶变换,F-1(·)为傅里叶反变换,X为所述第一特征参数,X′为X的转置,w为所述第一区域的长,h为所述第一区域的宽,(i,j)为所述第一区域内的像素点坐标,(ic,jc)为所述第一区域内的中心像素点坐标。in, λ is a preset constant, σ is the preset standard deviation parameter, ☉ is the dot multiplication operation, F(·) is the Fourier transform, F −1 (·) is the inverse Fourier transform, X is the first characteristic parameter, and X′ is X The transpose of , w is the length of the first area, h is the width of the first area, (i, j) is the pixel coordinates in the first area, ( ic , j c ) is the The coordinates of the center pixel point in the first area.
确定单元403:用于基于所述第一区域的位置参数,确定第二交通图像中的第二区域,以及所述第二区域的第二信息;其中,所述第二区域包括所述中心点坐标,所述第二信息指示所述第二区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征。Determining unit 403: for determining a second area in the second traffic image and second information of the second area based on the position parameter of the first area; wherein the second area includes the center point The second information indicates the grayscale feature and gradient feature of each pixel in the second region, and the relationship feature between the grayscale of each pixel and the grayscale of other pixels.
中心单元404:用于将所述第一信息作为模板,确定所述模板与所述第二信息的相关性,并确定所述相关性最大值对应像素点的所在位置为所述第二交通图像中信号灯的中心位置;其中,所述相关性指示所述第一交通图像中第一区域中所有像素点与所述第二交通图像中第二区域中所有像素点之间的相关性。Central unit 404: used to use the first information as a template, determine the correlation between the template and the second information, and determine the location of the pixel corresponding to the maximum correlation value as the second traffic image The center position of the signal light in the middle; wherein, the correlation indicates the correlation between all the pixels in the first area in the first traffic image and all the pixels in the second area in the second traffic image.
所述中心单元具体用于基于目标跟踪算法和信号相关性原理,确定所述模板与所述第二信息的相关性;将所述相关性中的最大值与设定阈值对比,当所述相关性中的最大值大于设定阈值,则确定交通信号灯跟踪成功。The central unit is specifically configured to determine the correlation between the template and the second information based on the target tracking algorithm and the signal correlation principle; If the maximum value in the property is greater than the set threshold, it is determined that the traffic light tracking is successful.
所述交通信号灯的跟踪装置还包括更新单元,具体用于利用所述第一交通图像中第一区域的长、宽,在所述第二交通图像中确定以所述第二交通图像中信号灯的中心位置为区域中心的第三区域;确定所述第三区域的第三信息;其中所述第三信息指示所述第三区域内每一个像素点灰度特征、梯度特征,以及所述每一个像素点灰度与其它像素点灰度的关系特征;分别将所述模板和所述模板与对应权重相乘并求和,得到第四信息,并基于所述第四信息更新所述模板用于下一帧交通图像中信号灯的跟踪。The traffic signal tracking device further includes an update unit, which is specifically configured to use the length and width of the first area in the first traffic image to determine in the second traffic image the signal light in the second traffic image. The center position is the third area in the center of the area; the third information of the third area is determined; wherein the third information indicates the grayscale feature and gradient feature of each pixel in the third area, and each of the The relationship between the grayscale of a pixel point and the grayscale of other pixel points; the template and the template are respectively multiplied and summed with the corresponding weights to obtain fourth information, and the template is updated based on the fourth information for Tracking of traffic lights in the next frame of traffic image.
基于同一发明构思,本申请实施例还提供一种可读存储介质,包括:Based on the same inventive concept, an embodiment of the present application also provides a readable storage medium, including:
存储器,memory,
所述存储器用于存储指令,当所述指令被处理器执行时,使得包括所述可读存储介质的装置完成如上所述的交通信号灯的跟踪方法。The memory is used for storing instructions which, when executed by the processor, cause the apparatus including the readable storage medium to complete the traffic signal tracking method as described above.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of the description, only the division of the above-mentioned functional modules is used for illustration. In practical applications, the above-mentioned functions can be allocated to different functional modules as required. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the system, apparatus and unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
在本发明所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:通用串行总线闪存盘(Universal Serial Bus flash disk)、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: Universal Serial Bus flash disk (Universal Serial Bus flash disk), mobile hard disk, Read-Only Memory (ROM), Random Access Memory (Random Access Memory, RAM), magnetic disk Or various media such as optical discs that can store program codes.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210291109.XA CN114638860B (en) | 2022-03-23 | 2022-03-23 | Traffic signal light tracking method, device and readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210291109.XA CN114638860B (en) | 2022-03-23 | 2022-03-23 | Traffic signal light tracking method, device and readable storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114638860A true CN114638860A (en) | 2022-06-17 |
| CN114638860B CN114638860B (en) | 2025-02-07 |
Family
ID=81950469
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210291109.XA Active CN114638860B (en) | 2022-03-23 | 2022-03-23 | Traffic signal light tracking method, device and readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114638860B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116189439A (en) * | 2023-05-05 | 2023-05-30 | 成都市青羊大数据有限责任公司 | Urban Intelligent Management System |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5640200A (en) * | 1994-08-31 | 1997-06-17 | Cognex Corporation | Golden template comparison using efficient image registration |
| CN110532903A (en) * | 2019-08-12 | 2019-12-03 | 浙江大华技术股份有限公司 | A kind of method and apparatus of traffic lights image procossing |
| CN111292531A (en) * | 2020-02-06 | 2020-06-16 | 北京百度网讯科技有限公司 | Tracking method, device and equipment of traffic signal lamp and storage medium |
| CN113748315A (en) * | 2018-12-27 | 2021-12-03 | 北京嘀嘀无限科技发展有限公司 | System for automatic lane marking |
-
2022
- 2022-03-23 CN CN202210291109.XA patent/CN114638860B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5640200A (en) * | 1994-08-31 | 1997-06-17 | Cognex Corporation | Golden template comparison using efficient image registration |
| CN113748315A (en) * | 2018-12-27 | 2021-12-03 | 北京嘀嘀无限科技发展有限公司 | System for automatic lane marking |
| CN110532903A (en) * | 2019-08-12 | 2019-12-03 | 浙江大华技术股份有限公司 | A kind of method and apparatus of traffic lights image procossing |
| CN111292531A (en) * | 2020-02-06 | 2020-06-16 | 北京百度网讯科技有限公司 | Tracking method, device and equipment of traffic signal lamp and storage medium |
Non-Patent Citations (3)
| Title |
|---|
| XUE YUAN 等: "Robust Traffic Sign Recognition Based on Color Global and Local Oriented Edge Magnitude Patterns", IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, vol. 15, no. 4, 5 May 2014 (2014-05-05), pages 1466 - 1477, XP011555231, DOI: 10.1109/TITS.2014.2298912 * |
| 曹再辉;施进发;孙建华;宗思生;: "基于感兴趣区域提取与双过滤器的交通标志检测算法", 电子测量与仪器学报, no. 05, 15 May 2018 (2018-05-15), pages 112 - 120 * |
| 王浩;: "彩色图像视觉目标区域轨迹点跟踪方法", 周口师范学院学报, no. 02, 15 March 2020 (2020-03-15), pages 134 - 138 * |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116189439A (en) * | 2023-05-05 | 2023-05-30 | 成都市青羊大数据有限责任公司 | Urban Intelligent Management System |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114638860B (en) | 2025-02-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20220092882A1 (en) | Living body detection method based on facial recognition, and electronic device and storage medium | |
| CN112016569B (en) | Attention mechanism-based object detection method, network, device and storage medium | |
| CN107944450B (en) | License plate recognition method and device | |
| CN111754519B (en) | Class activation mapping-based countermeasure method | |
| CN108875600A (en) | A kind of information of vehicles detection and tracking method, apparatus and computer storage medium based on YOLO | |
| CN110008867A (en) | A kind of early warning method, device and storage medium based on abnormal behavior of people | |
| CN108681693A (en) | Licence plate recognition method based on trusted area | |
| CN114387591A (en) | License plate recognition method, system, device and storage medium | |
| CN113822352B (en) | Infrared dim target detection method based on multi-feature fusion | |
| CN112215190A (en) | Illegal building detection method based on YOLOV4 model | |
| CN115424032B (en) | Object detection model training methods, equipment, and computer-readable storage media | |
| CN110263654A (en) | A kind of flame detecting method, device and embedded device | |
| CN108681735A (en) | Optical character recognition method based on convolutional neural networks deep learning model | |
| CN111368682A (en) | A method and system for station logo detection and recognition based on faster RCNN | |
| CN105426895A (en) | Prominence detection method based on Markov model | |
| CN114399729A (en) | Monitoring object movement identification method, system, terminal and storage medium | |
| CN111814562A (en) | Vehicle identification method, vehicle identification model training method and related device | |
| CN119399158A (en) | A method, device and equipment for detecting defects on concrete joint surfaces | |
| CN116311214B (en) | License plate recognition method and device | |
| CN110633712A (en) | Method, system and device for recognizing vehicle body color and computer readable medium | |
| CN114638860A (en) | Method, device and readable storage medium for tracking traffic signal | |
| CN110969104B (en) | Method, system and storage medium for detecting drivable area based on binary network | |
| US12315173B2 (en) | Image processing system, image processing method, and storage medium for associating moving objects in images | |
| CN116863458A (en) | License plate recognition method, device, system and storage medium | |
| Bikmullina et al. | Stand for development of tasks of detection and recognition of objects on image |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |



























