Multi-reference-based traffic video vehicle speed measurement method, device and equipment and storage medium
By constructing a preset mapping table between vehicle type and length and weighted fusion of the historical queue of pixels per meter of reference objects, the problem of high cost of existing vehicle speed measurement methods is solved, and low-cost, high-accuracy automated vehicle speed measurement is achieved.
Patent Information
- Application Number
- CN202611204576.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-03
AI Technical Summary
Existing vehicle speed measurement methods rely on fixed calibration boards or radar assistance, resulting in high maintenance costs or expensive hardware, making them difficult to use on a large scale.
By constructing a preset mapping table between vehicle type and length, and automatically obtaining the number of pixels per meter of the reference vehicle by combining vehicle samples, and using the historical queue of the number of pixels per meter of the reference vehicle and the reference object for weighted fusion, the automatic measurement of vehicle speed is realized.
It reduces labor and hardware costs, improves the accuracy and robustness of vehicle speed measurement, adapts to changes in camera angle or focal length, and requires no manual intervention.
Smart Images

Figure CN123033376A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle speed measurement technology, and in particular to a method, apparatus, equipment and storage medium for measuring vehicle speed based on multi-reference traffic video. Background Technology
[0002] Existing vehicle speed measurement methods mainly rely on fixed calibration plates or radar-assisted vehicle speed measurement methods.
[0003] However, the fixed calibration plate method requires manual on-site construction to place the calibration object, which is complicated and time-consuming. Furthermore, once the camera's posture changes due to wind, vibration, or maintenance, the calibration becomes invalid and requires manual recalibration, resulting in high operation and maintenance costs. The radar-assisted method has expensive hardware costs, with a single device costing thousands to tens of thousands of yuan. It also requires wiring and power supply, making it uneconomical for large-scale deployment on road networks and difficult to promote on a large scale. Summary of the Invention
[0004] The main purpose of this application is to provide a traffic video speed measurement method, device, equipment and storage medium based on multiple references, which aims to solve the technical problem that current vehicle speed measurement is difficult to use on a large scale due to high operation and maintenance costs or hardware costs.
[0005] To achieve the above objectives, this application proposes a multi-reference-based traffic video vehicle speed measurement method, which includes: Acquire vehicle samples, reference object samples, preset mapping tables, and videos of the vehicles to be inspected; Based on the vehicle samples and the preset mapping table, a historical queue of the number of pixels per meter for the reference vehicle is obtained. The reference sample is preprocessed to obtain a historical queue of the number of pixels per meter of the reference object; The number of pixels per meter to be fused is determined based on the historical queue of the number of pixels per meter of the reference vehicle and the historical queue of the number of pixels per meter of the reference object; The estimated vehicle speed is obtained based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter.
[0006] In one embodiment, the step of obtaining the estimated vehicle speed based on the video of the vehicle to be detected, the historical queue of pixels per meter of the reference vehicle, and the fused pixels per meter includes: Based on the video of the vehicle to be detected, determine the first ordinate and the second ordinate of the vehicle to be detected within a preset time period, wherein the frame sequence corresponding to the first ordinate is greater than the frame sequence corresponding to the second ordinate. The frame interval, inter-frame pixel displacement, and midpoint ordinate are determined based on the first and second ordinates. The target number of pixels per meter is determined based on preset weights, the midpoint ordinate, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter. The estimated vehicle speed is obtained based on the number of pixels per meter of the target, the inter-frame pixel displacement, and the frame interval.
[0007] In one embodiment, the step of determining the target number of pixels per meter based on preset weights, the midpoint ordinate, the historical queue of pixels per meter for the reference vehicle, and the fused pixel per meter count includes: The segment to which the vehicle belongs is determined based on the midpoint ordinate. The local pixel count per meter corresponding to the segment to which the vehicle belongs is determined from the historical queue of pixel count per meter of the reference vehicle. The target number of pixels per meter is determined based on preset weights, the number of local pixels per meter, and the number of fused pixels per meter.
[0008] In one embodiment, the step of obtaining the estimated vehicle speed based on the number of pixels per meter of the target, the inter-frame pixel displacement, and the frame interval includes: The actual distance within the preset time period is obtained based on the number of pixels per meter of the target and the inter-frame pixel displacement; The instantaneous velocity within the preset time period is obtained based on the actual distance and the frame interval; A velocity sequence is obtained based on the instantaneous velocity within the preset time period; The speed sequence is filtered to obtain the estimated vehicle speed.
[0009] In one embodiment, the step of obtaining the historical queue of pixels per meter for a reference vehicle based on the vehicle samples and the preset mapping table includes: The vehicle model and the bounding box height of each vehicle are obtained from the vehicle samples. The actual length corresponding to each vehicle model is obtained from the preset mapping table based on the vehicle model. The number of pixels per meter for each vehicle is determined based on the actual length and the bounding box height. The number of pixels per meter for the vehicle is filtered to obtain a historical queue of the number of pixels per meter for the reference vehicle.
[0010] In one embodiment, the step of filtering the number of pixels per meter of the vehicle to obtain a historical queue of the number of pixels per meter of the reference vehicle includes: Obtain a first threshold and a second threshold, wherein the first threshold is less than the second threshold; When the number of pixels per meter of the vehicle is less than the first threshold or the number of pixels per meter of the vehicle is greater than the second threshold, the number of pixels per meter of the vehicle is filtered to obtain the filtered number of pixels per meter of the vehicle. The historical queue of the number of pixels per meter for the reference vehicle is obtained based on the filtered number of pixels per meter for the vehicle.
[0011] In one embodiment, the step of preprocessing the reference sample to obtain the historical queue of pixels per meter of the reference sample includes: The reference sample is preprocessed to obtain the pixel length of the arrow, the pixel spacing of the pillars, and the pixel width of the lane; Obtain the standard length of the arrows, the standard spacing between the posts, and the standard width of the lane; The historical queue of the number of pixels per meter of the arrow is obtained based on the standard length of the arrow and the pixel length of the arrow; The historical queue of the number of pixels per meter of the columns is obtained based on the standard spacing of the columns and the pixel spacing of the columns. The historical queue of the number of pixels per meter of the lane is obtained based on the standard width of the lane and the pixel width of the lane; The historical queue of the reference object's pixel count per meter is obtained based on the historical queue of the arrow's pixel count per meter, the historical queue of the column's pixel count per meter, and the historical queue of the lane's pixel count per meter.
[0012] Furthermore, to achieve the above objectives, this application also proposes a multi-reference-based traffic video vehicle speed measurement device, which includes: The acquisition module is used to acquire vehicle samples, reference object samples, preset mapping tables, and videos of the vehicles to be detected. The acquisition module is also used to obtain a historical queue of the number of pixels per meter of the reference vehicle based on the vehicle sample and the preset mapping table; The processing module is used to preprocess the reference sample to obtain a historical queue of the number of pixels per meter of the reference; The calculation module is used to determine the number of pixels per meter to be fused based on the historical queue of the number of pixels per meter of the reference vehicle and the historical queue of the number of pixels per meter of the reference object. The calculation module is also used to obtain the estimated vehicle speed based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter.
[0013] Furthermore, to achieve the above objectives, this application also proposes a multi-reference-based traffic video vehicle speed measurement device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the multi-reference-based traffic video vehicle speed measurement method described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the multi-reference-based traffic video vehicle speed measurement method described above.
[0015] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the multi-reference-based traffic video vehicle speed measurement method described above.
[0016] One or more technical solutions proposed in this application have at least the following technical effects: 1) By constructing a preset mapping table of vehicle type and length, and combining it with vehicle samples, the PPM (pixels per meter) of the reference vehicle is automatically obtained, and the historical queue of the reference vehicle's pixels per meter is obtained accordingly. This eliminates the need for manual placement of fixed calibration boards, effectively reducing costs.
[0017] 2) By weighted fusion of the historical queue of pixels per meter for the reference vehicle and the historical queue of pixels per meter for the reference object, the number of pixels per meter is determined, which effectively eliminates the influence of outliers and improves the robustness and accuracy of the calibration.
[0018] 3) By using the acquired video of the vehicle to be detected (usually traffic video) and calculating based on the determined PPM historical queue, the estimated vehicle speed is obtained, which further reduces costs and improves the accuracy of the measured estimated vehicle speed. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1This is a flowchart illustrating an embodiment of the traffic video speed measurement method based on multiple references in this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the traffic video speed measurement method based on multiple references in this application; Figure 3 This is a flowchart illustrating Embodiment 3 of the traffic video speed measurement method based on multiple references in this application; Figure 4 This is a schematic diagram of the module structure of the traffic video vehicle speed measurement device based on multiple references according to an embodiment of this application; Figure 5 This is a schematic diagram of the equipment structure of the hardware operating environment involved in the traffic video speed measurement method based on multiple references in the embodiments of this application.
[0022] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0023] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0024] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0025] The main solution of this application embodiment is as follows: acquiring vehicle samples, reference object samples, a preset mapping table, and a video of the vehicle to be detected; obtaining a historical queue of the number of pixels per meter for the reference vehicle based on the vehicle samples and the preset mapping table; preprocessing the reference object samples to obtain a historical queue of the number of pixels per meter for the reference object; determining the number of pixels per meter to be fused based on the historical queue of the number of pixels per meter for the reference vehicle and the historical queue of the number of pixels per meter for the reference object; and obtaining the estimated vehicle speed based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter for the reference vehicle, and the number of pixels per meter to be fused.
[0026] Existing technologies typically measure vehicle speed using fixed calibration plates or radar-assisted methods. However, these methods rely heavily on manual calibration to obtain PPM or manual hardware maintenance. While they can measure vehicle speed, the high labor or hardware costs make it difficult to scale these methods up.
[0027] This application provides a solution that automatically obtains the PPM (pixels per meter) of a reference vehicle by utilizing a pre-built mapping table of vehicle type and length, combined with vehicle samples. The PPM of the reference vehicle is then added to a historical queue of pixels per meter for that vehicle, and weighted fusion is performed with the historical queue of pixels per meter for the reference vehicle to determine the fused pixel count per meter, effectively reducing the impact of outliers. Based on the video of the vehicle to be detected, and combined with the determined fused pixel count per meter, automated measurement of vehicle speed in traffic videos is achieved.
[0028] It should be noted that the executing entity of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions, such as a multi-reference traffic video speed measurement system. The following description uses a multi-reference traffic video speed measurement system as an example to illustrate this embodiment and the subsequent embodiments. All actions involving the acquisition of signals, information, or data in this application are performed in accordance with the relevant data protection regulations of the country where the application is located and with authorization from the owner of the corresponding device.
[0029] Based on this, embodiments of this application provide a multi-reference-based traffic video vehicle speed measurement method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the traffic video speed measurement method based on multiple references in this application.
[0030] In this embodiment, the multi-reference-based traffic video vehicle speed measurement method includes steps S10~S40: Step S10: Obtain vehicle samples, reference object samples, preset mapping tables, and videos of the vehicles to be detected.
[0031] It should be noted that vehicle samples are typically obtained from all suitable vehicles detected in historical traffic videos. For example, data on cars, SUVs (Sport Utility Vehicles), buses, large trucks, medium-sized trucks, light trucks, vans, and motorcycles are collected from historical traffic videos. Reference object samples are usually sample data of traffic facilities in the traffic videos, such as directional arrows, road guardrail posts, and lane markings. The preset mapping table is typically a pre-established mapping table between vehicle type and length. This preset mapping stores the actual physical length of each vehicle type based on vehicle type standards and industry statistics. For example: car - actual physical length 4.5m, SUV - actual physical length 4.7m, bus - actual physical length 12.0m, large truck - actual physical length 12.0m, medium-sized truck - actual physical length 8.0m, light truck - actual physical length 5.5m, van - actual physical length 5.0m, and motorcycle - actual physical length 2.0m.
[0032] The video of the vehicle to be detected is usually the video data of the vehicle whose speed needs to be measured and which is being tracked in the current traffic video.
[0033] By acquiring basic data such as vehicle samples, reference samples, preset mapping tables, and videos of the vehicles to be tested, a data foundation is laid for subsequent high-precision vehicle speed measurement.
[0034] Step S20: Based on the vehicle samples and the preset mapping table, obtain the historical queue of the number of pixels per meter for the reference vehicle.
[0035] It should be noted that the number of pixels per meter usually refers to how many pixels correspond to 1 meter in the real world in an image. It is the core scale of the entire video-based ranging and speed measurement system.
[0036] Additionally, the historical queue of pixels per meter for reference vehicles typically refers to the system continuously selecting qualified vehicles of known size from traffic flow in historical traffic videos as reference vehicles, storing their respective derived PPM values in a fixed-length sliding window, thus constructing the historical queue of pixels per meter for reference vehicles. This historical queue of pixels per meter for reference vehicles can then be used in subsequent vehicle speed measurement processes.
[0037] Understandably, the actual length of the corresponding vehicle can be determined from a preset mapping table based on the data information of the vehicle sample. Then, the number of pixels per meter of the reference vehicle can be calculated, and the calculated number of pixels per meter of the reference vehicle can be filtered to construct a historical queue of the number of pixels per meter of the reference vehicle.
[0038] By introducing a historical queue of pixels per meter for reference vehicles, the calculation of PPM no longer relies on manual calibration. Instead, the historical queue of pixels per meter for reference vehicles is automatically generated using historical data. This reduces the probability of data errors caused by manual calculation, lowers costs, and significantly improves the accuracy of the measured vehicle speed.
[0039] Step S30: Preprocess the reference sample to obtain the historical queue of the number of pixels per meter of the reference.
[0040] It should be noted that the historical queue of reference objects' pixel count per meter usually refers to the information of reference objects (usually traffic facilities, such as road directional arrows, road guardrail posts, and lane markings) obtained by the system from historical traffic videos. Based on this reference object information, the corresponding PPM is automatically calculated, and the PPM corresponding to this reference object information is stored in a sliding window of fixed length, thereby constructing the historical queue of reference objects' pixel count per meter.
[0041] In one embodiment, the step of preprocessing the reference sample to obtain a historical queue of the number of pixels per meter of the reference sample may include: preprocessing the reference sample to obtain the pixel length of the arrow, the pixel spacing of the pillars, and the pixel width of the lane; obtaining the standard length of the arrow, the standard spacing of the pillars, and the standard width of the lane; obtaining a historical queue of the number of pixels per meter of the arrow based on the standard length of the arrow and the pixel length of the arrow; obtaining a historical queue of the number of pixels per meter of the pillar based on the standard spacing of the pillar and the pixel spacing of the pillar; obtaining a historical queue of the number of pixels per meter of the lane based on the standard width of the lane and the pixel width of the lane; and obtaining a historical queue of the number of pixels per meter of the reference sample based on the historical queue of the number of pixels per meter of the arrow, the historical queue of the number of pixels per meter of the pillar, and the historical queue of the number of pixels per meter of the lane.
[0042] Specifically, image processing methods can be used to detect and process reference objects (such as road directional arrows, road guardrail posts, and lane markings) in historical traffic videos to obtain the pixel length of the arrow, the pixel spacing between (adjacent) posts, and the pixel width of the lane. Standard data is then used to obtain the standard length of the arrow, the standard spacing between posts, and the standard width of the lane. Based on the standard length and pixel length of the arrow, the number of pixels per meter of the arrow can be calculated, as shown in the following formula: PPM_arrow=A_pixel / A_real In the above formula, PPM_arrow is the number of pixels per meter of the arrow, A_pixel is the pixel length of the arrow, and A_real is the standard length of the arrow (usually A_real = 6.0m). After obtaining the number of pixels per meter of all directional arrows in the historical traffic video, a historical queue of the number of pixels per meter of the arrows can be constructed.
[0043] The number of pixels per meter of a column can be obtained based on the standard spacing and pixel spacing of the columns. The specific calculation process is as follows: PPM_guardrail=G_pixel / G_real In the above formula, PPM_guardrail represents the number of pixels per meter of the guardrail, G_pixel represents the pixel pitch of the guardrail, and G_real represents the standard spacing between the guardrails (usually G_real = 4.0m). After obtaining the number of pixels per meter of all road guardrail guardrails in historical traffic videos, a historical queue of the number of pixels per meter of the guardrails can be constructed.
[0044] The number of pixels per meter of the lane can be obtained based on the standard lane width and the lane's pixel width. The specific calculation process is as follows: PPM_lane=L_pixel / L_real In the above formula, PPM_lane is the number of pixels per meter of the lane, L_pixel is the pixel width of the lane, and L_real is the standard width of the lane (usually L_real = 3.5m). After obtaining the number of pixels per meter of all lane markings in historical traffic videos, a historical queue of the number of pixels per meter of lanes can be constructed.
[0045] It is understandable that after obtaining the historical queue of pixels per meter for arrows, the historical queue of pixels per meter for pillars, and the historical queue of pixels per meter for lanes, the historical queue of pixels per meter for reference objects can be constructed.
[0046] In addition, when the camera angle or focal length changes, the corresponding image changes. This embodiment can automatically recalculate PPM based on the vehicles and reference objects (usually traffic facilities) detected in the traffic video to build an updated historical queue of the number of pixels per meter for reference vehicles and an updated historical queue of the number of pixels per meter for reference objects. This does not require manual intervention and improves the adaptability of vehicle speed measurement.
[0047] This embodiment constructs a historical queue of pixels per meter for reference objects in the offline stage, using traffic facilities as reference objects, thus laying the foundation for the subsequent online stage to accurately measure vehicle speed.
[0048] Step S40: Determine the number of pixels per meter to be fused based on the historical queue of the number of pixels per meter of the reference vehicle and the historical queue of the number of pixels per meter of the reference object.
[0049] Understandably, weighted fusion of the historical queue of pixels per meter for the reference vehicle and the historical queue of pixels per meter for the reference object to obtain the fused pixel count per meter can effectively reduce the impact of outliers, thereby improving the accuracy of vehicle speed measurement.
[0050] In a specific embodiment, fusion weights can be pre-set (typically including four types of fusion weights): the weight corresponding to the reference vehicle, the weight corresponding to the guide arrow, the weight corresponding to the pillar, and the weight corresponding to the vehicle marking; then, the number of pixels per meter for fusion is calculated based on the fusion weights, the historical queue of pixels per meter for the reference vehicle, and the historical queue of pixels per meter for the reference object. The specific calculation process is as follows: PPM_fused=(W_vehicle×median(PPM_vehicle_history)+ W_arrow×median(PPM_arrow_history)+ W_guardrail×median(PPM_guardrail_history)+ W_lane×median(PPM_lane_history)) / (W_vehicle+W_arrow+W_guardrail+W_lane) In the above formula, PPM_fused is the number of pixels per meter fused, W_vehicle is the weight corresponding to the reference vehicle (usually set to W_vehicle=0.5), W_arrow is the weight corresponding to the guide arrow (usually set to W_arrow=0.25), W_guardrail is the weight corresponding to the post (usually set to W_guardrail=0.15), W_lane is the weight corresponding to the vehicle marking (usually set to W_lane=0.10), median ( For the median calculation, PPM_vehicle_history is the historical queue of pixels per meter for the reference vehicle, and PPM_arrow_history, PPM_guardrail_history, and PPM_lane_history are the historical queues of pixels per meter for the arrows, posts, and lanes, respectively.
[0051] Understandably, setting the weight corresponding to the reference vehicle to the largest weight in the fusion weights, and using the median instead of the mean to eliminate the influence of outliers, effectively improves the accuracy of subsequent calculations to predict vehicle speed.
[0052] In addition, the fused pixel count per meter can be updated after detecting and calculating the number of pixels per meter for a new reference vehicle or a new reference object.
[0053] In another embodiment, if no traffic facilities are detected (such as rural roads without directional arrows), only a reference vehicle can be used, and the weight of the reference vehicle is automatically adjusted to 1.0 to calculate the number of pixels per meter of fusion in this case.
[0054] Step S50: The estimated vehicle speed is obtained based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter.
[0055] It should be noted that step S50 involves real-time detection of traffic video and calculation of the estimated speed of the vehicle to be detected during the online phase.
[0056] In one embodiment, the estimated speed of the vehicle to be detected can be calculated by determining the relationship between the pixel displacement of the vehicle to be detected in the image and the actual displacement of the vehicle to be detected based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter.
[0057] This embodiment provides a multi-reference-based traffic video vehicle speed measurement method. It acquires vehicle samples, reference object samples, a preset mapping table, and video of the vehicle to be detected. Based on the vehicle samples and the preset mapping table, it obtains a historical queue of pixels per meter for reference vehicles. The reference object samples are preprocessed to obtain a historical queue of pixels per meter for reference objects. A fused pixel count per meter is determined based on the historical queues of pixels per meter for both the reference vehicles and the reference objects. The estimated vehicle speed is obtained based on the video of the vehicle to be detected, the historical queues of pixels per meter for reference vehicles, and the fused pixel count per meter. By pre-acquiring the historical queues of pixels per meter for reference objects and the reference vehicles, and combining them with the video of the vehicle to be detected, vehicle speed measurement can be achieved at low cost.
[0058] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S20 includes steps S201 to S204: Step S201: Obtain the vehicle model and the bounding box height of each vehicle based on the vehicle sample.
[0059] It should be noted that vehicle type usually refers to a vehicle classification label used to distinguish different types of vehicles, such as cars, SUVs, buses, large trucks, medium-sized trucks, small trucks, vans, and motorcycles. The vehicle's bounding box height usually refers to the number of pixels in the vertical direction of the rectangle drawn by the object detection algorithm.
[0060] In one embodiment, the vehicle model and the bounding box height of each vehicle are mainly obtained from the vehicle sample. For example, if a vehicle is determined to be a bus, the bounding box height of the bus is determined to be H_pixel.
[0061] In another embodiment, the lateral PPM can be calculated by referring to the vehicle's width (rather than its height), a method suitable for side-mounted cameras.
[0062] Step S202: Obtain the actual length corresponding to each vehicle model from the preset mapping table according to the vehicle model.
[0063] It should be noted that the preset mapping table stores the vehicle type and the corresponding actual length of each vehicle type. For example, if the vehicle type is determined to be a bus, then the actual length of the bus can be retrieved from the preset mapping table as 12.0m.
[0064] Step S203: Determine the number of pixels per meter for each vehicle based on the actual length and the bounding box height.
[0065] Understandably, the number of pixels per meter can be determined based on the object's actual length in the real world and the height of its bounding box in the image.
[0066] In practical implementation, after obtaining the actual length and bounding box height of the vehicle, the number of pixels per meter for each vehicle can be calculated. The process of calculating the number of pixels per meter for a specific vehicle is as follows: PPM_vehicle=H_pixel / L_real In the above formula, H_pixel is the bounding box height, L_real is the actual length, and PPM_vehicle is the number of pixels per meter for the vehicle.
[0067] Step S204: Filter the number of pixels per meter of the vehicle to obtain a historical queue of the number of pixels per meter of the reference vehicle.
[0068] It should be noted that the purpose of the filtering process is to filter out unreasonable vehicle pixel counts per meter, and retain reasonable vehicle pixel counts per meter and add them to the historical pixel count per meter queue of the reference vehicle.
[0069] In one embodiment, the step of filtering the number of pixels per meter of the vehicle to obtain a historical queue of the number of pixels per meter of the reference vehicle may include: obtaining a first threshold and a second threshold, wherein the first threshold is less than the second threshold; filtering the number of pixels per meter of the vehicle when the number of pixels per meter of the vehicle is less than the first threshold or the number of pixels per meter of the vehicle is greater than the second threshold to obtain a filtered number of pixels per meter of the vehicle; and obtaining a historical queue of the number of pixels per meter of the reference vehicle based on the filtered number of pixels per meter of the vehicle.
[0070] Specifically, a first threshold of 5 and a second threshold of 80 can be set. For example, the filtering condition can be set to "discard the value when PPM_vehicle is less than 5 or PPM_vehicle is greater than 80 (i.e., it is determined to be outside the reasonable range)". If the number of pixels per meter of a vehicle meets the filtering condition, then the number of pixels per meter of that vehicle is filtered out and discarded; if the number of pixels per meter of a vehicle does not meet the filtering condition, then the number of pixels per meter of that vehicle is retained and added to the historical queue of the number of pixels per meter of the reference vehicle. After filtering, the historical queue of the number of pixels per meter of the reference vehicle can be obtained.
[0071] This embodiment obtains the vehicle model and the bounding box height of each vehicle based on the vehicle sample; obtains the actual length corresponding to each vehicle model from the preset mapping table based on the vehicle model; determines the number of pixels per meter for each vehicle based on the actual length and the bounding box height; filters the number of pixels per meter for each vehicle to obtain a historical queue of the number of pixels per meter for reference vehicles, ensuring the rationality of the number of pixels per meter for reference vehicles, thereby improving the accuracy of subsequent vehicle speed measurements.
[0072] Based on the first embodiment of this application, in the third embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S50 includes steps S501 to S504: Step S501: Based on the video of the vehicle to be detected, determine the first ordinate and the second ordinate of the vehicle to be detected within a preset time period, wherein the frame sequence corresponding to the first ordinate is greater than the frame sequence corresponding to the second ordinate.
[0073] It should be noted that the ordinate of the vehicle to be detected usually refers to the ordinate of the bottom edge of the bounding box of the vehicle in consecutive frames. The preset time period usually refers to setting a time window. For example, the window size can be set to 10 frames, so that the first ordinate y_t and the second ordinate y_{t-1} of the vehicle to be detected within 10 frames of the video of the vehicle to be detected (usually traffic video) can be obtained.
[0074] Step S502: Determine the frame interval, inter-frame pixel displacement, and midpoint ordinate based on the first and second ordinates.
[0075] It should be noted that frame interval usually refers to the time difference between two consecutive frames; inter-frame pixel displacement usually refers to the change (absolute value) of the midpoint ordinate of the same vehicle between two adjacent frames; midpoint ordinate usually refers to the pixel coordinate of the center point of the vehicle in two adjacent frames on the vertical direction (y-axis) of the image.
[0076] It is understandable that, given that the frame sequences corresponding to the first and second ordinates differ by one frame, and assuming the frame rate of the traffic video is 20fps, the frame interval is 0.05 seconds. The process of calculating and determining the inter-frame pixel displacement is as follows: Δy_pixel=|y_t-y_{t-1}| In the above formula, y_t is the first ordinate, y_{t-1} is the second ordinate, and Δy_pixel is the inter-frame pixel displacement.
[0077] The process of calculating and determining the ordinate of the midpoint is as follows: y_mid=(y_t+y_{t-1}) / 2 In the above formula, y_t is the first ordinate, y_{t-1} is the second ordinate, and y_mid is the midpoint ordinate.
[0078] Step S503: Determine the target number of pixels per meter based on the preset weight, the midpoint ordinate, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter.
[0079] It should be noted that the target pixels per meter is the final PPM value used. Based on the target pixels per meter, the estimated speed of the vehicle to be detected can be determined in subsequent steps.
[0080] In one embodiment, the step of determining the target number of pixels per meter based on a preset weight, the midpoint ordinate, the historical queue of pixels per meter for the reference vehicle, and the fused number of pixels per meter may include: determining the segment to which the vehicle belongs based on the midpoint ordinate; determining the local number of pixels per meter corresponding to the segment to which the vehicle belongs from the historical queue of pixels per meter for the reference vehicle according to the segment to which the vehicle belongs; and determining the target number of pixels per meter based on the preset weight, the local number of pixels per meter, and the fused number of pixels per meter.
[0081] It is understandable that the video of the vehicle to be detected consists of several frames of traffic images. In the offline stage, the vertical coordinate (y-axis) of the traffic image can be divided into segments of 100 pixels each. In the offline stage, an independent local queue of pixels per meter (up to 20 values) can be maintained for each segment based on the historical queue of pixels per meter of the reference vehicle.
[0082] Specifically, in the online (vehicle speed measurement) phase, the segment to which the vehicle belongs (i.e., which segment interval the vehicle is in) is determined based on the midpoint ordinate. Since each segment interval maintains a corresponding local pixel count per meter queue, the local pixel count per meter queue corresponding to the vehicle's segment can be determined from the historical pixel count per meter queue of the reference vehicle. The median of the local pixel count per meter queue corresponding to the vehicle's segment is used as the local pixel count per meter corresponding to the vehicle's segment for subsequent calculations. The preset weights include at least a first preset weight and a second preset weight. The first preset weight can be set to 0.7, and the second preset weight can be set to 0.3. The calculation process for determining the target pixel count per meter based on the preset weights, local pixel count per meter, and fused pixel count per meter is as follows: PPM_final=0.7×PPM_local+0.3×PPM_fused In the above formula, PPM_final is the number of pixels per meter of the target, PPM_local is the number of pixels per meter of the local area, and PPM_fused is the number of pixels per meter of the fused area.
[0083] This embodiment takes into account that the PPM values of different areas (near and far) on the traffic image are different. By setting a preset weight corresponding to the number of pixels per meter in the local area to be greater than the preset weight corresponding to the number of pixels per meter in the fusion, it can effectively compensate for the perspective effect caused by "near objects appearing larger and far objects appearing smaller" in the image.
[0084] Step S504: Obtain the estimated vehicle speed based on the number of pixels per meter of the target, the inter-frame pixel displacement, and the frame interval.
[0085] It should be noted that the estimated vehicle speed is the speed of the vehicle to be detected calculated by a measurement method in this embodiment. It may differ slightly from the actual vehicle speed, but the estimated vehicle speed in this embodiment ensures high accuracy of the speed data through the various steps mentioned above.
[0086] In one embodiment, the step of obtaining the estimated vehicle speed based on the number of pixels per meter of the target, the inter-frame pixel displacement, and the frame interval may include: obtaining the actual distance within the preset time period based on the number of pixels per meter of the target and the inter-frame pixel displacement; obtaining the instantaneous speed within the preset time period based on the actual distance and the frame interval; obtaining a speed sequence based on the instantaneous speed within the preset time period; and filtering the speed sequence to obtain the estimated vehicle speed.
[0087] Specifically, actual distance refers to the amount of displacement of a vehicle in the real world, obtained by converting pixel displacements from traffic video into actual distances. The calculation steps for actual distance based on the number of pixels per meter of the target and the inter-frame pixel displacements are as follows: Δd = Δy_pixel / PPM_final In the above formula, Δy_pixel is the inter-frame pixel displacement, PPM_final is the number of pixels per meter of the target, and Δd is the actual distance. Several actual distance data points within the preset time period can be obtained by calculating the actual distance of each frame within the preset time period.
[0088] The process of calculating the instantaneous velocity based on the actual distance and frame interval is as follows: v=Δd / Δt In the above formula, Δd is the actual distance, Δt is the frame interval, and v is the instantaneous speed. Based on the formula for calculating instantaneous speed, several instantaneous speed data points within a preset time period can be obtained; these instantaneous speed data points can be used to form a speed sequence; then, the speed sequence is processed by median filtering or Kalman filtering to remove impulse noise, and the final estimated vehicle speed is output.
[0089] This embodiment determines the first and second ordinates of the vehicle to be detected within a preset time period based on the video of the vehicle to be detected, wherein the frame sequence corresponding to the first ordinate is greater than the frame sequence corresponding to the second ordinate. Frame interval, inter-frame pixel displacement, and midpoint ordinate are determined based on the first and second ordinates. Target pixels per meter are determined based on preset weights, the midpoint ordinate, the historical PPM queue of the reference vehicle, and the fused pixels per meter. The estimated vehicle speed is obtained based on the target pixels per meter, the inter-frame pixel displacement, and the frame interval. By utilizing the acquired video of the vehicle to be detected, combined with the determined historical PPM queue and the fused pixels per meter, the estimated vehicle speed is obtained, further reducing costs while improving the accuracy of the measured estimated vehicle speed.
[0090] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the multi-reference traffic video vehicle speed measurement method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0091] This application also provides a traffic video speed measurement device based on multiple references, please refer to... Figure 4 The multi-reference-based traffic video vehicle speed measurement device includes: The acquisition module 10 is used to acquire vehicle samples, reference object samples, preset mapping tables, and videos of the vehicles to be detected.
[0092] The acquisition module 10 is also used to obtain a historical queue of the number of pixels per meter of the reference vehicle based on the vehicle sample and the preset mapping table.
[0093] The processing module 20 is used to preprocess the reference sample to obtain a historical queue of the number of pixels per meter of the reference.
[0094] The calculation module 30 is used to determine the number of pixels per meter to be fused based on the historical queue of the number of pixels per meter of the reference vehicle and the historical queue of the number of pixels per meter of the reference object.
[0095] The calculation module 30 is also used to obtain the estimated vehicle speed based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter.
[0096] The multi-reference-based traffic video speed measurement device provided in this application, employing the multi-reference-based traffic video speed measurement method described in the above embodiments, can solve the technical problem that current vehicle speed measurement methods are difficult to scale up due to high maintenance or hardware costs. Compared with the prior art, the beneficial effects of the multi-reference-based traffic video speed measurement device provided in this application are the same as those of the multi-reference-based traffic video speed measurement method provided in the above embodiments, and other technical features in the multi-reference-based traffic video speed measurement device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0097] In one embodiment, the calculation module 30 is further configured to determine a first ordinate and a second ordinate of the vehicle to be detected within a preset time period based on the video of the vehicle to be detected, wherein the frame sequence corresponding to the first ordinate is greater than the frame sequence of the second ordinate; determine a frame interval, an inter-frame pixel displacement, and a midpoint ordinate based on the first and second ordinates; determine a target number of pixels per meter based on a preset weight, the midpoint ordinate, the historical queue of pixels per meter of the reference vehicle, and the fused number of pixels per meter; and obtain an estimated vehicle speed based on the target number of pixels per meter, the inter-frame pixel displacement, and the frame interval.
[0098] In one embodiment, the calculation module 30 is further configured to determine the segment to which the vehicle belongs based on the midpoint ordinate; determine the local number of pixels per meter corresponding to the segment to which the vehicle belongs from the historical queue of the number of pixels per meter of the reference vehicle according to the segment to which the vehicle belongs; and determine the target number of pixels per meter based on the preset weight, the local number of pixels per meter, and the fused number of pixels per meter.
[0099] In one embodiment, the calculation module 30 is further configured to: obtain the actual distance within the preset time period based on the number of pixels per meter of the target and the inter-frame pixel displacement; obtain the instantaneous speed within the preset time period based on the actual distance and the frame interval; obtain a speed sequence based on the instantaneous speed within the preset time period; and perform filtering processing on the speed sequence to obtain the estimated vehicle speed.
[0100] In one embodiment, the processing module 20 is further configured to obtain the vehicle model and the bounding box height of each vehicle based on the vehicle sample; obtain the actual length corresponding to each vehicle model from the preset mapping table based on the vehicle model; determine the number of pixels per meter for each vehicle based on the actual length and the bounding box height; and filter the number of pixels per meter for each vehicle to obtain a historical queue of the number of pixels per meter for reference vehicles.
[0101] In one embodiment, the processing module 20 is further configured to obtain a first threshold and a second threshold, wherein the first threshold is less than the second threshold; when the number of pixels per meter of the vehicle is less than the first threshold or the number of pixels per meter of the vehicle is greater than the second threshold, the number of pixels per meter of the vehicle is filtered to obtain a filtered number of pixels per meter of the vehicle; and a historical queue of the number of pixels per meter of the reference vehicle is obtained based on the filtered number of pixels per meter of the vehicle.
[0102] In one embodiment, the processing module 20 is further configured to preprocess the reference object sample to obtain the pixel length of the arrow, the pixel spacing of the pillars, and the pixel width of the lane; obtain the standard length of the arrow, the standard spacing of the pillars, and the standard width of the lane; obtain a historical queue of the number of pixels per meter of the arrow based on the standard length of the arrow and the pixel length of the arrow; obtain a historical queue of the number of pixels per meter of the pillars based on the standard spacing of the pillars and the pixel spacing of the pillars; obtain a historical queue of the number of pixels per meter of the lane based on the standard width of the lane and the pixel width of the lane; and obtain a historical queue of the number of pixels per meter of the reference object based on the historical queue of the number of pixels per meter of the arrow, the historical queue of the number of pixels per meter of the pillars, and the historical queue of the number of pixels per meter of the lane.
[0103] This application provides a multi-reference-based traffic video vehicle speed measurement device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the multi-reference-based traffic video vehicle speed measurement method in Embodiment 1 above.
[0104] The following is for reference. Figure 5 This document illustrates a structural schematic diagram of a multi-reference-based traffic video speed measurement device suitable for implementing embodiments of this application. The multi-reference-based traffic video speed measurement device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), tablets, PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The traffic video speed measurement device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0105] like Figure 5As shown, a multi-reference-based traffic video speed measurement device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in ROM (Read Only Memory) 1002 or a program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the multi-reference-based traffic video speed measurement device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the multi-reference-based traffic video speed measurement device to communicate wirelessly or wiredly with other devices to exchange data. Although a multi-reference-based traffic video speed measurement device with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0106] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0107] The multi-reference-based traffic video speed measurement device provided in this application, employing the multi-reference-based traffic video speed measurement method described in the above embodiments, can solve the technical problem that current vehicle speed measurement methods are difficult to scale up due to high maintenance or hardware costs. Compared with the prior art, the beneficial effects of the multi-reference-based traffic video speed measurement device provided in this application are the same as those of the multi-reference-based traffic video speed measurement method provided in the above embodiments, and other technical features of this multi-reference-based traffic video speed measurement device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0108] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0109] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0110] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the multi-reference-based traffic video vehicle speed measurement method in the above embodiments.
[0111] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash Memory), optical fibers, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0112] The aforementioned computer-readable storage medium may be included in a multi-reference-based traffic video speed measurement device; or it may exist independently and not assembled into a multi-reference-based traffic video speed measurement device.
[0113] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a multi-reference-based traffic video vehicle speed measurement device, cause the multi-reference-based traffic video vehicle speed measurement device to: acquire vehicle samples, reference object samples, a preset mapping table, and video of the vehicle to be detected; obtain a historical queue of the number of pixels per meter for reference vehicles based on the vehicle samples and the preset mapping table; preprocess the reference object samples to obtain a historical queue of the number of pixels per meter for reference objects; determine the fused number of pixels per meter based on the historical queue of the number of pixels per meter for reference vehicles and the historical queue of the number of pixels per meter for reference objects; and obtain an estimated vehicle speed based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter for reference vehicles, and the fused number of pixels per meter.
[0114] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0116] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0117] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described multi-reference-based traffic video vehicle speed measurement method. This solves the technical problem that current vehicle speed measurement methods are difficult to scale up due to high maintenance or hardware costs. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the multi-reference-based traffic video vehicle speed measurement method provided in the above embodiments, and will not be repeated here.
[0118] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the multi-reference-based traffic video vehicle speed measurement method described above.
[0119] The computer program product provided in this application can solve the technical problem that current vehicle speed measurement is difficult to scale up due to high operation and maintenance costs or hardware costs. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the multi-reference traffic video vehicle speed measurement method provided in the above embodiments, and will not be repeated here.
[0120] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for measuring vehicle speed based on multi-reference traffic video, characterized in that, The multi-reference-based traffic video vehicle speed measurement method includes: Acquire vehicle samples, reference object samples, preset mapping tables, and videos of the vehicles to be inspected; Based on the vehicle samples and the preset mapping table, a historical queue of the number of pixels per meter for the reference vehicle is obtained. The reference sample is preprocessed to obtain a historical queue of the number of pixels per meter of the reference; The number of pixels per meter to be fused is determined based on the historical queue of the number of pixels per meter of the reference vehicle and the historical queue of the number of pixels per meter of the reference object; The estimated vehicle speed is obtained based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter.
2. The method as described in claim 1, characterized in that, The step of obtaining the estimated vehicle speed based on the video of the vehicle to be detected, the historical queue of pixels per meter of the reference vehicle, and the fused pixels per meter includes: Based on the video of the vehicle to be detected, determine the first ordinate and the second ordinate of the vehicle to be detected within a preset time period, wherein the frame sequence corresponding to the first ordinate is greater than the frame sequence corresponding to the second ordinate. The frame interval, inter-frame pixel displacement, and midpoint ordinate are determined based on the first and second ordinates. The target number of pixels per meter is determined based on preset weights, the midpoint ordinate, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter. The estimated vehicle speed is obtained based on the number of pixels per meter of the target, the inter-frame pixel displacement, and the frame interval.
3. The method as described in claim 2, characterized in that, The step of determining the target pixel count per meter based on preset weights, the midpoint ordinate, the historical queue of pixels per meter for the reference vehicle, and the fused pixel count per meter includes: The segment to which the vehicle belongs is determined based on the midpoint ordinate. The local pixel count per meter corresponding to the segment to which the vehicle belongs is determined from the historical queue of pixel count per meter of the reference vehicle. The target number of pixels per meter is determined based on preset weights, the number of local pixels per meter, and the number of fused pixels per meter.
4. The method as described in claim 2, characterized in that, The step of estimating the vehicle speed based on the number of pixels per meter of the target, the inter-frame pixel displacement, and the frame interval includes: The actual distance within the preset time period is obtained based on the number of pixels per meter of the target and the inter-frame pixel displacement; The instantaneous velocity within the preset time period is obtained based on the actual distance and the frame interval; A velocity sequence is obtained based on the instantaneous velocity within the preset time period; The speed sequence is filtered to obtain the estimated vehicle speed.
5. The method as described in claim 1, characterized in that, The step of obtaining the historical queue of pixels per meter for the reference vehicle based on the vehicle sample and the preset mapping table includes: The vehicle model and the bounding box height of each vehicle are obtained from the vehicle samples. The actual length corresponding to each vehicle model is obtained from the preset mapping table based on the vehicle model. The number of pixels per meter for each vehicle is determined based on the actual length and the bounding box height. The number of pixels per meter for the vehicle is filtered to obtain a historical queue of the number of pixels per meter for the reference vehicle.
6. The method as described in claim 5, characterized in that, The step of filtering the number of pixels per meter of the vehicle to obtain the historical queue of the number of pixels per meter of the reference vehicle includes: Obtain a first threshold and a second threshold, wherein the first threshold is less than the second threshold; When the number of pixels per meter of the vehicle is less than the first threshold or the number of pixels per meter of the vehicle is greater than the second threshold, the number of pixels per meter of the vehicle is filtered to obtain the filtered number of pixels per meter of the vehicle. The historical queue of the number of pixels per meter for the reference vehicle is obtained based on the filtered number of pixels per meter for the vehicle.
7. The method as described in claim 1, characterized in that, The step of preprocessing the reference sample to obtain the historical queue of pixels per meter of the reference sample includes: The reference sample is preprocessed to obtain the pixel length of the arrow, the pixel spacing of the pillars, and the pixel width of the lane; Obtain the standard length of the arrows, the standard spacing between the posts, and the standard width of the lane; The historical queue of the number of pixels per meter of the arrow is obtained based on the standard length of the arrow and the pixel length of the arrow; The historical queue of the number of pixels per meter of the columns is obtained based on the standard spacing of the columns and the pixel spacing of the columns. The historical queue of the number of pixels per meter of the lane is obtained based on the standard width of the lane and the pixel width of the lane; The historical queue of the reference object's pixel count per meter is obtained based on the historical queue of the arrow's pixel count per meter, the historical queue of the column's pixel count per meter, and the historical queue of the lane's pixel count per meter.
8. A traffic video speed measurement device based on multiple references, characterized in that, The multi-reference-based traffic video vehicle speed measurement device includes: The acquisition module is used to acquire vehicle samples, reference object samples, preset mapping tables, and videos of the vehicles to be detected. The acquisition module is also used to obtain a historical queue of the number of pixels per meter of the reference vehicle based on the vehicle sample and the preset mapping table; The processing module is used to preprocess the reference sample to obtain a historical queue of the number of pixels per meter of the reference; The calculation module is used to determine the number of pixels per meter to be fused based on the historical queue of the number of pixels per meter of the reference vehicle and the historical queue of the number of pixels per meter of the reference object. The calculation module is also used to obtain the estimated vehicle speed based on the video of the vehicle to be detected, the historical queue of the number of pixels per meter of the reference vehicle, and the fused number of pixels per meter.
9. A traffic video speed measurement device based on multiple references, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the multi-reference-based traffic video vehicle speed measurement method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the multi-reference-based traffic video vehicle speed measurement method as described in any one of claims 1 to 7.
