CN112069969A - A method and system for cross-mirror vehicle tracking in expressway surveillance video - Google Patents
A method and system for cross-mirror vehicle tracking in expressway surveillance video Download PDFInfo
- Publication number
- CN112069969A CN112069969A CN202010897531.0A CN202010897531A CN112069969A CN 112069969 A CN112069969 A CN 112069969A CN 202010897531 A CN202010897531 A CN 202010897531A CN 112069969 A CN112069969 A CN 112069969A
- Authority
- CN
- China
- Prior art keywords
- vehicle
- image
- target
- tracking
- detection 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
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000001514 detection method Methods 0.000 claims abstract description 198
- 238000012544 monitoring process Methods 0.000 claims abstract description 8
- 238000000605 extraction Methods 0.000 claims description 37
- 239000011159 matrix material Substances 0.000 claims description 33
- 238000005070 sampling Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000012549 training Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/52—Surveillance or monitoring of activities, e.g. for recognising suspicious objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/40—Scenes; Scene-specific elements in video content
- G06V20/41—Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/40—Scenes; Scene-specific elements in video content
- G06V20/46—Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Multimedia (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机视觉图像技术领域,尤其涉及一种高速公路监控视频跨镜车辆跟踪方法及系统。The invention relates to the technical field of computer vision images, in particular to a method and system for tracking a vehicle across mirrors in a highway surveillance video.
背景技术Background technique
目前,高速公路监控系统越来越完善,摄像头布设也越来越密集,但高速公路仍是最容易发生事故的地方,究其原因是高速公路车速快,大车多,监控摄像头发挥作用有限。At present, the highway monitoring system is getting more and more perfect, and the cameras are more and more densely arranged, but the highway is still the most prone to accidents. The reason is that the highway speed is fast, there are many large vehicles, and the surveillance cameras are limited.
现有的跨镜车辆再识别技术都是基于已经标注好的数据集,虽然随着高质量数据集的更新发布,车辆的重识别技术也得到了进一步的发展,但数据集场景有限,算法模型局限性较强,在实际场景中难以实施且算法的适用性较低。The existing cross-mirror vehicle re-identification technology is based on the data sets that have been labeled. Although the vehicle re-identification technology has been further developed with the update and release of high-quality data sets, the data set scenarios are limited, and the algorithm model It has strong limitations, it is difficult to implement in practical scenarios and the applicability of the algorithm is low.
发明内容SUMMARY OF THE INVENTION
鉴于上述的分析,本发明实施例旨在提供一种高速公路监控视频跨镜车辆跟踪方法及系统,用以解决现有的跨镜车辆跟踪方法在实际场景中实施困难较大且算法的适用性较低的问题。In view of the above analysis, the embodiments of the present invention aim to provide a method and system for cross-mirror vehicle tracking in expressway surveillance video, so as to solve the problem that the existing cross-mirror vehicle tracking method is difficult to implement in actual scenarios and the algorithm is applicable. lower problem.
一方面,本发明实施例提供了一种高速公路监控视频跨镜车辆跟踪方法,包括如下步骤:On the one hand, an embodiment of the present invention provides a method for tracking a vehicle across a mirror in a highway surveillance video, including the following steps:
获取待监测高速公路多个摄像头视频文件中的帧图像,基于改进的YOLO目标检测模型对每张帧图像进行车辆检测得到包含有完整车辆矩形框的车辆检测图像;Obtain frame images from multiple camera video files of the highway to be monitored, and perform vehicle detection on each frame image based on the improved YOLO target detection model to obtain a vehicle detection image containing a complete vehicle rectangular frame;
将所述车辆检测图像输入多目标跟踪模型得到车辆跟踪结果;所述车辆跟踪结果包括车辆ID和车辆轨迹;Inputting the vehicle detection image into a multi-target tracking model to obtain a vehicle tracking result; the vehicle tracking result includes a vehicle ID and a vehicle trajectory;
根据所述车辆检测图像和车辆跟踪结果建立车辆信息数据库;Establish a vehicle information database according to the vehicle detection image and the vehicle tracking result;
基于所述车辆信息数据库中任一摄像头编号对应的某一车辆检测图像截取目标车辆图像,并根据所述车辆信息数据库匹配目标车辆图像对应的目标车辆的运动轨迹,实现跨镜跟踪。The target vehicle image is intercepted based on a vehicle detection image corresponding to any camera number in the vehicle information database, and the motion track of the target vehicle corresponding to the target vehicle image is matched according to the vehicle information database to realize cross-mirror tracking.
进一步,所述改进的YOLO目标检测模型包括特征提取网络层和YOLO检测层;其中,所述特征提取网络层包括stem单元和OSA单元;Further, the improved YOLO target detection model includes a feature extraction network layer and a YOLO detection layer; wherein, the feature extraction network layer includes a stem unit and an OSA unit;
stem单元,用于对所述高速公路多个摄像头视频文件中的帧图像进行下采样,得到尺寸为304*304*128的图像;The stem unit is used for down-sampling the frame images in the video files of the multiple cameras of the expressway to obtain an image with a size of 304*304*128;
OSA单元,用于对输入尺寸为304*304*128的图像进行卷积,获得尺寸为19*19*512的图像;The OSA unit is used to convolve an image with an input size of 304*304*128 to obtain an image with a size of 19*19*512;
YOLO检测层,用于根据所述OSA单元输出的尺寸为19*19*512的图像,获得包含有完整车辆矩形框的车辆检测图像。The YOLO detection layer is used to obtain a vehicle detection image containing a complete vehicle rectangular frame according to the image with a size of 19*19*512 output by the OSA unit.
进一步,所述多目标跟踪模型包括运动预测单元和深度外观特征提取单元:Further, the multi-target tracking model includes a motion prediction unit and a depth appearance feature extraction unit:
所述运动预测单元,用于根据上一帧车辆检测图像预测得到当前帧车辆预测图像;The motion prediction unit is used for predicting the vehicle prediction image of the current frame according to the vehicle detection image of the previous frame;
所述深度外观特征提取单元包括重识别网络,基于输入所述重识别网络的车辆检测图像及车辆预测图像,得到车辆轨迹,并对所述车辆轨迹进行编号,得到与车辆轨迹对应的车辆ID。The deep appearance feature extraction unit includes a re-identification network, obtains a vehicle trajectory based on the vehicle detection image and the vehicle prediction image input to the re-identification network, and numbers the vehicle trajectory to obtain a vehicle ID corresponding to the vehicle trajectory.
进一步,根据所述车辆跟踪结果建立车辆信息数据库具体包括:基于摄像头编号及车辆ID将车辆检测图像及车辆轨迹存储至数据库得到车辆信息数据库。Further, establishing the vehicle information database according to the vehicle tracking result specifically includes: storing the vehicle detection image and the vehicle trajectory in the database based on the camera number and the vehicle ID to obtain the vehicle information database.
进一步,基于所述车辆信息数据库中任一摄像头编号对应的某一车辆检测图像截取目标车辆图像,并根据所述车辆信息数据库匹配目标车辆图像对应的目标车辆的运动轨迹,实现跨镜跟踪,包括如下步骤:Further, the target vehicle image is intercepted based on a vehicle detection image corresponding to any camera number in the vehicle information database, and the motion trajectory of the target vehicle corresponding to the target vehicle image is matched according to the vehicle information database to realize cross-mirror tracking, including: Follow the steps below:
获取所述车辆信息数据库中任一摄像头编号对应的某一车辆检测图像,并截取目标车辆图像;Obtain a vehicle detection image corresponding to any camera number in the vehicle information database, and intercept the target vehicle image;
基于所述目标车辆图像及其他摄像头编号对应的某一车辆检测图像,分别获得目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵;Based on the target vehicle image and a certain vehicle detection image corresponding to other camera numbers, respectively obtain a depth feature matrix of the target vehicle image and a depth feature matrix of a vehicle detection image corresponding to other camera numbers;
基于所述目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵,利用所述重识别网络获得目标车辆与其他摄像头编号对应的某一车辆检测图像中车辆的余弦相似度距离;Based on the depth feature matrix of the target vehicle image and the depth feature matrix of a vehicle detection image corresponding to other camera numbers, the re-identification network is used to obtain the cosine of the vehicle in the target vehicle and a vehicle detection image corresponding to other camera numbers similarity distance;
将所述余弦相似度距离按照摄像头编号进行归类并排序,得到相同摄像头编号对应的最小余弦相似度距离;Classify and sort the cosine similarity distance according to the camera number to obtain the minimum cosine similarity distance corresponding to the same camera number;
判断所述最小余弦相似度距离是否小于相似度阈值,若是,则相应所述车辆检测图像中的车辆为目标车辆,若否,判断目标车辆驶离待监测高速公路;Judging whether the minimum cosine similarity distance is less than the similarity threshold, if so, the vehicle in the corresponding vehicle detection image is the target vehicle, if not, judging that the target vehicle has left the highway to be monitored;
基于所述车辆检测图像对应的摄像头编号及车辆ID匹配所述车辆信息数据库,得到目标车辆的运动轨迹,实现跨镜跟踪。Based on the camera number and vehicle ID corresponding to the vehicle detection image, the vehicle information database is matched to obtain the motion trajectory of the target vehicle, thereby realizing cross-mirror tracking.
另一方面,本发明实施例提供了一种高速公路监控视频跨镜车辆跟踪系统,包括:On the other hand, an embodiment of the present invention provides a cross-mirror vehicle tracking system for highway surveillance video, including:
检测模块,用于获取待监测高速公路多个摄像头视频文件中的帧图像,基于改进的YOLO目标检测模型对每张帧图像进行车辆检测得到包含有完整车辆矩形框的车辆检测图像;The detection module is used to obtain frame images in the video files of multiple cameras on the highway to be monitored, and based on the improved YOLO target detection model, vehicle detection is performed on each frame image to obtain a vehicle detection image containing a complete vehicle rectangular frame;
跟踪模块,用于将所述车辆检测图像输入多目标跟踪模型得到车辆跟踪结果;所述车辆跟踪结果包括车辆ID和车辆轨迹;a tracking module for inputting the vehicle detection image into a multi-target tracking model to obtain a vehicle tracking result; the vehicle tracking result includes a vehicle ID and a vehicle trajectory;
车辆信息数据库获得模块,用于根据所述车辆检测图像和车辆跟踪结果建立车辆信息数据库;a vehicle information database obtaining module, used for establishing a vehicle information database according to the vehicle detection image and the vehicle tracking result;
运动轨迹获得模块,用于根据所述车辆信息数据库中任一摄像头编号对应的某一车辆检测图像截取目标车辆图像,并根据所述车辆信息数据库匹配目标车辆图像对应的目标车辆的运动轨迹,实现跨镜跟踪。The motion trajectory obtaining module is used to intercept the target vehicle image according to a vehicle detection image corresponding to any camera number in the vehicle information database, and match the motion trajectory of the target vehicle corresponding to the target vehicle image according to the vehicle information database to achieve Tracking across mirrors.
进一步,所述检测模块包括特征提取网络层和YOLO检测层;其中,所述特征提取网络层包括stem单元和OSA单元;Further, the detection module includes a feature extraction network layer and a YOLO detection layer; wherein, the feature extraction network layer includes a stem unit and an OSA unit;
stem单元,用于对所述高速公路多个摄像头视频文件中的帧图像进行下采样,得到尺寸为304*304*128的图像;The stem unit is used for down-sampling the frame images in the video files of the multiple cameras of the expressway to obtain an image with a size of 304*304*128;
OSA单元,用于对输入尺寸为304*304*128的图像进行卷积,获得尺寸为19*19*512的图像;The OSA unit is used to convolve an image with an input size of 304*304*128 to obtain an image with a size of 19*19*512;
YOLO检测层,用于根据所述OSA单元输出的尺寸为19*19*512的图像,获得包含有完整车辆矩形框的车辆检测图像。The YOLO detection layer is used to obtain a vehicle detection image containing a complete vehicle rectangular frame according to the image with a size of 19*19*512 output by the OSA unit.
进一步,所述跟踪模块包括运动预测单元和深度外观特征提取单元:Further, the tracking module includes a motion prediction unit and a depth appearance feature extraction unit:
所述运动预测单元,用于根据上一帧车辆检测图像预测得到当前帧车辆预测图像;The motion prediction unit is used for predicting the vehicle prediction image of the current frame according to the vehicle detection image of the previous frame;
所述深度外观特征提取单元包括重识别网络,基于输入所述重识别网络的车辆检测图像及车辆预测图像,得到车辆轨迹,并对所述车辆轨迹进行编号,得到与车辆轨迹对应的车辆ID。The deep appearance feature extraction unit includes a re-identification network, obtains a vehicle trajectory based on the vehicle detection image and the vehicle prediction image input to the re-identification network, and numbers the vehicle trajectory to obtain a vehicle ID corresponding to the vehicle trajectory.
进一步,所述车辆信息数据库获得模块根据摄像头编号及车辆ID将车辆检测图像及车辆轨迹存储至数据库得到车辆信息数据库。Further, the vehicle information database obtaining module stores the vehicle detection image and the vehicle track in the database according to the camera number and the vehicle ID to obtain the vehicle information database.
进一步,所述运动轨迹获得模块执行下述流程:Further, the motion trajectory obtaining module executes the following process:
获取所述车辆信息数据库中任一摄像头编号对应的某一车辆检测图像,并截取目标车辆图像;Obtain a vehicle detection image corresponding to any camera number in the vehicle information database, and intercept the target vehicle image;
基于所述目标车辆图像及其他摄像头编号对应的某一车辆检测图像,分别获得目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵;Based on the target vehicle image and a certain vehicle detection image corresponding to other camera numbers, respectively obtain a depth feature matrix of the target vehicle image and a depth feature matrix of a vehicle detection image corresponding to other camera numbers;
基于所述目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵,利用所述重识别网络获得目标车辆与其他摄像头编号对应的某一车辆检测图像中车辆的余弦相似度距离;Based on the depth feature matrix of the target vehicle image and the depth feature matrix of a vehicle detection image corresponding to other camera numbers, the re-identification network is used to obtain the cosine of the vehicle in the target vehicle and a vehicle detection image corresponding to other camera numbers similarity distance;
将所述余弦相似度距离按照摄像头编号进行归类并排序,得到相同摄像头编号对应的最小余弦相似度距离;Classify and sort the cosine similarity distance according to the camera number to obtain the minimum cosine similarity distance corresponding to the same camera number;
判断所述最小余弦相似度距离是否小于相似度阈值,若是,则相应所述车辆检测图像中的车辆为目标车辆,若否,判断目标车辆驶离待监测高速公路;Judging whether the minimum cosine similarity distance is less than the similarity threshold, if so, the vehicle in the corresponding vehicle detection image is the target vehicle, if not, judging that the target vehicle has left the highway to be monitored;
基于所述车辆检测图像对应的摄像头编号及车辆ID匹配所述车辆信息数据库,得到目标车辆的运动轨迹,实现跨镜跟踪。Based on the camera number and vehicle ID corresponding to the vehicle detection image, the vehicle information database is matched to obtain the motion trajectory of the target vehicle, thereby realizing cross-mirror tracking.
与现有技术相比,本发明至少可实现如下有益效果之一:Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
1、一种高速公路监控视频跨镜车辆跟踪方法,通过改进的YOLO目标检测模型对车辆进行检测,得到车辆检测图像,通过多目标跟踪模型对车辆进行跟踪,得到车辆ID及车辆轨迹,最后基于重识别网络获得余弦相似度,进而拼接得到目标车辆的完整运动轨迹,为高速公路管理部门安全监控、搜查目标车辆提供了高效、快速且高精度的视频分析技术。1. A cross-mirror vehicle tracking method for highway surveillance video. The vehicle is detected through the improved YOLO target detection model, and the vehicle detection image is obtained. The vehicle is tracked through the multi-target tracking model to obtain the vehicle ID and vehicle trajectory. Finally, based on The re-identification network obtains the cosine similarity, and then splices to obtain the complete motion trajectory of the target vehicle, which provides an efficient, fast and high-precision video analysis technology for the highway management department to safely monitor and search for the target vehicle.
2、通过将YOLOv3中的骨干网络替换为具有更好学习能力的DenseNet的变体VoVNet以得到特征提取网络层,同时,针对高速公路监控视频图像拍摄车辆的尺寸,将YOLOv3检测层的大中小三个尺度减少为中小两个尺度,得到改进的YOLO目标检测模型,使得模型体积更小,计算速度更快且减少了运算量,能过更快速的获得包含有完整车辆矩形框的车辆检测图像。2. By replacing the backbone network in YOLOv3 with VoVNet, a variant of DenseNet with better learning ability, the feature extraction network layer is obtained. At the same time, according to the size of the vehicle in the highway surveillance video image, the large, medium and small three of the YOLOv3 detection layer are used. The scale is reduced to two scales of medium and small, and the improved YOLO target detection model is obtained, which makes the model smaller, the calculation speed is faster, and the calculation amount is reduced, and the vehicle detection image containing the complete vehicle rectangular frame can be obtained more quickly.
3、通过以摄像头编号-车辆ID的命名规则将车辆检测图像及车辆轨迹保存至数据库即可得到车辆信息数据库,为车辆轨迹的重识别及目标车辆轨迹的完整拼接提供了数据支持和依据。3. The vehicle information database can be obtained by saving the vehicle detection image and vehicle trajectory to the database according to the naming rule of camera number-vehicle ID, which provides data support and basis for the re-identification of vehicle trajectory and the complete splicing of target vehicle trajectory.
4、通过利用深度外观特征提取单元在车辆信息数据库中任一摄像头对应的某一车辆检测图像中截取目标车辆图像,并计算目标车辆图像与其他摄像头中某一车辆检测图像中的多辆车的余弦相似度,并通过该余弦相似度将目标车辆与其他摄像头中某一车辆检测图像中的多辆车进行匹配,进而拼接得到目标车辆的运动轨迹,实现跨镜跟踪,匹配效率高且精度高。4. Intercept the target vehicle image from a vehicle detection image corresponding to any camera in the vehicle information database by using the depth appearance feature extraction unit, and calculate the difference between the target vehicle image and multiple vehicles in a vehicle detection image in other cameras. Cosine similarity, and through the cosine similarity, the target vehicle is matched with multiple vehicles in a vehicle detection image in other cameras, and then the motion trajectory of the target vehicle is obtained by splicing to achieve cross-mirror tracking, with high matching efficiency and high precision. .
本发明中,上述各技术方案之间还可以相互组合,以实现更多的优选组合方案。本发明的其他特征和优点将在随后的说明书中阐述,并且,部分优点可从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过说明书以及附图中所特别指出的内容中来实现和获得。In the present invention, the above technical solutions can also be combined with each other to achieve more preferred combination solutions. Additional features and advantages of the invention will be set forth in the description which follows, and some of the advantages may become apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by means of particularly pointed out in the description and drawings.
附图说明Description of drawings
附图仅用于示出具体实施例的目的,而并不认为是对本发明的限制,在整个附图中,相同的参考符号表示相同的部件。The drawings are for the purpose of illustrating specific embodiments only and are not to be considered limiting of the invention, and like reference numerals refer to like parts throughout the drawings.
图1为高速公路监控视频跨镜车辆跟踪方法整体结构图;Figure 1 is the overall structure diagram of the cross-mirror vehicle tracking method for highway surveillance video;
图2为高速公路监控视频跨镜车辆跟踪方法流程示意图;FIG. 2 is a schematic flowchart of a method for tracking a vehicle across a mirror in a highway surveillance video;
图3为改进的YOLO目标检测模型结构示意图;Figure 3 is a schematic structural diagram of the improved YOLO target detection model;
图4为DeepSort多目标跟踪模型结构示意图;Figure 4 is a schematic diagram of the structure of the DeepSort multi-target tracking model;
图5为高速公路监控视频跨镜车辆跟踪系统结构示意图;Figure 5 is a schematic structural diagram of a cross-mirror vehicle tracking system for highway surveillance video;
附图标记:Reference number:
100-检测模块,200-跟踪模块,300-车辆信息数据库获得模块,400-运动轨迹获得模块。100-detection module, 200-tracking module, 300-vehicle information database acquisition module, 400-movement trajectory acquisition module.
具体实施方式Detailed ways
下面结合附图来具体描述本发明的优选实施例,其中,附图构成本申请一部分,并与本发明的实施例一起用于阐释本发明的原理,并非用于限定本发明的范围。The preferred embodiments of the present invention are specifically described below with reference to the accompanying drawings, wherein the accompanying drawings constitute a part of the present application, and together with the embodiments of the present invention, are used to explain the principles of the present invention, but are not used to limit the scope of the present invention.
跨镜跟踪指的是基于多个摄像头拍摄的视频文件对目标车辆的运动轨迹进行追踪,并将每个摄像头对应的目标车辆运动轨迹进行拼接,以得到目标车辆的完整运动轨迹。现有的跨镜车辆再识别技术都是基于已经标注好的数据集,虽然随着高质量数据集的更新发布,车辆的重识别技术也得到了进一步的发展,但数据集场景有限,算法模型局限性较强,在实际场景中难以实施且算法的适用性较低。为此,本申请提出一种高速公路监控视频跨镜车辆跟踪方法及系统,如图1所示,通过改进的YOLO目标检测模型对待监测高速公路多个摄像头视频文件中的每张帧图像进行车辆检测得到车辆检测图像,将该车辆检测图像输入多目标跟踪模型得到车辆轨迹及与之对应的车辆ID,车辆ID就是对车辆轨迹的编号;将车辆检测图像及车辆轨迹按照摄像头编号及车辆ID存储至数据库,最后根据车辆信息数据库匹配目标车辆图像对应的目标车辆的运动轨迹,实现跨镜跟踪。本申请通过提取每个监控摄像头拍摄视频对应的车辆轨迹信息,并将目标车辆的轨迹跨镜头连接,以得到目标车辆在待监测高速公路的完整运动轨迹,实现了车辆的跨镜跟踪,解决了现有的跨镜车辆跟踪方法在实际场景中实施困难较大且算法的适用性较低等问题,为高速公路管理部门安全监控、搜查目标车辆提供了高效、快速且高精度的视频分析技术,具有较高的实用价值。Cross-camera tracking refers to tracking the motion trajectory of the target vehicle based on video files captured by multiple cameras, and splicing the motion trajectory of the target vehicle corresponding to each camera to obtain the complete motion trajectory of the target vehicle. The existing cross-mirror vehicle re-identification technology is based on the data sets that have been labeled. Although the vehicle re-identification technology has been further developed with the update and release of high-quality data sets, the data set scenarios are limited, and the algorithm model It has strong limitations, it is difficult to implement in practical scenarios and the applicability of the algorithm is low. To this end, the present application proposes a method and system for vehicle tracking across mirrors in highway surveillance video, as shown in Figure 1, through the improved YOLO target detection model to monitor each frame image in the highway video files of multiple cameras to perform vehicle tracking The vehicle detection image is obtained by detection, and the vehicle detection image is input into the multi-target tracking model to obtain the vehicle trajectory and the corresponding vehicle ID. The vehicle ID is the number of the vehicle trajectory; the vehicle detection image and vehicle trajectory are stored according to the camera number and vehicle ID. Finally, according to the vehicle information database, the motion trajectory of the target vehicle corresponding to the target vehicle image is matched to realize cross-mirror tracking. In this application, the vehicle trajectory information corresponding to the video captured by each surveillance camera is extracted, and the trajectory of the target vehicle is connected across the lenses to obtain the complete motion trajectory of the target vehicle on the highway to be monitored, thereby realizing the vehicle's cross-mirror tracking and solving the problem. The existing cross-mirror vehicle tracking method is difficult to implement in actual scenarios and the applicability of the algorithm is low. It provides an efficient, fast and high-precision video analysis technology for the highway management department to monitor and search for target vehicles. Has high practical value.
本发明的一个具体实施例,公开了一种高速公路监控视频跨镜车辆跟踪方法,如图2所示。包括如下步骤:A specific embodiment of the present invention discloses a method for tracking vehicles across mirrors in expressway surveillance video, as shown in FIG. 2 . It includes the following steps:
步骤S1、获取待监测高速公路多个摄像头视频文件中的帧图像,基于改进的YOLO目标检测模型对每张帧图像进行车辆检测得到包含有完整车辆矩形框的车辆检测图像。考虑到高速公路监控视频图像的特点包括高速公路监控摄像头距地面约10米、拍摄图像清晰度较差且车辆目标较小、角度多为斜向下且车辆目标多为俯视侧向车身、图像中障碍物较少等,因此本申请利用改进的YOLO目标检测模型分别对获取的待监测高速公路多个摄像头视频文件中的每张帧图像进行车辆检测,以得到包含有完整车辆矩形框的车辆检测图像。其中,改进的YOLO目标检测模型是将原来的YOLOv3中的骨干网络替换为具有更好学习能力的DenseNet的变体VoVNet(特征提取网络层),模型体积更小,速度更快,同时,针对高速公路监控视频图像拍摄车辆的尺寸,将YOLOv3检测层的大中小三个尺度减少为中小两个尺度,进一步减少了运算量。Step S1: Obtain frame images from multiple camera video files of the expressway to be monitored, and perform vehicle detection on each frame image based on the improved YOLO target detection model to obtain a vehicle detection image containing a complete vehicle rectangular frame. Considering the characteristics of highway surveillance video images, the highway surveillance cameras are about 10 meters away from the ground, the image resolution is poor, and the vehicle target is small, the angle is mostly oblique downward, and the vehicle target is mostly looking down at the sideways body, and the image There are few obstacles, etc. Therefore, this application uses the improved YOLO target detection model to perform vehicle detection on each frame image obtained from multiple camera video files of the highway to be monitored, so as to obtain a vehicle detection that contains a complete vehicle rectangular frame. image. Among them, the improved YOLO target detection model is to replace the backbone network in the original YOLOv3 with VoVNet (feature extraction network layer), a variant of DenseNet with better learning ability. The model is smaller and faster. At the same time, for high-speed The size of the vehicle captured by the road surveillance video image reduces the three scales of large, medium and small in the YOLOv3 detection layer to two scales, which further reduces the amount of computation.
优选地,改进的YOLO目标检测模型包括特征提取网络层和YOLO检测层;其中,特征提取网络层包括stem单元和OSA单元;stem单元,用于对高速公路多个摄像头视频文件中的帧图像进行下采样,得到尺寸为304*304*128的图像;OSA单元,用于对输入尺寸为304*304*128的图像进行卷积,获得尺寸为19*19*512的图像;YOLO检测层,用于根据OSA单元输出的尺寸为19*19*512的图像,获得包含有完整车辆矩形框的车辆检测图像,其中,车辆检测图像中包括由完整车辆矩形框框出的多辆车的图像。Preferably, the improved YOLO target detection model includes a feature extraction network layer and a YOLO detection layer; wherein, the feature extraction network layer includes a stem unit and an OSA unit; the stem unit is used for the frame images in the video files of multiple cameras on the highway. Downsampling to obtain an image with a size of 304*304*128; OSA unit, used to convolve an image with an input size of 304*304*128 to obtain an image with a size of 19*19*512; YOLO detection layer, with According to the image with a size of 19*19*512 output by the OSA unit, a vehicle detection image containing a complete vehicle rectangle frame is obtained, wherein the vehicle detection image includes images of multiple vehicles framed by the complete vehicle rectangle frame.
具体来说,如图3所示,改进的YOLO目标检测模型包括特征提取网络层和YOLO检测层。其中,特征提取网络层包括stem单元和OSA单元,stem单元的作用是对高速公路多个摄像头视频文件中的帧图像进行下采样,得到尺寸为304*304*128的图像。OSA单元包括四个OSA子单元,第一个OSA子单元的作用是将stem单元输出的尺寸为304*304*128的图像进行卷积,得到尺寸为152*152*128的图像;第二个OSA子单元的作用是将第一个OSA子单元输出的尺寸为152*152*128的图像进行卷积,得到尺寸为76*76*256的图像;第三个OSA子单元的作用是将第二个OSA子单元输出的尺寸为76*76*256的图像进行卷积,得到尺寸为38*38*384的图像;第四个OSA子单元的作用是将第三个OSA子单元输出的尺寸为38*38*384的图像进行卷积,得到尺寸为19*19*512的图像。同时,改进的YOLO目标检测模型中的YOLO检测层是将原来YOLOv3检测层的大中小三个尺度减少为中小两个尺度,作用是将根据第四个OSA子单元输出的尺寸为19*19*512的图像,获得包含有完整车辆矩形框的车辆检测图像。基于得到的改进的YOLO目标检测模型,利用道路监控数据集进行模型的训练,并通过超参数搜索,即对于每个新一代超参数,都选择适应性最高的前一代(在所有前几代中)进行突变,所有参数都根据具有约20%的1-sigma的正态分布同时变异,以获得合适的学习率、各部分损失函数的权重等超参数,进行多尺度训练,最终保存网络表现最好的一代超参数作为正式训练的超参数。Specifically, as shown in Figure 3, the improved YOLO target detection model includes a feature extraction network layer and a YOLO detection layer. Among them, the feature extraction network layer includes a stem unit and an OSA unit. The function of the stem unit is to downsample the frame images in the video files of multiple cameras on the highway to obtain an image with a size of 304*304*128. The OSA unit includes four OSA subunits. The function of the first OSA subunit is to convolve the image output by the stem unit with a size of 304*304*128 to obtain an image with a size of 152*152*128; the second one The role of the OSA subunit is to convolve the image with the size of 152*152*128 output by the first OSA subunit to obtain an image of size 76*76*256; the role of the third OSA subunit is to The image of size 76*76*256 output by the two OSA subunits is convolved to obtain an image of size 38*38*384; the function of the fourth OSA subunit is to convert the output size of the third OSA subunit Convolve an image of 38*38*384 to get an image of
通过将YOLOv3中的骨干网络替换为具有更好学习能力的DenseNet的变体VoVNet以得到特征提取网络层,同时,针对高速公路监控视频图像拍摄车辆的尺寸,将YOLOv3检测层的大中小三个尺度减少为中小两个尺度,得到改进的YOLO目标检测模型,使得模型体积更小,计算速度更快且减少了运算量,能过更快速的获得包含有完整车辆矩形框的车辆检测图像。The feature extraction network layer is obtained by replacing the backbone network in YOLOv3 with VoVNet, a variant of DenseNet with better learning ability. It is reduced to two scales of medium and small, and an improved YOLO target detection model is obtained, which makes the model smaller, the calculation speed is faster, and the calculation amount is reduced, and the vehicle detection image containing the complete vehicle rectangular frame can be obtained more quickly.
步骤S2、将车辆检测图像输入多目标跟踪模型得到车辆跟踪结果;车辆跟踪结果包括车辆ID和车辆轨迹。优选地,多目标跟踪模型包括运动预测单元和深度外观特征提取单元:运动预测单元,用于根据上一帧车辆检测图像预测得到当前帧车辆预测图像;深度外观特征提取单元包括重识别网络,基于输入重识别网络的车辆检测图像及车辆预测图像,得到车辆轨迹,并对车辆轨迹进行编号,得到与车辆轨迹对应的车辆ID。Step S2, input the vehicle detection image into the multi-target tracking model to obtain the vehicle tracking result; the vehicle tracking result includes the vehicle ID and the vehicle trajectory. Preferably, the multi-target tracking model includes a motion prediction unit and a depth appearance feature extraction unit: the motion prediction unit is used to predict and obtain the vehicle prediction image of the current frame according to the vehicle detection image of the previous frame; the depth appearance feature extraction unit includes a re-identification network, based on The vehicle detection image and vehicle prediction image of the re-identification network are input to obtain the vehicle trajectory, and the vehicle trajectory is numbered to obtain the vehicle ID corresponding to the vehicle trajectory.
具体来说,如图4所示,DeepSort多目标跟踪模型包括运动预测单元和深度外观特征提取单元,其中,运动预测单元的作用是根据上一帧车辆检测图像预测得到当前帧车辆预测图像,深度外观特征提取单元主要通过重识别网络计算车辆检测图像和车辆预测图像的深度特征信息,将关联匹配成功的车辆预测图像作为车辆在当前帧的车辆位置,连接多帧车辆位置的中心点坐标即可获得车辆轨迹,在得到车辆轨迹的同时,对车辆轨迹进行编号,可得到车辆轨迹对应的车辆ID。Specifically, as shown in Figure 4, the DeepSort multi-target tracking model includes a motion prediction unit and a depth appearance feature extraction unit. The function of the motion prediction unit is to predict the current frame vehicle prediction image according to the previous frame of vehicle detection image, and the depth The appearance feature extraction unit mainly calculates the depth feature information of the vehicle detection image and the vehicle prediction image through the re-identification network, takes the vehicle prediction image that has been successfully associated and matched as the vehicle position of the vehicle in the current frame, and connects the center point coordinates of the vehicle positions in multiple frames. The vehicle track is obtained, and the vehicle track is numbered while the vehicle track is obtained, and the vehicle ID corresponding to the vehicle track can be obtained.
步骤S3、根据车辆检测图像和车辆跟踪结果建立车辆信息数据库。Step S3, establishing a vehicle information database according to the vehicle detection image and the vehicle tracking result.
优选地,根据车辆跟踪结果建立车辆信息数据库具体包括:基于摄像头编号及车辆ID将车辆检测图像及车辆轨迹存储至数据库得到车辆信息数据库。具体来说,基于步骤S1得到的车辆检测图像及步骤S2获得的车辆轨迹对应的车辆ID,以摄像头编号-车辆ID的命名规则将车辆检测图像及车辆轨迹保存至数据库即可得到车辆信息数据库。Preferably, establishing the vehicle information database according to the vehicle tracking result specifically includes: storing the vehicle detection image and the vehicle trajectory in the database based on the camera number and the vehicle ID to obtain the vehicle information database. Specifically, based on the vehicle detection image obtained in step S1 and the vehicle ID corresponding to the vehicle trajectory obtained in step S2, the vehicle information database can be obtained by saving the vehicle detection image and vehicle trajectory to the database according to the naming rule of camera number-vehicle ID.
通过以摄像头编号-车辆ID的命名规则将车辆检测图像及车辆轨迹保存至数据库即可得到车辆信息数据库,为车辆轨迹的重识别及目标车辆轨迹的完整拼接提供了数据支持和依据。The vehicle information database can be obtained by saving the vehicle detection image and vehicle trajectory to the database according to the naming rule of camera number-vehicle ID, which provides data support and basis for the re-identification of vehicle trajectory and the complete splicing of target vehicle trajectory.
步骤S4、基于车辆信息数据库中任一摄像头编号对应的某一车辆检测图像截取目标车辆图像,并根据车辆信息数据库匹配目标车辆图像对应的目标车辆的运动轨迹,实现跨镜跟踪。具体的,步骤S3中以摄像头编号-车辆ID将车辆检测图像及车辆轨迹保存至数据库后,可选择任一摄像头编号对应的某一车辆检测图像截取目标车辆图像,进而根据该目标车辆图像寻找其他摄像头对应的某一车辆检测图像中的目标车辆,将每个摄像头中的目标车辆的运动轨迹进行拼接,即可得到目标车辆的完整运动轨迹。优选地,基于车辆信息数据库中的车辆检测图像截取目标车辆图像,并根据车辆信息数据库匹配目标车辆图像对应的目标车辆的运动轨迹,实现跨镜跟踪,包括如下步骤:Step S4: Intercept the target vehicle image based on a vehicle detection image corresponding to any camera number in the vehicle information database, and match the motion trajectory of the target vehicle corresponding to the target vehicle image according to the vehicle information database to realize cross-mirror tracking. Specifically, in step S3, after the vehicle detection image and the vehicle trajectory are stored in the database with the camera number-vehicle ID, a vehicle detection image corresponding to any camera number can be selected to intercept the target vehicle image, and then the target vehicle image can be searched for other vehicles according to the target vehicle image. A vehicle corresponding to the camera detects the target vehicle in the image, and splices the motion trajectories of the target vehicle in each camera to obtain the complete motion trajectory of the target vehicle. Preferably, the target vehicle image is intercepted based on the vehicle detection image in the vehicle information database, and the motion trajectory of the target vehicle corresponding to the target vehicle image is matched according to the vehicle information database to realize cross-mirror tracking, including the following steps:
步骤S401、获取车辆信息数据库中任一摄像头对应的某一车辆检测图像,并截取目标车辆图像。具体的,基于步骤S3中以摄像头编号-车辆ID将车辆检测图像及车辆轨迹保存至数据库后,可从车辆信息数据库中任一摄像头编号对应的某一车辆检测图像截取目标车辆图像。Step S401 , acquiring a vehicle detection image corresponding to any camera in the vehicle information database, and intercepting the image of the target vehicle. Specifically, after the vehicle detection image and vehicle trajectory are saved to the database with the camera number-vehicle ID in step S3, the target vehicle image can be intercepted from a vehicle detection image corresponding to any camera number in the vehicle information database.
步骤S402、基于目标车辆图像及其他摄像头对应的某一车辆检测图像,分别获得目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵。具体的,将目标车辆图像及其他摄像头编号对应的某一车辆检测图像输入深度外观特征提取单元,可得到目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵。这里是根据每个摄像头对应的某一车辆检测图像得到深度特征矩阵,相比于步骤S2中在获得车辆轨迹的过程中对实时的每一帧图像的处理得到的深度特征矩阵来说,计算量减少了且精确度更高了。Step S402 , based on the target vehicle image and a certain vehicle detection image corresponding to other cameras, obtain a depth feature matrix of the target vehicle image and a depth feature matrix of a certain vehicle detection image corresponding to other camera numbers, respectively. Specifically, the target vehicle image and a certain vehicle detection image corresponding to other camera numbers are input into the depth appearance feature extraction unit, and the depth feature matrix of the target vehicle image and the depth feature matrix of a vehicle detection image corresponding to other camera numbers can be obtained. Here, the depth feature matrix is obtained according to a vehicle detection image corresponding to each camera. Compared with the depth feature matrix obtained by processing each frame of images in real time in the process of obtaining the vehicle trajectory in step S2, the amount of calculation reduced and more accurate.
步骤S403、基于目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵,利用重识别网络获得目标车辆与其他摄像头对应的某一车辆检测图像中多个车辆的余弦相似度距离。具体来说,余弦相似度距离的计算公式为:Step S403, based on the depth feature matrix of the target vehicle image and the depth feature matrix of a vehicle detection image corresponding to other camera numbers, use the re-identification network to obtain the cosines of multiple vehicles in a vehicle detection image corresponding to the target vehicle and other cameras. similarity distance. Specifically, the formula for calculating the cosine similarity distance is:
式中,cos(θ)为余弦相似度距离,a为目标车辆图像对应的深度特征矩阵,b为车辆检测图像对应的深度特征矩阵,xi为目标车辆图像对应的深度特征矩阵中的第i维元素,yi为车辆检测图像对应的深度特征矩阵中的第i维元素,n为深度特征矩阵的维数,1≤i≤n。In the formula, cos(θ) is the cosine similarity distance, a is the depth feature matrix corresponding to the target vehicle image, b is the depth feature matrix corresponding to the vehicle detection image, and x i is the ith in the depth feature matrix corresponding to the target vehicle image. dimension element, y i is the i-th dimension element in the depth feature matrix corresponding to the vehicle detection image, n is the dimension of the depth feature matrix, 1≤i≤n.
步骤S404、将余弦相似度距离按照摄像头编号进行归类并排序,得到相同摄像头编号对应的最小余弦相似度距离。具体的,基于每个摄像头编号选择了一张车辆检测图像,每一张车辆检测图像中包含多辆车的图像。基于步骤S404可计算得到目标车辆与其他摄像头对应的某一车辆检测图像中多个车辆的余弦相似度距离,将余弦相似度距离按照摄像头编号进行归类并排序,得到相同摄像头编号对应的最小余弦相似度距离。Step S404 , classify and sort the cosine similarity distances according to the camera numbers to obtain the minimum cosine similarity distances corresponding to the same camera numbers. Specifically, a vehicle detection image is selected based on each camera number, and each vehicle detection image includes images of multiple vehicles. Based on step S404, the cosine similarity distances of multiple vehicles in a certain vehicle detection image corresponding to the target vehicle and other cameras can be calculated, and the cosine similarity distances are classified and sorted according to the camera number to obtain the minimum cosine corresponding to the same camera number. similarity distance.
步骤S405、判断最小余弦相似度距离是否小于相似度阈值,若是,则相应车辆检测图像中的最小余弦相似度距离对应的车辆为目标车辆,若否,判断目标车辆驶离待监测高速公路。具体来说,其他每个摄像头对应的某一车辆检测图像均可获得一个最小余弦相似度距离,基于该最小余弦相似度距离可判断得到其他每个摄像头对应的某一车辆检测图像中是否有目标车辆。其中,相似度阈值根据大量的实验取平均数得到,对于不同的外界条件,如光照、阴雨等影响监控拍摄的条件下,不同的车型对应不同的相似度阈值。Step S405, determine whether the minimum cosine similarity distance is less than the similarity threshold, if so, the vehicle corresponding to the minimum cosine similarity distance in the corresponding vehicle detection image is the target vehicle, if not, determine that the target vehicle leaves the highway to be monitored. Specifically, a vehicle detection image corresponding to each other camera can obtain a minimum cosine similarity distance, and based on the minimum cosine similarity distance, it can be determined whether there is a target in a vehicle detection image corresponding to each other camera vehicle. Among them, the similarity threshold is obtained by taking the average of a large number of experiments. For different external conditions, such as light, rain and other conditions that affect the monitoring and shooting, different vehicle models correspond to different similarity thresholds.
步骤S406、基于车辆检测图像对应的摄像头编号及车辆ID匹配所述车辆信息数据库,得到目标车辆的运动轨迹,实现跨镜跟踪。基于上一步骤,判断得到其他每个摄像头对应的车辆检测图像中的车辆为目标图像时,可通过摄像头-车辆ID查询车辆信息数据库得到各个摄像头对应的车辆检测图像中为目标车辆的相应车辆轨迹,并把相应车辆轨迹进行拼接,即可得到目标车辆的完整运动轨迹,实现跨镜跟踪。Step S406 , matching the vehicle information database based on the camera number and the vehicle ID corresponding to the vehicle detection image to obtain the motion trajectory of the target vehicle, so as to realize cross-mirror tracking. Based on the previous step, when it is determined that the vehicle in the vehicle detection image corresponding to each other camera is the target image, the vehicle information database can be queried through the camera-vehicle ID to obtain the corresponding vehicle trajectory of the target vehicle in the vehicle detection image corresponding to each camera. , and splicing the corresponding vehicle trajectories, the complete motion trajectory of the target vehicle can be obtained to achieve cross-mirror tracking.
通过利用深度外观特征提取单元在车辆信息数据库中任一摄像头对应的某一车辆检测图像中截取目标车辆图像,并计算目标车辆图像与其他摄像头中某一车辆检测图像中的多辆车的余弦相似度,并通过该余弦相似度将目标车辆与他摄像头中某一车辆检测图像中的多辆车进行匹配,进而得到目标车辆的运动轨迹,实现跨镜跟踪,匹配效率高且精度高。By using the depth appearance feature extraction unit, the target vehicle image is intercepted from a vehicle detection image corresponding to any camera in the vehicle information database, and the cosine similarity between the target vehicle image and multiple vehicles in a vehicle detection image in other cameras is calculated. The cosine similarity is used to match the target vehicle with multiple vehicles in a vehicle detection image in his camera, and then the motion trajectory of the target vehicle is obtained to achieve cross-mirror tracking, with high matching efficiency and high accuracy.
与现有技术相比,本实施例提供的一种高速公路监控视频跨镜车辆跟踪方法,通过改进的YOLO目标检测模型对车辆进行检测,得到车辆检测图像,通过多目标跟踪模型对车辆进行跟踪,得到车辆ID及车辆轨迹,最后基于重识别网络获得余弦相似度,进而拼接得到目标车辆的完整运动轨迹,为高速公路管理部门安全监控、搜查目标车辆提供了高效、快速且高精度的视频分析技术。Compared with the prior art, this embodiment provides a cross-mirror vehicle tracking method for expressway surveillance video. The vehicle is detected by the improved YOLO target detection model, the vehicle detection image is obtained, and the vehicle is tracked by the multi-target tracking model. , obtain the vehicle ID and vehicle trajectory, and finally obtain the cosine similarity based on the re-identification network, and then splicing to obtain the complete motion trajectory of the target vehicle, which provides an efficient, fast and high-precision video analysis for the highway management department to monitor and search the target vehicle. technology.
本发明的另一个具体实施例,公开了一种高速公路监控视频跨镜车辆跟踪系统,如图5所示,包括检测模块100,用于获取待监测高速公路多个摄像头视频文件中的帧图像,基于改进的YOLO目标检测模型对每张帧图像进行车辆检测得到包含有完整车辆矩形框的车辆检测图像;跟踪模块200,用于将车辆检测图像输入多目标跟踪模型得到车辆跟踪结果,车辆跟踪结果包括车辆ID和车辆轨迹;车辆信息数据库获得模块300,用于根据车辆检测图像和车辆跟踪结果建立车辆信息数据库;运动轨迹获得模块400,用于根据车辆信息数据库中的车辆检测图像截取目标车辆图像,并根据车辆信息数据库匹配目标车辆图像对应的目标车辆的运动轨迹,实现跨镜跟踪。具体的,该系统可以选择视频文件、进行跟踪跟踪且显示跟踪结果,即每个车辆的图像,并且以表单形式展示车辆的中心点坐标,以得到车辆轨迹即与之对应的车辆ID,同时还有暂停恢复跟踪功能。Another specific embodiment of the present invention discloses a cross-mirror vehicle tracking system for highway surveillance video, as shown in FIG. 5 , including a
一种高速公路监控视频跨镜车辆跟踪系统,通过改进的YOLO目标检测模型对车辆进行检测,得到车辆检测图像,通过多目标跟踪模型对车辆进行跟踪,得到车辆ID及车辆轨迹,最后基于重识别网络获得余弦相似度,进而拼接得到目标车辆的完整运动轨迹,为高速公路管理部门安全监控、搜查目标车辆提供了高效、快速且高精度的视频分析技术。A cross-mirror vehicle tracking system for highway surveillance video, detects vehicles through an improved YOLO target detection model, obtains vehicle detection images, tracks vehicles through a multi-target tracking model, obtains vehicle IDs and vehicle trajectories, and finally based on re-identification The network obtains the cosine similarity, and then splices to obtain the complete motion trajectory of the target vehicle, which provides an efficient, fast and high-precision video analysis technology for the highway management department to monitor and search the target vehicle safely.
优选地,检测模块包括特征提取网络层和YOLO检测层;其中,特征提取网络层包括stem单元和OSA单元;stem单元,用于对高速公路多个摄像头视频文件中的帧图像进行下采样,得到尺寸为304*304*128的图像;OSA单元,用于对输入尺寸为304*304*128的图像进行卷积,获得尺寸为19*19*512的图像;YOLO检测层,用于根据OSA单元输出的尺寸为19*19*512的图像,获得包含有完整车辆矩形框的车辆检测图像。Preferably, the detection module includes a feature extraction network layer and a YOLO detection layer; wherein, the feature extraction network layer includes a stem unit and an OSA unit; the stem unit is used to downsample the frame images in the video files of multiple cameras on the highway, and obtain An image of size 304*304*128; OSA unit, used to convolve an image with an input size of 304*304*128 to obtain an image of
检测模块将YOLOv3中的骨干网络替换为具有更好学习能力的DenseNet的变体VoVNet以得到特征提取网络层,同时,针对高速公路监控视频图像拍摄车辆的尺寸,将YOLOv3检测层的大中小三个尺度减少为中小两个尺度,得到改进的YOLO目标检测模型,使得模型体积更小,计算速度更快且减少了运算量,能过更快速的获得包含有完整车辆矩形框的车辆检测图像。The detection module replaces the backbone network in YOLOv3 with VoVNet, a variant of DenseNet with better learning ability to obtain the feature extraction network layer. The scale is reduced to two scales of medium and small, and the improved YOLO target detection model is obtained, which makes the model smaller, the calculation speed is faster and the amount of calculation is reduced, and the vehicle detection image containing the complete vehicle rectangular frame can be obtained more quickly.
优选地,跟踪模块包括运动预测单元和深度外观特征提取单元,所述运动预测单元,用于根据上一帧车辆检测图像预测得到当前帧车辆预测图像;深度外观特征提取单元包括重识别网络,基于输入重识别网络的车辆检测图像及车辆预测图像,得到车辆轨迹,并对车辆轨迹进行编号,得到与车辆轨迹对应的车辆ID。Preferably, the tracking module includes a motion prediction unit and a depth appearance feature extraction unit, the motion prediction unit is used to predict and obtain the vehicle prediction image of the current frame according to the vehicle detection image of the previous frame; the depth appearance feature extraction unit includes a re-identification network, based on The vehicle detection image and vehicle prediction image of the re-identification network are input to obtain the vehicle trajectory, and the vehicle trajectory is numbered to obtain the vehicle ID corresponding to the vehicle trajectory.
优选地,车辆信息数据库获得模块根据摄像头编号及车辆ID将车辆检测图像及车辆轨迹存储至数据库得到车辆信息数据库。Preferably, the vehicle information database obtaining module stores the vehicle detection image and the vehicle track in the database according to the camera number and the vehicle ID to obtain the vehicle information database.
通过车辆信息数据库获得模块以摄像头编号-车辆ID的命名规则将车辆检测图像及车辆轨迹保存至数据库即可得到车辆信息数据库,为车辆轨迹的重识别及目标车辆轨迹的完整拼接提供了数据支持和依据。Through the vehicle information database acquisition module, the vehicle detection image and vehicle trajectory are saved to the database according to the naming rule of camera number-vehicle ID, and the vehicle information database can be obtained, which provides data support for the re-identification of vehicle trajectory and the complete splicing of target vehicle trajectory. in accordance with.
优选地,运动轨迹获得模块执行下述流程:Preferably, the motion trajectory obtaining module executes the following process:
获取车辆信息数据库中任一摄像头编号对应的某一车辆检测图像,利用深度外观特征提取单元截取目标车辆图像;Obtain a vehicle detection image corresponding to any camera number in the vehicle information database, and use the depth appearance feature extraction unit to intercept the target vehicle image;
基于目标车辆图像及其他摄像头编号对应的某一车辆检测图像,分别获得目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵;Based on the target vehicle image and a vehicle detection image corresponding to other camera numbers, the depth feature matrix of the target vehicle image and the depth feature matrix of a vehicle detection image corresponding to other camera numbers are obtained respectively;
基于目标车辆图像的深度特征矩阵及其他摄像头编号对应的某一车辆检测图像的深度特征矩阵,利用重识别网络获得目标车辆与其他摄像头编号对应的某一车辆检测图像中车辆的余弦相似度距离;Based on the depth feature matrix of the target vehicle image and the depth feature matrix of a vehicle detection image corresponding to other camera numbers, the re-identification network is used to obtain the cosine similarity distance between the target vehicle and a vehicle detection image corresponding to other camera numbers;
将余弦相似度距离按照摄像头编号进行归类并排序,得到相同摄像头编号对应的最小余弦相似度距离;Categorize and sort the cosine similarity distance according to the camera number to obtain the minimum cosine similarity distance corresponding to the same camera number;
判断最小余弦相似度距离是否小于相似度阈值,若是,则相应车辆检测图像中的车辆为目标车辆,若否,判断目标车辆驶离待监测高速公路;Determine whether the minimum cosine similarity distance is less than the similarity threshold, if so, the vehicle in the corresponding vehicle detection image is the target vehicle, if not, determine that the target vehicle leaves the highway to be monitored;
基于车辆检测图像对应的摄像头编号及车辆ID匹配所述车辆信息数据库,得到目标车辆的运动轨迹,实现跨镜跟踪。Based on the camera number and vehicle ID corresponding to the vehicle detection image, the vehicle information database is matched to obtain the motion trajectory of the target vehicle, thereby realizing cross-mirror tracking.
运动轨迹获得模块能够计算目标车辆与跟踪到的所有车辆的相似度,并按照相似度的大小排序展示在计算机界面,排序越靠前,说明与目标车辆月接近,匹配成功后,在界面的右方输出匹配成功的车辆ID并拼接轨迹,以得到目标车辆的完整轨迹。利用深度外观特征提取单元在车辆信息数据库中任一摄像头对应的某一车辆检测图像中截取目标车辆图像,并计算目标车辆图像与其他摄像头中某一车辆检测图像中的多辆车的余弦相似度,并通过该余弦相似度将目标车辆与他摄像头中某一车辆检测图像中的多辆车进行匹配,进而得到目标车辆的运动轨迹,实现跨镜跟踪,匹配效率高且精度高。The motion trajectory acquisition module can calculate the similarity between the target vehicle and all the tracked vehicles, and display it on the computer interface according to the size of the similarity. The higher the order is, the closer it is to the target vehicle. The square outputs the successfully matched vehicle IDs and splices the trajectory to obtain the complete trajectory of the target vehicle. Use the depth appearance feature extraction unit to intercept the target vehicle image from a vehicle detection image corresponding to any camera in the vehicle information database, and calculate the cosine similarity between the target vehicle image and multiple vehicles in a vehicle detection image from other cameras. , and use the cosine similarity to match the target vehicle with multiple vehicles in a vehicle detection image in his camera, and then obtain the motion trajectory of the target vehicle to achieve cross-mirror tracking, with high matching efficiency and high accuracy.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited to this. Substitutions should be covered within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010897531.0A CN112069969B (en) | 2020-08-31 | 2020-08-31 | Expressway monitoring video cross-mirror vehicle tracking method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010897531.0A CN112069969B (en) | 2020-08-31 | 2020-08-31 | Expressway monitoring video cross-mirror vehicle tracking method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112069969A true CN112069969A (en) | 2020-12-11 |
CN112069969B CN112069969B (en) | 2023-07-25 |
Family
ID=73665803
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010897531.0A Active CN112069969B (en) | 2020-08-31 | 2020-08-31 | Expressway monitoring video cross-mirror vehicle tracking method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112069969B (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112991134A (en) * | 2021-05-11 | 2021-06-18 | 交通运输部科学研究院 | Driving path reduction measuring and calculating method and device and electronic equipment |
CN113516054A (en) * | 2021-06-03 | 2021-10-19 | 三峡大学 | Wood-carrying vehicle detection, identification and tracking method |
CN113657378A (en) * | 2021-07-28 | 2021-11-16 | 讯飞智元信息科技有限公司 | Vehicle tracking method, vehicle tracking system and computing device |
CN113673395A (en) * | 2021-08-10 | 2021-11-19 | 深圳市捷顺科技实业股份有限公司 | Vehicle track processing method and device |
CN114067270A (en) * | 2021-11-18 | 2022-02-18 | 华南理工大学 | Vehicle tracking method and device, computer equipment and storage medium |
CN114092820A (en) * | 2022-01-20 | 2022-02-25 | 城云科技(中国)有限公司 | Target detection method and moving target tracking method applying same |
CN114399714A (en) * | 2022-01-12 | 2022-04-26 | 福州大学 | Vehicle parking violation detection method based on in-vehicle camera video |
CN114549444A (en) * | 2022-02-16 | 2022-05-27 | 同济大学 | Cross-camera target detection and tracking system and method |
CN114724131A (en) * | 2022-04-01 | 2022-07-08 | 北京明略昭辉科技有限公司 | A vehicle tracking method, device, electronic device and storage medium |
CN115761616A (en) * | 2022-10-13 | 2023-03-07 | 深圳市芯存科技有限公司 | Control method and system based on storage space self-adaption |
CN117274927A (en) * | 2023-09-19 | 2023-12-22 | 盐城工学院 | Traffic flow monitoring method based on improved multi-object tracking |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106846374A (en) * | 2016-12-21 | 2017-06-13 | 大连海事大学 | The track calculating method of vehicle under multi-cam scene |
CN109873990A (en) * | 2019-03-13 | 2019-06-11 | 武汉大学 | A computer vision-based early warning method for illegal mining in mines |
CN110866473A (en) * | 2019-11-04 | 2020-03-06 | 浙江大华技术股份有限公司 | Target object tracking detection method and device, storage medium and electronic device |
CN111127520A (en) * | 2019-12-26 | 2020-05-08 | 华中科技大学 | A method and system for vehicle tracking based on video analysis |
CN111257957A (en) * | 2020-02-25 | 2020-06-09 | 西安交通大学 | Identification tracking system and method based on passive terahertz imaging |
-
2020
- 2020-08-31 CN CN202010897531.0A patent/CN112069969B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106846374A (en) * | 2016-12-21 | 2017-06-13 | 大连海事大学 | The track calculating method of vehicle under multi-cam scene |
CN109873990A (en) * | 2019-03-13 | 2019-06-11 | 武汉大学 | A computer vision-based early warning method for illegal mining in mines |
CN110866473A (en) * | 2019-11-04 | 2020-03-06 | 浙江大华技术股份有限公司 | Target object tracking detection method and device, storage medium and electronic device |
CN111127520A (en) * | 2019-12-26 | 2020-05-08 | 华中科技大学 | A method and system for vehicle tracking based on video analysis |
CN111257957A (en) * | 2020-02-25 | 2020-06-09 | 西安交通大学 | Identification tracking system and method based on passive terahertz imaging |
Non-Patent Citations (1)
Title |
---|
YOUNGWAN LEE ET AL.: "An Energy and GPU-Computation Efficient Backbone Network for Real-Time Object Detection", 《2019 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION WORKSHOPS (CVPRW)》, pages 3 - 4 * |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112991134A (en) * | 2021-05-11 | 2021-06-18 | 交通运输部科学研究院 | Driving path reduction measuring and calculating method and device and electronic equipment |
CN113516054A (en) * | 2021-06-03 | 2021-10-19 | 三峡大学 | Wood-carrying vehicle detection, identification and tracking method |
CN113657378A (en) * | 2021-07-28 | 2021-11-16 | 讯飞智元信息科技有限公司 | Vehicle tracking method, vehicle tracking system and computing device |
CN113657378B (en) * | 2021-07-28 | 2024-04-26 | 讯飞智元信息科技有限公司 | Vehicle tracking method, vehicle tracking system and computing device |
CN113673395A (en) * | 2021-08-10 | 2021-11-19 | 深圳市捷顺科技实业股份有限公司 | Vehicle track processing method and device |
CN114067270A (en) * | 2021-11-18 | 2022-02-18 | 华南理工大学 | Vehicle tracking method and device, computer equipment and storage medium |
CN114399714A (en) * | 2022-01-12 | 2022-04-26 | 福州大学 | Vehicle parking violation detection method based on in-vehicle camera video |
CN114092820A (en) * | 2022-01-20 | 2022-02-25 | 城云科技(中国)有限公司 | Target detection method and moving target tracking method applying same |
CN114549444A (en) * | 2022-02-16 | 2022-05-27 | 同济大学 | Cross-camera target detection and tracking system and method |
CN114724131A (en) * | 2022-04-01 | 2022-07-08 | 北京明略昭辉科技有限公司 | A vehicle tracking method, device, electronic device and storage medium |
CN115761616A (en) * | 2022-10-13 | 2023-03-07 | 深圳市芯存科技有限公司 | Control method and system based on storage space self-adaption |
CN115761616B (en) * | 2022-10-13 | 2024-01-26 | 深圳市芯存科技有限公司 | Control method and system based on storage space self-adaption |
CN117274927A (en) * | 2023-09-19 | 2023-12-22 | 盐城工学院 | Traffic flow monitoring method based on improved multi-object tracking |
CN117274927B (en) * | 2023-09-19 | 2024-05-17 | 盐城工学院 | Traffic flow monitoring method based on improved multi-target tracking |
Also Published As
Publication number | Publication date |
---|---|
CN112069969B (en) | 2023-07-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112069969A (en) | A method and system for cross-mirror vehicle tracking in expressway surveillance video | |
CN108802785B (en) | Vehicle self-positioning method based on high-precision vector map and monocular vision sensor | |
CN109800692B (en) | Visual SLAM loop detection method based on pre-training convolutional neural network | |
CN111429484A (en) | Multi-target vehicle track real-time construction method based on traffic monitoring video | |
CN109099929B (en) | Intelligent vehicle positioning device and method based on scene fingerprint | |
CN111340855A (en) | Road moving target detection method based on track prediction | |
CN111310728B (en) | Pedestrian re-identification system based on monitoring camera and wireless positioning | |
CN108846854A (en) | A kind of wireless vehicle tracking based on motion prediction and multiple features fusion | |
CN113129335B (en) | Visual tracking algorithm and multi-template updating strategy based on twin network | |
CN112949751B (en) | Vehicle image clustering and track restoring method | |
Shi et al. | Visual localization using sparse semantic 3D map | |
CN110636248B (en) | Target tracking method and device | |
CN114879695A (en) | Track matching method, device, equipment and medium | |
CN112541403B (en) | Indoor personnel falling detection method by utilizing infrared camera | |
CN112258580A (en) | Visual SLAM loop detection method based on deep learning | |
CN112634368A (en) | Method and device for generating space and OR graph model of scene target and electronic equipment | |
CN117036404A (en) | Monocular thermal imaging simultaneous positioning and mapping method and system | |
CN110503663B (en) | A random multi-target automatic detection and tracking method based on frame sampling detection | |
CN113450457B (en) | Road reconstruction method, apparatus, computer device and storage medium | |
Mao et al. | Aic2018 report: Traffic surveillance research | |
CN113865581B (en) | Closed scene positioning method based on multi-level map | |
CN117671022B (en) | Mobile robot vision positioning system and method in indoor weak texture environment | |
Shi et al. | Dense semantic 3D map based long-term visual localization with hybrid features | |
CN118038494A (en) | A cross-modal person re-identification method robust to damaged scenes | |
CN116503833A (en) | Urban high-complexity detection scene-based vehicle illegal parking detection method |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 050011 No. 36, Jianshe South Street, Qiaoxi District, Shijiazhuang City, Hebei Province Applicant after: Hebei transportation planning and Design Institute Co.,Ltd. Applicant after: Beijing Jiaotong University Address before: 050011 No. 36, Jianshe South Street, Shijiazhuang City, Hebei Province Applicant before: HEBEI PROVINCIAL COMMUNICATIONS PLANNING AND DESIGN INSTITUTE Applicant before: Beijing Jiaotong University |
|
GR01 | Patent grant | ||
GR01 | Patent grant |