A vehicle speed measurement method based on monitoring video, medium and equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG MEIRI HUDONG NETWORK TECH CO LTD
- Filing Date
- 2025-05-23
- Publication Date
- 2026-08-07
AI Technical Summary
准确测量车辆速度对于交通管理、安全监控以及流量优化等多个方面都具有深远意义,常见的车辆测速方法包括雷达测速、激光测速和地感线圈测速等,然而,雷达测速和激光测速容易受到天气条件的影响,导致测速精度较低,地感线圈测速的部署和维护成本较大
[0019]通过获取目标道路区域的监控视频,从监控视频中确定参考图像,目标道路区域包括第一车道和第二车道,在参考图像中确定两个车道线标识点分别作为第一参考点和第二参考点,在参考图像中,根据第一参考点确定第一参考线,根据第二参考点确定第二参考线,在监控视频中获取第一车道中定速巡航车辆经过第一参考线对应的第一时间点,以及第一车道中定速巡航车辆经过第二参考线对应的第二时间点,根据第一时间点、第二时间点和定速巡航车辆的速度,确定第一真实距离,在监控视频中获取第二车道中定速巡航车辆经过第一参考线对应的第三时间点,以及第二车道中定速巡航车辆经过第二参考线对应的第四时间点,根据第三时间点、第四时间点和定速巡航车辆的速度,确定第二真实距离,根据第一真实距离、第二真实距离,对第一参考线进行调整,得到第一调整线,根据第一调整线和第二参考线形成测速区间,测速区间对应于目标距离,获取待测速车辆经过测速区间对应的目标时长,根据目标时长和目标距离,确定待测速车辆的测速结果,可知,在参考图像中确定两个车道线标识点分别作为第一参考点和第二参考点,再根据第一参考点确定第一参考线,根据第二参考点确定第二参考线,能够使第一参考线和第二参考线之间的实际距离尽可能接近预设的测速距离,由于摄像头视角、畸变等因素的影响,第一参考线和第二参考线在实际场景下可能并不平行,从而导致不同车道的测速精度存在差异,因此,根据第一真实距离和第二真实距离对第一参考线调整,得到第一调整线,能够使得第一调整线和第二参考线在实际场景下满足平行条件,进而确定测速区间,该测速区间能够较为准确地对不同车道的车辆进行测速,提高基于监控视频进行车辆测速的测速精度。
Smart Images

Figure CN120636175B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and in particular to a vehicle speed measurement method, medium, and device based on surveillance video. Background Technology
[0002] With the increasing complexity of urban traffic, the development of intelligent transportation systems has become crucial for alleviating traffic congestion and improving traffic safety. Accurate vehicle speed measurement has profound implications for traffic management, safety monitoring, and flow optimization. Common vehicle speed measurement methods include radar speed measurement, laser speed measurement, and inductive loop speed measurement. However, radar and laser speed measurement are easily affected by weather conditions, resulting in lower accuracy, while inductive loop speed measurement has high deployment and maintenance costs.
[0003] In existing technologies, some methods propose to accurately measure vehicle speed by detecting, tracking, and analyzing vehicles in surveillance videos. However, these methods all require the intrinsic and extrinsic parameters of the camera that collects the surveillance video as known information, so that the image coordinate system of the surveillance image in the video can be mapped to the real world coordinate system, thereby enabling vehicle speed measurement. However, in practical applications, the camera parameters are often difficult to obtain, resulting in low speed measurement accuracy based on surveillance video.
[0004] Therefore, improving the accuracy of vehicle speed measurement based on surveillance video has become an urgent problem to be solved. Summary of the Invention
[0005] To address the aforementioned technical problems, the present invention provides a vehicle speed measurement method based on surveillance video, which includes:
[0006] S101, acquire surveillance video of the 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.
[0007] S102, two lane line marker points are determined in the reference image as the first reference point and the second reference point, respectively.
[0008] S103, in the reference image, a first reference line is determined based on the first reference point, and a second reference line is determined based on the second reference point.
[0009] S104, in the monitoring video, obtain the first time point corresponding to the cruise control vehicle in the first lane passing the first reference line, and the second time point corresponding to the cruise control vehicle in the first lane passing the second reference line.
[0010] S105, determine the first true distance based on the first time point, the second time point, and the speed of the cruise control vehicle.
[0011] S106, in the monitoring video, obtain the third time point corresponding to the cruise control vehicle in the second lane passing the first reference line, and the fourth time point corresponding to the cruise control vehicle in the second lane passing the second reference line.
[0012] S107, determine the second true distance based on 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 true distance and the second true distance to obtain the first adjustment line.
[0014] S109, a speed measurement interval is formed based on the first adjustment line and the second reference line, and the speed measurement interval corresponds to the target distance.
[0015] S110, obtain the target duration of the vehicle to be tested passing through the speed measurement interval, and determine the speed measurement result of the vehicle to be tested based on the target duration and the target distance.
[0016] The present invention also provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the above-described vehicle speed measurement method based on surveillance video.
[0017] The present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0018] Compared with the prior art, the present invention has significant advantages. Through the above technical solution, the vehicle speed measurement method based on surveillance video provided by the present invention achieves considerable technological progress and practicality, and has broad industrial application value. It has at least the following advantages:
[0019] By acquiring surveillance video of the target road area, a reference image is determined from the video. The target road area includes a first lane and a second lane. Two lane marking points are identified in the reference image as the first reference point and the second reference point, respectively. A first reference line is determined based on the first reference point, and a second reference line is determined based on the second reference point. The first time point when a vehicle with cruise control in the first lane crosses the first reference line and the second time point when it crosses the second reference line are acquired from the surveillance video. A first true distance is determined based on the first and second time points and the speed of the vehicle with cruise control. A third time point when a vehicle with cruise control in the second lane crosses the first reference line and the fourth time point when it crosses the second reference line are acquired from the surveillance video. A second true distance is determined based on the third and fourth time points and the speed of the vehicle with cruise control. The first reference line is adjusted based on the first and second true distances to obtain a first adjustment line. The adjustment line and the second reference line form a speed measurement interval, which corresponds to the target distance. The target time for the vehicle to be measured to pass through the speed measurement interval is obtained. Based on the target time and target distance, the speed measurement result of the vehicle to be measured is determined. It can be seen that determining two lane line markers 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, can make the actual distance between the first reference line and the second reference line as close as possible to the preset speed measurement distance. Due to the influence of factors such as camera angle and distortion, the first reference line and the second reference line may not be parallel in the actual scene, resulting in differences in the speed measurement accuracy of different lanes. Therefore, adjusting the first reference line based on the first and second actual distances to obtain the first adjustment line can make the first adjustment line and the second reference line meet the parallel condition in the actual scene, thereby determining the speed measurement interval. This speed measurement interval can accurately measure the speed of vehicles in different lanes, improving the speed measurement accuracy of vehicle speed measurement based on surveillance video. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating a vehicle speed measurement method based on surveillance video, provided in Embodiment 1 of the present invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] Example 1
[0024] This embodiment provides a vehicle speed measurement method based on surveillance video. See [link to previous document]. Figure 1 The above is a flowchart illustrating a vehicle speed measurement method based on surveillance video provided in Embodiment 1 of the present invention, including:
[0025] S101, acquire surveillance video of the target road area, and determine a reference image from the surveillance video, wherein the target road area includes the first lane and the second lane.
[0026] S102, In the reference image, two lane line marker points are determined as the first reference point and the second reference point, respectively.
[0027] S103, in the reference image, a first reference line is determined based on a first reference point, and a second reference line is determined based on a second reference point.
[0028] S104: Obtain the first time point in the monitoring video corresponding to the passing of the first reference line by the cruise control vehicle in the first lane, and the second time point corresponding to the passing of the second reference line by the cruise control vehicle in the first lane.
[0029] S105 determines the first true distance based on the first time point, the second time point, and the speed of the cruise control vehicle.
[0030] S106, obtain the third time point corresponding to the passage of the cruise control vehicle in the second lane through the first reference line from the monitoring video, and the fourth time point corresponding to the passage of the cruise control vehicle in the second lane through the second reference line.
[0031] S107 determines the second true 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 true distance and the second true distance to obtain the first adjustment line.
[0033] S109, a speed measurement interval is formed based on the first adjustment line and the second reference line, and the speed measurement interval corresponds to the target distance.
[0034] S110: Obtain the target duration of the vehicle to be measured passing through the speed measurement section, and determine the speed measurement result of the vehicle to be measured based on the target duration and target distance.
[0035] 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 used as an example. The implementer can set multiple speed measurement intervals based on 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 markers can be used to characterize the specific location of the lane line. In this embodiment, the lane line is a dashed line.
[0038] Cruise control vehicles can be used to calibrate the first and second reference lines by driving at a constant speed in the first and second lanes once each.
[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, and will not be elaborated here.
[0040] In one specific implementation, the surveillance video includes M surveillance images, where M is an integer greater than one;
[0041] S101 includes the following steps:
[0042] S1011, Perform vehicle target detection on each of the M monitoring images to obtain the vehicle target detection results corresponding to each of the M monitoring images;
[0043] S1012, any monitoring image whose vehicle target detection result meets the first preset condition is used as a reference image.
[0044] Vehicle target detection can be achieved using a pre-trained target detection model, such as the YOLO model or the RCNN model. In general, vehicle category is a common category in target detection models, so a pre-trained target detection model can be used directly for vehicle target detection without the need for fine-tuning.
[0045] Specifically, for any given surveillance image, the current surveillance image is input into a trained target detection model to obtain the category and bounding box information corresponding to each target in the current surveillance image, which is used as the vehicle target detection result of the current surveillance image.
[0046] The first precondition may be that the vehicle target detection results do not contain targets of the category of vehicles.
[0047] In one specific implementation, S102 includes the following steps:
[0048] S1021, Perform lane line segmentation in the reference image to obtain several lane line connected components;
[0049] S1022, For any lane line connected region, determine the minimum bounding rectangle of the current lane line connected region, and use the center points of the two short sides of the minimum bounding rectangle of the current lane line connected region as two lane line marker points.
[0050] S1023, Select any two lane line marking points from all lane line marking points whose actual distance is closest to the preset distance as the first reference point and the second reference point, respectively.
[0051] Lane segmentation can be achieved 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 category is determined as the image to be analyzed.
[0052] Specifically, connected component analysis is performed on the image to be analyzed to obtain several lane line connected components. Then, the minimum bounding rectangle of each lane line connected component is determined. The center points of the two short sides of the minimum bounding rectangle of each lane line connected component are used as two lane line marker points to obtain several lane line marker points.
[0053] From all lane marking points, select any two lane marking points whose actual distance is closest to the preset distance as the first reference point and the second reference point, respectively. Since lane markings are usually set according to standards, the actual distance between any two lane marking points can be considered known. Therefore, any two lane marking points whose actual distance is closest to the preset distance can be selected as the first and second reference points, respectively. The smaller the preset distance, the narrower the speed measurement zone, and the closer the measured speed is to the instantaneous speed, resulting in higher speed measurement accuracy. However, a preset distance that is too small may prevent the camera from capturing the duration of the speed measurement zone via video. Therefore, in this embodiment, the preset distance is set to 15m. The implementer can adjust this preset distance according to actual conditions, such as the camera's acquisition frequency. For example, if the camera's acquisition frequency is high, the preset distance should be lowered; if the camera's acquisition frequency is low, the preset distance should be increased.
[0054] In one specific implementation, S103 includes the following steps:
[0055] S1031, the straight line corresponding to the short side of the first reference point is taken as the first reference line;
[0056] S1032, the line corresponding to the short side of the second reference point is used as the second reference line.
[0057] In this embodiment, the straight line corresponding to the short side of the first reference point is used as the first reference line, and the straight line corresponding to the short side of the second reference point is used as the second reference line. This makes the angle between the first reference line and the second reference line smaller in the actual scene, which helps to reduce the number of iterations in the subsequent adjustment process and improve the adjustment efficiency.
[0058] In one specific implementation, S104 includes the following steps:
[0059] S1041, Obtain the center points of several first vehicle detection bounding boxes corresponding to the cruise control vehicle in the first lane from M monitoring images.
[0060] S1042, determine the acquisition frame of the monitoring image corresponding to the center point of the first vehicle detection bounding box that is closest to the first reference line as the first time point;
[0061] S1043, determine the acquisition frame of the monitoring image corresponding to the center point of the first vehicle detection bounding box that is closest to the second reference line as the second time point.
[0062] For several monitoring images of a vehicle with cruise control in the first lane, the bounding box information of the cruise control vehicle can be obtained through the target detection model, and then the center point of the first vehicle detection bounding box can be obtained. It should be noted that, according to the actual situation, 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, 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 the trajectory points of the cruise vehicle in the first lane. The implementer can add additional center points of the first vehicle detection bounding box and their corresponding acquisition frames by interpolation, thereby improving the accuracy of the determination of the first time point and the second time point.
[0064] In one specific implementation, S105 includes the following steps:
[0065] S1051, determine the first time interval based on the first time point and the second time point;
[0066] S1052, multiply the first time interval by the speed of the cruise control vehicle, and use the result of the multiplication as the first true distance.
[0067] The first time interval can be the time taken for a vehicle traveling at a specified speed to pass through the section defined by the first reference line and the second reference line, and the first actual distance can be the actual distance between the first reference line and the second reference line in the first lane.
[0068] In one specific implementation, S108 includes the following steps:
[0069] S1081, If the first true distance is less than the second true distance, then fix the first reference point and adjust the first reference line at a preset angle in a counterclockwise direction to obtain the first median line;
[0070] S1082, If the first true distance is greater than the second true distance, then fix the first reference point and adjust the first reference line at a preset angle in a clockwise direction to obtain the first median line;
[0071] S1083, using the first median line as the first reference line, return to execute steps S104 to S107 and steps S1081 to S1082 until the first true distance and the second true distance are the same, using the first median line as the first adjustment line and the first true distance as the target distance.
[0072] The preset angle can be set by the implementer, for example, 0.5 degrees. Since the camera parameters are unknown, it is necessary to adjust the first reference line through an iterative process.
[0073] In one implementation, the iteration count can be additionally recorded, and the size of the preset angle can be adjusted according to the iteration count to improve the iteration speed. The iteration count is denoted as K, and the initial value of the preset angle is θ. The updated angle θ changes with the iteration count. ’ =θ×γ K , where γ is an adjustment coefficient, and the value of γ ranges from [0, 1]. In this embodiment, γ is set to 0.9.
[0074] In one specific implementation, S110 includes the following steps:
[0075] S1101, obtain the fifth time point when the vehicle to be measured passes the first adjustment line, and the sixth time point when the vehicle to be measured passes the second reference line.
[0076] S1102, determine the target duration based on the fifth and sixth time points;
[0077] S1103 uses the ratio of target distance to target duration as the speed measurement result of the vehicle to be measured.
[0078] The target duration can refer to the time taken for the vehicle to pass through the speed measurement section. Given the target distance corresponding to the speed measurement section, the speed measurement result of the vehicle in the speed measurement section can be determined.
[0079] As can be seen, in this embodiment, two lane line markers are determined in the reference image as the first reference point and the second reference point, respectively. Then, a first reference line is determined based on the first reference point, and a second reference line is determined based on the second reference point. This allows the actual distance between the first and second reference lines to be as close as possible to the preset speed measurement distance. Due to the influence of factors such as camera angle and distortion, the first and second reference lines may not be parallel in actual scenarios, resulting in differences in speed measurement accuracy for different lanes. Therefore, the first reference line is adjusted based on the first and second actual distances to obtain a first adjustment line. This ensures 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, improving the speed measurement accuracy of vehicle speed measurement based on surveillance video.
[0080] Example 2
[0081] This second embodiment provides a vehicle speed measurement device based on surveillance video, which includes:
[0082] The video acquisition module is used to acquire surveillance video of the target road area and determine reference images from the surveillance video. The target road area includes the first lane and the second lane.
[0083] The reference point determination module is used to determine two lane line marker points in the reference image as the first reference point and the second reference point, respectively.
[0084] The reference line determination module is used to determine a first reference line in a reference image based on a first reference point and a second reference line based on a second reference point.
[0085] The first-time determination module is used to obtain the first time point in the monitoring video corresponding to the passing of the first reference line by the cruise control vehicle in the first lane, and the second time point corresponding to the passing of the second reference line by the cruise control vehicle in the first lane.
[0086] The first distance determination module is used to determine the first true distance based on 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 the third time point corresponding to the passage of the cruise control vehicle in the second lane through the first reference line and the fourth time point corresponding to the passage of the cruise control vehicle in the second lane through the second reference line in the monitoring video.
[0088] The second distance determination module is used to determine the second true distance based on 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 based on the first true distance and the second true distance to obtain the first adjustment line.
[0090] The interval forming module is used to form a speed measurement interval based on the first adjustment line and the second reference line, and the speed measurement interval corresponds to the target distance.
[0091] The speed measurement module is used to obtain the target time for the vehicle to be measured to pass through the speed measurement section, and to determine the speed measurement result of the vehicle to be measured based on the target time and target distance.
[0092] In one specific implementation, the surveillance video includes M surveillance images, where M is an integer greater than one.
[0093] The aforementioned video acquisition module includes:
[0094] The vehicle detection unit is used to perform vehicle target detection on M monitoring images respectively, and obtain the vehicle target detection results corresponding to the M monitoring images respectively.
[0095] The reference image determination unit is used to use any monitoring image whose vehicle target detection result meets the first preset condition as a reference image.
[0096] In one specific implementation, the reference point determination module includes:
[0097] The lane line segmentation unit is used to segment lane lines in a reference image to obtain several lane line connected regions.
[0098] The connected component analysis unit is used to determine the minimum bounding rectangle of any lane line connected component, and to use the center points of the two short sides of the minimum bounding rectangle of the current lane line connected component as the two lane line marker points.
[0099] The reference point determination unit is used to select any two lane line marking points from all lane line marking points whose actual distance is closest to the preset distance as the first reference point and the second reference point, respectively.
[0100] In one specific implementation, the reference line determination module includes:
[0101] The first reference line determination unit is used to take the straight line corresponding to the short side of the first reference point as the first reference line.
[0102] The second reference line determination unit is used to take the straight line corresponding to the short side of the second reference point as the second reference line.
[0103] In one specific implementation, the aforementioned first-time determination module includes:
[0104] The bounding box acquisition unit is used to acquire, from M monitoring images, several center points of the first vehicle detection bounding boxes corresponding to the cruise control vehicle in the first lane.
[0105] The first time point determination unit is used to determine the acquisition frame of the monitoring image corresponding to the center point of the first vehicle detection bounding box that is closest to the first reference line as the first time point.
[0106] The second time point determination unit is used to determine the acquisition frame of the monitoring image corresponding to the center point of the first vehicle detection bounding box that is closest to the second reference line as the second time point.
[0107] In one specific implementation, the first distance determination module includes:
[0108] The time interval determination unit is used to determine the first time interval based on the first time point and the second time point.
[0109] The first distance determination unit is used to multiply the first time interval and the speed of the cruise vehicle, and use the result of the multiplication as the first true distance.
[0110] In one specific implementation, the adjustment module includes:
[0111] The first adjustment unit is used to fix the first reference point and adjust the first reference line at a preset angle in a counterclockwise direction to obtain the first median line if the first true distance is less than the second true distance.
[0112] The second adjustment unit is used to fix the first reference point and adjust the first reference line at a preset angle in a clockwise direction to obtain the first median line if the first true distance is greater than the second true distance.
[0113] The iterative adjustment unit is used to take the first median line as the first reference line, and 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 real distance and the second real distance are the same, taking the first median line as the first adjustment line and the first real distance as the target distance.
[0114] In one specific implementation, the speed measuring module includes:
[0115] The third time determination unit is used to obtain the fifth time point when the vehicle to be measured passes the first adjustment line, and the sixth time point when the vehicle to be measured passes the second reference line.
[0116] The target duration determination unit is used to determine the target duration based on the fifth and sixth time points.
[0117] The speed measurement result determination unit is used to determine the speed measurement result of the vehicle to be measured by using the ratio of the target distance to the target duration.
[0118] It should be noted that the information interaction and execution process between the above modules and units are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0119] Example 3
[0120] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, which stores at least one instruction or at least one program segment, wherein 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, acquire surveillance video of the target road area, and determine a reference image from the surveillance video, wherein the target road area includes the first lane and the second lane.
[0122] S102, In the reference image, two lane line marker points are determined as the first reference point and the second reference point, respectively.
[0123] S103, in the reference image, a first reference line is determined based on a first reference point, and a second reference line is determined based on a second reference point.
[0124] S104: Obtain the first time point in the monitoring video corresponding to the passing of the first reference line by the cruise control vehicle in the first lane, and the second time point corresponding to the passing of the second reference line by the cruise control vehicle in the first lane.
[0125] S105 determines the first true distance based on the first time point, the second time point, and the speed of the cruise control vehicle.
[0126] S106, obtain the third time point corresponding to the passage of the cruise control vehicle in the second lane through the first reference line from the monitoring video, and the fourth time point corresponding to the passage of the cruise control vehicle in the second lane through the second reference line.
[0127] S107 determines the second true 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 true distance and the second true distance to obtain the first adjustment line.
[0129] S109, a speed measurement interval is formed based on the first adjustment line and the second reference line, and the speed measurement interval corresponds to the target distance.
[0130] S110: Obtain the target duration of the vehicle to be measured passing through the speed measurement section, and determine the speed measurement result of the vehicle to be measured based on the target duration and target distance.
[0131] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. 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 embodiments of the methods described above. Furthermore, any references to memory, storage, databases, or other media used in the embodiments provided in this application can include both non-volatile and volatile memory.
[0132] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to 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] Embodiment 4 of the present invention provides an electronic device, which includes a processor and a non-transitory computer-readable storage medium as described in Embodiment 3 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 way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope 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 surveillance video includes: S101, acquire surveillance video of the 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; S102, in the reference image, two lane line marker points are determined as the first reference point and the second reference point, respectively, wherein S102 includes the following steps: S1021, Lane line segmentation is performed in the reference image to obtain several lane line connected regions; S1022, For any lane line connected region, determine the minimum bounding rectangle of the current lane line connected region, and use the center points of the two short sides of the minimum bounding rectangle of the current lane line connected region as two lane line marker points. S1023, Select any two lane line marking points from all lane line marking points whose actual distance is closest to the preset distance as the first reference point and the second reference point respectively; S103, in the reference image, a first reference line is determined based on the first reference point, and a second reference line is determined based on the second reference point; S104, in the monitoring video, obtain the first time point corresponding to the cruise control vehicle in the first lane passing the first reference line, and the second time point corresponding to the cruise control vehicle in the first lane passing the second reference line. S105, determine the first true distance based on the first time point, the second time point, and the speed of the cruise control vehicle; S106, in the monitoring video, obtain the third time point corresponding to the passing of the cruise control vehicle in the second lane through the first reference line, and the fourth time point corresponding to the passing of the cruise control vehicle in the second lane through the second reference line. S107, determine the second true distance based on the third time point, the fourth time point, and the speed of the cruise control vehicle; S108, based on the first true distance and the second true distance, adjust the first reference line to obtain the first adjustment line, wherein S108 includes the following steps: S1081, if the first true distance is less than the second true distance, then fix the first reference point and adjust the first reference line at a preset angle in a counterclockwise direction to obtain the first median line; S1082, if the first true distance is greater than the second true distance, then fix the first reference point and adjust the first reference line at a preset angle in a clockwise direction to obtain the first median line; S1083, using the first median line as the first reference line, return 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 median line as the first adjustment line and the first real distance as the target distance. S109, a speed measurement interval is formed based on the first adjustment line and the second reference line, and the speed measurement interval corresponds to the target distance; S110, obtain the target duration of the vehicle to be tested passing through the speed measurement interval, and determine the speed measurement result of the vehicle to be tested based on the target duration and the target distance.
2. The vehicle speed measurement method based on surveillance 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, Perform vehicle target detection on each of the M monitoring images to obtain the vehicle target detection results corresponding to each of the M monitoring images; S1012, any monitoring image whose vehicle target detection result meets the first preset condition is used as the reference image.
3. The vehicle speed measurement method based on surveillance video according to claim 1, characterized in that, S103 includes the following steps: S1031, the straight line corresponding to the short side to which the first reference point belongs is used as the first reference line; S1032, the straight line corresponding to the short side of the second reference point is used as the second reference line.
4. The vehicle speed measurement method based on surveillance video according to claim 2, characterized in that, S104 includes the following steps: S1041, Obtain the center points of several first vehicle detection bounding boxes corresponding to the cruise control vehicle in the first lane from M monitoring images; S1042, determine the acquisition frame of the monitoring image corresponding to the center point of the first vehicle detection bounding box that is closest to the first reference line as the first time point; S1043, determine the acquisition frame of the monitoring image corresponding to the center point of the first vehicle detection bounding box that is closest to the second reference line as the second time point.
5. The vehicle speed measurement method based on surveillance video according to claim 1, characterized in that, S105 includes the following steps: S1051, determine the first time interval based on the first time point and the second time point; S1052, multiply the first time interval by the speed of the cruise control vehicle, and use the multiplication result as the first true distance.
6. The vehicle speed measurement method based on surveillance video according to claim 1, characterized in that, S110 includes the following steps: S1101, obtain the fifth time point when the vehicle to be tested passes through the first adjustment line, and the sixth time point when the vehicle to be tested passes through the second reference line. S1102, determine the target duration based on the fifth time point and the sixth time point; S1103, the ratio of the target distance to the target duration is used as the speed measurement result of the vehicle to be measured.
7. 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, 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-6.
8. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 7.
Citation Information
Patent Citations
Video-based vehicle speed detecting method
CN102622895A
Vehicle speed detection method, vehicle and computer storage medium
CN119757791A