Vehicle queuing number determination method and related device

Through multi-target tracking technology, the vehicle ID of the lane queue area is determined, and the video frame is traced back from the first occurrence moment, which solves the problem of inaccurate lane queues caused by camera installation limitations, and achieves more accurate queuing counts.

CN120388476APending Publication Date: 2025-07-29AIBEE (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510469807.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-29

Smart Images

  • Figure CN120388476A_ABST
    Figure CN120388476A_ABST
Patent Text Reader

Abstract

The invention discloses a lane queuing number determination method and a related device, and the method comprises the steps: firstly obtaining vehicle data from a video sequence obtained by a camera, and then determining a headmost vehicle and a rearmost vehicle located in a queuing region of a target lane at the current moment based on the vehicle data; the number of vehicles between two vehicles in different video frames is respectively counted from the moment when the rearmost vehicle appears for the first time, and the queuing number of the target lane is obtained through the maximum number obtained through statistics, so that the vehicles about to enter the queuing area run slowly, the overtaking situation is not easy to occur, and the accuracy of the vehicle queuing is improved. According to the method, the sequence of the vehicles in the target lane can be considered not to change, and the queuing number is counted from the moment when the rearmost vehicle appears for the first time, so that the situation that the counted number is smaller than the actual number due to the fact that the vehicles are shielded in the moving process is effectively reduced, and the accuracy of the vehicle queuing is improved. Therefore, the queuing number of the target lane obtained by the technical scheme is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision technology, and particularly to a method for determining the number of queuing vehicles and related devices. Background Art

[0002] In big cities, the traffic flow is large, which easily leads to slow vehicle speeds or congestion at some traffic intersections. To solve this problem, it is necessary to know the real-time queuing number of vehicles so that downstream can make decisions quickly.

[0003] In the related art, by monitoring the road conditions with cameras, multi-object tracking of vehicles on the road can be performed, and according to the multi-object tracking results at the current moment, the number of queuing vehicles in each lane is counted.

[0004] However, due to the limitations of camera installation, it is easy for vehicles to be blocked, resulting in inaccurate statistical results of the number of lanes. Summary of the Invention

[0005] In view of this, this application provides a method for determining the number of queuing lanes. Through multi-object tracking technology, the situation where vehicles are blocked due to the limitations of camera installation can be effectively avoided, thereby effectively improving the accuracy of counting the number of queuing lanes.

[0006] To solve the above problems, the technical solutions provided in this application are as follows:

[0007] On the one hand, this application provides a method for determining the number of queuing lanes, and the method includes:

[0008] Obtain vehicle data of the target lane. The vehicle data includes data of multiple video frames in a video sequence, and the data is used to identify the identity identifier ID and position information of the vehicles on the target lane. The ID is the same when corresponding to the same vehicle in different video frames, and the video sequence is obtained by a camera;

[0009] According to the vehicle data, determine the ID X of the vehicle at the frontmost position and the ID Y of the vehicle at the rearmost position in the queuing area of the target lane at the current moment;

[0010] According to the vehicle data, determine M video frames from the moment when the ID Y first appears to the current moment;

[0011] According to the data of the M video frames, determine the maximum number of vehicles between the ID X and the ID Y in the target lane as the first queuing number;

[0012] According to the first queuing number, obtain the queuing number of the target lane.

[0013] In a possible implementation, after determining, based on the data of the M video frames, the maximum number of vehicles between the ID X and the ID Y in the target lane as the first queuing number, the method further includes:

[0014] Determine N video frames from the moment when the ID X first appears to the current moment according to the vehicle data;

[0015] Determine the ID X1 of the vehicle that finally crosses the stop line at the current moment, where the stop line is used to identify the boundary in front of the queuing area of the target lane, and the vehicles in front of the stop line are not blocked;

[0016] Determine the maximum number of vehicles between the ID X1 and the ID X as the second queuing number according to the data of the N video frames;

[0017] Take the sum of the second queuing number and the first queuing number as the first queuing number.

[0018] In a possible implementation, before taking the sum of the second queuing number and the first queuing number as the first queuing number, the method further includes:

[0019] Obtain the vehicle data of the parallel lane of the target lane;

[0020] Determine the first vehicle between the ID X and the ID Y in the target lane from the video frame when the number of vehicles between the ID X and the ID Y in the target lane is the largest;

[0021] If at the current moment, P vehicles among the first vehicles appear in the parallel lane, update the first queuing number based on the P.

[0022] In a possible implementation, before taking the sum of the second queuing number and the first queuing number as the first queuing number, the method further includes:

[0023] Determine the second vehicle between the ID X1 and the ID X in the target lane from the video frame when the number of vehicles between the ID X1 and the ID X in the target lane is the largest;

[0024] If at the current moment, R vehicles among the second vehicles appear in the parallel lane, update the second queuing number based on the R.

[0025] In a possible implementation, the obtaining of the vehicle data of the target lane includes:

[0026] Perform multi-object tracking on the vehicles in the video sequences obtained for each camera to obtain multi-object tracking results. Each of the cameras is used to cover a local area of the target lane, and the multi-object tracking results are used to identify the data of multiple video frames in the corresponding video sequences.

[0027] Match the IDs of the same vehicle according to the multi-object tracking results respectively corresponding to each camera to obtain the vehicle data.

[0028] In a possible implementation manner, the matching the IDs of the same vehicle according to the multi-object tracking results respectively corresponding to each camera to obtain the vehicle data includes:

[0029] Construct a three-dimensional model of the target lane;

[0030] At different times, project the vehicles located on the target lane into the three-dimensional model according to the multi-object tracking results respectively corresponding to each camera;

[0031] Match the vehicle IDs at the same position to obtain the vehicle data.

[0032] In a possible implementation manner, the frames per second (FPS) of the multi-object tracking results is not less than 12.

[0033] In another aspect, an embodiment of the present application provides a device for determining the number of vehicles queuing in a lane. The device includes an acquisition unit and a determination unit:

[0034] The acquisition unit is used to acquire vehicle data of the target lane. The vehicle data includes the data of multiple video frames in the video sequence, and the data is used to identify the identity identifier (ID) and position information of the vehicles on the target lane. The ID is the same when corresponding to the same vehicle in different video frames, and the video sequence is acquired by a camera;

[0035] The determination unit is used to determine, according to the vehicle data, the ID X of the vehicle at the forefront and the ID Y of the vehicle at the rearmost in the queuing area of the target lane at the current moment;

[0036] The determination unit is further used to determine, according to the vehicle data, M video frames from the moment when the ID Y first appears to the current moment;

[0037] The determination unit is further used to determine, according to the data of the M video frames, the maximum number of vehicles between the ID X and the ID Y in the target lane as the first queuing number;

[0038] The determination unit is further used to obtain the number of vehicles queuing in the target lane according to the first queuing number.

[0039] In a possible implementation, the determining unit is further configured to:

[0040] Determine N video frames from the moment when the ID X first appears to the current moment according to the vehicle data;

[0041] Determine the ID X1 of the vehicle that finally crosses the stop line at the current moment, where the stop line is used to identify the boundary in front of the queuing area of the target lane, and the vehicles in front of the stop line are not blocked;

[0042] Determine the maximum number of vehicles between the ID X1 and the ID X as the second queuing number according to the data of the N video frames;

[0043] Use the sum of the second queuing number and the first queuing number as the first queuing number.

[0044] In a possible implementation, the obtaining unit is further configured to:

[0045] Obtain the vehicle data of the parallel lanes of the target lane;

[0046] The determining unit is further configured to determine the first vehicle between the ID X and the ID Y in the target lane from the video frame when the number of vehicles between the ID X and the ID Y in the target lane is the largest;

[0047] If at the current moment, P vehicles in the first vehicle appear in the parallel lane, update the first queuing number based on the P.

[0048] In a possible implementation, the determining unit is further configured to:

[0049] Determine the second vehicle between the ID X1 and the ID X in the target lane from the video frame when the number of vehicles between the ID X1 and the ID X in the target lane is the largest;

[0050] If at the current moment, R vehicles in the second vehicle appear in the parallel lane, update the second queuing number based on the R.

[0051] In a possible implementation, the obtaining unit is specifically configured to:

[0052] Perform multi-object tracking on the vehicles in the video sequence obtained by each camera to obtain a multi-object tracking result. Each camera is used to cover a local area of the target lane, and the multi-object tracking result is used to identify the data of multiple video frames in the corresponding video sequence;

[0053] Match the IDs of the same vehicle according to the multi-object tracking results corresponding to each camera respectively, to obtain the vehicle data.

[0054] In a possible implementation manner, the determining unit is specifically configured to:

[0055] Construct a three-dimensional model of the target lane;

[0056] According to different times, project the vehicles located on the target lane onto the three-dimensional model according to the multi-object tracking results corresponding to each camera respectively;

[0057] Match the vehicle IDs at the same position to obtain the vehicle data.

[0058] In a possible implementation manner, the frames per second (FPS) of the multi-object tracking results is not less than 12.

[0059] In another aspect, the present application provides a computer device, which includes a processor and a memory:

[0060] The memory is used to store a computer program;

[0061] The processor is configured to execute the method described in any one of the above according to the computer program.

[0062] In another aspect, the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program realizes the execution of the method described in any one of the above when executed by a computer device.

[0063] In another aspect, the present application provides a computer program product including a computer program, which when running on a computer device, causes the computer device to execute the method described in any one of the above.

[0064] As can be seen from the above technical solution, the technical solution first obtains vehicle data of the target lane. The vehicle data is obtained from the video sequence captured by the camera and includes data of multiple video frames. The data of each video frame is used to identify the identity identifier ID of the vehicle on the target lane and the corresponding position of the vehicle. Then, according to the obtained vehicle data, the ID X of the vehicle at the front of the queuing area on the target lane and the ID Y of the vehicle at the rear at the current moment can be determined. The moment of the video frame when ID Y first appears is traced back from the current moment to obtain M video frames. Based on the data of these M video frames, the number of vehicles between ID X and ID Y in the target lane in each video frame can be counted, and the maximum number among them is used as the first queuing number. Finally, the queuing number of the target lane can be obtained according to the first queuing number. Since the vehicles about to enter the queuing area are moving slowly and it is not easy to overtake, it can be considered that the order of the vehicles in the target lane does not change among the multiple video frames of the video sequence. Therefore, the maximum number of vehicles between ID X and ID Y obtained can be used as the number of vehicles between ID X and ID Y at the current moment. Moreover, the moment when ID Y first appears in the target lane is selected for backtracking to count the maximum number, ensuring that vehicle information in a longer time series is obtained based on the visible range of the camera, effectively reducing the situation where the statistical quantity is less than the actual quantity due to vehicle occlusion during the process of vehicle ID Y moving to the current moment of the queuing area. Thus, the queuing number of the target lane obtained by this technical solution is more accurate. Description of the Drawings

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings described below are only some embodiments recorded in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0066] Figure 1 Flow chart of a method for determining the queuing number of a lane provided by an embodiment of the present application;

[0067] Figure 2 Schematic diagram of a device for determining the queuing number of a lane provided by an embodiment of the present application. Detailed Embodiments

[0068] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without making creative efforts belong to the scope of protection of this application.

[0069] As described in the background art, when currently performing real-time statistics on the queuing quantity of a lane based on the multi-target tracking result at the current moment, due to the limitation of camera installation, vehicles are easily blocked in the video frame at the current moment, resulting in inaccurate statistical results of the lane queuing quantity.

[0070] This application provides a technical solution. First, vehicle data of the target lane is obtained. The vehicle data includes data of multiple video frames, where the data of each video frame is used to identify the identity identifier ID of the vehicle on the target lane and the corresponding position of the vehicle. Then, according to the obtained vehicle data, the ID X of the vehicle at the front of the queuing area on the target lane and the ID Y of the vehicle at the rear can be determined at the current moment. The moment of the video frame when ID Y first appears is traced back from the current moment to obtain M video frames. Based on the data of these M video frames, the number of vehicles between ID X and ID Y in the target lane in each video frame can be counted, and the maximum number among them is used as the first queuing number. Finally, the queuing quantity of the target lane can be obtained according to the first queuing number. Since the vehicles about to enter the queuing area travel slowly and it is not easy to overtake, it can be considered that in multiple video frames of the video sequence, the order of vehicles in the target lane will not change. Therefore, the maximum number of vehicles between ID X and ID Y obtained can be used as the number of vehicles between ID X and ID Y at the current moment. Moreover, by choosing to trace back at the moment when ID Y first appears in the target lane to count the maximum number, it ensures that vehicle information in a longer time series is obtained based on the visible range of the camera, effectively reducing the situation where the statistical quantity is less than the actual quantity due to vehicle occlusion during the process of vehicle ID Y moving to the current moment of the queuing area, thus making the queuing quantity of the target lane obtained by this technical solution more accurate.

[0071] The solution provided in the embodiments of this application relates to the field of computer vision technology, and will be specifically described through the following embodiments.

[0072] See Figure 1 As shown, it is a flow diagram of a method for determining the queuing quantity of a lane provided in the embodiments of this application. In this embodiment, it can be executed by taking a computer device as an example.

[0073] S101: Obtain the vehicle data of the target lane.

[0074] In the embodiments of the present application, the target lane is the lane for which the vehicle queue number needs to be counted, including the queue area of the lane. Counting the vehicle queue number of the target lane is actually counting the number of vehicles in the queue area of the lane. The queue area can be all sections of the lane or some sections of the lane.

[0075] The vehicle data includes the data of multiple video frames in the video sequence, and this data is used to identify the identity identifier ID and the position information of the vehicles on the target lane. Among them, the ID of the same vehicle remains consistent in different video frames.

[0076] The video sequence is obtained by a camera. If the target lane can be covered by one camera, then the video sequence is obtained based on this camera. However, the visual range of each camera is limited. If the target lane is too long and needs to be covered by multiple cameras, then there are multiple video sequences at this time.

[0077] The vehicle data can be obtained through multi-object tracking technology. Since there will be overlapping parts in the fields of view of different cameras, multiple video frames in the video sequences obtained by multiple cameras can be stitched based on the visual range of the cameras, and then multi-object tracking is performed to obtain the vehicle data of the target lane. It is also possible to perform multi-object tracking on the vehicles in the video sequences obtained by multiple cameras respectively, and then match the IDs of the same vehicle in different cameras according to the results of multi-object tracking to obtain the vehicle data of the target lane.

[0078] In a possible implementation, S101 is executed through the following steps:

[0079] A1: Perform multi-object tracking on the vehicles in the video sequence obtained by each camera to obtain the multi-object tracking results.

[0080] The camera is used to photograph a local area of the target lane. Multiple cameras are sequentially installed on the side of the target lane to cover the target lane, and there will be overlapping parts in the local areas corresponding to different cameras.

[0081] The multi-object tracking results are used to identify the data of multiple video frames in the video sequence obtained by each camera in the corresponding area, and this data is used to identify the ID and its position information of the vehicles on the target lane in the corresponding area covered by the camera.

[0082] A2: According to the multi-object tracking results corresponding to each camera respectively, match the IDs of the same vehicle to obtain the vehicle data.

[0083] Since there is an overlapping part in the fields of view of adjacent cameras installed in sequence, the IDs of the same vehicle in the overlapping part are inconsistent in the multi-object tracking results of different cameras, and it is necessary to match the IDs of the same vehicle.

[0084] Based on the position information of the vehicles in the multi-object tracking results, it can be determined whether the vehicles in different cameras are the same vehicle, so as to unify the IDs of the vehicles at the same position at the same time, summarize the multi-object tracking results of multiple cameras, and obtain vehicle data.

[0085] In a possible implementation manner, A2 can be executed through the following steps:

[0086] B1: Construct a three-dimensional model of the target lane.

[0087] According to the installation positions of multiple cameras, the target lane can be scanned to help capture the spatial information of the target lane, thereby establishing a three-dimensional model of the target lane.

[0088] B2: According to different times, project the vehicles located on the target lane onto the three-dimensional model based on the multi-object tracking results corresponding to each camera respectively.

[0089] Since the multi-object tracking results of each camera include multiple time-series video frames, it is necessary to match the IDs of the same vehicle in the video frames of different cameras within the same time.

[0090] According to different times, divide the data of the video frames obtained by different cameras, and then project the vehicles located on the target lane onto the three-dimensional model through the position information of the vehicles in the video frame data, so as to determine whether the vehicles in multiple cameras are at the same position on the target lane at the same time.

[0091] B3: Match the IDs of the vehicles in the same position to obtain vehicle data.

[0092] Within the same time, the vehicles projected to the same position on the target lane are actually the same vehicle. Match the IDs of the same vehicle in different cameras to ensure the consistency of the IDs of the same vehicle. For example, according to the installation order of the cameras, use the vehicle ID obtained in the previous-order camera as the standard to adjust the IDs of the corresponding vehicles in the subsequent cameras.

[0093] Project the vehicle onto the three-dimensional model of the target lane according to its position on the target lane. Through the spatial information, the relationship between the vehicles in different cameras at the same time can be established, so as to summarize the multi-object tracking results of multiple cameras.

[0094] Thus, by using multiple cameras to perform multi-object tracking on the vehicles in the target lane and then aggregating the multi-object tracking results of multiple cameras to obtain the vehicle data of the target lane, a larger field of view coverage can be ensured, and it is more capable of coping with complex lane environments. As a result, the vehicle information on the target lane can be obtained more accurately, improving the accuracy of queue number statistics.

[0095] The vehicle data obtained through multi-object tracking technology can have the following forms of expression: in each video frame, the vehicles located in the target lane are marked by detection boxes, and the ID and specific location information of the vehicle are correspondingly marked.

[0096] In a possible implementation, the frames per second (FPS) of the multi-object tracking results is not less than 12, which can ensure the accuracy and real-time performance of multi-object tracking.

[0097] S102: According to the vehicle data, determine the IDX of the vehicle at the frontmost position and the ID Y of the vehicle at the rearmost position in the queuing area of the target lane at the current moment.

[0098] Based on the position information of the vehicles in the current video frame, the ID X of the vehicle at the frontmost position and the ID Y of the vehicle at the rearmost position in the queuing area of the target lane at the current moment can be determined.

[0099] S103: According to the vehicle data, determine M video frames from the moment when ID Y first appears to the current moment.

[0100] The multiple video frames in the vehicle data are continuous in time. The moment when ID Y first appears can be determined from the multiple video frames. Since the camera coverage range is larger than the queuing area of the target lane, there is a period of time between the moment when ID Y first appears and the current moment when ID Y enters the queuing area. Thus, M video frames from that moment to the current moment can be determined.

[0101] S104: According to the data of the M video frames, determine the maximum number of vehicles between ID X and ID Y in the target lane as the first queue number.

[0102] Analyze each of the M video frames to determine the number of vehicles between ID X and ID Y in the target lane for each video frame. Since it is not easy for vehicles to overtake when approaching the queuing area, it can be considered that the order of vehicles in the target lane does not change much. Therefore, the maximum number among them can be determined as the first queuing number between ID X and ID Y. Moreover, when performing multi-object tracking, vehicles may not be tracked at certain times or positions due to occlusion. Selecting the maximum number effectively avoids the situation where the queuing quantity statistics are inaccurate due to the occlusion of vehicles between ID X and ID Y.

[0103] Due to the limitation of the camera installation position, a single camera may need to cover multiple lanes simultaneously. At this time, the vehicle ID X at the forefront of the queuing area in the target lane may not necessarily be the first vehicle in this queuing area. In one possible implementation, the following steps may be further executed after S104:

[0104] C1: Determine N video frames from the moment when ID X first appears to the current moment according to the vehicle data.

[0105] In the embodiments of the present application, the moment when ID X first appears refers to the moment when ID X is first marked in the video frame through multi-object tracking technology. At this time, the vehicle may be located in the queuing area of the target lane or may not have entered the queuing area.

[0106] C2: Determine the ID X1 of the vehicle that crosses the stop line last at the current moment.

[0107] Among them, the stop line is used to identify the boundary in front of the queuing area of the target lane. Vehicles in front of the stop line will not be occluded, and vehicles that cross this stop line are considered to have left the queuing area and are not included in the statistics of the vehicle queuing quantity.

[0108] From the video frame at the current moment, the ID X1 of the vehicle that finally leaves the queuing area in the target lane can be determined. The vehicles between ID X1 and ID X are the vehicles occluded in this queuing area.

[0109] C3: Determine the maximum number of vehicles between ID X1 and ID X as the second queuing number according to the data of the N video frames.

[0110] Analyze each of the N video frames to determine the number of vehicles between ID X1 and ID X in the target lane for each video frame, and determine the maximum number among them as the second queuing number between ID X1 and ID X.

[0111] C4: Use the sum of the second queuing number and the first queuing number as the first queuing number.

[0112] The queuing number obtained by adding the second queuing number between ID X1 and ID X and the first queuing number between ID X and ID Y is used as the new first queuing number.

[0113] Therefore, for the case where the first vehicle in the queuing area identified by the multi-target tracking technology is not the first vehicle in the actual queuing area, the vehicles between the first vehicle identified by the multi-target tracking technology and the last vehicle leaving the queuing area are counted, further avoiding the inaccurate queuing number statistics caused by the occlusion of the vehicles in the front of the queuing area due to the limitation of camera installation.

[0114] In a possible implementation manner, before using the sum of the second queuing number and the first queuing number as the first queuing number, the method further includes:

[0115] E1: Obtain the vehicle data of the parallel lanes of the target lane.

[0116] The target vehicle and its parallel lanes can be covered by the same camera or multiple cameras, and the vehicle data is also obtained by multi-target tracking of the vehicles in the video sequence captured by the camera.

[0117] E2: Determine the first vehicle between IDX and IDY in the target lane from the video frame when the number of vehicles between IDX and IDY in the target lane is the largest.

[0118] The first vehicle may be one vehicle or multiple vehicles, and each vehicle has a uniquely determined ID. The IDs of multiple intermediate vehicles can be determined from the video frame when the number of vehicles between IDX and IDY in the target lane is the largest.

[0119] E3: If at the current moment, P vehicles in the first vehicle appear in the parallel lane, update the first queuing number based on P.

[0120] Based on the IDs of the multiple vehicles determined in E2, the position information of these multiple vehicles in the video frame at the current moment can be determined. If P of these vehicles appear in the parallel lane at the current moment, that is, they have changed lanes, then subtract P from the first queuing number to update the first queuing number.

[0121] Thus, when counting the first queuing number between the first vehicle and the last vehicle obtained by the multi-target tracking technology in the queuing area, the occurrence of vehicle lane-changing is considered, which can more truly reflect the queuing situation of the target lane.

[0122] In a possible implementation manner, before using the sum of the second queuing number and the first queuing number as the first queuing number, the method further includes:

[0123] F1: Determine the second vehicle between ID X1 and ID X in the target lane from the video frame when the number of vehicles between ID X1 and ID X in the target lane is the largest.

[0124] F2: If at the current moment, R vehicles in the second vehicle appear in the parallel lane, update the second queue count based on R.

[0125] Thus, when counting the number of vehicles blocked before the first vehicle obtained by multi-object tracking technology in the queuing area, the occurrence of vehicle lane-changing is considered, which can more realistically reflect the queuing situation of the target lane.

[0126] S105: Obtain the queuing quantity of the target lane according to the first queue count.

[0127] Add 2 to the first queue count, that is, add the quantities of the two vehicles ID X and ID Y, then the queuing quantity of the vehicles in the queuing area of the target lane can be obtained.

[0128] Thus, select the moment when ID Y first appears in the target lane for backtracking, determine the maximum number of vehicles between ID X and ID Y during this period, and then count the maximum number. It can obtain vehicle information with a longer time series based on the visible range of the camera, help determine the order of vehicles before entering the queuing area, and effectively avoid the situation where the statistical quantity is less than the actual due to vehicle occlusion. Therefore, the queuing quantity of the target lane obtained by this technical solution is more accurate.

[0129] To describe this method for determining the lane queuing quantity more clearly, the following is illustrated with a specific implementation scenario. There are multiple parallel lanes in the target section, and the target section is segmented and covered by multiple cameras installed on the side of the road, and each camera covers all lanes of the corresponding section. Now it is necessary to count the queuing quantity of the vehicles in the queuing area of each lane. Taking one lane as an example for statistics, the specific steps are as follows:

[0130] Step 1: Aggregate the multi-object tracking results of multiple cameras.

[0131] 1) Perform real-time multi-object tracking on the vehicles in each camera to obtain the multi-object tracking results.

[0132] Through open-source methods, such as ByteTrack, etc., the ID and position information of the vehicles under a single camera can be obtained. This ID can be called the singleview car id, abbreviated as svcid. Its essence is to match the same vehicle at different times under the same camera so that they are associated with the same svcid. To ensure the effect of real-time multi-object tracking, the FPS for detecting the vehicle detection frame during multi-object tracking should not be lower than 12.

[0133] 2) Aggregate the multi-object tracking results of all single cameras within a set time window (e.g., 5 seconds) (regarded as a batch).

[0134] That is, match the same vehicle at the same time but under different cameras so that they are associated with the same svcid. To obtain the spatial relationship, the lane can be scanned into a three-dimensional model, and then based on the camera calibration results, project the vehicle positions in the single camera into the three-dimensional model space. After the matching is completed, the trajectories of each svcid cannot conflict in space-time, and the appearance features of the vehicles with the same scvid are relatively close.

[0135] Since it takes several seconds to perform multi-object tracking and aggregate the multi-object tracking results of multiple cameras, there will be a delay of several seconds when counting the queuing quantity of the lane.

[0136] Step 2: Count the queuing quantity of the lane according to the aggregated results.

[0137] The visual fields of multiple cameras on the same road may overlap in some lane areas. Mark the effective queuing areas of each camera and the sequence relationship of each camera in that lane. At the same time, a "stop line" is determined at the front boundary of the queuing area, and it is considered that the vehicle crossing the stop line is the vehicle leaving the queuing area.

[0138] After aggregation and merging, the vehicle data of the target lane can be obtained. The vehicle data includes multiple video frames. In each video frame, the vehicles visible to the camera are marked by vehicle detection frames, as well as the corresponding IDs and positions of the vehicles. Thus, the sequence relationship of the vehicles on that lane can be known through the vehicle data.

[0139] Through the video frame at the current moment, the IDs of the first and last vehicles in the queuing area of the lane can be determined, which are x and y respectively. To count how many vehicles are queuing in the lane, it is first necessary to count how many vehicles are between x and y and how many vehicles are between x and the stop line.

[0140] 1) Count the number of vehicles between x and y.

[0141] There may be no vehicles between x and y, or the middle vehicles may not be visible in the video frame at the current moment obtained by the multi-object tracking technology due to occlusion.

[0142] Check whether there are other multiple vehicles between x and y at a previous moment, and take the maximum number of vehicles between them at the previous moment as the number of vehicles between x and y at that moment. If a certain vehicle between them appears in other lanes at the moment of currently counting the vehicle queue length, the number of vehicles that appear in other lanes needs to be deducted. The farthest moment to be traced back is the time when y first appears. Therefore, it is necessary to record or cache the queue situation of each lane at each moment. Since the length of the lane that the camera can see is longer than the length of the actual queue area, more and farther vehicles can be seen in terms of their distance or front-back relationship on the lane.

[0143] 2) Count the number of vehicles between x and the stop line.

[0144] x may be the first vehicle, or due to occlusion, other vehicles between x and the stop line cannot be seen in the video frame at the current moment obtained according to the multi-object tracking technology.

[0145] Assume that there is no occlusion at the stop line. Therefore, it can be observed at the stop line whether a vehicle crosses the line to count which vehicles have completely left the queue area of the lane. By observing at the stop line, the vehicle x1 that is the last to leave the queue area at the current moment can be known. Then, check whether there are other vehicles between x1 and x at the previous moment, and take the maximum value of the number of vehicles between them at the previous moment as the number of vehicles between x and the stop line at the current moment. If some of the vehicles between the two appear in other lanes at the moment of counting the number of vehicles, the number of vehicles that appear in other lanes needs to be deducted. The farthest moment to be traced back is the moment when x first appears. Therefore, it is necessary to record or cache the queue situation of each lane at each time, and it is also necessary to record all the vehicles that cross the line and leave the queue area and the time.

[0146] Thus, the number of vehicles queuing in this lane = 2 + "the number of vehicles between x and y" + "the number of vehicles between x and the stop line".

[0147] Therefore, through the summary of the multi-object tracking results of multiple cameras, the vehicle dynamics on this lane before the current moment can be known, including the front-back relationship of vehicles and whether lane changes occur, etc. Thus, based on the dynamic changes of vehicles, the number of vehicles queuing in this lane is counted, effectively avoiding the situation where some vehicles in the queue area of this lane are occluded due to the limitations of camera installation, resulting in inaccurate statistics, and effectively improving the accuracy of lane queue number statistics. Thus, the real-time lane queue number can be fed back to the downstream, facilitating the downstream to quickly make strategies for improving queues, congestion, etc.

[0148] Based on the above embodiments, the embodiments of the present application provide a device for determining the number of vehicles queuing in a lane. Refer to Figure 2As shown in the figure, it is a schematic diagram of a device for determining the number of vehicles queuing in a lane provided by an embodiment of the present application. The device 200 includes an acquisition unit 201 and a determination unit 202:

[0149] The acquisition unit is used to acquire vehicle data of the target lane. The vehicle data includes data of multiple video frames in a video sequence. The data is used to identify the identity identifier ID and the position information of the vehicles on the target lane. The ID is the same when corresponding to the same vehicle in different video frames. The video sequence is acquired by a camera;

[0150] The determination unit is used to determine, according to the vehicle data, the ID X of the vehicle at the frontmost position and the ID Y of the vehicle at the rearmost position in the queuing area of the target lane at the current moment;

[0151] The determination unit is further used to determine, according to the vehicle data, M video frames from the moment when the ID Y first appears to the current moment;

[0152] The determination unit is further used to determine, according to the data of the M video frames, the maximum number of vehicles between the ID X and the ID Y in the target lane as the first queuing number;

[0153] The determination unit is further used to obtain the queuing number of the target lane according to the first queuing number.

[0154] Therefore, by selecting the moment when the ID Y first appears in the target lane for backtracking, determining the maximum number of vehicles between the ID X and the ID Y during this period, and thus counting the maximum number, it is possible to obtain vehicle information in a longer time series based on the visible range of the camera, help determine the order of vehicles before entering the queuing area, and effectively avoid the situation where the counted number is less than the actual number due to vehicle occlusion. As a result, the queuing number of the target lane obtained by this technical solution is more accurate.

[0155] In a possible implementation manner, the determination unit is further used to:

[0156] Determine, according to the vehicle data, N video frames from the moment when the ID X first appears to the current moment;

[0157] Determine the ID X1 of the vehicle that is the last to cross the stop line at the current moment. The stop line is used to identify the boundary in front of the queuing area of the target lane;

[0158] Determine, according to the data of the N video frames, the maximum number of vehicles between the ID X1 and the ID X as the second queuing number;

[0159] Take the sum of the second queue number and the first queue number as the first queue number.

[0160] Thus, for the case where the first vehicle in the queuing area identified by the multi-target tracking technology is not the first vehicle in the actual queuing area, the vehicles between the first vehicle identified by the multi-target tracking technology and the last vehicle leaving the queuing area are counted, further avoiding the inaccurate queuing quantity statistics caused by the occlusion of the vehicles in the front of the queuing area due to the limitations of camera installation.

[0161] In a possible implementation manner, the obtaining unit is further configured to:

[0162] Obtain the vehicle data of the parallel lanes of the target lane;

[0163] The determining unit is further configured to determine the first vehicle between the IDX and the IDY in the target lane from the video frame when the number of vehicles between the IDX and the IDY in the target lane is the largest;

[0164] If at the current moment, P vehicles in the first vehicle appear in the parallel lane, update the first queue number based on the P.

[0165] Therefore, when counting the first queue number between the first vehicle and the last vehicle obtained by the multi-target tracking technology in the queuing area, the occurrence of vehicle lane-changing is considered, which can more realistically reflect the queuing situation of the target lane.

[0166] In a possible implementation manner, the determining unit is further configured to:

[0167] Determine the second vehicle between the ID X1 and the ID X in the target lane from the video frame when the number of vehicles between the ID X1 and the ID X in the target lane is the largest;

[0168] If at the current moment, R vehicles in the second vehicle appear in the parallel lane, update the second queue number based on the R.

[0169] Therefore, when counting the number of occluded vehicles before the first vehicle obtained by the multi-target tracking technology in the queuing area, the occurrence of vehicle lane-changing is considered, which can more realistically reflect the queuing situation of the target lane.

[0170] In a possible implementation manner, the obtaining unit is specifically configured to:

[0171] Perform multi-object tracking on the vehicles in the video sequences obtained by each camera to obtain multi-object tracking results. Each of the cameras is used to cover a local area of the target lane, and the multi-object tracking results are used to identify the data of multiple video frames in the corresponding video sequences.

[0172] Match the IDs of the same vehicle according to the multi-object tracking results respectively corresponding to each camera to obtain the vehicle data.

[0173] Thus, by performing multi-object tracking on the vehicles on the target lane through multiple cameras and then summarizing the multi-object tracking results of multiple cameras to obtain the vehicle data of the target lane, a larger field of view coverage can be ensured, and it is more capable of dealing with complex lane environments. Therefore, the vehicle information on the target lane can be obtained more accurately, and the accuracy of the queuing quantity statistics can be improved.

[0174] In a possible implementation manner, the determining unit is specifically configured to:

[0175] Construct a three-dimensional model of the target lane;

[0176] Project the vehicles located on the target lane onto the three-dimensional model according to the multi-object tracking results respectively corresponding to each camera at different times;

[0177] Match the vehicle IDs in the same position to obtain the vehicle data.

[0178] Projecting the vehicles onto the three-dimensional model of the target lane according to their positions on the target lane can establish the relationship between the vehicles among different cameras at the same time through spatial information, so as to summarize the multi-object tracking results of multiple cameras.

[0179] In a possible implementation manner, the frames per second (FPS) of the multi-object tracking results is not less than 12.

[0180] This can ensure the accuracy and real-time performance of multi-object tracking.

[0181] Based on the above embodiments, an embodiment of the present application provides a computer device, which includes a processor and a memory:

[0182] The memory is used to store a computer program;

[0183] The processor is used to execute the method for determining the lane queuing quantity according to the computer program.

[0184] Based on the above embodiments, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, which, when executed by a computer device, implements the method for determining the number of vehicles queuing in a lane as described above.

[0185] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the systems or devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and reference can be made to the description in the method part for the relevant parts.

[0186] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for determining the number of vehicles queuing in a lane, characterized in that, The method includes: Obtaining vehicle data of a target lane, where the vehicle data includes data of multiple video frames in a video sequence, the data being used to identify an identity identifier ID and location information of vehicles on the target lane, the ID being the same when corresponding to the same vehicle in different video frames, and the video sequence being obtained by a camera; According to the vehicle data, determining an ID X of the foremost vehicle and an ID Y of the rearmost vehicle in the queuing area of the target lane at the current moment; According to the vehicle data, determining M video frames from the moment when the ID Y first appears to the current moment; According to the data of the M video frames, determining the maximum number of vehicles between the ID X and the ID Y in the target lane as a first queuing number; According to the first queuing number, obtaining the queuing quantity of the target lane.

2. The method according to claim 1, characterized in that, After determining the maximum number of vehicles between the ID X and the ID Y in the target lane as the first queuing number according to the data of the M video frames, the method further includes: According to the vehicle data, determining N video frames from the moment when the ID X first appears to the current moment; Determining an ID X1 of the last vehicle that crosses a stop line at the current moment, where the stop line is used to identify the boundary in front of the queuing area of the target lane, and the vehicles in front of the stop line are not blocked; According to the data of the N video frames, determining the maximum number of vehicles between the ID X1 and the ID X as a second queuing number; Taking the sum of the second queuing number and the first queuing number as the first queuing number.

3. The method according to claim 2, wherein Before taking the sum of the second queuing number and the first queuing number as the first queuing number, the method further includes: Obtaining vehicle data of a parallel lane of the target lane; Determining a first vehicle between the ID X and the ID Y in the target lane from a video frame when the number of vehicles between the ID X and the ID Y in the target lane is the largest; If P vehicles in the first vehicle appear in the parallel lane at the current moment, updating the first queuing number based on the P.

4. The method according to claim 3, characterized in that Before taking the sum of the second queuing number and the first queuing number as the first queuing number, the method further includes: Determining a second vehicle between the ID X1 and the ID X in the target lane from a video frame when the number of vehicles between the ID X1 and the ID X in the target lane is the largest; If R vehicles in the second vehicle appear in the parallel lane at the current moment, updating the second queuing number based on the R.

5. The method according to claim 1, wherein The obtaining vehicle data of the target lane includes: Performing multi-object tracking on vehicles in a video sequence obtained by each camera to obtain a multi-object tracking result, each camera being used to cover a local area of the target lane, and the multi-object tracking result being used to identify data of multiple video frames in the corresponding video sequence; According to the multi-object tracking results respectively corresponding to each camera, matching the IDs of the same vehicles to obtain the vehicle data.

6. The method according to claim 5, wherein Matching the IDs of the same vehicle according to the multi-object tracking results respectively corresponding to each camera to obtain the vehicle data includes: Constructing a three-dimensional model of the target lane; Projecting the vehicles located on the target lane onto the three-dimensional model according to the multi-object tracking results respectively corresponding to each camera at different times; Matching the vehicle IDs at the same position to obtain the vehicle data.

7. The method according to any one of claims 5-6, characterized in that, The frames per second (FPS) of the multi-object tracking results is not less than 12.

8. A device for determining the number of vehicles queuing in a lane, characterized in that, The device includes an acquisition unit and a determination unit: The acquisition unit is used to acquire vehicle data of the target lane. The vehicle data includes data of multiple video frames in a video sequence. The data is used to identify the identity identifier (ID) and position information of the vehicles on the target lane. The ID is the same when corresponding to the same vehicle in different video frames. The video sequence is acquired by a camera; The determination unit is used to determine the ID X of the foremost vehicle and the ID Y of the rearmost vehicle in the queuing area of the target lane at the current moment according to the vehicle data; The determination unit is further used to determine M video frames from the moment when the ID Y first appears to the current moment according to the vehicle data; The determination unit is further used to determine the maximum number of vehicles between the ID X and the ID Y in the target lane as the first queuing number according to the data of the M video frames; The determination unit is further used to obtain the queuing quantity of the target lane according to the first queuing number.

9. A computer device, characterized in that, The computer device includes a processor and a memory: The memory is used to store a computer program; The processor is used to execute the method according to any one of claims 1-7 according to the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program. The computer program, when executed by a computer device, implements the method according to any one of claims 1-7.