WO2024017413A2 - Method and apparatus for port entry/exit detection of vehicle, device, and storage medium - Google Patents

Method and apparatus for port entry/exit detection of vehicle, device, and storage medium Download PDF

Info

Publication number
WO2024017413A2
WO2024017413A2 PCT/CN2023/120391 CN2023120391W WO2024017413A2 WO 2024017413 A2 WO2024017413 A2 WO 2024017413A2 CN 2023120391 W CN2023120391 W CN 2023120391W WO 2024017413 A2 WO2024017413 A2 WO 2024017413A2
Authority
WO
WIPO (PCT)
Prior art keywords
image
transportation
target vehicle
vehicle
target
Prior art date
Application number
PCT/CN2023/120391
Other languages
French (fr)
Chinese (zh)
Other versions
WO2024017413A3 (en
Inventor
张恒瑞
Original Assignee
顺丰科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 顺丰科技有限公司 filed Critical 顺丰科技有限公司
Publication of WO2024017413A2 publication Critical patent/WO2024017413A2/en
Publication of WO2024017413A3 publication Critical patent/WO2024017413A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/46Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/096Transfer learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/08Detecting or categorising vehicles
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Image Analysis (AREA)
  • Traffic Control Systems (AREA)
  • Time Recorders, Dirve Recorders, Access Control (AREA)

Abstract

The present application discloses a method and apparatus for port entry/exit detection of a vehicle, a device, and a storage medium. The method comprises: determining depth information of a target vehicle in each transportation image according to position-depth relation data associated with a target site and position information of the target vehicle in each transportation image; obtaining a depth information change pattern of the target vehicle according to the depth information of the target vehicle in each transportation image; and obtaining an port entry/exit detection result for the target vehicle according to the depth information change pattern. The technical solution of the present application can improve the accuracy of port entry/exit detection.

Description

车辆进出港检测方法、装置、设备和存储介质Vehicle entry and exit detection methods, devices, equipment and storage media 技术领域Technical field
本申请涉及物流技术领域,尤其涉及一种车辆进出港检测方法、装置、设备和存储介质。This application relates to the field of logistics technology, and in particular to a vehicle entry and exit detection method, device, equipment and storage medium.
发明背景Background of the invention
在物流中转场中,有很多用于货车装货或者卸货的卡位,为了提升中转场的运行效率,需要管理人员来进行车辆进出港检测。In the logistics transfer yard, there are many bays for loading or unloading trucks. In order to improve the operating efficiency of the transfer yard, managers are required to conduct vehicle entry and exit inspections.
通常情况下,在装卸货卡位都会安装监控摄像头,因此可以基于计算机视觉技术来进行车辆进出港检测。现有的基于计算机视觉技术的车辆进出港检测方案,根据目标识别技术检测采集的视频图像中是否存在车厢,并通过定性分析来对车辆进出港进行检测,但是由于车辆在行驶过程中容易被遮挡,使得采集到的视频图像中检测不到车厢,造成车辆进出港检测的检测结果的不准确。Under normal circumstances, surveillance cameras are installed at the loading and unloading bays, so vehicle entry and exit detection can be carried out based on computer vision technology. The existing vehicle entry and exit detection solution based on computer vision technology detects whether there is a carriage in the collected video images based on target recognition technology, and detects the vehicle entry and exit through qualitative analysis. However, the vehicle is easily blocked during driving. , so that the carriage cannot be detected in the collected video images, resulting in inaccurate detection results of vehicle entry and exit detection.
发明内容Contents of the invention
本申请实施例提供一种车辆进出港检测方法、装置、设备和存储介质,以提高现有基于计算机视觉技术的车辆进出港检测方案的准确性。Embodiments of the present application provide a vehicle entry and exit detection method, device, equipment and storage medium to improve the accuracy of existing vehicle entry and exit detection solutions based on computer vision technology.
一方面,本申请实施例提供一种车辆进出港检测方法,所述方法包括:On the one hand, embodiments of the present application provide a vehicle entry and exit detection method, which method includes:
获取目标场地中目标车辆的多张连续的运输图像,以及所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息;Obtaining multiple continuous transportation images of the target vehicle in the target site, and corresponding position information of the target vehicle in each of the multiple continuous transportation images;
根据所述目标场地关联的位置深度关系数据以及所述位置信息,确定所述目标车辆在所述运输图像中对应的深度信息;所述位置深度关系数据包括所述目标场地中每个位置信息以及每个位置信息对应的深度信息,所述深度信息表征运输图像中的位置信息对应的点映射到所述目标场地中时,所述点至采集运输图像的摄像头之间的距离;Determine the depth information corresponding to the target vehicle in the transportation image according to the position-depth relationship data associated with the target site and the position information; the position-depth relationship data includes each position information in the target site and Depth information corresponding to each position information. The depth information represents the distance between the point corresponding to the position information in the transportation image and the camera that collects the transportation image when it is mapped to the target site;
根据所述多张连续的运输图像分别对应的深度信息,得到所述目标车辆的深度信息变化趋势;According to the depth information corresponding to the multiple consecutive transportation images, the depth information change trend of the target vehicle is obtained;
根据所述深度信息变化趋势,得到所述目标车辆的进出港检测结果。According to the change trend of the depth information, the entry and exit detection results of the target vehicle are obtained.
在本申请一些实施例中,在所述根据所述目标场地关联的位置深度关系数据以及所述位置信息,确定所述目标车辆在所述运输图像中对应的深度信息之前,车辆进出港检测方法还包括:In some embodiments of the present application, before determining the corresponding depth information of the target vehicle in the transportation image based on the position depth relationship data associated with the target site and the location information, the vehicle entry and exit detection method Also includes:
采集所述目标场地对应的目标图像;所述目标图像为所述目标场地中未存在车辆的图像;Collect a target image corresponding to the target site; the target image is an image in which no vehicle exists in the target site;
通过已训练的深度估计网络对所述目标图像进行深度估计,得到所述目标图像中至少一个像素点对应的深度信息;Perform depth estimation on the target image through a trained depth estimation network to obtain depth information corresponding to at least one pixel in the target image;
获取所述至少一个像素点在所述目标图像中的位置信息,将所述至少一个像素点的位置信息与所述至少一个像素点对应的深度信息关联,得到所述位置深度关系数据。Obtain the position information of the at least one pixel point in the target image, associate the position information of the at least one pixel point with the depth information corresponding to the at least one pixel point, and obtain the position-depth relationship data.
在本申请一些实施例中,在所述通过已训练的深度估计网络对所述目标图像进行深度估计,得到所述目标图像中至少一个像素点对应的深度信息之前,车辆进出港检测方法还包括:In some embodiments of the present application, before performing depth estimation on the target image through the trained depth estimation network to obtain depth information corresponding to at least one pixel in the target image, the vehicle entry and exit detection method further includes :
在所述目标场地中设置多个测试点;Set up multiple test points in the target site;
采集设置所述多个测试点之后的目标场地对应的样本图像;Collect sample images corresponding to the target site after setting the plurality of test points;
将所述样本图像输入预训练的深度估计网络,得到所述样本图像中所述多个测试点分别对应的测试深度值; Input the sample image into a pre-trained depth estimation network to obtain test depth values corresponding to the multiple test points in the sample image;
若所述多个测试点中的一个测试点对应的测试深度值与所述一个测试点对应的真实距离之间的误差,大于预设误差阈值,则根据所述一个测试点对应的测试深度值与所述一个测试点对应的真实距离之间的训练损失值,调整所述预训练的深度估计网络的参数,直至所述多个测试点对应的误差小于或等于所述预设误差阈值,得到所述已训练的深度估计网络;其中,所述真实距离表征测试点与摄像头之间的真实距离。If the error between the test depth value corresponding to one of the plurality of test points and the true distance corresponding to the one test point is greater than the preset error threshold, then according to the test depth value corresponding to the one test point The training loss value between the real distance corresponding to the one test point, adjusting the parameters of the pre-trained depth estimation network until the errors corresponding to the multiple test points are less than or equal to the preset error threshold, we get The trained depth estimation network; wherein the real distance represents the real distance between the test point and the camera.
在本申请一些实施例中,所述根据所述多张连续的运输图像分别对应的深度信息,得到所述目标车辆的深度信息变化趋势,包括:In some embodiments of the present application, obtaining the depth information change trend of the target vehicle based on the depth information corresponding to the multiple consecutive transportation images includes:
将所述目标车辆在所述多张连续的运输图像中的深度信息,分别与预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势;或Compare the depth information of the target vehicle in the multiple consecutive transportation images with the preset distance threshold respectively to obtain the change trend of the depth information of the target vehicle; or
根据所述目标车辆在所述多张连续的运输图像中的深度信息之间的差值,得到所述目标车辆的深度信息变化趋势。According to the difference between the depth information of the target vehicle in the multiple consecutive transportation images, the change trend of the depth information of the target vehicle is obtained.
在本申请一些实施例中,所述将所述目标车辆在所述多张连续的运输图像中的深度信息,分别与预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势,包括:In some embodiments of the present application, the depth information of the target vehicle in the multiple consecutive transportation images is compared with a preset distance threshold respectively to obtain the change trend of the depth information of the target vehicle, including :
根据所述多张连续的运输图像对应的时间顺序,对所述多张连续的运输图像进行排序,得到排序后的多张运输图像以及所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息;Sort the multiple consecutive transportation images according to the time order corresponding to the multiple consecutive transportation images, and obtain the multiple sorted transportation images and the position of the target vehicle in the sorted multiple transportation images. Corresponding depth information;
将所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息与预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势。Compare the corresponding depth information of the target vehicle in the plurality of sorted transportation images with a preset distance threshold to obtain the change trend of the depth information of the target vehicle.
在本申请一些实施例中,所述将所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息与预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势,包括:In some embodiments of the present application, the corresponding depth information of the target vehicle in the plurality of sorted transportation images is compared with a preset distance threshold to obtain the change trend of the depth information of the target vehicle, include:
将所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息与预设距离阈值进行作差,得到差值序列;Difference the corresponding depth information of the target vehicle in the plurality of sorted transportation images with the preset distance threshold to obtain a difference sequence;
根据所述差值序列得到所述目标车辆的深度信息变化趋势。The depth information change trend of the target vehicle is obtained according to the difference sequence.
在本申请一些实施例中,在所述根据所述差值序列得到所述目标车辆的深度信息变化趋势之后,车辆进出港检测方法还包括:In some embodiments of the present application, after obtaining the depth information change trend of the target vehicle based on the difference sequence, the vehicle entry and exit detection method further includes:
若所述深度信息变化趋势为递减,且所述差值序列中小于或等于预设差值阈值的时间段大于预设时长,则所述目标车辆的进出港检测结果为进港;If the change trend of the depth information is decreasing, and the time period in the difference sequence that is less than or equal to the preset difference threshold is greater than the preset time length, then the entry and exit detection result of the target vehicle is port arrival;
若所述深度信息变化趋势为递增,且所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息中,存在大于预设值的目标深度信息,则所述目标车辆的进出港检测结果为出港。If the change trend of the depth information is increasing, and the corresponding depth information of the target vehicle in the plurality of sorted transportation images contains target depth information greater than the preset value, then the entry and exit of the target vehicle The port test result is outbound.
在本申请一些实施例中,所述根据所述目标车辆在所述多张连续的运输图像中的深度信息之间的差值,得到所述目标车辆的深度信息变化趋势,包括:In some embodiments of the present application, obtaining the change trend of the depth information of the target vehicle based on the difference between the depth information of the target vehicle in the multiple consecutive transportation images includes:
在所述多张连续的运输图像对应的时间段内,将所述目标车辆在所述时间段内的每个时刻对应的运输图像中的深度信息,与下一时刻对应的运输图像中的深度信息进行比较;In the time period corresponding to the multiple consecutive transportation images, the depth information in the transportation image corresponding to the target vehicle at each moment in the time period is compared with the depth information in the transportation image corresponding to the next moment. information for comparison;
若每个时刻对应的深度信息大于下一时刻对应的深度信息,则确定所述目标车辆的深度信息变化趋势为递增;If the depth information corresponding to each moment is greater than the depth information corresponding to the next moment, it is determined that the change trend of the depth information of the target vehicle is increasing;
若每个时刻对应的深度信息小于下一时刻对应的深度信息,则确定所述目标车辆的深度信息变化趋势为递减。If the depth information corresponding to each moment is less than the depth information corresponding to the next moment, it is determined that the change trend of the depth information of the target vehicle is decreasing.
在本申请一些实施例中,在所述得到所述目标车辆的进出港检测结果之后,车辆进出港检测方法还包括:In some embodiments of the present application, after obtaining the entry and exit detection results of the target vehicle, the vehicle entry and exit detection method further includes:
根据所述进出港检测结果中的出港时间和进港时间之间的时间差,得到所述目标车辆在所述目标场地的第一滞留时长;According to the time difference between the departure time and the arrival time in the entry and exit detection results, the first residence time of the target vehicle at the target site is obtained;
获取至少一个第二滞留时长,其中,所述至少一个第二滞留时长为所述目标车辆在所述目标场地的至少一个后续场地的滞留时长;Obtain at least one second residence time, wherein the at least one second residence time is the residence time of the target vehicle in at least one subsequent site of the target site;
确定所述第一滞留时长和所述至少一个第二滞留时长中的最大滞留时长; Determining the maximum residence time among the first residence time and the at least one second residence time;
根据所述最大滞留时长,所述最大滞留时长的次数,以及所述最大滞留时长对应的场地,调整所述目标车辆的运输路线及运输量。The transportation route and transportation volume of the target vehicle are adjusted according to the maximum detention time, the number of the maximum detention time, and the site corresponding to the maximum detention time.
在本申请一些实施例中,所述获取目标场地中目标车辆的多张连续的运输图像,以及所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息,包括:In some embodiments of the present application, the acquisition of multiple continuous transportation images of the target vehicle in the target site, and the corresponding position information of the target vehicle in each of the multiple continuous transportation images, include:
获取所述目标场地的视频图像,提取所述视频图像中包含所述目标车辆的连续帧图像,将所述连续帧图像设置为所述目标车辆在所述目标场地中的多张连续的运输图像;Obtain the video image of the target site, extract the continuous frame images containing the target vehicle in the video image, and set the continuous frame images as multiple continuous transportation images of the target vehicle in the target site. ;
对所述多张连续的运输图像中的每个运输图像进行目标检测,得到所述运输图像中所述目标车辆的边界框坐标;Perform target detection on each transportation image in the multiple consecutive transportation images to obtain the bounding box coordinates of the target vehicle in the transportation image;
根据所述边界框坐标,计算所述目标车辆的边界框的中点坐标;Calculate the midpoint coordinates of the bounding box of the target vehicle according to the bounding box coordinates;
将所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的中点坐标,设置为所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息。The midpoint coordinates of the target vehicle corresponding to each transportation image in the multiple continuous transportation images are set to the corresponding midpoint coordinates of the target vehicle in each transportation image of the multiple continuous transportation images. location information.
在本申请一些实施例中,所述获取所述目标场地的视频图像,提取所述视频图像中包含所述目标车辆的连续帧图像,包括:In some embodiments of the present application, obtaining a video image of the target site and extracting consecutive frame images containing the target vehicle in the video image includes:
获取所述目标场地的视频图像,对所述视频图像中每一帧图像进行车辆检测,得到每一帧图像中目标车辆的检测结果;所述检测结果表征所述帧图像中是否存在所述目标车辆;Obtain the video image of the target site, perform vehicle detection on each frame of the video image, and obtain the detection result of the target vehicle in each frame of image; the detection result represents whether the target exists in the frame image vehicle;
以存在所述目标车辆的帧图像为起始帧,提取所述视频图像中包含所述目标车辆的连续帧图像。Taking the frame image in which the target vehicle exists as the starting frame, extract consecutive frame images containing the target vehicle in the video image.
在本申请一些实施例中,所述对所述视频图像中每一帧图像进行车辆检测,包括:In some embodiments of the present application, performing vehicle detection on each frame of the video image includes:
将采集的所述目标场地中不存在车辆时的图像设置为基准图像;Set the collected image when there is no vehicle in the target site as the reference image;
将所述视频图像中的第一图像与所述基准图像进行做差,得到差分图像;Difference the first image in the video image and the reference image to obtain a difference image;
若所述差分图像中存在像素值大于预设像素值的第一区域,且所述第一区域的像素值均值大于预设均值,则确定所述视频图像中位于所述第一图像后的第二图对应的差分图像;If there is a first region with a pixel value greater than the preset pixel value in the difference image, and the average pixel value of the first region is greater than the preset average value, then it is determined that the third image in the video image is located after the first image. The difference image corresponding to the two images;
若所述第二图像对应的差分图像中像素值大于预设像素值的第二区域的像素值均值大于预设均值,则确定所述视频图像中存在所述目标车辆。If the average pixel value of the second area in the differential image corresponding to the second image is greater than the preset pixel value, it is determined that the target vehicle exists in the video image.
另一方面,本申请实施例提供一种车辆进出港检测装置,所述装置包括:On the other hand, embodiments of the present application provide a vehicle entry and exit detection device, which includes:
获取模块,用于获取目标场地中目标车辆的多张连续的运输图像,以及所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息;An acquisition module, configured to acquire multiple continuous transportation images of the target vehicle in the target site, and the corresponding position information of the target vehicle in each of the multiple continuous transportation images;
深度确定模块,用于根据所述目标场地关联的位置深度关系数据以及所述位置信息,确定所述目标车辆在所述运输图像中对应的深度信息;所述位置深度关系数据包括所述目标场地中每个位置信息以及每个位置信息对应的深度信息,所述深度信息表征运输图像中的位置信息对应的点映射到所述目标场地中时,所述点至采集运输图像的摄像头之间的距离;Depth determination module, configured to determine the depth information corresponding to the target vehicle in the transportation image according to the position-depth relationship data associated with the target site and the location information; the position-depth relationship data includes the target site Each position information in the transportation image and the depth information corresponding to each position information. The depth information represents the distance between the point and the camera that collects the transportation image when the point corresponding to the position information in the transportation image is mapped to the target site. distance;
深度趋势确定模块,用于根据所述多张连续的运输图像分别对应的深度信息,得到所述目标车辆的深度信息变化趋势;A depth trend determination module, configured to obtain the depth information change trend of the target vehicle based on the depth information corresponding to the multiple consecutive transportation images;
检测模块,用于根据所述深度信息变化趋势,得到所述目标车辆的进出港检测结果。A detection module is used to obtain the entry and exit detection results of the target vehicle according to the change trend of the depth information.
另一方面,本申请实施例提供一种车辆进出港检测设备,包括存储器和处理器;所述存储器存储有应用程序,所述处理器用于运行所述存储器内的应用程序,以执行所述的车辆进出港检测方法中的操作。On the other hand, embodiments of the present application provide a vehicle entry and exit detection device, including a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the Operations in the vehicle entry and exit detection method.
另一方面,本申请实施例提供一种存储介质,所述存储介质存储有多条指令,所述指令适于处理器进行加载,以执行所述的车辆进出港检测方法中的步骤。On the other hand, embodiments of the present application provide a storage medium that stores multiple instructions, and the instructions are suitable for loading by a processor to execute the steps in the vehicle entry and exit detection method.
本申请实施例获取目标场地中目标车辆的多张连续的运输图像,以及所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息;根据所述目标场地关联的位置深度关系数据以及所述位置信息,确定所述目标车辆在所述运输图像中对应的深度信息;根据所述多张连续的运输图像分别对应的深度信息,得到所述目标车辆的深度信息变化趋势;根据所述深度信息变化趋势,得到所述目标车辆的进出港检测结果。如此,通过目标车辆在目标场地的深度信息变化趋势确定目标车辆的进出港检测结果,将进出港检测由通过车厢检测的定性分析调整为通过深度变化趋势的定量计算,提高进出港检测的准确性。 The embodiment of the present application obtains multiple continuous transportation images of the target vehicle in the target site, and the corresponding position information of the target vehicle in each of the multiple continuous transportation images; according to the target site association The position-depth relationship data and the position information are used to determine the depth information corresponding to the target vehicle in the transportation image; and the depth information of the target vehicle is obtained according to the depth information corresponding to the multiple consecutive transportation images. Change trend: According to the change trend of the depth information, the entry and exit detection results of the target vehicle are obtained. In this way, the entry and exit detection results of the target vehicle are determined through the change trend of the depth information of the target vehicle at the target site, and the entry and exit detection is adjusted from the qualitative analysis of the carriage detection to the quantitative calculation of the depth change trend, thereby improving the accuracy of the entry and exit detection. .
附图简要说明Brief description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without exerting creative efforts.
图1是本申请实施例提供的车辆进出港检测方法的一个实施例流程示意图。Figure 1 is a schematic flow diagram of an embodiment of a vehicle entry and exit detection method provided by an embodiment of the present application.
图2是本申请实施例提供的步骤101的流程示意图。Figure 2 is a schematic flowchart of step 101 provided by the embodiment of the present application.
图3是本申请实施例提供的车厢检测模型的一个实施例结构示意图。FIG. 3 is a schematic structural diagram of an embodiment of a carriage detection model provided by an embodiment of the present application.
图4是本申请实施例提供的确定目标车辆是否出港的方法的一个实施例流程示意图。Figure 4 is a schematic flowchart of an embodiment of a method for determining whether a target vehicle leaves the port provided by the embodiment of the present application.
图5是本申请实施例提供的深度估计网络的一个实施例结构示意图。Figure 5 is a schematic structural diagram of an embodiment of a depth estimation network provided by an embodiment of the present application.
图6是本申请实施例提供的深度估计层的一个实施例结构示意图。FIG. 6 is a schematic structural diagram of a depth estimation layer provided by an embodiment of the present application.
图7是本申请实施例提供的对预训练的深度估计网络进行适配性测试方法的一个实施例流程示意图。Figure 7 is a schematic flowchart of an embodiment of a method for testing the adaptability of a pre-trained depth estimation network provided by an embodiment of the present application.
图8是本申请实施例提供的车辆进出港检测装置的一个实施例结构示意图供。FIG. 8 is a schematic structural diagram of an embodiment of the vehicle entry and exit detection device provided by the embodiment of the present application.
图9是本申请实施例提供的车辆进出港检测设备的一个实施例结构示意图。Figure 9 is a schematic structural diagram of an embodiment of the vehicle entry and exit detection equipment provided by the embodiment of the present application.
实施本发明的方式Ways to practice the invention
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts fall within the scope of protection of this application.
如背景技术所述,现有技术基于计算机视觉技术中的目标检测技术,对采集到的视频图像进行车厢检测,根据车厢检测结果确定车辆的进出港检测结果,造成检测结果的不准确。As mentioned in the background art, the existing technology is based on the target detection technology in computer vision technology, and performs carriage detection on the collected video images, and determines the vehicle's entry and exit detection results based on the carriage detection results, resulting in inaccurate detection results.
现有技术为了解决仅通过车厢检测确定车辆的进出港检测结果造成的准确性低的问题,从硬件和算法两个方面做了改进;其中在硬件改进上,部署多个摄像头收集大量车辆停靠过程的图片,虽然多个摄像头可以降低由于车辆行驶过程中被遮挡造成的检测结果的误差,但是部署多个摄像头将造成部署成本增加;而算法改进方面,现有基于计算机视觉技术的车辆进出港检测方案,收集场景中大量车辆停靠过程的图片,涵盖车辆完全停靠到位、车辆部分停靠到位以及无车的场景,以提高车辆进出港检测的准确性,这使得现有检测方案应用到新的场景时,需要补充大量数据,增加数据收集成本。In order to solve the problem of low accuracy caused by only determining vehicle entry and exit detection results through carriage detection, the existing technology has made improvements from both hardware and algorithm aspects; among them, in terms of hardware improvements, multiple cameras are deployed to collect a large number of vehicle parking processes Although multiple cameras can reduce the error in detection results caused by occlusion while the vehicle is driving, deploying multiple cameras will increase the deployment cost; in terms of algorithm improvement, the existing vehicle entry and exit detection based on computer vision technology The program collects a large number of pictures of the vehicle parking process in the scene, covering scenes where the vehicle is fully parked, partially parked, and without a car, in order to improve the accuracy of vehicle entry and exit detection, which allows existing detection solutions to be applied to new scenes. , a large amount of data needs to be supplemented, which increases the cost of data collection.
基于上述研究,为了提高车辆进出港检测的准确性,同时降低车辆进出港检测应用中的硬件成本,本申请实施例提供一种车辆进出港检测方法,根据目标车辆在各运输图像中的深度信息,确定得到目标车辆的深度信息变化趋势;根据深度信息变化趋势,得到目标车辆的进出港检测结果;如此,通过目标车辆在目标场地的深度信息变化趋势确定目标车辆的进出港检测结果,将进出港检测由定性分析调整为定量计算,通过数据提高进出港检测的准确性;同时不需要额外部署摄像头,仅使用目标场地的监控摄像头,降低车辆进出港检测应用中的硬件成本;并通过查询目标场地关联的位置深度关系数据得到目标车辆在各运输图像中的深度信息,减少车辆进出港检测应用中的计算成本,提高检测效率。Based on the above research, in order to improve the accuracy of vehicle entry and exit detection and at the same time reduce the hardware cost in vehicle entry and exit detection applications, embodiments of the present application provide a vehicle entry and exit detection method, based on the depth information of the target vehicle in each transportation image , determine the change trend of the depth information of the target vehicle; according to the change trend of the depth information, obtain the entry and exit detection results of the target vehicle; in this way, determine the entry and exit detection results of the target vehicle through the depth information change trend of the target vehicle at the target site, and then determine the entry and exit detection results of the target vehicle. Port detection is adjusted from qualitative analysis to quantitative calculation, and the accuracy of entry and exit detection is improved through data; at the same time, there is no need to deploy additional cameras, only the surveillance cameras at the target site are used, reducing the hardware cost in vehicle entry and exit detection applications; and by querying the target The location-depth relationship data associated with the site obtains the depth information of the target vehicle in each transportation image, reducing the computational cost in vehicle entry and exit detection applications and improving detection efficiency.
如图1所示,图1是本申请实施例提供的车辆进出港检测方法的一个实施例流程示意图,所示的车辆进出港检测方法包括步骤101~104:As shown in Figure 1, Figure 1 is a flow diagram of an embodiment of the vehicle entry and exit detection method provided by the embodiment of the present application. The vehicle entry and exit detection method shown includes steps 101 to 104:
步骤101,获取目标场地中目标车辆的多张连续的运输图像,以及目标车辆在多张连续的运输图像中分别对应的位置信息。Step 101: Obtain multiple continuous transportation images of the target vehicle in the target site, and corresponding position information of the target vehicle in the multiple continuous transportation images.
目标场地指的是车辆运输过程中的中转场地、车站,例如物流中转场、客运车中转场、汽车站、火车站等。多张连续的运输图像可以是目标场地的监控视频,多张连续的运输图像也可以是从目标场地的监控视频提取的连续帧图像,多张连续的运输图像还可以是在预设时 间段内对目标场地进行连续拍摄得到的。运输图像指的是目标车辆在目标场地中停靠、行驶的图像。目标车辆包括但不限于货运车、搬运车、客运车、动车、货车、公交车。The target site refers to the transfer site and station during vehicle transportation, such as logistics transfer site, passenger vehicle transfer site, bus station, railway station, etc. Multiple continuous transportation images can be surveillance videos of the target site. Multiple continuous transportation images can also be continuous frame images extracted from surveillance videos of the target site. Multiple continuous transportation images can also be preset images. It is obtained by continuously shooting the target site during the interval. Transportation images refer to images of target vehicles parking and driving in the target site. Target vehicles include but are not limited to freight cars, trucks, passenger cars, motor cars, trucks, and buses.
位置信息指的是获取的运输图像中,目标车辆在整幅运输图像中的空间坐标,在本申请一些实施中,为了便于提取各运输图像中的位置信息,可以对各运输图像进行目标检测,确定各运输图像中目标车辆所在的图像区域,通过包络框标记出目标车辆所在的图像区域,根据包络框中角点的坐标确定目标车辆在各运输图像中的位置信息。其中,可以根据包络框中各角点的坐标确定包络框的中心点坐标,将中心点坐标设置为目标车辆在各运输图像中的位置信息;还可以根据包络框中处于同一垂直纵坐标的两个水平方向的角点的坐标确定包络框中上边界或下边界的中点坐标,将包络框中上边界或下边界的中点坐标设置为目标车辆在各运输图像中的位置信息。The position information refers to the spatial coordinates of the target vehicle in the entire transportation image in the acquired transportation image. In some implementations of this application, in order to facilitate the extraction of the position information in each transportation image, target detection can be performed on each transportation image. Determine the image area where the target vehicle is located in each transportation image, mark the image area where the target vehicle is located through the envelope box, and determine the position information of the target vehicle in each transportation image based on the coordinates of the corner points in the envelope box. Among them, the center point coordinates of the envelope frame can be determined based on the coordinates of each corner point in the envelope frame, and the center point coordinates can be set as the position information of the target vehicle in each transportation image; it can also be based on the same vertical vertical position in the envelope frame. The coordinates of the two horizontal corner points of the coordinates determine the midpoint coordinates of the upper or lower boundary in the envelope box, and set the midpoint coordinates of the upper or lower boundary in the envelope box as the coordinates of the target vehicle in each transportation image. location information.
步骤102,根据目标场地关联的位置深度关系数据以及目标车辆在各运输图像中分别对应的位置信息,确定目标车辆在各运输图像中分别对应的深度信息。Step 102: Determine the corresponding depth information of the target vehicle in each transportation image based on the position-depth relationship data associated with the target site and the corresponding position information of the target vehicle in each transportation image.
位置深度关系数据包括目标场地中每个位置信息以及该位置信息对应的深度信息。The position-depth relationship data includes each position information in the target site and the depth information corresponding to the position information.
深度信息指的是运输图像中的位置信息对应的点映射到真实的目标场地中时,该点距离拍摄该运输图像的摄像头之间的距离。在车辆进出港检测中,考虑到用于监控目标场地的监控摄像头通常部署在目标场地的装卸卡位,其中装卸卡位可以是装卸货卡位、上下客卡位,因此可以通过查询目标场地关联的位置深度关系数据,确定与各运输图像中的位置信息匹配的深度信息,将该深度信息作为量化目标车辆进出港判断的指标。Depth information refers to the distance between the point corresponding to the position information in the transportation image and the camera that captured the transportation image when it is mapped to the real target site. In the vehicle entry and exit detection, considering that the surveillance cameras used to monitor the target site are usually deployed at the loading and unloading bays of the target site, where the loading and unloading bays can be loading and unloading bays, pick-up and unloading bays, so the target site association can be queried The position-depth relationship data is used to determine the depth information that matches the position information in each transportation image, and the depth information is used as an indicator to quantify the judgment of the target vehicle entering and leaving the port.
103,根据目标车辆在各运输图像中分别对应的深度信息,确定得到目标车辆的深度信息变化趋势。103. According to the corresponding depth information of the target vehicle in each transportation image, determine the change trend of the depth information of the target vehicle.
深度信息变化趋势用于表征目标车辆与摄像头之间的距离的变化情况。目标车辆的深度信息变化趋势包括多张连续的运输图像对应的时间段内目标车辆的深度信息对应数值递减、目标车辆的深度信息对应数值递增和目标车辆的深度信息对应数值不变。在本申请一些实施例中,当深度信息变化趋势为递减时,即目标车辆与摄像头之间的距离逐渐减少时,说明目标车辆在靠近摄像头,则确定目标车辆的进港。The change trend of depth information is used to characterize the changes in the distance between the target vehicle and the camera. The change trend of the depth information of the target vehicle includes a decrease in the value corresponding to the depth information of the target vehicle, an increase in the value corresponding to the depth information of the target vehicle, and a constant value corresponding to the depth information of the target vehicle within the time period corresponding to multiple consecutive transportation images. In some embodiments of the present application, when the change trend of the depth information is decreasing, that is, when the distance between the target vehicle and the camera gradually decreases, it means that the target vehicle is approaching the camera, and the arrival of the target vehicle is determined.
在本申请一些实施例中,可以将目标车辆在多张连续的运输图像中的深度信息分别与预设距离阈值进行比较,确定得到目标车辆的深度信息变化趋势,其中预设距离阈值可以是目标场景中装卸卡位月台边缘到摄像头的距离。例如,在多张连续的运输图像对应的时间段内,目标车辆的深度信息的数值与预设距离阈值逐渐降低时,目标车辆的深度信息变化趋势为递减。In some embodiments of the present application, the depth information of the target vehicle in multiple consecutive transportation images can be compared with a preset distance threshold to determine the change trend of the depth information of the target vehicle, where the preset distance threshold can be the target The distance from the edge of the loading and unloading platform to the camera in the scene. For example, during the time period corresponding to multiple consecutive transportation images, when the value of the depth information of the target vehicle gradually decreases from the preset distance threshold, the change trend of the depth information of the target vehicle is decreasing.
在本申请一些实施例中,还可以根据目标车辆在各运输图像中的深度信息之间的差值确定得到目标车辆的深度信息变化趋势,例如,在多张连续的运输图像对应的时间段内,将目标车辆在时间段内各时刻对应的运输图像中深度信息与下一时刻对应的深度信息进行比较,如果下一时刻对应的深度信息的数值较大,说明目标车辆在远离摄像头,则目标车辆的深度信息变化趋势为递增;如果下一时刻对应的深度信息的数值较小,说明目标车辆在靠近摄像头,则目标车辆的深度信息变化趋势为递减。In some embodiments of the present application, the change trend of the depth information of the target vehicle can also be determined based on the difference between the depth information of the target vehicle in each transportation image, for example, within the time period corresponding to multiple consecutive transportation images. , compare the depth information in the transportation image corresponding to the target vehicle at each moment in the time period with the depth information corresponding to the next moment. If the value of the depth information corresponding to the next moment is larger, it means that the target vehicle is far away from the camera, then the target The changing trend of the depth information of the vehicle is increasing; if the value of the depth information corresponding to the next moment is smaller, it means that the target vehicle is approaching the camera, and the changing trend of the depth information of the target vehicle is decreasing.
104,根据深度信息变化趋势,得到目标车辆的进出港检测结果。104. According to the changing trend of the depth information, obtain the entry and exit detection results of the target vehicle.
在本申请一些实施例中,步骤104包括:若深度信息变化趋势为递减,则确定目标车辆进港;若深度信息变化趋势为递增,则确定目标车辆出港。In some embodiments of the present application, step 104 includes: if the depth information change trend is decreasing, determine the target vehicle to enter the port; if the depth information change trend is increasing, determine the target vehicle to leave the port.
在本申请一些实施例中,若深度信息变化趋势为递减,则确定目标车辆进港,并根据多张连续的运输图像对应的时间信息确定目标车辆的进港时间,并获取后续多张连续的运输图像,根据目标车辆在各后续运输图像中的深度信息确定目标车辆是否出港;若目标车辆出港,则根据后续多张连续的运输图像对应的时间信息确定目标车辆的出港时间;根据出港时间和进港时间之间的时间差得到目标车辆在目标场地的滞留时长。In some embodiments of the present application, if the change trend of the depth information is decreasing, it is determined that the target vehicle has entered the port, and the arrival time of the target vehicle is determined based on the time information corresponding to multiple consecutive transportation images, and multiple subsequent consecutive transportation images are obtained. For transportation images, determine whether the target vehicle leaves the port based on the depth information of the target vehicle in each subsequent transportation image; if the target vehicle leaves the port, determine the departure time of the target vehicle based on the time information corresponding to multiple subsequent consecutive transportation images; based on the departure time and The time difference between arrival times gives the target vehicle's dwell time at the target site.
在本申请一些实施例中,当目标车辆在行驶或运输过程中涉及多个目标场地时,可以根据该目标车辆在已停靠的多个目标场地中的滞留时长,以及获取目标车辆的行驶速度,预测 目标车辆达到下一目标场地的时间以及从下一目标场地驶出的时间。在本申请一些实施例中,滞留时长与目标车辆的车况、目标车辆在目标场地的货物装卸量、货物装卸时长以及目标场地的客流量、车流量存在关联,因此还可以根据目标车辆在多个目标场地的滞留时长,确定目标车辆在各个目标场地的运输货物或客流量较大的目标场地;根据各滞留时长中最大值,并获取该最大值出现次数以及出现时长,根据出现次数和出现时长以及对应的目标场地调整目标车辆的运输路线以及运输量;例如,以目标车辆是物流运输车为例进行说明,当目标车辆在某一个目标场地的滞留时长较长,并且出现次数较多时,则获取该目标场地中其余车辆的滞留时长,如果其余车辆的滞留时长小于该目标车辆的滞留时长,则说明该目标车辆的运输货物较多,需要较长的装卸时长,则增加运输该目标车辆对应的货物的车辆数量,降低该目标车辆的滞留时长,从而提高该运输车辆的运输效率。In some embodiments of the present application, when the target vehicle involves multiple target sites during driving or transportation, the target vehicle can be obtained based on the length of stay of the target vehicle in the multiple target sites where it has stopped and the traveling speed of the target vehicle. predict The time it takes for the target vehicle to reach the next target site and the time it takes to drive out of the next target site. In some embodiments of the present application, the detention time is related to the condition of the target vehicle, the cargo loading and unloading volume of the target vehicle at the target site, the cargo loading and unloading time, and the passenger flow and vehicle flow at the target site. Determine the target site's detention time at each target site where the target vehicle transports goods or has a larger passenger flow; based on the maximum value of each stay time, obtain the number of occurrences and duration of the maximum value, and based on the number of occurrences and duration And the corresponding target site adjusts the transportation route and transportation volume of the target vehicle; for example, taking the target vehicle as a logistics transport vehicle as an example, when the target vehicle stays at a certain target site for a long time and appears frequently, then Obtain the detention time of the remaining vehicles in the target site. If the detention time of the other vehicles is less than the detention time of the target vehicle, it means that the target vehicle transports more goods and requires a longer loading and unloading time. Then increase the transportation corresponding to the target vehicle. The number of cargo vehicles reduces the detention time of the target vehicle, thereby improving the transportation efficiency of the transport vehicle.
本申请实施例,通过目标场地关联的位置深度关系数据,基于在目标场地中的多张连续的运输图像的位置信息,确定目标车辆的深度信息,根据深度值确定目标车辆的到进出港检测结果,降低检测过程中的运算量,提高检测效率,其中,深度值可表征深度信息对应的距离值;并且通过目标车辆在目标场地的连续多张运输图像中分别对应的深度信息,得到目标车辆的深度信息变化趋势,根据深度变化趋势确定目标车辆的进出港检测结果,如此,将进出港检测由定性分析调整为定量计算,通过数据提高进出港检测的准确性。In the embodiment of the present application, the depth information of the target vehicle is determined based on the position depth relationship data associated with the target site and based on the location information of multiple consecutive transportation images in the target site, and the arrival and departure port detection results of the target vehicle are determined based on the depth value. , reduce the amount of calculations in the detection process and improve detection efficiency, in which the depth value can represent the distance value corresponding to the depth information; and through the corresponding depth information of the target vehicle in multiple consecutive transportation images of the target site, the target vehicle's The change trend of depth information determines the entry and exit detection results of the target vehicle based on the depth change trend. In this way, the entry and exit detection is adjusted from qualitative analysis to quantitative calculation, and the accuracy of the entry and exit detection is improved through data.
在本申请一些实施例中,如图2所示,在步骤101中,可以从目标场地的视频图像中提取出目标车辆的多张连续的运输图像,确定目标车辆在各运输图像中的图像区域,根据图像区域的中点坐标得到目标车辆在各运输图像中的位置信息。具体地,步骤101可包括步骤1011~1013:In some embodiments of the present application, as shown in Figure 2, in step 101, multiple consecutive transportation images of the target vehicle can be extracted from the video image of the target site, and the image area of the target vehicle in each transportation image is determined. , the position information of the target vehicle in each transportation image is obtained based on the midpoint coordinates of the image area. Specifically, step 101 may include steps 1011 to 1013:
步骤1011,获取目标场地的视频图像,提取视频图像中包含目标车辆的连续帧图像,将连续帧图像设置为目标车辆在目标场地中的多张连续的运输图像。Step 1011: Obtain the video image of the target site, extract the continuous frame images containing the target vehicle from the video image, and set the continuous frame images as multiple continuous transportation images of the target vehicle in the target site.
在本申请一些实施例中,为了减少车辆进出港检测方法在实际应用中的硬件成本,通过目标场地已安装的摄像头对目标场地进行监控,获取该摄像头采集的目标场地的视频图像。其中,该视频图像可以是实时的监控图像,也可以是过去一段时间内的监控图像。其中,过去一段时间内可以是过去1小时、过去2小时、过去3小时等。In some embodiments of the present application, in order to reduce the hardware cost of the vehicle entry and exit detection method in practical applications, the target site is monitored through a camera installed at the target site, and the video image of the target site collected by the camera is obtained. The video image may be a real-time surveillance image or a surveillance image in the past period of time. Among them, the past period of time can be the past 1 hour, the past 2 hours, the past 3 hours, etc.
在本申请一些实施例中,为了提高车辆进出港检测的精准度,在获取目标场地的视频图像后,对视频图像中每一帧图像进行车辆检测,确定该视频图像中是否存在车辆;若该视频图像中不存在车辆,说明该视频图像对应时间段内目标场地中没有车辆驶入或离开,则获取下一时间段的视频图像;若该视频图像中存在车辆,则对视频图像中车辆进行车辆标识识别,确定该视频图像中包含的车辆数量以及每辆车辆对应的车辆标识;根据车辆标识获取视频图像中各车辆标识对应的目标车辆在目标场地中的多张连续的运输图像。In some embodiments of the present application, in order to improve the accuracy of vehicle entry and exit detection, after obtaining the video image of the target site, vehicle detection is performed on each frame of the video image to determine whether there is a vehicle in the video image; if the video image is If there is no vehicle in the video image, it means that there is no vehicle entering or leaving the target site in the corresponding time period of the video image, and then the video image of the next time period is obtained; if there is a vehicle in the video image, then the vehicle in the video image is Vehicle identification recognition, determine the number of vehicles contained in the video image and the vehicle identification corresponding to each vehicle; obtain multiple consecutive transportation images of the target vehicle corresponding to each vehicle identification in the video image in the target site based on the vehicle identification.
在本申请一些实施例中,可以通过对视频图像中每一帧图像进行图像差分,对视频图像中每一帧图像进行车辆检测。具体地,将采集的目标场地中不存在车辆时的图像设置为基准图像,逐帧将视频图像中每一帧图像(第一图像)与基准图像进行做差,得到差分图像;获取该差分图像中像素值大于预设像素值的区域(第一区域),若该区域的像素值均值大于预设均值,说明该帧图像与基准图像不相同,则确定该帧图像中后续帧图像(第二图像)的差分图像中像素值大于预设像素值的区域的像素值均值是否大于预设均值;若后续帧图像的差分图像中像素值大于预设像素值的区域(第二区域)的像素值均值大于预设均值,则确定该视频图像存在车辆;若该区域的像素值均值小于或等于预设均值,或该差分图像中像素值不存在大于预设像素值的区域,说明该帧图像与基准图像相同,则确定该视频图像中后续帧图像的差分图像中是否存在大于预设像素值的区域;若该视频图像中后续帧图像的差分图像中都不存在大于预设像素值的区域,则确定该视频图像不存在车辆。In some embodiments of the present application, vehicle detection can be performed on each frame of the video image by performing image difference on each frame of the video image. Specifically, the collected image when there is no vehicle in the target site is set as the reference image, and each frame image (first image) in the video image is compared with the reference image frame by frame to obtain a difference image; the difference image is obtained The area in which the pixel value is greater than the preset pixel value (the first area). If the mean value of the pixel value in this area is greater than the preset mean value, it means that the frame image is different from the reference image, and then the subsequent frame image in the frame image (the second area) is determined. Is the average pixel value of the area where the pixel value is greater than the preset pixel value in the difference image of the image) greater than the preset average value; if the pixel value of the area (the second area) where the pixel value is greater than the preset pixel value in the difference image of the subsequent frame image If the mean value is greater than the preset mean value, it is determined that there is a vehicle in the video image; if the mean pixel value of the area is less than or equal to the preset mean value, or there is no area with a pixel value greater than the preset pixel value in the difference image, it means that the frame image is different from the preset mean value. If the reference images are the same, determine whether there is an area greater than the preset pixel value in the difference image of the subsequent frame image in the video image; if there is no area greater than the preset pixel value in the difference image of the subsequent frame image in the video image, Then it is determined that there is no vehicle in the video image.
在本申请一些实施例中,还可以通过确定视频图像中每一帧图像中是否存在车厢,对视频图像中每一帧图像进行车辆检测,例如通过已训练的车厢检测模型对视频图像中每一帧图像进行车辆检测。其中车厢检测模型可以是机器学习模型,例如字典学习模型、逻辑回归模 型,车厢检测模型还可以是基于神经网络的检测模型。例如基于YOLO的检测模型、基于SSD的检测模型、基于RCNN的检测模型。In some embodiments of the present application, vehicle detection can also be performed on each frame of the video image by determining whether there is a carriage in each frame of the video image. For example, each frame of the video image can be detected through a trained carriage detection model. Frame images for vehicle detection. The carriage detection model can be a machine learning model, such as a dictionary learning model, a logistic regression model type, the carriage detection model can also be a detection model based on a neural network. For example, YOLO-based detection model, SSD-based detection model, and RCNN-based detection model.
步骤1012,对多张连续的运输图像中的每个运输图像进行目标检测,得到运输图像中目标车辆的边界框坐标。Step 1012: Perform target detection on each transportation image in multiple consecutive transportation images to obtain the bounding box coordinates of the target vehicle in the transportation image.
在本申请一些实施例中,每一张运输图像中目标车辆的边界框坐标可以是每一张运输图像中目标车辆的车厢边框的边界框坐标,例如车厢边界框的角点坐标、车厢边界框的中心点坐标、车厢边界的上边界的中点坐标或车厢边界框的下边界的中点坐标。In some embodiments of the present application, the bounding box coordinates of the target vehicle in each transportation image may be the bounding box coordinates of the compartment border of the target vehicle in each transportation image, such as the corner coordinates of the compartment boundary box, the compartment boundary box The center point coordinates of , the midpoint coordinates of the upper boundary of the carriage boundary, or the midpoint coordinates of the lower boundary of the carriage bounding box.
步骤1013,根据边界框坐标,计算目标车辆的边界框的中点坐标,将目标车辆在多张连续运输图像中的每个运输图像中对应的中点坐标,设置为目标车辆在多张连续的运输图像中的每个运输图像中对应的位置信息。Step 1013: Calculate the midpoint coordinates of the target vehicle's bounding box based on the bounding box coordinates, and set the corresponding midpoint coordinates of the target vehicle in each of the multiple continuous transportation images as the target vehicle in multiple continuous transportation images. Corresponding location information in each transportation image in the transportation image.
在本申请一些实施例中,考虑到车辆在进出港检测中,如果以车辆的车身或车头的坐标进行检测,由于车辆车头的形状的不规则,增加目标车辆的边界框坐标计算的难度,可能造成车厢进出港检测中计算量的增加,因此将车厢边界框的下边界的中点坐标设置为目标车辆在目标场地中的多张连续的运输图像的位置信息。In some embodiments of the present application, considering that during vehicle entry and exit detection, if the coordinates of the vehicle's body or front are used for detection, due to the irregular shape of the vehicle's front, it may be more difficult to calculate the bounding box coordinates of the target vehicle. This causes an increase in the amount of calculation in the detection of carriages entering and exiting the port. Therefore, the midpoint coordinates of the lower boundary of the carriage bounding box are set as the position information of multiple consecutive transportation images of the target vehicle in the target site.
在本申请一些实施例中,可以通过目标检测算法对每一张运输图像进行车厢目标检测,获取每一张运输图像中目标车辆的车厢的边界框。其中,目标检测算法包括但不限于RCNN、SSD、YOLO等。In some embodiments of the present application, a target detection algorithm can be used to detect the carriage target on each transportation image, and obtain the bounding box of the carriage of the target vehicle in each transportation image. Among them, target detection algorithms include but are not limited to RCNN, SSD, YOLO, etc.
在本申请一些实施例中,可以在获取每一张运输图像中目标车辆的车厢边界之后,确定该运输图像的中心,将该运输图像的中心作为坐标原点,根据车厢边界的角点与该运输图像的中心之间的水平像素长度和垂直像素长度确定车厢边界的角点的坐标,根据车厢边界点的各角点的坐标确定车厢边界的中心点坐标、车厢边界的上边界的中点坐标或车厢边界的下边界的中点坐标。需要说明的是,上述确定坐标的方式仅为示例性说明,在实际应用场景中可以调整坐标的确定方式,例如预先制作网格图像,其中该网格图像的图像尺寸与视频图像中每一帧图像的图像尺寸相同,在网格图像中每一个小格都设置坐标,在获取每一张运输图像中目标车辆的车厢边界之后,将该网格图像与每一张运输图像进行对齐,根据对齐后的运输图像中车厢边界的各角点所在的小格,确定各角点的坐标。In some embodiments of the present application, after obtaining the carriage boundary of the target vehicle in each transportation image, the center of the transportation image can be determined, and the center of the transportation image can be used as the coordinate origin. According to the corner point of the carriage boundary and the transportation The horizontal pixel length and vertical pixel length between the centers of the image determine the coordinates of the corner points of the carriage boundary. According to the coordinates of each corner point of the carriage boundary point, the coordinates of the center point of the carriage boundary, the coordinates of the midpoint of the upper boundary of the carriage boundary, or The coordinates of the midpoint of the lower boundary of the carriage boundary. It should be noted that the above method of determining coordinates is only an exemplary explanation. In actual application scenarios, the method of determining coordinates can be adjusted, for example, a grid image is made in advance, where the image size of the grid image is the same as that of each frame in the video image. The image sizes of the images are the same. Coordinates are set for each cell in the grid image. After obtaining the compartment boundary of the target vehicle in each transportation image, the grid image is aligned with each transportation image. According to the alignment The small grid where each corner point of the carriage boundary is located in the final transportation image is determined, and the coordinates of each corner point are determined.
在本申请一些实施例中,可以通过已训练的车厢检测模型对视频图像中每一帧图像进行车辆检测,得到每一张运输图像中目标车辆的边界坐标,根据边界坐标确定目标车辆在目标场地中的多张连续的运输图像中分别对应的位置信息。如图所示,图3是本申请实施例提供的车厢检测模型的一个实施例结构示意图,所示的车厢检测模型包括依次连接的输入层201、车厢检测层202和图像输出层203。In some embodiments of the present application, vehicle detection can be performed on each frame of the video image through a trained carriage detection model to obtain the boundary coordinates of the target vehicle in each transportation image, and the location of the target vehicle at the target site is determined based on the boundary coordinates. Corresponding position information in multiple consecutive transportation images. As shown in the figure, Figure 3 is a schematic structural diagram of an embodiment of a carriage detection model provided by an embodiment of the present application. The carriage detection model shown includes an input layer 201, a carriage detection layer 202 and an image output layer 203 connected in sequence.
输入层201获取目标场地的视频图像,并将目标场地的视频图像输入车辆检测层;车辆检测层对视频图像中每一帧图像进行车辆检测,得到目标车辆在目标场地中的多张连续的运输图像,对每一张运输图像进行目标检测,获取每一张运输图像中目标车辆的边界框坐标,并将目标车辆的边界框坐标输出至图像输出层203;图像输出层203输出目标车辆的边界框坐标。The input layer 201 obtains the video image of the target site, and inputs the video image of the target site into the vehicle detection layer; the vehicle detection layer performs vehicle detection on each frame of the video image, and obtains multiple continuous transportation images of the target vehicle in the target site. image, perform target detection on each transportation image, obtain the bounding box coordinates of the target vehicle in each transportation image, and output the bounding box coordinates of the target vehicle to the image output layer 203; the image output layer 203 outputs the boundary of the target vehicle box coordinates.
如图3所示,车厢检测层202包括依次连接的车厢检测单元20201和边界标记单元20202。其中车厢检测单元20201视频图像中每一帧图像进行车辆检测,得到目标车辆在目标场地中的多张连续的运输图像,并将目标车辆在目标场地中的多张连续的运输图像输入至边界标记单元20202,边界标记单元20202对每一张运输图像进行目标检测,获取每一张运输图像中目标车辆的边界框坐标,并将目标车辆的边界坐标输出至图像输出层203。As shown in Figure 3, the car detection layer 202 includes a car detection unit 20201 and a boundary marking unit 20202 connected in sequence. The carriage detection unit 20201 performs vehicle detection on each frame of the video image, obtains multiple continuous transportation images of the target vehicle in the target site, and inputs multiple continuous transportation images of the target vehicle in the target site to the boundary mark. Unit 20202, the boundary marking unit 20202 performs target detection on each transportation image, obtains the boundary box coordinates of the target vehicle in each transportation image, and outputs the boundary coordinates of the target vehicle to the image output layer 203.
在本申请一些实施例中,车厢检测单元20201还包括依次连接的车厢检测子单元和车标识别子单元,车厢检测子单元对视频图像中每一帧图像进行车辆检测,若该视频图像中存在车辆,则将该视频输入至车标识别子单元;车标识别子单元对视频图像中车辆进行车辆标识识别,确定该视频图像中包含的车辆数量以及每辆车辆对应的车辆标识,根据车辆标识获取视频图像中各车辆标识对应的目标车辆在目标场地中的多张连续的运输图像。 In some embodiments of the present application, the carriage detection unit 20201 also includes a carriage detection subunit and a vehicle logo recognition subunit connected in sequence. The carriage detection subunit performs vehicle detection on each frame of the video image. If there is a vehicle in the video image, vehicle, the video is input to the vehicle logo recognition subunit; the vehicle logo recognition subunit performs vehicle logo recognition on the vehicles in the video image, determines the number of vehicles contained in the video image and the vehicle logo corresponding to each vehicle, and based on the vehicle logo Obtain multiple consecutive transportation images of the target vehicle corresponding to each vehicle identification in the video image in the target site.
在本申请一些实施例中,图像输出层203还可以根据目标车辆的车厢边界框坐标计算车厢边界的下边界的中间坐标,将该车厢边界的下边界的中间坐标设置为目标车辆在目标场地中的多张连续的运输图像的位置信息并输出。In some embodiments of the present application, the image output layer 203 can also calculate the intermediate coordinates of the lower boundary of the compartment boundary based on the coordinates of the target vehicle's compartment boundary box, and set the intermediate coordinates of the lower boundary of the compartment boundary to the position of the target vehicle in the target site. The position information of multiple consecutive transportation images is output.
在本申请一些实施例中,可以通过目标场地中部署的监控摄像头采集的历史监控视频对车厢检测模型进行训练,得到已训练的车厢检测模型,具体地车厢检测模型训练过程包括:从目标场地的监控摄像头采集的历史监控视频中,选取车辆出港过程的样本视频图像,并标注车辆的车厢尾部边界框,将标注车辆的真实车厢尾部边界框的样本视频图像作为真实样本视频图像;将样本视频图像中每一帧样本图像输入车厢检测模型,得到每一帧样本图像对应的预测图像,其中预测图像上标记有预测的车厢尾部边界框;根据预设的损失函数计算预测图像与真实样本视频图像中每一帧样本图像对应的真实样本图像之间的误差,将误差作为训练损失;根据训练损失调整车厢检测模型的参数,直到车厢检测模型达到预设收敛条件,得到已训练的车厢检测模型。其中预设的损失函数可以是均方误差函数或平均绝对误差损失函数,理解为:根据损失函数分析每一帧样本图像的预测的车厢尾部边界框与每一帧样本图像对应的真实车厢尾部边界框之间的均方误差,将均方误差作为车厢检测模型的训练损失;根据损失函数分析每一帧样本图像的预测的车厢尾部边界框与每一帧样本图像对应的真实车厢尾部边界框之间的平均绝对误差,将平均绝对误差作为车厢检测模型的训练损失。预设收敛条件可以是训练损失小于或等于预设损失阈值,或者训练次数达到预设次数,例如当训练损失小于或等于0.0001,或训练次数达到1000次时,判定车厢检测模型达到预设收敛条件,得到已训练的车厢检测模型。历史监控视频可以是过去一段时间内监控摄像头采集的监控视频。在本申请一些实施例中,为了提高车厢检测模型的检测准确度,可以选取车辆出港过程以及进港过程的样本视频图像、以及获取多个目标场地的部署的监控摄像头采集的历史监控视频。在本申请一些实施例中,为了提高车厢检测模型在雨天、雾天、雪天、阴天等能见度较差的环境的检测准确度,可以对获取的多个目标场地的部署的监控摄像头采集的历史监控视频添加噪声,模拟雨天、雾天、雪天和阴天环境下采集的历史监控视频,将处理后的历史监控视频中选取的车辆出港过程以及进港过程的样本视频图像,对车厢检测模型进行训练,以提高车厢检测模型的泛化能力。In some embodiments of the present application, the carriage detection model can be trained through historical surveillance videos collected by surveillance cameras deployed in the target site to obtain a trained carriage detection model. Specifically, the carriage detection model training process includes: from the target site From the historical surveillance videos collected by surveillance cameras, select the sample video image of the vehicle's departure process, and mark the vehicle's rear compartment bounding box. The sample video image marked with the vehicle's real compartment rear bounding box will be used as the real sample video image; the sample video image Each frame of sample image is input into the carriage detection model to obtain the predicted image corresponding to each frame of sample image, in which the predicted carriage rear bounding box is marked on the predicted image; the difference between the predicted image and the real sample video image is calculated based on the preset loss function The error between the real sample images corresponding to each frame of sample image is regarded as the training loss; the parameters of the carriage detection model are adjusted according to the training loss until the carriage detection model reaches the preset convergence condition, and the trained carriage detection model is obtained. The preset loss function can be a mean square error function or a mean absolute error loss function, which is understood as: analyzing the predicted carriage rear boundary box of each frame of sample image according to the loss function and the real carriage rear boundary corresponding to each frame of sample image. The mean square error between frames is used as the training loss of the carriage detection model; according to the loss function, the predicted carriage rear bounding box of each frame of sample image is analyzed and the real carriage rear bounding box corresponding to each frame of sample image is analyzed. The average absolute error between the two is used as the training loss of the carriage detection model. The preset convergence condition can be that the training loss is less than or equal to the preset loss threshold, or the number of training times reaches the preset number. For example, when the training loss is less than or equal to 0.0001, or the number of training times reaches 1000, it is determined that the carriage detection model has reached the preset convergence condition. , to obtain the trained carriage detection model. Historical surveillance videos can be surveillance videos collected by surveillance cameras in the past period of time. In some embodiments of the present application, in order to improve the detection accuracy of the carriage detection model, sample video images of the vehicle's departure and entry process can be selected, and historical surveillance videos collected by surveillance cameras deployed at multiple target sites can be obtained. In some embodiments of the present application, in order to improve the detection accuracy of the carriage detection model in environments with poor visibility such as rainy days, foggy days, snowy days, cloudy days, etc., the obtained data collected by surveillance cameras deployed at multiple target sites can be Noise is added to the historical surveillance video to simulate the historical surveillance video collected in rainy, foggy, snowy and cloudy environments. Sample video images of the vehicle departure process and entry process selected from the processed historical surveillance video are used for carriage detection. The model is trained to improve the generalization ability of the carriage detection model.
在本申请实施例中,通过目标场地已部署的监控摄像头采集目标场地的视频图像,不需要额外部署摄像头,降低车辆进出港检测的硬件成本;并且通过检测目标车辆的车厢边界框坐标,确定目标车辆在目标场地中的多张连续的运输图像的位置信息,利用车厢形状规则以及便于识别的优势,提高车辆进出港检测的便捷性。在本申请一些实施例中,如图4所示,在获取目标场地的视频图像之后,可以通过判断视频图像中是否存在不能检测到目标车辆的车厢的帧图像,以及该帧图像在视频图像中的位置信息,确定目标车辆是否出港,具体地,获取目标场地的视频图像,提取视频图像中包含目标车辆的连续帧图像可包括步骤301~302:In the embodiment of this application, video images of the target site are collected through surveillance cameras that have been deployed at the target site. There is no need to deploy additional cameras, which reduces the hardware cost of vehicle entry and exit detection; and by detecting the coordinates of the carriage boundary box of the target vehicle, the target is determined The position information of multiple consecutive transportation images of vehicles in the target site is used to improve the convenience of vehicle entry and exit detection by taking advantage of the shape rules of the carriages and easy identification. In some embodiments of the present application, as shown in Figure 4, after obtaining the video image of the target site, it can be determined whether there is a frame image in the video image in which the target vehicle cannot be detected, and whether the frame image is in the video image. The location information of the target vehicle is determined to determine whether the target vehicle has left the port. Specifically, obtaining the video image of the target site, and extracting the continuous frame images containing the target vehicle in the video image may include steps 301 to 302:
步骤301,获取目标场地的视频图像,对视频图像中每一帧图像进行车辆检测,得到每一帧图像中目标车辆的检测结果。Step 301: Obtain the video image of the target site, perform vehicle detection on each frame of the video image, and obtain the detection result of the target vehicle in each frame of image.
步骤302,以存在目标车辆的帧图像为起始帧,提取视频图像中包含目标车辆的连续帧图像。Step 302: Taking the frame image in which the target vehicle exists as the starting frame, extract consecutive frame images containing the target vehicle in the video image.
在本申请一些实施例中,可以通过步骤1011中对视频图像中每一帧图像进行车辆检测的方式对视频图像中每一帧图像进行车辆检测,确定视频图像中是否存在车辆,在视频图像存在车辆时,获取该车辆的标识,获取视频图像中第一次检测到该标识对应的车辆所在的帧图像,并对该帧图像后续的连续帧图像执行步骤302。In some embodiments of the present application, vehicle detection can be performed on each frame of the video image by performing vehicle detection on each frame of the video image in step 1011 to determine whether a vehicle exists in the video image. When a vehicle is detected, the identification of the vehicle is obtained, the frame image in the video image where the vehicle corresponding to the identification is detected for the first time is obtained, and step 302 is performed on subsequent consecutive frame images of the frame image.
在本申请一些实施例中,当视频图像存在车辆时,获取该车辆的标识,查询已记录的车辆进出港数据,获取该标识对应的目标车辆的进出港时间,根据进出港时间获取最新时刻对应的进出港记录,若最新时刻对应的进出港记录为出港,该视频图像中该标识对应的目标车辆可能是驶入目标场地,则从车辆进出港数据中获取该目标标识对应的上一次出港时间与下一次进港时间之间的时间差,如果每次出港和下一次进港之间的时间差相等,则确定该时间 差与最新时刻之间的时间和与视频图像对应的时间是否相等,如果时间相等,说明该视频图像中该标识对应的目标车辆又一次驶入目标场地,则输出目标车辆进港,并获取目标车辆的进港时间,将该目标车辆的进港时间写入已记录的车辆进出港数据中该目标车辆的标识对应的进出港记录,更新车辆进出港数据。In some embodiments of the present application, when a vehicle exists in the video image, the identification of the vehicle is obtained, the recorded vehicle entry and exit data is queried, the entry and exit time of the target vehicle corresponding to the identification is obtained, and the latest time corresponding to the entry and exit time is obtained. If the entry and exit record corresponding to the latest moment is departure, the target vehicle corresponding to the logo in the video image may be driving into the target site, and the last departure time corresponding to the target logo is obtained from the vehicle entry and exit data. The time difference from the next arrival time, determined if the time difference between each departure and the next arrival is equal Is the time between the difference and the latest time and the time corresponding to the video image equal? If the times are equal, it means that the target vehicle corresponding to the logo in the video image has entered the target site again, then the target vehicle is output and the target is obtained. The arrival time of the vehicle is written into the entry and exit record corresponding to the identification of the target vehicle in the recorded vehicle entry and exit data, and the vehicle entry and exit data is updated.
在本申请一些实施例中,考虑到仅根据每次出港和下一次进港之间的时间差判断目标车辆是否进港,可能造成判断不准确,因此在若最新时刻对应的进出港记录为出港,则根据步骤101~103在检测该视频图像中的后续帧图像中该标识对应的目标车辆的车厢的位置信息的变化趋势是否为递减;若该标识对应的目标车辆的车厢的位置信息的变化趋势是递减,则输出目标车辆的进出港检测结果为车辆进港;若该标识对应的目标车辆的车厢的位置信息的变换趋势是递增或不变,说明目标车辆还未完全驶出目标场地或目标车辆停靠目标场地,则获取视频图像中其余标识对应的车辆的连续帧图像。In some embodiments of the present application, considering that only judging whether the target vehicle has entered the port based on the time difference between each departure and the next arrival may cause inaccurate judgment, if the entry and exit record corresponding to the latest time is a departure, Then according to steps 101 to 103, it is detected whether the changing trend of the position information of the compartment of the target vehicle corresponding to the identification in the subsequent frame images in the video image is decreasing; if the changing trend of the position information of the compartment of the target vehicle corresponding to the identification is is decreasing, then the output detection result of the target vehicle's arrival and departure is that the vehicle has entered the port; if the transformation trend of the position information of the target vehicle's compartment corresponding to the mark is increasing or unchanged, it means that the target vehicle has not completely driven out of the target site or target. When the vehicle stops at the target site, continuous frame images of the vehicle corresponding to the remaining markers in the video image are obtained.
在本申请一些实施例中,若最新时刻对应的进出港记录为进港,则获取视频图像中第一次检测到该标识对应的车辆所在的帧图像,并对该帧图像后续的连续帧图像执行步骤302。In some embodiments of the present application, if the entry and exit record corresponding to the latest moment is an arrival, then the frame image in the video image where the vehicle corresponding to the logo is detected for the first time is obtained, and the subsequent consecutive frame images of the frame image are Execute step 302.
在本申请一些实施例中,针对每一帧图像,若该帧图像未存在目标车辆的车厢,则检测该帧图像之后的图像是否存在目标车辆的车厢。In some embodiments of the present application, for each frame image, if there is no cabin of the target vehicle in the frame image, it is detected whether the cabin of the target vehicle exists in the image after the frame image.
在本申请一些实施例中,对视频图像中的连续帧图像的每一帧图像进行车厢检测,确定后续帧图像中是否存在目标车辆的车厢的帧图像;若该帧图像未存在目标车辆的车厢,则检测该帧图像之后的图像是否存在目标车辆的车厢。In some embodiments of the present application, cabin detection is performed on each frame of consecutive frame images in the video image to determine whether there is a frame image of the target vehicle's cabin in the subsequent frame image; if there is no frame image of the target vehicle's cabin in the frame image, , then detect whether the target vehicle compartment exists in the image after the frame image.
在本申请一些实施例中,当步骤301中检测到目标车辆最新时刻对应的进出港记录为进港,则获取视频图像中第一次检测到该标识对应的车辆所在的帧图像,并对该帧图像后续的连续帧图像的每一帧图像进行车厢检测,确定后续帧图像中是否存在目标车辆的车厢的帧图像;若该帧图像未存在目标车辆的车厢,则输出目标车辆的进出港检测结果为车辆出港。In some embodiments of the present application, when it is detected in step 301 that the entry and exit record corresponding to the latest moment of the target vehicle is an arrival, then the frame image in the video image where the vehicle corresponding to the identification is detected for the first time is obtained, and the Carriage detection is performed on each subsequent frame image of the frame image to determine whether there is a frame image of the target vehicle's cabin in the subsequent frame image; if there is no frame image of the target vehicle's cabin in the frame image, the entry and exit detection of the target vehicle is output. The result is vehicle departure.
在本申请一些实施例中,若该帧图像之后的图像不存在目标车辆的车厢,则确定目标车辆的进出港检测结果为车辆出港;若该帧图像之后的图像存在目标车辆的车厢,则以存在目标车辆的车厢的帧图像为起始帧,提取视频图像中包含目标车辆的连续帧图像。In some embodiments of the present application, if the target vehicle's compartment does not exist in the image after the frame image, then it is determined that the target vehicle's entry and exit detection result is the vehicle leaving the port; if the target vehicle's compartment exists in the image after the frame image, then the target vehicle's compartment is determined as The frame image of the compartment where the target vehicle exists is the starting frame, and the continuous frame images containing the target vehicle in the video image are extracted.
本申请实施例在获取到目标场地的视频图像后,对视频图像中每一帧图像进行车辆检测,通过判断不存在该目标车辆的车厢的帧图像的后续帧图像中是否存在目标车辆的车厢,确定视频图像中目标车辆的出港检测结果;并且通过车标的标识从已记录的车辆进出港数据中提取该目标车辆进港和出港的时间信息,根据时间信息判断视频图像中目标车辆的出港检测结果,提供多种视频图像中目标车辆的出港检测方法。In the embodiment of the present application, after acquiring the video image of the target site, vehicle detection is performed on each frame of the video image, and by determining whether there is a compartment of the target vehicle in the subsequent frame image in which the compartment of the target vehicle does not exist, Determine the departure detection result of the target vehicle in the video image; and extract the entry and departure time information of the target vehicle from the recorded vehicle entry and exit data through the identification of the vehicle logo, and determine the departure detection result of the target vehicle in the video image based on the time information , providing a variety of exit detection methods for target vehicles in video images.
在本申请一些实施例中,在获取在目标场地中针对目标车辆的多张连续的运输图像以及目标车辆在各运输图像中的位置信息之后,根据目标场地的场地标识获取该目标场地关联的位置深度关系数据,获取位置深度关系数据中与各运输图像中的位置信息匹配的目标位置信息,根据各目标位置信息得到目标车辆在各运输图像中的深度信息。In some embodiments of the present application, after acquiring multiple consecutive transportation images of the target vehicle in the target site and the location information of the target vehicle in each transportation image, the location associated with the target site is obtained based on the site identifier of the target site. Depth relation data: obtain the target position information in the position depth relation data that matches the position information in each transportation image, and obtain the depth information of the target vehicle in each transportation image based on each target position information.
在本申请一些实施例中,为了降低车辆进出港检测方法的计算复杂度,可以在目标场地不存在车辆和货物时,采集目标场地对应的目标图像;其中,目标图像表征目标场地中不存在车辆和货物;通过已训练的深度估计网络对目标图像进行深度估计,得到目标图像中至少一个像素点对应的深度信息;获取至少一个像素点在目标图像中的位置信息,将至少一个像素点的位置信息与至少一个像素点对应的深度信息关联,得到位置深度关系数据。进一步地,可将位置深度关系数据与目标场地的场地标识关联。In some embodiments of the present application, in order to reduce the computational complexity of the vehicle entry and exit detection method, the target image corresponding to the target site can be collected when there are no vehicles and goods at the target site; wherein, the target image represents the absence of vehicles in the target site. and goods; perform depth estimation on the target image through the trained depth estimation network to obtain the depth information corresponding to at least one pixel in the target image; obtain the position information of at least one pixel in the target image, and convert the position of at least one pixel into The information is associated with the depth information corresponding to at least one pixel to obtain position-depth relationship data. Further, the location depth relationship data can be associated with the site identification of the target site.
如图5所示,图5是本申请实施例提供的深度估计网络的一个实施例结构示意图,所示的深度估计网络包括依次连接的编码层401和深度估计层402。As shown in Figure 5, Figure 5 is a schematic structural diagram of a depth estimation network provided by an embodiment of the present application. The depth estimation network shown includes a coding layer 401 and a depth estimation layer 402 connected in sequence.
其中,编码层401是基于预先训练的EfficientNet B5编码器和标准特征上采样解码器构建的,目标图像输入至深度估计网络中的编码层401进行特征提取,得到解码特征;其中目标图像的尺寸为(H*W*3),编码层401输出的解码特征为(H*W*Cd)的张量。 Among them, the encoding layer 401 is constructed based on the pre-trained EfficientNet B5 encoder and the standard feature upsampling decoder. The target image is input to the encoding layer 401 in the depth estimation network for feature extraction to obtain decoding features; where the size of the target image is (H*W*3), the decoding feature output by the encoding layer 401 is a tensor of (H*W*Cd).
编码层401将解码特征输入至深度估计层402,深度估计层402根据输入的解码特征进行深度信息估计,输出尺寸为(H*W*1)的深度图像。如图6所示,图6给出了深度估计层的一个结构示意图,所示的深度估计层包括转换单元501、卷积单元502、深度单元503和输出单元504,其中转换单元501的输出两个分支,其中一个分支输出范围注意力图,并将范围注意力图输入卷积单元502,卷积单元502的输出的范围注意力图中每个像素的Softmax分数输入至输出单元504;另一个分支输出的单元宽度向量输入深度单元503,深度单元503计算深度单元中心,将深度单元中心输入输出单元504。输出单元504根据Softmax分数和该像素的深度单元中心预测该像素的深度值,组合各像素的深度值得到目标图像对应的深度图像。The encoding layer 401 inputs the decoding features to the depth estimation layer 402. The depth estimation layer 402 estimates depth information based on the input decoding features and outputs a depth image with a size of (H*W*1). As shown in Figure 6, Figure 6 provides a schematic structural diagram of the depth estimation layer. The depth estimation layer shown includes a conversion unit 501, a convolution unit 502, a depth unit 503 and an output unit 504. The output of the conversion unit 501 is two branches, one of which outputs a range attention map and inputs the range attention map to the convolution unit 502. The Softmax score of each pixel in the range attention map output by the convolution unit 502 is input to the output unit 504; the other branch outputs The unit width vector is input to the depth unit 503, the depth unit 503 calculates the depth unit center, and inputs the depth unit center to the output unit 504. The output unit 504 predicts the depth value of the pixel based on the Softmax score and the depth unit center of the pixel, and combines the depth values of each pixel to obtain a depth image corresponding to the target image.
在本申请一些实施例中,为了降低车辆进出港检测方法的成本,可以通过迁移学习对深度估计网络进行训练,考虑到因为中转场有很多车辆,和自动驾驶数据集KITTI的场景具有相似性,因此选择KITTI上训练的AdaBins网络作为预训练的深度估计网络,通过目标场地的监控摄像头采集目标场地的样本图像,根据样本图像对预训练的深度估计网络进行适配性测试;若预训练的深度估计网络的适配性测试通过,则将预训练的深度估计网络设置为已训练的深度估计网络;若预训练的深度估计网络的适配性测试不通过,则根据样本图像调整预训练的深度估计网络的参数,得到已训练的深度估计网络。具体地,如图7所示,对预训练的深度估计网络进行适配性测试方法包括步骤601~604:In some embodiments of this application, in order to reduce the cost of the vehicle entry and exit detection method, the depth estimation network can be trained through transfer learning. Considering that there are many vehicles in the transfer yard, it is similar to the scene of the autonomous driving data set KITTI. Therefore, the AdaBins network trained on KITTI is selected as the pre-trained depth estimation network. Sample images of the target site are collected through the surveillance camera of the target site, and the adaptability test of the pre-trained depth estimation network is performed based on the sample images; if the pre-trained depth If the suitability test of the estimation network passes, the pre-trained depth estimation network is set to the trained depth estimation network; if the suitability test of the pre-trained depth estimation network fails, the pre-trained depth is adjusted based on the sample image The parameters of the network are estimated to obtain the trained depth estimation network. Specifically, as shown in Figure 7, the method for testing the adaptability of the pre-trained depth estimation network includes steps 601 to 604:
步骤601,在目标场地中设置多个测试点,获取各测试点到摄像头之间的真实距离。Step 601: Set multiple test points in the target site to obtain the true distance between each test point and the camera.
在本申请一些实施例中,可以通过雷达、激光、声纳或红外测距获取各测试点到摄像头之间的真实距离,具体地,在摄像头相同位置部署雷达、激光、声纳或红外设备,根据雷达、激光、声纳或红外设备采集各测试点到摄像头之间的真实距离。In some embodiments of this application, the real distance between each test point and the camera can be obtained through radar, laser, sonar or infrared ranging. Specifically, radar, laser, sonar or infrared equipment is deployed at the same position of the camera. Collect the true distance between each test point and the camera based on radar, laser, sonar or infrared equipment.
步骤602,采集设置多个测试点之后的目标场地对应的样本图像,将样本图像输入预训练的深度估计网络,得到样本图像中多个测试点分别对应的测试深度值。Step 602: Collect sample images corresponding to the target site after setting multiple test points, input the sample images into the pre-trained depth estimation network, and obtain test depth values corresponding to the multiple test points in the sample image.
在本申请一些实施例中,步骤602包括:采集设置多个测试点之后的目标场地对应的样本图像,将样本图像输入预训练的深度估计网络,得到该样本图像对应的预测深度图像;根据多个测试点在样本图像中的位置坐标,获取预测深度图像中相同位置坐标对应的像素的深度值,将各深度值设置为样本图像中各测试点对应的测试深度值。In some embodiments of the present application, step 602 includes: collecting sample images corresponding to the target site after setting multiple test points, inputting the sample images into the pre-trained depth estimation network, and obtaining the predicted depth image corresponding to the sample image; based on the multiple test points The position coordinates of each test point in the sample image are obtained, the depth value of the pixel corresponding to the same position coordinate in the predicted depth image is obtained, and each depth value is set to the test depth value corresponding to each test point in the sample image.
步骤603,若多个测试点对应的测试深度值与真实距离之间的误差小于或等于预设误差阈值,则将预训练的深度估计网络设置为已训练的深度估计网络。Step 603: If the error between the test depth values corresponding to the multiple test points and the real distance is less than or equal to the preset error threshold, the pre-trained depth estimation network is set as the trained depth estimation network.
在本申请一些实施例中,若各测试点对应的测试深度值与真实距离之间的误差小于或等于预设误差阈值,说明预训练的深度估计网络的适配性测试通过,则将预训练的深度估计网络设置为已训练的深度估计网络。In some embodiments of the present application, if the error between the test depth value corresponding to each test point and the true distance is less than or equal to the preset error threshold, it means that the adaptability test of the pre-trained depth estimation network has passed, and the pre-trained The depth estimation network is set to the trained depth estimation network.
步骤604,若多个测试点对应的测试深度值与真实距离之间的误差大于预设误差阈值,则根据测试深度值与真实距离的训练损失值调整预训练的深度估计网络的参数,直至多个测试点对应的测试深度值与真实距离之间的误差小于或等于所述预设误差阈值,得到已训练的深度估计网络。Step 604: If the error between the test depth values corresponding to multiple test points and the true distance is greater than the preset error threshold, adjust the parameters of the pre-trained depth estimation network according to the training loss value between the test depth value and the true distance until multiple The error between the test depth value corresponding to each test point and the real distance is less than or equal to the preset error threshold, and a trained depth estimation network is obtained.
在本申请一些实施例中,步骤604包括:若至少一个测试点对应的测试深度值与真实距离之间的误差大于预设误差阈值,说明预训练的深度估计网络适配性测试不通过,则采集目标场景的多张样本图像得到样本数据集;将样本图像输入预训练的深度估计网络得到预测深度图像,以及预测深度图像中各测试点的测试深度值;根据预设损失函数计算测试深度值与真实距离的训练损失值,根据训练损失调整预训练的深度估计网络的参数,当预训练的深度估计网络达到预测收敛条件时,得到已训练的深度估计网络。其中,预设的损失函数可以是均方误差函数或平均绝对误差损失函数,理解为:根据损失函数分析样本图像中各测试点的测试深度值与各测试点对应的真实距离之间的均方误差,将均方误差作为深度估计网络的训练损失;根据损失函数分析样本图像中各测试点的测试深度值与各测试点对应的真实距离之间的平均绝对误差,将平均绝对误差作为深度估计网络的训练损失。预测收敛条件可以是训练损失值小于或等于阈值,或者训练迭代次数达到预测次数。 In some embodiments of the present application, step 604 includes: If the error between the test depth value corresponding to at least one test point and the true distance is greater than the preset error threshold, it means that the pre-trained depth estimation network adaptability test fails, then Collect multiple sample images of the target scene to obtain a sample data set; input the sample images into the pre-trained depth estimation network to obtain a predicted depth image, and predict the test depth value of each test point in the depth image; calculate the test depth value according to the preset loss function The training loss value of the distance from the true distance, and the parameters of the pre-trained depth estimation network are adjusted according to the training loss. When the pre-trained depth estimation network reaches the prediction convergence condition, the trained depth estimation network is obtained. Among them, the preset loss function can be the mean square error function or the average absolute error loss function, which is understood as: analyzing the mean square between the test depth value of each test point in the sample image and the true distance corresponding to each test point according to the loss function Error, the mean square error is used as the training loss of the depth estimation network; according to the loss function, the average absolute error between the test depth value of each test point in the sample image and the true distance corresponding to each test point is analyzed, and the average absolute error is used as the depth estimate The training loss of the network. The prediction convergence condition can be that the training loss value is less than or equal to the threshold, or the number of training iterations reaches the prediction number.
在本申请一些实施例中,步骤604还包括:若至少一个测试点对应的测试深度值与真实距离之间的误差大于预设误差阈值,说明预训练的深度估计网络适配性测试不通过,则部署深度摄像头,通过深度摄像头采集多个目标场景的样本图像以及样本图像对应的真实深度图像组成训练样本数据集;将各样本图像输入预训练的深度估计网络得到预测深度图像;通过预设的损失函数、各样本图像对应的预测深度图像和各样本图像对应的真实样本图像确定预训练的深度估计网络的训练损失,根据训练损失迭代调整预训练的深度估计网络的参数,当预训练的深度估计网络得达到预设收敛条件时,停止训练,得到已训练的深度估计网络。其中,预设的损失函数可以是均方误差函数或平均绝对误差损失函数,理解为:根据损失函数分析样本图像对应的预测深度图像与样本图像对应的真实深度图像之间的均方误差,将均方误差作为深度估计网络的训练损失;根据损失函数分析样本图像对应的预测深度图像与样本图像对应的真实深度图像之间的平均绝对误差,将平均绝对误差作为深度估计网络的训练损失;预测收敛条件可以是训练损失值小于或等于阈值,或者训练迭代次数达到预测次数。其中,深度摄像头的可拆卸,并且该深度摄像头的架设高度和角度分别与各目标场景中摄像头的高度和角度相似。In some embodiments of the present application, step 604 also includes: if the error between the test depth value corresponding to at least one test point and the true distance is greater than the preset error threshold, it means that the pre-trained depth estimation network adaptability test fails, Then deploy a depth camera, collect sample images of multiple target scenes and the real depth images corresponding to the sample images through the depth camera to form a training sample data set; input each sample image into the pre-trained depth estimation network to obtain the predicted depth image; through the preset The loss function, the predicted depth image corresponding to each sample image and the real sample image corresponding to each sample image determine the training loss of the pre-trained depth estimation network, and iteratively adjust the parameters of the pre-trained depth estimation network based on the training loss. When the pre-trained depth When the estimation network reaches the preset convergence condition, the training is stopped and the trained depth estimation network is obtained. Among them, the preset loss function can be a mean square error function or a mean absolute error loss function, which is understood as: analyzing the mean square error between the predicted depth image corresponding to the sample image and the real depth image corresponding to the sample image according to the loss function, and The mean square error is used as the training loss of the depth estimation network; the average absolute error between the predicted depth image corresponding to the sample image and the real depth image corresponding to the sample image is analyzed according to the loss function, and the average absolute error is used as the training loss of the depth estimation network; prediction The convergence condition can be that the training loss value is less than or equal to the threshold, or the number of training iterations reaches the predicted number. Among them, the depth camera is detachable, and the installation height and angle of the depth camera are similar to the height and angle of the camera in each target scene.
本申请实施例在目标场景中没有任何车辆或者货物的时候,采集目标图像,运行已训练的深度估计网络获取该目标场景的位置深度关系数据,后续获取深度信息时只需要查询该位置深度关系数据,减少了算法运算量;并且在深度估计网络训练时,通过迁移学习对深度估计网络进行训练得到预训练的深度估计网络,当需要将预训练的深度估计网络部署到不同的目标场地时,仅需要进行适配性测试,也不需要再进行训练,就能复制到其他中转场,解决了以往基于分类的视觉方案需要不断增补数据的问题。In the embodiment of this application, when there are no vehicles or goods in the target scene, the target image is collected, and the trained depth estimation network is run to obtain the position-depth relationship data of the target scene. When subsequently obtaining depth information, only the position-depth relationship data needs to be queried. , reducing the computational complexity of the algorithm; and when training the depth estimation network, the depth estimation network is trained through transfer learning to obtain a pre-trained depth estimation network. When the pre-trained depth estimation network needs to be deployed to different target sites, only It requires adaptability testing and no further training, and can be copied to other staging areas, which solves the problem of previous classification-based visual solutions that require continuous data addition.
在本申请一些实施例中,在确定目标车辆在多张连续的运输图像中分别对应的深度信息之后,根据各运输图像的时间顺序,对各运输图像进行排序,得到排序后的多张运输图像,根据排序后的多张运输图像得到目标车辆在排序后的多张运输图像中的深度信息,将目标车辆在排序后的多张运输图像中的深度信息分别与预设距离阈值进行比较,得到目标车辆的深度信息变化趋势。In some embodiments of the present application, after determining the corresponding depth information of the target vehicle in multiple consecutive transportation images, the transportation images are sorted according to the time sequence of each transportation image to obtain multiple sorted transportation images. , obtain the depth information of the target vehicle in the multiple sorted transportation images based on the sorted multiple transportation images, and compare the depth information of the target vehicle in the multiple sorted transportation images with the preset distance threshold respectively, and get The changing trend of the depth information of the target vehicle.
在本申请一些实施例中,可以将目标车辆在排序后的多张运输图像中分别对应的深度信息,与预设距离阈值进行作差,得到差值序列,根据差值序列得到目标车辆的深度信息变化趋势。在本申请一些实施例中,可以将差值序列中各差值进行前向差分,根据差分结果确定得到目标车辆的深度信息变化趋势。例如,当差分结果小于0时,说明下一时刻对应的差值小于上一时刻对应的差值,则得到目标车辆的深度信息变化趋势为递减;当差分结果大于0时,说明下一时刻对应的差值大于上一时刻对应的差值,则得到目标车辆的深度信息变化趋势为递增。示例性的,以预设距离阈值为1米为例进行说明,当目标车辆在排序后的运输图像中的深度信息为{9,6,5,3,2}时,将目标车辆在排序后的运输图像中的深度信息与预设距离阈值进行作差,得到差值序列{8,5,2,1},由于差值序列{8,5,2,1}差分结果{-3,-3,-1}均小于0,则目标车辆的深度信息变化趋势为递减。In some embodiments of the present application, the corresponding depth information of the target vehicle in the multiple sorted transportation images can be compared with the preset distance threshold to obtain a difference sequence, and the depth of the target vehicle can be obtained based on the difference sequence. Information trends. In some embodiments of the present application, each difference value in the difference sequence can be forward differentiated, and the change trend of the depth information of the target vehicle can be determined based on the difference result. For example, when the difference result is less than 0, it means that the difference value corresponding to the next moment is less than the difference value corresponding to the previous moment, and the change trend of the depth information of the target vehicle is decreasing; when the difference result is greater than 0, it means that the difference value corresponding to the next moment moment is decreasing. The difference is greater than the corresponding difference at the previous moment, then the change trend of the depth information of the target vehicle is increasing. For example, taking the preset distance threshold of 1 meter as an example, when the depth information of the target vehicle in the sorted transportation image is {9, 6, 5, 3, 2}, the target vehicle will be The depth information in the transportation image is compared with the preset distance threshold to obtain the difference sequence {8, 5, 2, 1}. Since the difference sequence {8, 5, 2, 1} the difference result is {-3, - 3, -1} are both less than 0, then the change trend of the depth information of the target vehicle is decreasing.
为了提高车辆的进出港检测结果的准确性,在根据深度信息确定目标车辆变化趋势之后,可以根据差分序列确定目标车辆的进出港检测结果,具体地包括:若深度信息变化趋势为递减,且差值序列中小于或等于预设差值阈值的差值对应的时间段大于预设时长,则目标车辆的进出港检测结果为进港;若深度信息变化趋势为递增,且目标车辆在排序后的多张运输图像中的深度信息中,存在大于预设值的目标深度信息,则目标车辆的进出港检测结果为出港。In order to improve the accuracy of the vehicle's entry and exit detection results, after determining the target vehicle's change trend based on the depth information, the target vehicle's entry and exit detection results can be determined based on the difference sequence, specifically including: If the depth information change trend is decreasing, and the difference If the time period corresponding to the difference value in the value sequence that is less than or equal to the preset difference threshold is greater than the preset time length, the target vehicle's entry and exit detection result is port arrival; if the change trend of the depth information is increasing, and the target vehicle is in the sorted Among the depth information in multiple transportation images, if there is target depth information greater than the preset value, the target vehicle's entry and exit detection result is port departure.
在本申请一些实施例中,还可以在确定目标车辆在多张连续的运输图像中分别对应的深度信息之后,根据多张连续的运输图像对应的时间顺序,对目标车辆在各运输图像中的深度信息进行排序,按照差值序列的差分方式将目标车辆在排序后的各运输图像中的深度信息进行差分,得到深度差分结果,根据深度差分结果确定得到目标车辆的深度信息变化趋势;若深度信息变化趋势为递减,且排序后的各运输图像中的深度信息中存在至少一个小于或等于预设深度信息的目标深度信息,则目标车辆的进出港检测结果为进港,根据排序后的各运输 图像中时间信息记录目标车辆的进港时间;若深度信息变化趋势为递增,且排序后的各运输图像中的深度信息中存在大于预设值的目标深度信息,则目标车辆的进出港检测结果为出港,根据排序后的各运输图像中时间信息记录目标车辆的出港时间。In some embodiments of the present application, after determining the corresponding depth information of the target vehicle in multiple consecutive transportation images, the depth information of the target vehicle in each transportation image can be determined based on the time sequence corresponding to the multiple consecutive transportation images. The depth information is sorted, and the depth information of the target vehicle in each sorted transportation image is differentiated according to the difference sequence difference method to obtain the depth difference result. The change trend of the depth information of the target vehicle is determined based on the depth difference result; if the depth The information change trend is decreasing, and the depth information in each sorted transportation image contains at least one target depth information that is less than or equal to the preset depth information, then the entry and exit detection result of the target vehicle is port arrival. According to the sorted each transportation The time information in the image records the arrival time of the target vehicle; if the change trend of the depth information is increasing, and the depth information in each sorted transportation image contains target depth information greater than the preset value, the detection result of the target vehicle's entry into the port will be To leave the port, the departure time of the target vehicle is recorded based on the time information in each sorted transportation image.
本申请实施例通过深度信息进行车辆进出港检测,将到车辆进出港检测由定性分析修改为定量计算,提高车辆进出港检测的准确性。The embodiment of this application uses depth information to detect vehicle entry and exit, and changes the vehicle entry and exit detection from qualitative analysis to quantitative calculation, thereby improving the accuracy of vehicle entry and exit detection.
为了更好实施本申请实施例提供的车辆进出港检测方法,在车辆进出港检测方法基础上,本申请实施例提供一种车辆进出港检测装置,如图8所示,图8是本申请实施例提供的车辆进出港检测装置的一个实施例结构示意图,所示的车辆进出港检测装置包括:In order to better implement the vehicle entry and exit detection method provided by the embodiment of the present application, based on the vehicle entry and exit detection method, the embodiment of the present application provides a vehicle entry and exit detection device, as shown in Figure 8. Figure 8 is the implementation of the present application. The example provides a structural schematic diagram of an embodiment of a vehicle entry and exit detection device. The vehicle entry and exit detection device shown includes:
获取模块701,用于获取目标场地中目标车辆的多张连续的运输图像,以及目标车辆在多张连续的运输图像中的每个运输图像中对应位置信息;The acquisition module 701 is used to acquire multiple continuous transportation images of the target vehicle in the target site, and the corresponding position information of the target vehicle in each transportation image of the multiple continuous transportation images;
深度确定模块702,用于根据目标场地关联的位置深度关系数据,以及位置信息,确定目标车辆在运输图像中对应的深度信息;位置深度关系数据包括目标场地中每个位置信息以及每个位置信息对应的深度信息,深度信息表征运输图像中的位置信息对应的点映射到所述目标场地中时,点至采集运输图像的摄像头之间的距离;Depth determination module 702 is used to determine the depth information corresponding to the target vehicle in the transportation image based on the position depth relationship data associated with the target site and the location information; the position depth relationship data includes each location information and each location information in the target site. Corresponding depth information, which represents the distance between the point and the camera that collects the transportation image when the point corresponding to the position information in the transportation image is mapped to the target site;
深度趋势确定模块703,用于根据多张连续的运输图像分别对应的深度信息,得到目标车辆的深度信息变化趋势;The depth trend determination module 703 is used to obtain the depth information change trend of the target vehicle based on the depth information corresponding to multiple consecutive transportation images;
检测模块704,用于根据深度信息变化趋势,得到目标车辆的进出港检测结果。The detection module 704 is used to obtain the entry and exit detection results of the target vehicle based on the depth information change trend.
在本申请一些实施例中,车辆进出港检测装置还包括:In some embodiments of this application, the vehicle entry and exit detection device also includes:
深度估计模块705,用于采集目标场地对应的目标图像;目标图像为目标场地中未存在车辆的图像;通过已训练的深度估计网络对目标图像进行深度估计,得到目标图像中至少一个像素点对应的深度信息;获取至少一个像素点在目标图像中的位置信息,将至少一个像素点的位置信息与至少一个像素点对应的深度信息关联,得到位置深度关系数据。Depth estimation module 705 is used to collect the target image corresponding to the target site; the target image is an image without a vehicle in the target site; perform depth estimation on the target image through the trained depth estimation network to obtain at least one pixel corresponding to the target image Depth information; obtain the position information of at least one pixel in the target image, associate the position information of at least one pixel with the depth information corresponding to at least one pixel, and obtain position-depth relationship data.
在本申请一些实施例中,深度估计模块705还用于:In some embodiments of the present application, the depth estimation module 705 is also used to:
在目标场地中设置多个测试点;Set up multiple test points in the target site;
采集设置多个测试点之后的目标场地对应的样本图像;Collect sample images corresponding to the target site after setting multiple test points;
将样本图像输入预训练的深度估计网络,得到样本图像中多个测试点分别对应的测试深度值;Input the sample image into the pre-trained depth estimation network to obtain the test depth values corresponding to multiple test points in the sample image;
若多个测试点中的一个测试点对应的测试深度值与一个测试点对应的真实距离之间的误差,大于预设误差阈值,则根据一个测试点对应的测试深度值与一个测试点对应的真实距离之间的训练损失值,调整预训练的深度估计网络的参数,直至多个测试点对应的误差小于或等于预设误差阈值,得到已训练的深度估计网络;其中,真实距离表征测试点与摄像头之间的真实距离。If the error between the test depth value corresponding to one test point among multiple test points and the real distance corresponding to one test point is greater than the preset error threshold, then the test depth value corresponding to one test point and the true distance corresponding to one test point will be The training loss value between the real distances is used to adjust the parameters of the pre-trained depth estimation network until the errors corresponding to multiple test points are less than or equal to the preset error threshold, and the trained depth estimation network is obtained; among them, the real distance represents the test points The actual distance from the camera.
在本申请一些实施例中,深度趋势确定模块703用于:In some embodiments of the present application, the depth trend determination module 703 is used to:
将所述目标车辆在所述多张连续的运输图像中的深度信息,分别与预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势;或Compare the depth information of the target vehicle in the multiple consecutive transportation images with the preset distance threshold respectively to obtain the change trend of the depth information of the target vehicle; or
根据所述目标车辆在所述多张连续的运输图像中的深度信息之间的差值,得到所述目标车辆的深度信息变化趋势。According to the difference between the depth information of the target vehicle in the multiple consecutive transportation images, the change trend of the depth information of the target vehicle is obtained.
在本申请一些实施例中,深度趋势确定模块703用于:In some embodiments of the present application, the depth trend determination module 703 is used to:
根据多张连续的运输图像对应的时间顺序,对多张连续的运输图像进行排序,得到排序后的多张运输图像以及目标车辆在排序后的多张运输图像中分别对应的深度信息;Sort multiple consecutive transportation images according to the time sequence corresponding to the multiple consecutive transportation images, and obtain the sorted multiple transportation images and the corresponding depth information of the target vehicle in the sorted multiple transportation images;
将目标车辆在排序后的多张运输图像中分别对应的深度信息与预设距离阈值进行比较,得到目标车辆的深度信息变化趋势。Compare the corresponding depth information of the target vehicle in the sorted multiple transportation images with the preset distance threshold to obtain the change trend of the depth information of the target vehicle.
在本申请一些实施例中,深度趋势确定模块703用于:In some embodiments of the present application, the depth trend determination module 703 is used to:
将目标车辆在排序后的多张运输图像中分别对应的深度信息与预设距离阈值进行作差,得到差值序列;Difference the corresponding depth information of the target vehicle in the multiple sorted transportation images with the preset distance threshold to obtain a difference sequence;
根据差值序列得到目标车辆的深度信息变化趋势。 The depth information change trend of the target vehicle is obtained based on the difference sequence.
在本申请一些实施例中,检测模块704还用于:In some embodiments of this application, the detection module 704 is also used to:
若深度信息变化趋势为递减,且差值序列中小于或等于预设差值阈值的时间段大于预设时长,则目标车辆的进出港检测结果为进港;If the change trend of the depth information is decreasing, and the time period in the difference sequence that is less than or equal to the preset difference threshold is greater than the preset time, the target vehicle's entry and exit detection result is port arrival;
若深度信息变化趋势为递增,且目标车辆在排序后的多张运输图像中分别对应的深度信息中,存在大于预设值的目标深度信息,则目标车辆的进出港检测结果为出港。If the change trend of the depth information is increasing, and there is target depth information greater than the preset value in the corresponding depth information of the target vehicle in the sorted multiple transportation images, then the detection result of the target vehicle's entry and exit is port departure.
在本申请一些实施例中,深度趋势确定模块703用于:In some embodiments of the present application, the depth trend determination module 703 is used to:
在多张连续的运输图像对应的时间段内,将目标车辆在时间段内的每个时刻对应的运输图像中的深度信息,与下一时刻对应的运输图像中的深度信息进行比较;In the time period corresponding to multiple consecutive transportation images, compare the depth information in the transportation image corresponding to the target vehicle at each moment in the time period with the depth information in the transportation image corresponding to the next moment;
若每个时刻对应的深度信息大于下一时刻对应的深度信息,则确定目标车辆的深度信息变化趋势为递增;If the depth information corresponding to each moment is greater than the depth information corresponding to the next moment, it is determined that the change trend of the depth information of the target vehicle is increasing;
若每个时刻对应的深度信息小于下一时刻对应的深度信息,则确定目标车辆的深度信息变化趋势为递减。If the depth information corresponding to each moment is less than the depth information corresponding to the next moment, it is determined that the change trend of the depth information of the target vehicle is decreasing.
在本申请一些实施例中,车辆进出港检测装置还包括:In some embodiments of this application, the vehicle entry and exit detection device also includes:
调整模块706,用于根据所述进出港检测结果中的出港时间和进港时间之间的时间差,得到所述目标车辆在所述目标场地的第一滞留时长;获取至少一个第二滞留时长,其中,所述至少一个第二滞留时长为所述目标车辆在所述目标场地的至少一个后续场地的滞留时长;确定所述第一滞留时长和所述至少一个第二滞留时长中的最大滞留时长;根据所述最大滞留时长,所述最大滞留时长的次数,以及所述最大滞留时长对应的场地,调整所述目标车辆的运输路线及运输量。The adjustment module 706 is configured to obtain the first residence time of the target vehicle at the target site based on the time difference between the departure time and the entry time in the entry and exit detection results; obtain at least one second residence time, Wherein, the at least one second residence time is the residence time of the target vehicle at at least one subsequent site of the target site; determine the maximum residence time of the first residence time and the at least one second residence time. ; Adjust the transportation route and transportation volume of the target vehicle according to the maximum detention time, the number of the maximum detention time, and the venue corresponding to the maximum detention time.
在本申请一些实施例中,获取模块701用于:In some embodiments of this application, the acquisition module 701 is used for:
获取目标场地的视频图像,提取视频图像中包含目标车辆的连续帧图像,将视频图像中包含的连续帧图像设置为目标车辆在目标场地中的多张连续的运输图像;Obtain the video image of the target site, extract the continuous frame images containing the target vehicle in the video image, and set the continuous frame images contained in the video image as multiple continuous transportation images of the target vehicle in the target site;
对多张连续的运输图像中的每个运输图像进行目标检测,得到运输图像中目标车辆的边界框坐标;Perform target detection on each transportation image in multiple consecutive transportation images to obtain the bounding box coordinates of the target vehicle in the transportation image;
根据边界框坐标,计算目标车辆的边界框的中点坐标;According to the bounding box coordinates, calculate the midpoint coordinates of the target vehicle's bounding box;
将目标车辆在多张连续的运输图像中的每个运输图像中对应的中点坐标,设置为目标车辆在多张连续的运输图像中的每个图像中对应的位置信息。The corresponding midpoint coordinates of the target vehicle in each of the multiple continuous transportation images are set as the corresponding position information of the target vehicle in each of the multiple continuous transportation images.
在本申请一些实施例中,获取模块701用于:In some embodiments of this application, the acquisition module 701 is used for:
获取目标场地的视频图像,对视频图像中每一帧图像进行车辆检测,得到每一帧图像中目标车辆的检测结果;检测结果表征帧图像中是否存在目标车辆;Obtain the video image of the target site, perform vehicle detection on each frame of the video image, and obtain the detection result of the target vehicle in each frame of image; the detection result indicates whether the target vehicle exists in the frame image;
以存在目标车辆的帧图像为起始帧,提取视频图像中包含目标车辆的连续帧图像。Taking the frame image in which the target vehicle exists as the starting frame, extract the continuous frame images containing the target vehicle in the video image.
在本申请一些实施例中,获取模块701用于:In some embodiments of this application, the acquisition module 701 is used for:
将采集的所述目标场地中不存在车辆时的图像设置为基准图像;Set the collected image when there is no vehicle in the target site as the reference image;
将所述视频图像中的第一图像与所述基准图像进行做差,得到差分图像;Difference the first image in the video image and the reference image to obtain a difference image;
若所述差分图像中存在像素值大于预设像素值的第一区域,且所述第一区域的像素值均值大于预设均值,则确定所述视频图像中位于所述第一图像后的第二图对应的差分图像;If there is a first region with a pixel value greater than the preset pixel value in the difference image, and the average pixel value of the first region is greater than the preset average value, then it is determined that the third image in the video image is located after the first image. The difference image corresponding to the two images;
若所述第二图像对应的差分图像中像素值大于预设像素值的第二区域的像素值均值大于预设均值,则确定所述视频图像中存在所述目标车辆。If the average pixel value of the second area in the difference image corresponding to the second image whose pixel value is greater than the preset pixel value is greater than the preset average value, it is determined that the target vehicle exists in the video image.
本申请实施例通过目标场地关联的位置深度关系数据,基于在目标场地中的多张连续的运输图像的位置信息,确定目标车辆的深度信息,根据深度值确定目标车辆的到进出港检测结果,降低检测过程中的运算量,提高检测效率;并且通过目标车辆在目标场地的连续多张运输图像中深度信息,得到目标车辆的深度信息变化趋势,根据深度变化趋势确定目标车辆的进出港检测结果,将到进出港检测由定性分析调整为定量计算,通过数据提高进出港检测的准确性。The embodiment of the present application determines the depth information of the target vehicle through the position-depth relationship data associated with the target site and based on the position information of multiple consecutive transportation images in the target site, and determines the arrival and departure port detection results of the target vehicle based on the depth value. Reduce the amount of calculations in the detection process and improve detection efficiency; and obtain the depth information change trend of the target vehicle through the depth information of multiple consecutive transportation images of the target vehicle at the target site, and determine the entry and exit detection results of the target vehicle based on the depth change trend , adjust the inspection at the entry and exit ports from qualitative analysis to quantitative calculation, and improve the accuracy of the inspection at the entry and exit ports through data.
本申请实施例还提供一种车辆进出港检测设备,如图9所示,其示出了本申请实施例所涉及的车辆进出港检测设备的结构示意图,具体来讲: The embodiment of the present application also provides a vehicle entry and exit detection equipment, as shown in Figure 9, which shows a schematic structural diagram of the vehicle entry and exit detection equipment involved in the embodiment of the application. Specifically:
该车辆进出港检测设备可以包括一个或者一个以上处理核心的处理器801、一个或一个以上计算机可读存储介质的存储器802、电源803和输入单元804等部件。本领域技术人员可以理解,图8中示出的车辆进出港检测设备结构并不构成对车辆进出港检测设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:The vehicle entry and exit detection device may include components such as a processor 801 of one or more processing cores, a memory 802 of one or more computer-readable storage media, a power supply 803, an input unit 804 and other components. Those skilled in the art can understand that the structure of the vehicle entry and exit detection equipment shown in Figure 8 does not constitute a limitation on the vehicle entry and exit detection equipment. It may include more or fewer components than shown in the figure, or combine certain components. Or a different component arrangement. in:
处理器801是该车辆进出港检测设备的控制中心,利用各种接口和线路连接整个车辆进出港检测设备的各个部分,通过运行或执行存储在存储器802内的软件程序和/或模块,以及调用存储在存储器802内的数据,执行车辆进出港检测设备的各种功能和处理数据,从而对车辆进出港检测设备进行整体监控。可选的,处理器801可包括一个或多个处理核心;优选的,处理器801可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器801中。The processor 801 is the control center of the vehicle entry and exit detection equipment, using various interfaces and lines to connect various parts of the entire vehicle entry and exit detection equipment, by running or executing software programs and/or modules stored in the memory 802, and calling The data stored in the memory 802 executes various functions of the vehicle entry and exit detection equipment and processes data, thereby overall monitoring the vehicle entry and exit detection equipment. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 801.
存储器802可用于存储软件程序以及模块,处理器801通过运行存储在存储器802的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器802可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据车辆进出港检测设备的使用所创建的数据等。此外,存储器802可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器802还可以包括存储器控制器,以提供处理器801对存储器802的访问。The memory 802 can be used to store software programs and modules, and the processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802 . The memory 802 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store data according to Data created by the use of vehicle entry and exit inspection equipment, etc. In addition, memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802 .
车辆进出港检测设备还包括给各个部件供电的电源803,优选的,电源803可以通过电源管理系统与处理器801逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源803还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The vehicle entry and exit detection equipment also includes a power supply 803 that supplies power to various components. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, thereby realizing functions such as charging, discharging, and power consumption management through the power management system. The power supply 803 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
该车辆进出港检测设备还可包括输入单元804,该输入单元804可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。The vehicle entry and exit detection equipment may also include an input unit 804, which may be used to receive input numeric or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. .
尽管未示出,车辆进出港检测设备还可以包括显示单元等,在此不再赘述。具体在本实施例中,车辆进出港检测设备中的处理器801会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器802中,并由处理器801来运行存储在存储器802中的应用程序,从而实现各种功能,如下:Although not shown, the vehicle entry and exit detection device may also include a display unit, etc., which will not be described again here. Specifically, in this embodiment, the processor 801 in the vehicle entry and exit detection equipment will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will Run the application program stored in the memory 802 to implement various functions, as follows:
获取目标场地中目标车辆的多张连续的运输图像,以及目标车辆在多张连续的运输图像中的每个运输图像中对应的位置信息;Obtain multiple continuous transportation images of the target vehicle in the target site, and the corresponding position information of the target vehicle in each of the multiple continuous transportation images;
根据目标场地关联的位置深度关系数据以及位置信息,确定目标车辆在运输图像中的深度信息;位置深度关系数据包括目标场地中每个位置信息以及该位置信息对应的深度信息,深度信息表征运输图像中的位置信息对应的点映射到目标场地中时,点至采集运输图像的摄像头之间的距离;Determine the depth information of the target vehicle in the transportation image according to the position-depth relationship data and position information associated with the target site; the position-depth relationship data includes each position information in the target site and the depth information corresponding to the position information, and the depth information represents the transportation image When the point corresponding to the location information in is mapped to the target site, the distance between the point and the camera that collects the transportation image;
根据多张连续的运输图像分别对应的深度信息,确定得到目标车辆的深度信息变化趋势;According to the corresponding depth information of multiple consecutive transportation images, the changing trend of the depth information of the target vehicle is determined;
根据深度信息变化趋势,得到目标车辆的进出港检测结果。According to the changing trend of the depth information, the entry and exit detection results of the target vehicle are obtained.
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium, and loaded and executed by the processor.
为此,本申请实施例提供一种存储介质,其中存储有多条指令,该指令能够被处理器进行加载,以执行本申请实施例所提供的任一种车辆进出港检测方法中的步骤。例如,该指令可以执行如下步骤:To this end, embodiments of the present application provide a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by the processor to execute the steps in any vehicle entry and exit detection method provided by the embodiments of the present application. For example, this command can perform the following steps:
获取目标场地中目标车辆的多张连续的运输图像,以及目标车辆在多张连续的运输图像中的每个运输图像中对应的位置信息; Obtain multiple continuous transportation images of the target vehicle in the target site, and the corresponding position information of the target vehicle in each of the multiple continuous transportation images;
根据目标场地关联的位置深度关系数据以及位置信息,确定目标车辆在运输图像中的深度信息;位置深度关系数据包括目标场地中每个位置信息以及该位置信息对应的深度信息,深度信息表征运输图像中的位置信息对应的点映射到目标场地中时,点至采集运输图像的摄像头之间的距离;Determine the depth information of the target vehicle in the transportation image according to the position-depth relationship data and position information associated with the target site; the position-depth relationship data includes each position information in the target site and the depth information corresponding to the position information, and the depth information represents the transportation image When the point corresponding to the location information in is mapped to the target site, the distance between the point and the camera that collects the transportation image;
根据多张连续的运输图像分别对应的深度信息,确定得到目标车辆的深度信息变化趋势;According to the corresponding depth information of multiple consecutive transportation images, the changing trend of the depth information of the target vehicle is determined;
根据深度信息变化趋势,得到目标车辆的进出港检测结果。According to the changing trend of the depth information, the entry and exit detection results of the target vehicle are obtained.
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。For the specific implementation of each of the above operations, please refer to the previous embodiments and will not be described again here.
其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
由于该存储介质中所存储的指令,可以执行本申请实施例所提供的任一种车辆进出港检测方法中的步骤,因此,可以实现本申请实施例所提供的任一种车辆进出港检测方法所能实现的有益效果,详见前面的实施例,在此不再赘述。Since the instructions stored in the storage medium can execute the steps in any vehicle entry and exit detection method provided by the embodiments of this application, therefore, any vehicle entry and exit detection method provided by the embodiments of this application can be implemented. The beneficial effects that can be achieved are detailed in the previous embodiments and will not be described again here.
以上对本申请实施例所提供的一种车辆进出港检测方法、装置、设备和存储介质进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。 The above is a detailed introduction to the vehicle entry and exit detection method, device, equipment and storage medium provided by the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation modes of the present invention. The description of the above embodiments It is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, there will be changes in the specific implementation and application scope according to the idea of the present invention. To sum up, the present invention The content of the description should not be construed as limiting the invention.

Claims (15)

  1. 一种车辆进出港检测方法,其特征在于,所述方法包括:A vehicle entry and exit detection method, characterized in that the method includes:
    获取目标场地中目标车辆的多张连续的运输图像,以及所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息;Obtaining multiple continuous transportation images of the target vehicle in the target site, and corresponding position information of the target vehicle in each of the multiple continuous transportation images;
    根据所述目标场地关联的位置深度关系数据以及所述位置信息,确定所述目标车辆在所述运输图像中对应的深度信息;所述位置深度关系数据包括所述目标场地中每个位置信息以及每个位置信息对应的深度信息,所述深度信息表征运输图像中的位置信息对应的点映射到所述目标场地中时,所述点至采集运输图像的摄像头之间的距离;Determine the depth information corresponding to the target vehicle in the transportation image according to the position-depth relationship data associated with the target site and the position information; the position-depth relationship data includes each position information in the target site and Depth information corresponding to each position information. The depth information represents the distance between the point corresponding to the position information in the transportation image and the camera that collects the transportation image when it is mapped to the target site;
    根据所述多张连续的运输图像分别对应的深度信息,得到所述目标车辆的深度信息变化趋势;According to the depth information corresponding to the multiple consecutive transportation images, the depth information change trend of the target vehicle is obtained;
    根据所述深度信息变化趋势,得到所述目标车辆的进出港检测结果。According to the change trend of the depth information, the entry and exit detection results of the target vehicle are obtained.
  2. 如权利要求1所述的车辆进出港检测方法,其特征在于,在所述根据所述目标场地关联的位置深度关系数据以及所述位置信息,确定所述目标车辆在所述运输图像中对应的深度信息之前,还包括:The vehicle entry and exit detection method according to claim 1, characterized in that, based on the position depth relationship data associated with the target site and the position information, it is determined that the corresponding position of the target vehicle in the transportation image is Before depth information, also includes:
    采集所述目标场地对应的目标图像;所述目标图像为所述目标场地中未存在车辆的图像;Collect a target image corresponding to the target site; the target image is an image in which no vehicle exists in the target site;
    通过已训练的深度估计网络对所述目标图像进行深度估计,得到所述目标图像中至少一个像素点对应的深度信息;Perform depth estimation on the target image through a trained depth estimation network to obtain depth information corresponding to at least one pixel in the target image;
    获取所述至少一个像素点在所述目标图像中的位置信息,将所述至少一个像素点的位置信息与所述至少一个像素点对应的深度信息关联,得到所述位置深度关系数据。Obtain the position information of the at least one pixel point in the target image, associate the position information of the at least one pixel point with the depth information corresponding to the at least one pixel point, and obtain the position-depth relationship data.
  3. 如权利要求2所述的车辆进出港检测方法,其特征在于,在所述通过已训练的深度估计网络对所述目标图像进行深度估计,得到所述目标图像中至少一个像素点对应的深度信息之前,还包括:The vehicle entry and exit detection method according to claim 2, characterized in that, during the depth estimation of the target image through the trained depth estimation network, the depth information corresponding to at least one pixel in the target image is obtained. Previously, this also included:
    在所述目标场地中设置多个测试点;Set up multiple test points in the target site;
    采集设置所述多个测试点之后的目标场地对应的样本图像;Collect sample images corresponding to the target site after setting the plurality of test points;
    将所述样本图像输入预训练的深度估计网络,得到所述样本图像中所述多个测试点分别对应的测试深度值;Input the sample image into a pre-trained depth estimation network to obtain test depth values corresponding to the multiple test points in the sample image;
    若所述多个测试点中的一个测试点对应的测试深度值与所述一个测试点对应的真实距离之间的误差,大于预设误差阈值,则根据所述一个测试点对应的测试深度值与所述一个测试点对应的真实距离之间的训练损失值,调整所述预训练的深度估计网络的参数,直至所述多个测试点对应的误差小于或等于所述预设误差阈值,得到所述已训练的深度估计网络;其中,所述真实距离表征测试点与摄像头之间的真实距离。If the error between the test depth value corresponding to one of the plurality of test points and the true distance corresponding to the one test point is greater than the preset error threshold, then according to the test depth value corresponding to the one test point The training loss value between the real distance corresponding to the one test point, adjusting the parameters of the pre-trained depth estimation network until the errors corresponding to the multiple test points are less than or equal to the preset error threshold, we get The trained depth estimation network; wherein the real distance represents the real distance between the test point and the camera.
  4. 如权利要求1至3所述的车辆进出港检测方法,其特征在于,所述根据所述多张连续的运输图像分别对应的深度信息,得到所述目标车辆的深度信息变化趋势,包括:The vehicle entry and exit detection method according to claims 1 to 3, characterized in that the depth information change trend of the target vehicle is obtained based on the depth information corresponding to the multiple consecutive transportation images, including:
    将所述目标车辆在所述多张连续的运输图像中的深度信息,分别与预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势;或Compare the depth information of the target vehicle in the multiple consecutive transportation images with the preset distance threshold respectively to obtain the change trend of the depth information of the target vehicle; or
    根据所述目标车辆在所述多张连续的运输图像中的深度信息之间的差值,得到所述目标车辆的深度信息变化趋势。According to the difference between the depth information of the target vehicle in the multiple consecutive transportation images, the change trend of the depth information of the target vehicle is obtained.
  5. 如权利要求4所述的车辆进出港检测方法,其特征在于,所述将所述目标车辆在所述多张连续的运输图像中的深度信息,分别与预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势,包括:The vehicle entry and exit detection method according to claim 4, wherein the depth information of the target vehicle in the plurality of consecutive transportation images is compared with a preset distance threshold to obtain the The changing trend of the depth information of the target vehicle includes:
    根据所述多张连续的运输图像对应的时间顺序,对所述多张连续的运输图像进行排序,得到排序后的多张运输图像以及所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息; Sort the multiple consecutive transportation images according to the time order corresponding to the multiple consecutive transportation images, and obtain the multiple sorted transportation images and the position of the target vehicle in the sorted multiple transportation images. Corresponding depth information;
    将所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息与所述预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势。Compare the corresponding depth information of the target vehicle in the sorted plurality of transportation images with the preset distance threshold to obtain the change trend of the depth information of the target vehicle.
  6. 如权利要求5所述的车辆进出港检测方法,其特征在于,所述将所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息与所述预设距离阈值进行比较,得到所述目标车辆的深度信息变化趋势,包括:The vehicle entry and exit detection method according to claim 5, wherein the corresponding depth information of the target vehicle in the sorted plurality of transportation images is compared with the preset distance threshold, Obtain the depth information change trend of the target vehicle, including:
    将所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息与所述预设距离阈值进行作差,得到差值序列;Difference the corresponding depth information of the target vehicle in the plurality of sorted transportation images with the preset distance threshold to obtain a difference sequence;
    根据所述差值序列得到所述目标车辆的深度信息变化趋势。The depth information change trend of the target vehicle is obtained according to the difference sequence.
  7. 如权利要求6所述的车辆进出港检测方法,其特征在于,在所述根据所述差值序列得到所述目标车辆的深度信息变化趋势之后,还包括:The vehicle entry and exit detection method according to claim 6, characterized in that, after obtaining the depth information change trend of the target vehicle according to the difference sequence, it further includes:
    若所述深度信息变化趋势为递减,且所述差值序列中小于或等于预设差值阈值的时间段大于预设时长,则所述目标车辆的进出港检测结果为进港;If the change trend of the depth information is decreasing, and the time period in the difference sequence that is less than or equal to the preset difference threshold is greater than the preset time length, then the entry and exit detection result of the target vehicle is port arrival;
    若所述深度信息变化趋势为递增,且所述目标车辆在所述排序后的多张运输图像中分别对应的深度信息中,存在大于预设值的目标深度信息,则所述目标车辆的进出港检测结果为出港。If the change trend of the depth information is increasing, and the corresponding depth information of the target vehicle in the plurality of sorted transportation images contains target depth information greater than the preset value, then the entry and exit of the target vehicle The port test result is outbound.
  8. 如权利要求4所述的车辆进出港检测方法,其特征在于,所述根据所述目标车辆在所述多张连续的运输图像中的深度信息之间的差值,得到所述目标车辆的深度信息变化趋势,包括:The vehicle entry and exit detection method according to claim 4, wherein the depth of the target vehicle is obtained based on the difference between the depth information of the target vehicle in the multiple consecutive transportation images. Information trends include:
    在所述多张连续的运输图像对应的时间段内,将所述目标车辆在所述时间段内的每个时刻对应的运输图像中的深度信息,与下一时刻对应的运输图像中的深度信息进行比较;In the time period corresponding to the multiple consecutive transportation images, the depth information in the transportation image corresponding to the target vehicle at each moment in the time period is compared with the depth information in the transportation image corresponding to the next moment. information for comparison;
    若每个时刻对应的深度信息大于下一时刻对应的深度信息,则确定所述目标车辆的深度信息变化趋势为递增;If the depth information corresponding to each moment is greater than the depth information corresponding to the next moment, it is determined that the change trend of the depth information of the target vehicle is increasing;
    若每个时刻对应的深度信息小于下一时刻对应的深度信息,则确定所述目标车辆的深度信息变化趋势为递减。If the depth information corresponding to each moment is less than the depth information corresponding to the next moment, it is determined that the change trend of the depth information of the target vehicle is decreasing.
  9. 如权利要求1至8中任一项所述的车辆进出港检测方法,其特征在于,在所述得到所述目标车辆的进出港检测结果之后,还包括:The vehicle entry and exit detection method according to any one of claims 1 to 8, characterized in that, after obtaining the entry and exit detection results of the target vehicle, it further includes:
    根据所述进出港检测结果中的出港时间和进港时间之间的时间差,得到所述目标车辆在所述目标场地的第一滞留时长;According to the time difference between the departure time and the arrival time in the entry and exit detection results, the first residence time of the target vehicle at the target site is obtained;
    获取至少一个第二滞留时长,其中,所述至少一个第二滞留时长为所述目标车辆在所述目标场地的至少一个后续场地的滞留时长;Obtain at least one second residence time, wherein the at least one second residence time is the residence time of the target vehicle in at least one subsequent site of the target site;
    确定所述第一滞留时长和所述至少一个第二滞留时长中的最大滞留时长;Determining the maximum residence time among the first residence time and the at least one second residence time;
    根据所述最大滞留时长,所述最大滞留时长的次数,以及所述最大滞留时长对应的场地,调整所述目标车辆的运输路线及运输量。The transportation route and transportation volume of the target vehicle are adjusted according to the maximum detention time, the number of the maximum detention time, and the site corresponding to the maximum detention time.
  10. 如权利要求1至9任一项所述的车辆进出港检测方法,其特征在于,所述获取目标场地中目标车辆的多张连续的运输图像,以及所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息,包括:The vehicle entry and exit detection method according to any one of claims 1 to 9, characterized in that the acquisition of multiple continuous transportation images of the target vehicle in the target site, and the target vehicle in the multiple continuous transportation images The corresponding location information in each transportation image in the transportation image includes:
    获取所述目标场地的视频图像,提取所述视频图像中包含所述目标车辆的连续帧图像,将所述连续帧图像设置为所述目标车辆在所述目标场地中的多张连续的运输图像;Obtain the video image of the target site, extract the continuous frame images containing the target vehicle in the video image, and set the continuous frame images as multiple continuous transportation images of the target vehicle in the target site. ;
    对所述多张连续的运输图像中的每个运输图像进行目标检测,得到所述运输图像中所述目标车辆的边界框坐标;Perform target detection on each transportation image in the multiple consecutive transportation images to obtain the bounding box coordinates of the target vehicle in the transportation image;
    根据所述边界框坐标,计算所述目标车辆的边界框的中点坐标;Calculate the midpoint coordinates of the bounding box of the target vehicle according to the bounding box coordinates;
    将所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的中点坐标,设置为所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息。The midpoint coordinates of the target vehicle corresponding to each transportation image in the multiple continuous transportation images are set to the corresponding midpoint coordinates of the target vehicle in each transportation image of the multiple continuous transportation images. location information.
  11. 如权利要求10所述的车辆进出港检测方法,其特征在于,所述获取所述目标场地的视频图像,提取所述视频图像中包含所述目标车辆的连续帧图像,包括: The vehicle entry and exit detection method according to claim 10, characterized in that said obtaining the video image of the target site and extracting the continuous frame images containing the target vehicle in the video image includes:
    获取所述目标场地的视频图像,对所述视频图像中每一帧图像进行车辆检测,得到每一帧图像中目标车辆的检测结果;所述检测结果表征所述帧图像中是否存在所述目标车辆;Obtain the video image of the target site, perform vehicle detection on each frame of the video image, and obtain the detection result of the target vehicle in each frame of image; the detection result represents whether the target exists in the frame image vehicle;
    以存在所述目标车辆的帧图像为起始帧,提取所述视频图像中包含所述目标车辆的连续帧图像。Taking the frame image in which the target vehicle exists as the starting frame, extract consecutive frame images containing the target vehicle in the video image.
  12. 如权利要求11所述的方法,其特征在于,所述对所述视频图像中每一帧图像进行车辆检测,包括:The method of claim 11, wherein performing vehicle detection on each frame of the video image includes:
    将采集的所述目标场地中不存在车辆时的图像设置为基准图像;Set the collected image when there is no vehicle in the target site as the reference image;
    将所述视频图像中的第一图像与所述基准图像进行做差,得到差分图像;Difference the first image in the video image and the reference image to obtain a difference image;
    若所述差分图像中存在像素值大于预设像素值的第一区域,且所述第一区域的像素值均值大于预设均值,则确定所述视频图像中位于所述第一图像后的第二图对应的差分图像;If there is a first region with a pixel value greater than the preset pixel value in the difference image, and the average pixel value of the first region is greater than the preset average value, then it is determined that the third image in the video image is located after the first image. The difference image corresponding to the two images;
    若所述第二图像对应的差分图像中像素值大于预设像素值的第二区域的像素值均值大于预设均值,则确定所述视频图像中存在所述目标车辆。If the average pixel value of the second area in the differential image corresponding to the second image is greater than the preset pixel value, it is determined that the target vehicle exists in the video image.
  13. 一种车辆进出港检测装置,其特征在于,所述装置包括:A vehicle entry and exit detection device, characterized in that the device includes:
    获取模块,用于获取目标场地中目标车辆的多张连续的运输图像,以及所述目标车辆在所述多张连续的运输图像中的每个运输图像中对应的位置信息;An acquisition module, configured to acquire multiple continuous transportation images of the target vehicle in the target site, and the corresponding position information of the target vehicle in each of the multiple continuous transportation images;
    深度确定模块,用于根据所述目标场地关联的位置深度关系数据以及所述位置信息,确定所述目标车辆在所述运输图像中对应的深度信息;所述位置深度关系数据包括所述目标场地中每个位置信息以及每个位置信息对应的深度信息,所述深度信息表征运输图像中的位置信息对应的点映射到所述目标场地中时,所述点至采集运输图像的摄像头之间的距离;Depth determination module, configured to determine the depth information corresponding to the target vehicle in the transportation image according to the position-depth relationship data associated with the target site and the location information; the position-depth relationship data includes the target site Each position information in the transportation image and the depth information corresponding to each position information. The depth information represents the distance between the point and the camera that collects the transportation image when the point corresponding to the position information in the transportation image is mapped to the target site. distance;
    深度趋势确定模块,用于根据所述多张连续的运输图像分别对应的深度信息,得到所述目标车辆的深度信息变化趋势;A depth trend determination module, configured to obtain the depth information change trend of the target vehicle based on the depth information corresponding to the multiple consecutive transportation images;
    检测模块,用于根据所述深度信息变化趋势,得到所述目标车辆的进出港检测结果。A detection module is used to obtain the entry and exit detection results of the target vehicle according to the change trend of the depth information.
  14. 一种车辆进出港检测设备,其特征在于,包括存储器和处理器;所述存储器存储有应用程序,所述处理器用于运行所述存储器内的应用程序,以执行权利要求1至12任一项所述的车辆进出港检测方法中的操作。A vehicle entry and exit detection equipment, characterized in that it includes a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute any one of claims 1 to 12 Operations in the vehicle entry and exit detection method.
  15. 一种存储介质,其特征在于,所述存储介质存储有多条指令,所述指令适于处理器进行加载,以执行权利要求1至12任一项所述的车辆进出港检测方法中的步骤。 A storage medium, characterized in that the storage medium stores a plurality of instructions, and the instructions are suitable for loading by the processor to execute the steps in the vehicle entry and exit detection method according to any one of claims 1 to 12 .
PCT/CN2023/120391 2022-07-22 2023-09-21 Method and apparatus for port entry/exit detection of vehicle, device, and storage medium WO2024017413A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210872162.9A CN117496387A (en) 2022-07-22 2022-07-22 Vehicle arrival/departure detection method, device, equipment and storage medium
CN202210872162.9 2022-07-22

Publications (2)

Publication Number Publication Date
WO2024017413A2 true WO2024017413A2 (en) 2024-01-25
WO2024017413A3 WO2024017413A3 (en) 2024-03-14

Family

ID=89617172

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/120391 WO2024017413A2 (en) 2022-07-22 2023-09-21 Method and apparatus for port entry/exit detection of vehicle, device, and storage medium

Country Status (2)

Country Link
CN (1) CN117496387A (en)
WO (1) WO2024017413A2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4546956B2 (en) * 2003-06-12 2010-09-22 本田技研工業株式会社 Target orientation estimation using depth detection
JP6139088B2 (en) * 2012-10-02 2017-05-31 株式会社東芝 Vehicle detection device
KR101403039B1 (en) * 2012-10-08 2014-06-11 한국과학기술원 Apparatus and method for transmitting jamming signal
CN106952477B (en) * 2017-04-26 2020-01-14 智慧互通科技有限公司 Roadside parking management method based on multi-camera image joint processing
CN109033964B (en) * 2018-06-22 2022-03-15 顺丰科技有限公司 Method, system and equipment for judging arrival and departure events of vehicles

Also Published As

Publication number Publication date
CN117496387A (en) 2024-02-02
WO2024017413A3 (en) 2024-03-14

Similar Documents

Publication Publication Date Title
CN111667512B (en) Multi-target vehicle track prediction method based on improved Kalman filtering
US20140376769A1 (en) Method for detecting large size and passenger vehicles from fixed cameras
US20170032514A1 (en) Abandoned object detection apparatus and method and system
CN110263713B (en) Lane line detection method, lane line detection device, electronic device, and storage medium
CN110276293B (en) Lane line detection method, lane line detection device, electronic device, and storage medium
CN111292432A (en) Vehicle charging type distinguishing method and device based on vehicle type recognition and wheel axle detection
CN110263714B (en) Lane line detection method, lane line detection device, electronic device, and storage medium
CN113505671B (en) Machine vision-based carriage congestion degree determination method, system, device and medium
CN107886055A (en) A kind of retrograde detection method judged for direction of vehicle movement
CN112298194B (en) Lane changing control method and device for vehicle
CN114067295A (en) Method and device for determining vehicle loading rate and vehicle management system
CN110458050B (en) Vehicle cut-in detection method and device based on vehicle-mounted video
CN110232368B (en) Lane line detection method, lane line detection device, electronic device, and storage medium
CN111967396A (en) Processing method, device and equipment for obstacle detection and storage medium
CN111709341B (en) Method and system for detecting operation state of passenger elevator car
CN114926422B (en) Method and system for detecting passenger flow of getting on and off vehicles
CN112613509A (en) Railway wagon carriage number identification snapshot method and system
WO2024017413A2 (en) Method and apparatus for port entry/exit detection of vehicle, device, and storage medium
CN113112479A (en) Progressive target detection method and device based on key block extraction
CN105129295B (en) Reversing control method, device, system and rubbish van
CN110705495A (en) Detection method and device for vehicle, electronic equipment and computer storage medium
CN115550611A (en) Intelligent monitoring method, device and system for flight guarantee node
CN115359438A (en) Vehicle jam detection method, system and device based on computer vision
Aminmansour et al. Improving near-miss event detection rate at railway level crossings
CN115761668A (en) Camera stain recognition method and device, vehicle and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23842475

Country of ref document: EP

Kind code of ref document: A2