Vehicle speed measurement method based on monitoring video, medium and equipment
By determining the lane marking points and time points in the surveillance video and adjusting the reference line to form a parallel speed measurement interval, the problem of low speed measurement accuracy caused by the difficulty in obtaining camera parameters is solved, and the accuracy of vehicle speed measurement in the surveillance video is achieved.
Patent Information
- Application Number
- CN202510673675.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-05-23
AI Technical Summary
In existing vehicle speed measurement methods based on surveillance videos, camera parameters are difficult to obtain, resulting in low speed measurement accuracy.
By obtaining a reference image from the surveillance video, determining the lane marking point as a reference point to form a reference line, and obtaining the time point of the cruise vehicle in the surveillance video, the actual distance is calculated, and the reference line is adjusted to form a parallel speed measurement interval, thereby determining the vehicle's speed measurement result.
The speed measurement accuracy of vehicles in different lanes in the surveillance video is improved, the influence of factors such as camera viewing angle and distortion is reduced, and the accuracy of the speed measurement results is ensured.
Smart Images

Figure CN120636175A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a vehicle speed measurement method, medium and equipment based on monitoring video. Background Art
[0002] With the increasing complexity of urban traffic, the development of intelligent transportation systems has become crucial for alleviating traffic pressure and improving traffic safety. Accurately measuring vehicle speed is crucial for traffic management, safety monitoring, and flow optimization. Common vehicle speed measurement methods include radar, laser, and geofence loops. However, radar and laser speed measurement are susceptible to weather conditions, resulting in low speed measurement accuracy. Geofence loops are also expensive to deploy and maintain.
[0003] In the prior art, there are methods that propose to accurately measure vehicle speed by detecting, tracking, and analyzing vehicles in surveillance videos. However, the existing methods require the intrinsic and extrinsic parameter data of the camera that collects the surveillance video as known information, so that the image coordinate system of the surveillance image in the surveillance video can be mapped to the real world coordinate system, thereby realizing vehicle speed measurement. However, in actual applications, the parameters of the camera are often difficult to obtain, resulting in low speed measurement accuracy based on surveillance videos.
[0004] Therefore, how to improve the speed measurement accuracy of vehicle speed measurement based on surveillance video has become an urgent problem to be solved. Summary of the Invention
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is a vehicle speed measurement method based on surveillance video, which includes:
[0006] S101 , obtaining a surveillance video of a target road area, and determining a reference image from the surveillance video, wherein the target road area includes a first lane and a second lane.
[0007] S102: Determine two lane marking points in the reference image as a first reference point and a second reference point, respectively.
[0008] S103 : In the reference image, determine a first reference line according to the first reference point, and determine a second reference line according to the second reference point.
[0009] S104: Obtain, from the surveillance video, a first time point corresponding to when the cruise control vehicle in the first lane passes the first reference line, and a second time point corresponding to when the cruise control vehicle in the first lane passes the second reference line.
[0010] S105 : Determine a first real distance according to the first time point, the second time point, and the speed of the cruise control vehicle.
[0011] S106: Obtain, from the monitoring video, a third time point corresponding to when the cruise control vehicle in the second lane passes the first reference line, and a fourth time point corresponding to when the cruise control vehicle in the second lane passes the second reference line.
[0012] S107 : Determine a second real distance according to the third time point, the fourth time point, and the speed of the cruise control vehicle.
[0013] S108: Adjust the first reference line according to the first real distance and the second real distance to obtain a first adjustment line.
[0014] S109: Form a speed measurement interval according to the first adjustment line and the second reference line, where the speed measurement interval corresponds to a target distance.
[0015] S110 , obtaining a target duration corresponding to the vehicle to be measured passing through the speed measurement interval, and determining a speed measurement result of the vehicle to be measured according to the target duration and the target distance.
[0016] The present invention also provides a non-transitory computer-readable storage medium, which stores at least one instruction or at least one program. The at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned vehicle speed measurement method based on surveillance video.
[0017] The present invention also provides an electronic device comprising a processor and the above-mentioned non-transitory computer-readable storage medium.
[0018] Compared with the prior art, the present invention has significant beneficial effects. By means of the above technical solution, the vehicle speed measurement method based on surveillance video provided by the present invention can achieve considerable technological advancement and practicality, and has wide industrial application value. It has at least the following beneficial effects:
[0019] By acquiring a surveillance video of a target road area, determining a reference image from the surveillance video, the target road area includes a first lane and a second lane, determining two lane mark points in the reference image as a first reference point and a second reference point respectively, in the reference image, determining a first reference line according to the first reference point, and determining a second reference line according to the second reference point, acquiring a first time point corresponding to when a cruise control vehicle in the first lane passes the first reference line, and a second time point corresponding to when the cruise control vehicle in the first lane passes the second reference line in the surveillance video, determining a first real distance according to the first time point, the second time point and the speed of the cruise control vehicle, acquiring a third time point corresponding to when the cruise control vehicle in the second lane passes the first reference line, and a fourth time point corresponding to when the cruise control vehicle in the second lane passes the second reference line in the surveillance video, determining a second real distance according to the third time point, the fourth time point and the speed of the cruise control vehicle, adjusting the first reference line according to the first real distance and the second real distance to obtain a first adjusted line, and The adjustment line and the second reference line form a speed measurement interval. The speed measurement interval corresponds to the target distance. A target duration corresponding to the time it takes for the vehicle to pass through the speed measurement interval is obtained. The speed measurement result of the vehicle to be measured is determined based on the target duration and the target distance. It can be seen that by identifying two lane marking points in the reference image as the first reference point and the second reference point, respectively, and then determining the first reference line based on the first reference point and the second reference line based on the second reference point, the actual distance between the first reference line and the second reference line can be made as close as possible to the preset speed measurement distance. Due to factors such as camera viewing angle and distortion, the first reference line and the second reference line may not be parallel in actual scenarios, resulting in differences in speed measurement accuracy for different lanes. Therefore, adjusting the first reference line based on the first actual distance and the second actual distance to obtain a first adjustment line can ensure that the first adjustment line and the second reference line meet the parallel condition in actual scenarios, thereby determining the speed measurement interval. This speed measurement interval can more accurately measure the speed of vehicles in different lanes, thereby improving the speed measurement accuracy of vehicle speed measurement based on surveillance video. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A flowchart of a vehicle speed measurement method based on surveillance video provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0023] Example 1
[0024] This embodiment provides a vehicle speed measurement method based on monitoring video. Figure 1 , which is a flow chart of a vehicle speed measurement method based on surveillance video provided in the first embodiment of the present invention, including:
[0025] S101 , obtaining a surveillance video of a target road area, and determining a reference image from the surveillance video, wherein the target road area includes a first lane and a second lane.
[0026] S102: Determine two lane marking points in the reference image as a first reference point and a second reference point, respectively.
[0027] S103 : In the reference image, determine a first reference line according to the first reference point, and determine a second reference line according to the second reference point.
[0028] S104 , obtaining in the monitoring video a first time point corresponding to when the cruise control vehicle in the first lane passes through a first reference line, and a second time point corresponding to when the cruise control vehicle in the first lane passes through a second reference line.
[0029] S105 , determining a first real distance according to the first time point, the second time point, and the speed of the cruise control vehicle.
[0030] S106 , obtaining from the monitoring video a third time point corresponding to when the cruise control vehicle in the second lane passes the first reference line, and a fourth time point corresponding to when the cruise control vehicle in the second lane passes the second reference line.
[0031] S107 : Determine a second real distance based on the third time point, the fourth time point, and the speed of the cruise control vehicle.
[0032] S108: Adjust the first reference line according to the first real distance and the second real distance to obtain a first adjustment line.
[0033] S109 , forming a speed measurement interval according to the first adjustment line and the second reference line, where the speed measurement interval corresponds to the target distance.
[0034] S110, obtaining a target duration corresponding to the vehicle to be measured passing through the speed measurement interval, and determining a speed measurement result of the vehicle to be measured based on the target duration and the target distance.
[0035] Among them, the target road area can refer to the actual road area covered by the camera. In this embodiment, the target road area covered by a single camera is described as an example. The implementer can set multiple speed measurement intervals according to multiple target road areas to measure the speed of the vehicle to be measured.
[0036] In this embodiment, the target road area is described as a two-lane scenario in the same direction, that is, the first lane and the second lane included in the target road area are lanes in the same direction.
[0037] The reference image can be used to generate the first reference line and the second reference line, and the lane line identification point can be used to represent the specific position of the lane line. In this embodiment, the lane line is a dotted line.
[0038] The cruise control vehicle can be used to calibrate the first reference line and the second reference line. The cruise control vehicle only needs to travel once in the first lane and once in the second lane at a constant speed.
[0039] Specifically, when determining the speed measurement interval, the first reference line and the second reference line may not be parallel in the actual scenario. In order to ensure that the speed measurement accuracy of the first lane and the second lane is consistent, it is necessary to ensure that the first reference line and the second reference line are parallel in the actual scenario. Therefore, the first reference line needs to be adjusted. It should be noted that the implementer can also adjust the second reference line. The adjustment method is similar to that of the first reference line, which will not be repeated here.
[0040] In a specific embodiment, the surveillance video includes M surveillance images, where M is an integer greater than one;
[0041] S101 includes the following steps:
[0042] S1011, performing vehicle target detection on each of the M monitoring images to obtain vehicle target detection results corresponding to each of the M monitoring images;
[0043] S1012: Use any monitoring image whose vehicle target detection result meets the first preset condition as a reference image.
[0044] Among them, vehicle target detection can be achieved through a trained target detection model, such as the YOLO model, RCNN model, etc. Usually, the vehicle category is a common category in the target detection model, so the trained target detection model can be used directly for vehicle target detection without fine-tuning the target detection model.
[0045] Specifically, for any monitoring image, the current monitoring image is input into the trained target detection model to obtain the category and bounding box information corresponding to each target in the current monitoring image as the vehicle target detection result of the current monitoring image.
[0046] The first preset condition may mean that the vehicle target detection result does not include targets classified as vehicles.
[0047] In a specific embodiment, S102 includes the following steps:
[0048] S1021, performing lane segmentation in the reference image to obtain a plurality of lane connected regions;
[0049] S1022: For any lane line connected region, determine the minimum circumscribed rectangle of the current lane line connected region, and use the center points of the two short sides of the minimum circumscribed rectangle of the current lane line connected region as two lane line identification points;
[0050] S1023: Select any two lane marking points whose actual distance is closest to the preset distance from all lane marking points as the first reference point and the second reference point, respectively.
[0051] Among them, lane line segmentation can be implemented using a semantic segmentation model. The reference image is input into the trained semantic segmentation model to obtain a semantic segmentation image. In the semantic segmentation image, pixels of different pixel categories correspond to different channels. The channel image corresponding to the lane line category is determined as the image to be analyzed.
[0052] Specifically, a connected domain analysis is performed on the image to be analyzed to obtain several lane line connected domains. The minimum circumscribed rectangle of each lane line connected domain is then determined. The center points of the two short sides of the minimum circumscribed rectangle of each lane line connected domain are used as two lane line identification points to obtain several lane line identification points.
[0053] From all lane line marking points, any two lane line marking points whose actual distance is closest to the preset distance can be selected as the first reference point and the second reference point, respectively. Since the lane line setting is generally in compliance with standards, the actual distance between any two lane line marking points can be considered known. Therefore, any two lane line marking points whose actual distance is closest to the preset distance can be selected from all lane line marking points as the first reference point and the second reference point, respectively. The smaller the preset distance, the narrower the speed measurement interval, the closer the speed measured in the speed measurement interval is to the instantaneous speed, and the higher the speed measurement accuracy. However, if the preset distance is too small, the camera may not be able to capture the duration of the speed measurement interval through video. Therefore, in this embodiment, the preset distance is set to 15 meters. Implementers can adjust the preset distance based on actual conditions, such as the camera acquisition frequency. For example, if the camera acquisition frequency is high, the preset distance can be lowered; if the camera acquisition frequency is low, the preset distance can be increased.
[0054] In a specific embodiment, S103 includes the following steps:
[0055] S1031, using a straight line corresponding to the short side of the first reference point as a first reference line;
[0056] S1032: Use the straight line corresponding to the short side of the second reference point as the second reference line.
[0057] Among them, this embodiment uses the straight line corresponding to the short side of the first reference point as the first reference line, and the straight line corresponding to the short side of the second reference point as the second reference line, so that the initial angle between the first reference line and the second reference line in the actual scene is small, which is convenient for reducing the number of iterations in the subsequent adjustment process and improving the adjustment efficiency.
[0058] In a specific embodiment, S104 includes the following steps:
[0059] S1041, obtaining a plurality of first vehicle detection bounding box center points corresponding to the cruise control vehicle in the first lane in the M monitoring images;
[0060] S1042, determining a capture frame of the surveillance image corresponding to the center point of the first vehicle detection bounding box closest to the first reference line as the first time point;
[0061] S1043: Determine a capture frame of the monitoring image corresponding to the center point of the first vehicle detection bounding box closest to the second reference line as the second time point.
[0062] Among them, for several surveillance images with a cruise control vehicle in the first lane, the object detection model can be used to obtain the bounding box information of the cruise control vehicle, and then the center point of the first vehicle detection bounding box is obtained. It should be noted that the implementer can also use the center point of the edge of the bounding box corresponding to the rear of the cruise control vehicle as the center point of the first vehicle detection bounding box based on actual conditions, so as to minimize the influence of vehicle lights on the determination of the bounding box center point.
[0063] Specifically, several center points of the first vehicle detection bounding box can be regarded as trajectory points of the cruise control vehicle in the first lane. The implementer can add additional center points of the first vehicle detection bounding box and their corresponding acquisition frames through interpolation, thereby improving the accuracy of determining the first time point and the second time point.
[0064] In a specific embodiment, S105 includes the following steps:
[0065] S1051, determining a first time interval according to the first time point and the second time point;
[0066] S1052: Multiply the first time interval by the speed of the cruise vehicle, and use the multiplication result as the first real distance.
[0067] The first time interval may be the time taken for the cruise vehicle at a specified speed to pass through the interval defined by the first reference line and the second reference line, and the first real distance may refer to the actual distance between the first reference line and the second reference line in the first lane.
[0068] In a specific embodiment, S108 includes the following steps:
[0069] S1081: If the first real distance is less than the second real distance, fix the first reference point and adjust the first reference line in a counterclockwise direction by a preset angle to obtain a first middle line;
[0070] S1082: If the first real distance is greater than the second real distance, fix the first reference point and adjust the first reference line in a clockwise direction by a preset angle to obtain a first middle line;
[0071] S1083, using the first middle line as the first reference line, returning to execute steps S104 to S107, and steps S1081 to S1082, until the first real distance and the second real distance are the same, using the first middle line as the first adjustment line, and using the first real distance as the target distance.
[0072] The preset angle can be set by the implementer, for example, to 0.5 degrees. Since the camera parameters are unknown, the first reference line needs to be adjusted through iteration.
[0073] In one embodiment, the number of iterations can be recorded additionally, and the size of the preset angle can be adjusted according to the number of iterations to improve the iteration speed. The number of iterations is marked as K, and the initial value of the preset angle is θ. The updated angle θ changes with the number of iterations. ’ =θ×γ K , where γ is the adjustment coefficient, and the value range of γ is [0, 1]. In this embodiment, γ is set to 0.9.
[0074] In a specific embodiment, S110 includes the following steps:
[0075] S1101, obtaining a fifth time point at which the vehicle to be measured passes through the first adjustment line, and a sixth time point at which the vehicle to be measured passes through the second reference line;
[0076] S1102, determining a target duration based on the fifth time point and the sixth time point;
[0077] S1103: Taking the ratio of the target distance to the target duration as the speed measurement result of the vehicle to be measured.
[0078] The target duration may refer to the time taken by the vehicle to be measured to pass through the speed measurement interval. When the target distance corresponding to the speed measurement interval is known, the speed measurement result of the vehicle to be measured in the speed measurement interval can be determined.
[0079] It can be seen that this embodiment determines two lane line identification points in the reference image as the first reference point and the second reference point respectively, and then determines the first reference line based on the first reference point, and determines the second reference line based on the second reference point, so that the actual distance between the first reference line and the second reference line can be as close as possible to the preset speed measurement distance. Due to the influence of factors such as camera viewing angle and distortion, the first reference line and the second reference line may not be parallel in the actual scene, which leads to differences in speed measurement accuracy of different lanes. Therefore, the first reference line is adjusted according to the first real distance and the second real distance to obtain the first adjustment line, which can make the first adjustment line and the second reference line meet the parallel condition in the actual scene, and then determine the speed measurement interval. The speed measurement interval can more accurately measure the speed of vehicles in different lanes, thereby improving the speed measurement accuracy of vehicle speed measurement based on surveillance video.
[0080] Example 2
[0081] The second embodiment provides a vehicle speed measuring device based on surveillance video, and the vehicle speed measuring device based on surveillance video includes:
[0082] The video acquisition module is used to acquire a surveillance video of a target road area and determine a reference image from the surveillance video, wherein the target road area includes a first lane and a second lane.
[0083] The reference point determination module is used to determine two lane marking points in the reference image as a first reference point and a second reference point respectively.
[0084] The reference line determination module is used to determine a first reference line according to a first reference point and to determine a second reference line according to a second reference point in a reference image.
[0085] The first time determination module is used to obtain, from the monitoring video, a first time point corresponding to when a cruise control vehicle in the first lane passes a first reference line, and a second time point corresponding to when the cruise control vehicle in the first lane passes a second reference line.
[0086] The first distance determination module is configured to determine a first real distance according to the first time point, the second time point, and the speed of the cruise control vehicle.
[0087] The second time determination module is used to obtain, from the monitoring video, a third time point corresponding to when the cruise control vehicle in the second lane passes the first reference line, and a fourth time point corresponding to when the cruise control vehicle in the second lane passes the second reference line.
[0088] The second distance determination module is used to determine a second real distance according to the third time point, the fourth time point and the speed of the cruise control vehicle.
[0089] The adjustment module is used to adjust the first reference line according to the first real distance and the second real distance to obtain a first adjustment line.
[0090] The interval forming module is used to form a speed measurement interval according to the first adjustment line and the second reference line, where the speed measurement interval corresponds to the target distance.
[0091] The speed measurement module is used to obtain the target time corresponding to the vehicle to be measured passing through the speed measurement interval, and determine the speed measurement result of the vehicle to be measured based on the target time and target distance.
[0092] In a specific embodiment, the surveillance video includes M surveillance images, where M is an integer greater than one.
[0093] The video acquisition module includes:
[0094] The vehicle detection unit is used to perform vehicle target detection on each of the M monitoring images to obtain vehicle target detection results corresponding to each of the M monitoring images.
[0095] The reference image determination unit is configured to use any monitoring image whose vehicle target detection result meets a first preset condition as a reference image.
[0096] In a specific implementation, the reference point determination module includes:
[0097] The lane line segmentation unit is used to segment the lane lines in the reference image and obtain several lane line connected domains.
[0098] The connected domain analysis unit is used to determine the minimum circumscribed rectangle of any lane line connected domain, and use the center points of the two short sides of the minimum circumscribed rectangle of the current lane line connected domain as the two lane line identification points.
[0099] The reference point determination unit is used to select any two lane line marking points whose actual distance is closest to the preset distance from all lane line marking points as the first reference point and the second reference point respectively.
[0100] In a specific embodiment, the reference line determination module includes:
[0101] The first reference line determining unit is configured to use a straight line corresponding to a short side to which the first reference point belongs as the first reference line.
[0102] The second reference line determining unit is configured to use a straight line corresponding to a short side to which the second reference point belongs as the second reference line.
[0103] In a specific implementation, the first time determination module includes:
[0104] The bounding box acquisition unit is used to acquire, in the M monitoring images, a plurality of first vehicle detection bounding box center points corresponding to the cruise control vehicle in the first lane.
[0105] The first time point determining unit is configured to determine a capture frame of the monitoring image corresponding to a center point of a first vehicle detection bounding box closest to the first reference line as the first time point.
[0106] The second time point determining unit is configured to determine a capture frame of the monitoring image corresponding to a center point of the first vehicle detection bounding box closest to the second reference line as the second time point.
[0107] In a specific embodiment, the first distance determination module includes:
[0108] The time interval determining unit is configured to determine a first time interval according to the first time point and the second time point.
[0109] The first distance determining unit is configured to multiply the first time interval by the speed of the cruise vehicle and use the multiplication result as the first real distance.
[0110] In a specific embodiment, the adjustment module includes:
[0111] The first adjustment unit is configured to fix the first reference point and adjust the first reference line by a preset angle in a counterclockwise direction to obtain a first middle line if the first real distance is smaller than the second real distance.
[0112] The second adjustment unit is used to fix the first reference point and adjust the first reference line by a preset angle in a clockwise direction to obtain a first middle line if the first real distance is greater than the second real distance.
[0113] The iterative adjustment unit is configured to use the first middle line as the first reference line, return to execute the first time determination module, the first distance determination module, the second time determination module, the second distance determination module, the first adjustment unit, and the second adjustment unit until the first true distance and the second true distance are the same, use the first middle line as the first adjustment line, and use the first true distance as the target distance.
[0114] In a specific embodiment, the speed measurement module includes:
[0115] The third time determination unit is used to obtain a fifth time point when the vehicle to be speed measured passes through the first adjustment line, and a sixth time point when the vehicle to be speed measured passes through the second reference line.
[0116] The target duration determining unit is configured to determine the target duration according to the fifth time point and the sixth time point.
[0117] The speed measurement result determination unit is used to use the ratio of the target distance to the target duration as the speed measurement result of the vehicle to be measured.
[0118] It should be noted that the information interaction, execution process, etc. between the above-mentioned modules and units are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0119] Example 3
[0120] A third embodiment of the present invention provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores at least one instruction or at least one program segment, and the at least one instruction or at least one program segment is loaded and executed by a processor to implement the following steps:
[0121] S101 , obtaining a surveillance video of a target road area, and determining a reference image from the surveillance video, wherein the target road area includes a first lane and a second lane.
[0122] S102: Determine two lane marking points in the reference image as a first reference point and a second reference point, respectively.
[0123] S103 : In the reference image, determine a first reference line according to the first reference point, and determine a second reference line according to the second reference point.
[0124] S104 , obtaining in the monitoring video a first time point corresponding to when the cruise control vehicle in the first lane passes through a first reference line, and a second time point corresponding to when the cruise control vehicle in the first lane passes through a second reference line.
[0125] S105 , determining a first real distance according to the first time point, the second time point, and the speed of the cruise control vehicle.
[0126] S106 , obtaining from the monitoring video a third time point corresponding to when the cruise control vehicle in the second lane passes the first reference line, and a fourth time point corresponding to when the cruise control vehicle in the second lane passes the second reference line.
[0127] S107 : Determine a second real distance based on the third time point, the fourth time point, and the speed of the cruise control vehicle.
[0128] S108: Adjust the first reference line according to the first real distance and the second real distance to obtain a first adjustment line.
[0129] S109 , forming a speed measurement interval according to the first adjustment line and the second reference line, where the speed measurement interval corresponds to the target distance.
[0130] S110, obtaining a target duration corresponding to the vehicle to be measured passing through the speed measurement interval, and determining a speed measurement result of the vehicle to be measured based on the target duration and the target distance.
[0131] Those skilled in the art will appreciate that all or part of the processes in the above-described embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described embodiments. Any reference to memory, storage, database, or other media used in the embodiments provided herein may include both non-volatile and volatile memory.
[0132] Those skilled in the art will clearly understand that for the sake of convenience and brevity in description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0133] Example 4
[0134] A fourth embodiment of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium according to the third embodiment of the present invention.
[0135] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any form. Although the present invention has been disclosed as above in terms of preferred embodiments, they are not intended to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A vehicle speed measurement method based on surveillance video, characterized in that: The vehicle speed measurement method based on monitoring video includes: S101, obtaining a surveillance video of a target road area, and determining a reference image from the surveillance video, wherein the target road area includes a first lane and a second lane; S102, determining two lane marking points in the reference image as a first reference point and a second reference point respectively; S103, in the reference image, determining a first reference line according to the first reference point, and determining a second reference line according to the second reference point; S104: Acquire, from the surveillance video, a first time point corresponding to when a vehicle cruising at a constant speed in the first lane passes through the first reference line, and a second time point corresponding to when a vehicle cruising at a constant speed in the first lane passes through the second reference line; S105, determining a first real distance based on the first time point, the second time point, and the speed of the cruise control vehicle; S106, obtaining from the surveillance video a third time point corresponding to when the cruise control vehicle in the second lane passes the first reference line, and a fourth time point corresponding to when the cruise control vehicle in the second lane passes the second reference line; S107, determining a second real distance based on the third time point, the fourth time point, and the speed of the cruise control vehicle; S108, adjusting the first reference line according to the first real distance and the second real distance to obtain a first adjustment line; S109, forming a speed measurement interval according to the first adjustment line and the second reference line, wherein the speed measurement interval corresponds to a target distance; S110 , obtaining a target duration corresponding to the vehicle to be measured passing through the speed measurement interval, and determining a speed measurement result of the vehicle to be measured according to the target duration and the target distance.
2. The vehicle speed measurement method based on monitoring video according to claim 1, characterized in that: The surveillance video includes M surveillance images, where M is an integer greater than one; S101 includes the following steps: S1011, performing vehicle target detection on each of the M monitoring images to obtain vehicle target detection results corresponding to each of the M monitoring images; S1012: Use any monitoring image whose vehicle target detection result meets a first preset condition as the reference image.
3. The vehicle speed measurement method based on monitoring video according to claim 1, characterized in that: S102 includes the following steps: S1021, performing lane segmentation in the reference image to obtain a plurality of lane connected regions; S1022: For any lane line connected region, determine the minimum circumscribed rectangle of the current lane line connected region, and use the center points of the two short sides of the minimum circumscribed rectangle of the current lane line connected region as two lane line identification points; S1023: Select any two lane mark marking points whose actual distance is closest to the preset distance from all lane mark marking points as the first reference point and the second reference point, respectively.
4. The vehicle speed measurement method based on monitoring video according to claim 3, characterized in that: S103 includes the following steps: S1031: Use a straight line corresponding to the short side of the first reference point as a first reference line; S1032: Use the straight line corresponding to the short side to which the second reference point belongs as the second reference line.
5. The vehicle speed measurement method based on monitoring video according to claim 2, characterized in that: S104 includes the following steps: S1041, obtaining, in the M monitoring images, a plurality of first vehicle detection bounding box center points corresponding to the cruise control vehicle in the first lane; S1042, determining a captured frame of a surveillance image corresponding to a center point of a first vehicle detection bounding box closest to the first reference line as a first time point; S1043: Determine a captured frame of the monitoring image corresponding to the center point of the first vehicle detection bounding box closest to the second reference line as the second time point.
6. The vehicle speed measurement method based on monitoring video according to claim 1, characterized in that: S105 includes the following steps: S1051: Determine a first time interval according to the first time point and the second time point; S1052: Multiply the first time interval and the speed of the cruise control vehicle, and use the multiplication result as the first real distance.
7. The vehicle speed measurement method based on monitoring video according to claim 1, characterized in that: S108 includes the following steps: S1081: If the first real distance is less than the second real distance, fix the first reference point and adjust the first reference line in a counterclockwise direction by a preset angle to obtain a first middle line; S1082: If the first real distance is greater than the second real distance, fix the first reference point and adjust the first reference line in a clockwise direction by a preset angle to obtain a first middle line; S1083, using the first middle line as the first reference line, returning to execute steps S104 to S107, and steps S1081 to S1082, until the first real distance and the second real distance are the same, using the first middle line as the first adjustment line, and using the first real distance as the target distance.
8. The vehicle speed measurement method based on monitoring video according to claim 7, characterized in that: S110 includes the following steps: S1101, obtaining a fifth time point at which the vehicle to be speed measured passes through the first adjustment line, and a sixth time point at which the vehicle to be speed measured passes through the second reference line; S1102, determining the target duration according to the fifth time point and the sixth time point; S1103: Taking the ratio of the target distance to the target duration as the speed measurement result of the vehicle to be measured.
9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, characterized in that: The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the vehicle speed measurement method based on surveillance video as described in any one of claims 1-8.
10. An electronic device, characterized in that: The device comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.
Citation Information
Patent Citations
Video-based vehicle speed detecting method
CN102622895A
Vehicle speed detection method, vehicle driving event detection method and electronic device
CN110969864A
Vehicle speed measurement method and device and computer readable storage medium
CN111462503A
Method and device for determining vehicle running speed and electronic equipment
CN116311965A
Virtual lane determination method and device, medium and computing equipment
CN116394938A