Speed measurement method, device, apparatus and storage medium
By automatically recognizing camera viewpoint changes and updating speed measurement parameters, the problem of speed measurement parameter failure caused by camera viewpoint changes is solved, and accurate vehicle speed measurement is achieved when the viewpoint changes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNITED NETWORK COMM GRP CO LTD
- Filing Date
- 2022-11-21
- Publication Date
- 2026-07-31
AI Technical Summary
Existing video-based vehicle speed measurement methods lose their speed measurement parameters when the camera's shooting angle changes, thus failing to guarantee the accuracy of vehicle speed measurement.
By automatically recognizing camera shooting perspective changes and updating algorithm parameters in new scenes, including feature matching and vanishing point determination, scaling coefficients are obtained to achieve adaptive updates of speed measurement parameters.
The system can accurately measure vehicle speed even when the camera's angle of view changes, thus improving the adaptability of the speed measurement method.
Smart Images

Figure CN115984321B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of traffic control technology, and in particular to a speed measurement method, device, equipment and storage medium. Background Technology
[0002] In the construction of modern intelligent transportation systems and road traffic monitoring and management, vehicle speed measurement algorithms are a fundamental and common function, playing a crucial role in speeding detection, traffic accident liability determination, and road flow analysis. With the development of artificial intelligence and computer vision technologies, video-based vehicle speed measurement methods that are lower in cost and easier to deploy are gradually emerging.
[0003] Currently, when measuring vehicle speed based on video, algorithm parameters need to be predetermined. For example, by obtaining information such as the camera's focal length, pitch angle, and resolution in advance, the parameters of the mapping model between the image coordinates in the video and the world coordinate system are determined. In actual use, the vehicle's speed can be estimated simply by using the mapping model to transform the vehicle's two-dimensional coordinates to the world coordinate system. Once the parameters are determined, the camera cannot be moved, rotated, or zoomed; that is, the shooting angle must remain fixed. Otherwise, the predetermined parameters become invalid. Due to the high flexibility of PTZ cameras, they are increasingly widely used in traffic monitoring scenarios. However, traffic administrators can change the camera's angle, focal length, or zoom as needed in the background, causing the predetermined parameters to become invalid and making it impossible to guarantee accurate vehicle speed measurement. Summary of the Invention
[0004] To address the problem in existing technologies where changes in camera shooting angle cause the speed measurement parameters of the corresponding speed measurement algorithm to become invalid, thus failing to guarantee accurate speed measurement of vehicles, this disclosure provides a speed measurement method, device, equipment, and storage medium that can automatically identify camera shooting angle changes and automatically update algorithm parameters in new scenarios, thereby improving the adaptability of the speed measurement method.
[0005] To achieve the above objectives, the present disclosure adopts the following technical solution: Firstly, a speed measurement method is provided, the method comprising: Acquire video footage of the target road captured by the acquisition device; the video includes multiple still images. When a target static image is included in multiple static images, determine whether the shooting angle of the target static image is a preset angle; the target static image contains the vehicle to be tested. If it is determined that the shooting angle of the acquisition device is not the preset angle, the preset speed measurement parameters are updated based on the static image of the target. The speed of the vehicle under test is obtained based on video and preset speed measurement parameters.
[0006] In conjunction with the first aspect mentioned above, in one possible implementation, determining whether the shooting angle of the target still image is a preset angle includes: Acquire standard images of the target road taken by the acquisition device from a preset viewpoint, and obtain the standard feature points and their standard descriptors from the standard images; Image feature extraction is performed on the target static image to obtain the target feature points and their target descriptors; Feature matching is performed based on target descriptors and standard descriptor pairs, as well as standard feature points and target feature points. When matching feature points exist between the target features and the preset features, the positional offset between each matching feature point is calculated; the matching feature points include target feature points with a similarity greater than the preset similarity and standard feature points; If no matching feature point exists in the target features and preset features, or if each offset is greater than the preset offset, it is determined that the shooting angle of the target static image is not the preset angle.
[0007] In conjunction with the first aspect mentioned above, in one possible implementation, the method further includes: When no matching feature points exist in the target features and preset features, or when the offset is greater than the preset offset, the target static image is used as the new standard image.
[0008] In conjunction with the first aspect mentioned above, in one possible implementation, the method further includes: When matching feature points exist in the target features and preset features, the time difference between the update time of the standard image and the target time corresponding to the target static image is obtained; When the time difference is greater than the preset time difference, the target static image is used as the new standard image.
[0009] In conjunction with the first aspect mentioned above, in one possible implementation, updating the preset speed measurement parameters based on the target static image includes: Based on the lane line segmentation map of the target static image, the first vanishing point is obtained; the first vanishing point is the intersection of two first target fitted lines in the lane line segmentation map; the first target fitted line is a line whose number of first target pixels passing through is greater than or equal to a first preset threshold; the first target pixel is the pixel corresponding to the lane line in the lane line segmentation map; Based on the vehicle detection box of the vehicle under test in the target static image and the video, the motion trajectory, vehicle type and edge image of the vehicle under test are determined; the edge image is obtained from the region of interest corresponding to the vehicle detection box. Based on the edge image, a second vanishing point is obtained; the second vanishing point is the intersection of two second target fitting lines in the edge image; the second target fitting line is a line in the target line system that passes through a number of second target pixels greater than or equal to a second preset threshold and has an angle with the lane line greater than a preset angle; the target line system is obtained based on the edge image fitting; the second target pixel is a pixel in the edge image representing the edge of the vehicle under test; Based on the vehicle's motion trajectory and model, a scaling factor is obtained; where the scaling factor is used to represent the scaling ratio between the coordinates of the target static image and the world coordinates. The first vanishing point, the second vanishing point, and the scaling factor are determined as the new preset speed measurement parameters.
[0010] In conjunction with the first aspect above, in one possible implementation, the target static image includes multiple vehicles to be tested; each vehicle to be tested corresponds to a target line system; determining the second vanishing point based on the edge image includes: Two second candidate fitting lines are determined for each target line system; wherein, the second candidate fitting line is a line in the target line system whose number of second target pixels passing through it is greater than or equal to a second preset threshold and whose angle with the lane line is greater than a preset angle; the target line system is obtained by fitting the edge image of the corresponding vehicle to be tested; the second target pixel is a pixel in the edge image that represents the edge of the vehicle to be tested; Calculate the total number of second target pixels in the edge image that the two candidate second target fitted lines corresponding to each target line system pass through; The score of the target straight line system is calculated by multiplying the total number of vehicles by the vehicle model weights of the vehicles under test corresponding to the target straight line system. The vehicle model weights of the vehicles under test are used to represent the edge sharpness of the vehicle model. The two candidate fitting lines corresponding to the target line system with the highest score are determined as the two second target fitting lines, and the intersection of the two second target fitting lines is determined as the second vanishing point.
[0011] In conjunction with the first aspect mentioned above, one possible implementation involves obtaining the speed of the vehicle under test based on video and preset speed measurement parameters, including: Target tracking of the vehicle under test is performed based on video to determine the multiple positions of the vehicle under test in multiple static images of the video. Based on preset speed measurement parameters, multiple locations are mapped to the world coordinate system to obtain the displacement between any two locations. Obtain the time difference between any two positions, and calculate the speed of the vehicle under test based on the time difference and displacement.
[0012] Secondly, a speed measuring device is provided, the device comprising: The video image acquisition module is used to acquire video of the target road captured by the acquisition device. The video includes multiple frames of still images. The viewing angle determination module is used to determine whether the shooting angle of the target static image is a preset viewing angle when the target static image is included in multiple static images; and whether the vehicle to be tested exists in the target static image. The preset speed measurement parameter update module is used to update the preset speed measurement parameters based on the target static image if it is determined that the shooting angle of the acquisition device is not the preset angle. The motion speed determination module is used to obtain the motion speed of the vehicle under test based on video and preset speed measurement parameters.
[0013] In conjunction with the second aspect above, in one possible implementation, the perspective determination module includes: The standard feature acquisition unit is used to acquire a standard image of the target road taken by the acquisition device based on a preset viewpoint, and to acquire the standard feature points and their standard descriptors of the standard image; The target feature acquisition unit is used to extract image features from the target static image to obtain the target feature points and their target descriptors. The feature matching unit is used to perform feature matching based on the target descriptor and standard descriptor pair, as well as standard feature points and target feature points; The position offset calculation unit is used to calculate the position offset between each matching feature point when there are matching feature points in the target features and preset features; wherein the matching feature points include target feature points with similarity greater than preset similarity and standard feature points; The perspective judgment unit is used to determine that the shooting perspective of the target static image is not the preset perspective when there is no matching feature point in the target features and preset features, or when each offset is greater than the preset offset.
[0014] In conjunction with the second aspect above, in one possible implementation, the apparatus further includes: The standard image update module is used to use the target static image as the new standard image when there are no matching feature points in the target features and preset features, or when the offset is greater than the preset offset.
[0015] In conjunction with the second aspect above, in one possible implementation, the apparatus further includes: The time difference determination module is used to obtain the time difference between the update time of the standard image and the target time corresponding to the target static image when there are matching feature points in the target features and preset features. The standard image update module is also used to use the target static image as the new standard image when the time difference is greater than the preset time difference.
[0016] In conjunction with the second aspect above, in one possible implementation, the preset speed measurement parameter update module includes: The first vanishing point determination unit is used to obtain a first vanishing point based on the lane line segmentation map of the target static image; the first vanishing point is the intersection of two first target fitted lines in the lane line segmentation map; the first target fitted line is a line that passes through a number of first target pixels greater than or equal to a first preset threshold; the first target pixels are the pixels corresponding to the lane lines in the lane line segmentation map. The vehicle detection unit is used to determine the motion trajectory, vehicle type, and edge image of the vehicle under test based on the vehicle detection box in the target static image and the video; the edge image is obtained from the region of interest corresponding to the vehicle detection box. The second vanishing point determination unit is used to obtain the second vanishing point based on the edge image; the second vanishing point is the intersection of two second target fitting lines in the edge image; the second target fitting line is a line in the target line system that passes through a number of second target pixels greater than or equal to a second preset threshold and has an angle with the lane line greater than a preset angle; the target line system is obtained based on the edge image fitting; the second target pixel is a pixel in the edge image that represents the edge of the vehicle to be tested; The scaling factor determination unit is used to obtain the scaling factor based on the vehicle's motion trajectory and vehicle type; wherein, the scaling factor is used to represent the scaling ratio between the coordinates of the target static image and the world coordinates; The preset speed measurement parameter update unit is used to determine the first vanishing point, the second vanishing point, and the scaling factor as new preset speed measurement parameters.
[0017] In conjunction with the second aspect above, in one possible implementation, the target static image includes multiple vehicles to be tested; each vehicle to be tested corresponds to a target line system; the second vanishing point determination unit includes: The second candidate fitting line determination subunit is used to determine two second candidate fitting lines corresponding to each target line system; wherein, the second candidate fitting line is a line in the target line system whose number of second target pixels passing through it is greater than or equal to a second preset threshold and whose angle with the lane line is greater than a preset angle; the target line system is obtained by fitting the edge image of the corresponding vehicle to be tested; the second target pixel is a pixel in the edge image that represents the edge of the vehicle to be tested; The pixel calculation subunit is used to calculate the total number of second target pixels in the edge image that the two candidate second target fitted lines corresponding to each target line system pass through; The scoring calculation subunit is used to calculate the score of the target straight line system by multiplying the total number by the vehicle model weight of the test vehicle corresponding to the target straight line system. The vehicle model weight of the test vehicle is used to represent the edge sharpness of the vehicle model. The second vanishing point determination sub-unit is used to determine the two second candidate fitted lines corresponding to the target line system with the highest score as the two second target fitted lines, and to determine the intersection of the two second target fitted lines as the second vanishing point.
[0018] In conjunction with the second aspect above, in one possible implementation, the motion speed determination module includes: The target tracking unit is used to track the vehicle under test based on video to determine the multiple positions of the vehicle under test in multiple still images of the video. The displacement determination unit is used to map multiple positions to the world coordinate system based on preset velocity measurement parameters in order to obtain the displacement between any two positions. The motion speed calculation unit is used to obtain the time difference between any two positions and calculate the motion speed of the vehicle under test based on the time difference and displacement.
[0019] Thirdly, a speed measuring device is provided, comprising: a processor and a memory; wherein the memory is used to store computer execution instructions, and when the speed measuring device is running, the processor executes the computer execution instructions stored in the memory to cause the speed measuring device to perform the speed measuring method as described in the first aspect and any possible implementation thereof.
[0020] Fourthly, this disclosure provides a computer-readable storage medium storing instructions that, when executed by a processor of a speed measuring device, enable the speed measuring device to perform the speed measuring method described in the first aspect and any possible implementation thereof.
[0021] In this disclosure, the names of the aforementioned speed measuring devices do not limit the devices or functional modules themselves. In actual implementation, these devices or functional modules may appear under other names. As long as the functions of each device or functional module are similar to those of this disclosure, they fall within the scope of the claims of this disclosure and their equivalents.
[0022] These or other aspects of this disclosure will become more readily apparent in the following description.
[0023] The technical solution provided in this disclosure offers at least the following advantages: acquiring video footage of a target road captured by a data acquisition device, the video including multiple still images; determining whether the target still image is captured from a preset viewing angle when the multiple still images include the target still image; identifying the vehicle to be measured in the target still image; updating preset speed measurement parameters based on the target still image if the captured viewing angle of the data acquisition device is not the preset viewing angle; and obtaining the speed of the vehicle to be measured based on the video and the preset speed measurement parameters. By determining whether the captured viewing angle of the target still image is the preset viewing angle and updating the preset speed measurement parameters, it is possible to accurately determine the speed of the vehicle to be measured even when a change in the captured angle of the data acquisition device is detected, thus achieving adaptability of the speed measurement method to the switching of the data acquisition device's viewing angle. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating a speed measurement method provided in this disclosure; Figure 2 This is another flowchart illustrating a speed measurement method provided in this disclosure; Figure 3 This is another flowchart illustrating a speed measurement method provided in this disclosure; Figure 4 This is another flowchart illustrating a speed measurement method provided in this disclosure; Figure 5 This is a schematic diagram of the structure of a speed measuring device provided in this disclosure; Figure 6 This is a schematic diagram of the hardware structure of a speed measuring device provided in this disclosure. Detailed Implementation
[0025] The speed measurement method, apparatus, and storage medium provided in the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0026] The terms “first” and “second” in this disclosure and its accompanying drawings are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a particular order of objects.
[0027] Furthermore, the terms “comprising” and “having”, and any variations thereof, used in the description of this disclosure are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0028] It should be noted that in this disclosure, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this disclosure should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0029] The following is an explanation of the terms used in this application.
[0030] 1. Feature points In image processing, feature points refer to points where the grayscale value of an image changes drastically or points with significant curvature on image edges, i.e., the intersection of two edges. Image feature points play a crucial role in feature-based image matching algorithms. They reflect the essential features of an image and can identify target objects within it; therefore, matching images can be achieved through feature point matching.
[0031] 2. Descriptor A descriptor is a simplified representation of an image, describing the detected feature points and containing only the most important information about the image.
[0032] 3. Lane markings Lane markings are traffic markings used to separate traffic flows traveling in the same direction. They are generally white dashed and solid lines or yellow dashed and solid lines. White dashed lines separate vehicles traveling in the same direction, and lane changing and overtaking are permitted when it is safe to do so. White solid lines also separate vehicles traveling in the same direction, but lane changing is not allowed. Yellow solid lines separate vehicles traveling in opposite directions, and sometimes separate vehicles traveling in the same direction. They can serve as both dividing lines and center lines, and lane changing is not allowed. Yellow dashed lines can serve as both dividing lines and center lines; when used as dividing lines, lane changing is permitted.
[0033] 4. Region of Interest (ROI) In machine vision and image processing, the region to be processed from the image is delineated using rectangles, circles, ellipses, irregular polygons, etc., and is called the region of interest (ROI). The ROI is the focus of image analysis; defining the ROI and the target can reduce processing time and increase accuracy.
[0034] 5. Vanishing point Parallel lines in the world coordinate system will converge at a single point in the perspective view; this point is the vanishing point of the perspective view. When measuring vehicle speed based on video, only video capture devices need to be deployed on the speed measurement road. Since speed measurement is based on video captured by these devices, it is more cost-effective and easier to deploy. In video-based vehicle speed measurement, digital image processing technology can be used to analyze the video recorded by the camera and establish a video coordinate system. The vehicle speed can be calculated based on the time it takes for the vehicle to travel a certain distance. Specifically, a speed measurement area is defined within the area captured by the camera. The actual distance length corresponding to the speed measurement area is calculated based on the video coordinate system and the world coordinate system. Then, the time it takes for the vehicle to pass through this speed measurement area is determined based on the video. Finally, the vehicle speed can be determined based on the actual distance length and time.
[0035] However, the above process requires extensive calculations, and applying this method to speed measurement on roads with heavy traffic is time-consuming. To improve the efficiency of speed measurement algorithms, engineers have proposed pre-determining the parameters of a mapping model that establishes the relationship between the image coordinates in the video and the world coordinate system by obtaining information such as the camera's focal length, pitch angle, and resolution. In practical use, the vehicle's speed can be estimated simply by using the mapping model to transform the vehicle's two-dimensional coordinates to the world coordinate system. While this method improves speed measurement efficiency to some extent, once the parameters are determined, the camera cannot be moved, rotated, or zoomed; the shooting angle must remain fixed. Otherwise, the pre-determined parameters become invalid. For example, on roads with rotating cameras, if the camera rotates, the mapping transformation between the image coordinates in the video captured by the camera and the world coordinate system changes, causing the mapping model to fail. In such cases, accurate vehicle speed cannot be obtained.
[0036] To address this technical problem, this application provides a speed measurement method that improves the adaptability of speed measurement.
[0037] like Figure 1 The diagram shown is a flowchart of a speed measurement method provided in an embodiment of this application. The method includes the following steps: Step S110: Acquire video of the target road captured by the acquisition device. The video includes multiple still images.
[0038] The acquisition device can be a camera or other device with video recording capabilities. The acquisition device can vary depending on the application scenario. For example, for acquiring data on vehicles traveling on a specific road, a fixed spherical camera deployed near the target road might be used. For traffic researchers conducting research on a road or for temporary traffic control work, a portable camera might be used. The video includes multiple still images, and the frame rate is related to the video's frame rate, which is the number of still images played per second in the video format.
[0039] When acquiring video footage of a target road taken by a data acquisition device, the device can acquire real-time video footage to enable timely speed measurement of vehicles, or it can acquire video footage taken by the data acquisition device in a storage device to enable speed measurement of vehicles captured at a specific time in the past.
[0040] Step S120: When the target static image is included in multiple static images, determine whether the shooting angle of the target static image is a preset angle.
[0041] The vehicle to be tested is present in the target static image.
[0042] When measuring the speed of a vehicle under test at a specific moment, the image corresponding to that moment is the target static image. For example, to detect the speed of a vehicle passing through an area captured by the acquisition device at 2:26 PM, the target static image corresponding to 2:26 PM can be obtained from the video acquired by the acquisition device. In practical applications, to achieve real-time speed detection, the target static image can be the static image corresponding to the current moment in the video acquired in real-time by the acquisition device.
[0043] In addition, when determining whether the shooting angle of the target static image is the preset angle, the target static image can be compared with a standard image captured by the acquisition device at the preset angle to determine whether the target static image is the preset angle.
[0044] Step S130: If it is determined that the shooting angle of the acquisition device is not the preset angle, the preset speed measurement parameters are updated based on the target static image.
[0045] If the shooting angle of the target static image is not the preset angle, it indicates that the preset speed measurement parameters have become invalid. In this case, the preset speed measurement parameters can be updated based on the target static image, thereby ensuring that the vehicle's speed can be accurately obtained based on the updated preset speed measurement parameters.
[0046] The preset speed measurement parameters include a first vanishing point, a second vanishing point, and a scaling factor. Parallel lines in the world coordinate system converge at a single point on the perspective view; this point is the vanishing point of the perspective view. The first vanishing point represents the intersection of two parallel lane lines in the lane segmentation diagram, the second vanishing point represents the intersection of two parallel lines containing the edges of the vehicle's front and rear, and the scaling factor represents the scaling ratio between the size of the vehicle in the image and its actual size.
[0047] Step S140: Obtain the speed of the vehicle under test based on the video and preset speed measurement parameters.
[0048] The speed of a vehicle under test can be determined based on video and predicted speed parameters. For example, first, obtain the coordinates of the vehicle in the target static image in the video and the coordinates of the previous static image. Using preset speed parameters, the distance between these two coordinates after mapping from image coordinates to world coordinates can be calculated. This distance represents the distance traveled by the vehicle between the time corresponding to the target static image and the time corresponding to the previous static image. Calculating the distance traveled and the time taken yields the vehicle's speed.
[0049] In one possible implementation, the speed measurement method specifically determines whether the shooting angle of the target static image is a preset angle through the following steps S121 to S125. Please refer to [link / reference]. Figure 2 : Step S121: Acquire a standard image of the target road taken by the acquisition device based on a preset viewpoint, and acquire the standard feature points and standard descriptors of the standard image.
[0050] Step S122: Extract image features from the target static image to obtain the target feature points and their target descriptors.
[0051] Step S123: Perform feature matching based on the target descriptor and standard descriptor pair, as well as the standard feature points and target feature points.
[0052] Step S124: When there are matching feature points in the target features and preset features, calculate the positional offset between each matching feature point; wherein the matching feature points include target feature points with similarity greater than the preset similarity and standard feature points.
[0053] Step S125: If there are no matching feature points in the target features and preset features, or if each offset is greater than the preset offset, determine that the shooting angle of the target static image is not the preset angle.
[0054] In conjunction with the above embodiments, in one possible implementation, the method further includes: When no matching feature points exist in the target features and preset features, or when the offset is greater than the preset offset, the target static image is used as the new standard image.
[0055] In conjunction with the above embodiments, in one possible implementation, the method further includes: When matching feature points exist in the target features and preset features, the time difference between the update time of the standard image and the target time corresponding to the target static image is obtained.
[0056] When the time difference is greater than the preset time difference, the target static image is used as the new standard image.
[0057] Specifically, an Oriented Fast and Rotated BRIEF (ORB) algorithm can be used to extract ORB feature points from the static images acquired by the acquisition device. A corresponding descriptor is then created for each ORB feature point. The extracted feature points and descriptors of the current image are then matched with the ORB feature points and descriptors of the standard image stored in the system. The algorithm determines whether there are matching ORB feature points between the two images, and whether the positions of the matching ORB feature points on the images have not shifted significantly. If a match is found and there is no significant shift, it checks if a certain time has passed since the last update of the standard image. If so, the current image is updated to the standard image, and a "viewpoint not switched" result is returned; otherwise, the standard image is not updated, and a "viewpoint not switched" result is directly returned. By periodically updating the standard image when the viewpoint has not switched, natural scene changes, such as changes in sky color over time, can be addressed. Setting a certain update interval aims to prevent feature point matching from being consistently successful due to rapid updates of the standard image, making it difficult to identify viewpoint changes in the scene. Depending on the specific needs during implementation, the standard image can be updated every minute. If feature point matching fails or, although matching is successful, there is a significant shift, the current image is updated to the standard image, and a "viewpoint switch" judgment result is returned.
[0058] Understandably, when extracting features from a static image of a target, other methods can be used, such as Scale-Invariant Feature Transform (SIFT), Harris feature extraction, Speeded Up Robust Feature (SURF), Features from Accelerated Segment Test (FAST), and Binary Robust Independent Elementary Features (BRIEF).
[0059] See Figure 3 In one possible implementation, the preset speed measurement parameters are updated based on the target static image, including the following steps (steps S131-S135): Step S131: Based on the lane line segmentation map of the target static image, obtain the first vanishing point; the first vanishing point is the intersection of two first target fitting lines in the lane line segmentation map; the first target fitting line is a line whose number of first target pixels passing through is greater than or equal to a first preset threshold; the first target pixel is the pixel corresponding to the lane line in the lane line segmentation map.
[0060] The process involves feeding a pre-trained lane line semantic segmentation model into a static target image. This model outputs a lane line segmentation map, a binary image where the value of the first target pixel in the lane line region is 1, and the value of pixels in the non-lane line region is 0. A system of lines, including multiple fitted lines, is fitted from the lane line segmentation map obtained in step two using the Hough transform. Then, two first target fitted lines are determined from these lines. These first target fitted lines are those that pass through the lane line segmentation map where the number of first target pixels is greater than a preset first threshold (i.e., lines where the number of pixels with a value of 1 is greater than the preset first threshold). Understandably, the lane line semantic segmentation model can be a deep learning-based LaneNet model, or other deep learning-based models such as Mask R-CNN, DeepLab, and SegNet, or it can be a model based on traditional methods such as histogram methods.
[0061] Specifically, in practical applications, two best-fitting first target fitting lines can be selected from the line system. These two best-fitting first target fitting lines are those that pass through the two first target fitting lines with the most pixels having a value of 1 in the lane segmentation image. The intersection point of these two lines is then found, and this point is the first vanishing point of the image. In the perspective view, parallel lines in the world coordinate system converge at a single point, which is the vanishing point of the perspective view.
[0062] Step S132: Based on the vehicle detection box of the vehicle under test in the target static image and the video, determine the motion trajectory, vehicle type and edge image of the vehicle under test; the edge image is obtained according to the region of interest corresponding to the vehicle detection box.
[0063] Specifically, by invoking a deep learning-based vehicle detection algorithm, the algorithm can identify the vehicle type in a target static image, such as sedan, SUV, truck, or bus. It can also identify vehicle detection boxes representing the vehicle's location within the image. The vehicle detection algorithm outputs a set... Each of them Given a 6-dimensional vector, ( and This indicates the coordinates of the top left and bottom right corners of the vehicle detection frame. Indicates its vehicle type, This indicates the confidence level. A confidence threshold can be set to filter out detection results with low confidence levels. This represents the number of vehicles detected.
[0064] The image ROI region corresponding to each vehicle detection box is fed into the edge detector. The edge detector outputs an edge image for each input ROI sub-image. This edge image is a binary image, in which the pixel value of the edge point is 1, that is, the second target pixel point, and the pixel value of the non-edge point is 0.
[0065] Understandably, deep learning-based vehicle detection algorithms can be various versions of the You Only Look Once (YOLO) algorithm, Fast Region-based Convolutional Network (Fast RCNN), Faster Region-based Convolutional Network (Faster RCNN), Mask Region-based Convolutional Network (Mask RCNN), Single Shot MultiBox Detector (SSD), etc., or they can be object detection algorithms based on traditional methods, such as object detection based on Histogram of Oriented Gradient and Support Vector Machine (HOG+SVM), Deformable Part Model (DPM), etc.
[0066] Step S133: Based on the edge image, obtain the second vanishing point; the second vanishing point is the intersection of two second target fitting lines in the edge image; the second target fitting line is a line in the target line system whose number of second target pixels is greater than or equal to the second preset threshold and whose angle with the lane line is greater than the preset angle; the target line system is obtained based on the edge image fitting; the second target pixel is a pixel in the edge image representing the edge of the vehicle to be tested.
[0067] Specifically, a target straight line system can be fitted from the edge image using the Hough transform. This target straight line system includes multiple fitted straight lines. The second target pixel is the pixel in the edge image that represents the edge of the vehicle under test, i.e., the edge point with a pixel value of 1. From the target straight line system, two straight lines are selected from the multiple fitted straight lines whose number of second target pixels is greater than or equal to a second preset threshold and whose angle with the lane line is greater than a preset angle. These two lines are then used as the two second target fitted straight lines, and the intersection of the two second target fitted straight lines is determined as the second vanishing point.
[0068] Step S134: Based on the vehicle's motion trajectory and vehicle type, obtain the scaling factor; where the scaling factor is used to represent the scaling ratio between the coordinates of the target static image and the world coordinates.
[0069] The length of a vehicle in the image can be represented by a line segment between the intersection of the vehicle's trajectory and the detection box. The actual length of this line segment in the world coordinate system is then calculated, providing an estimate of the vehicle's length for each vehicle. A scaling factor is then first set. Then adjust the scaling factor according to the empirical value of the vehicle length. The length is adjusted accordingly, as different vehicle models have different empirical values. For example, the empirical length for sedans and SUVs is 4.8 meters, while for trucks and buses it is 10 meters. The adjusted length is then... The scaling factor can be obtained by averaging the values. .
[0070] Step S135: Determine the first vanishing point, the second vanishing point, and the scaling factor as new preset speed measurement parameters.
[0071] In one possible implementation, the target static image includes multiple vehicles to be tested; each vehicle to be tested corresponds to a target straight line system; the step of determining the second vanishing point based on the edge image includes the following process.
[0072] First, two second candidate fitting lines are determined for each target line system; wherein, the second candidate fitting line is a line in the target line system that passes through a number of second target pixels greater than or equal to a second preset threshold and has an angle with the lane line greater than a preset angle; the target line system is obtained by fitting the edge image of the corresponding vehicle to be tested; the second target pixel is a pixel in the edge image that represents the edge of the vehicle to be tested.
[0073] Next, the total number of second target pixels in the edge image passed by the two candidate second target fitted lines corresponding to each target line system is calculated.
[0074] Furthermore, the product of the total number and the vehicle model weights of the test vehicles corresponding to the target straight line system is the score of the target straight line system, where the vehicle model weights of the test vehicles are used to represent the edge sharpness of the vehicle model.
[0075] Finally, the two second candidate fitted lines corresponding to the target line system with the highest score are determined as the two second target fitted lines, and the intersection of the two second target fitted lines is determined as the second vanishing point.
[0076] Specifically, after fitting the target straight line system from the edge image using the Hough transform, lines in the target straight line system with an angle less than a certain threshold to the lane lines are filtered out based on the fitted lane lines. According to the definition of the second vanishing point, after the first vanishing point is determined, another set of parallel lines perpendicular to the set converging at the first vanishing point in the world coordinate system also converge at the same point in the perspective view. This point is the second vanishing point corresponding to the aforementioned first vanishing point. Since some vehicle edge lines are perpendicular to the lane lines and some are parallel to the lane lines, lines parallel to the lane lines should not be used to solve for the second vanishing point.
[0077] Two second-target fitting lines are selected from each target line system. These second-target fitting lines are lines that pass through an edge image where the number of pixels with a value of 1 is greater than a preset threshold. The sum of the number of pixels with a value of 1 passed through each selected second-target fitting line is multiplied by the vehicle type weight corresponding to the edge image. Different vehicle types have different weights; vehicles with clearer edges are given higher weights because clearer edges result in higher accuracy in solving the second vanishing point. Empirical values used in the implementation process are: trucks have a weight of 2, buses 1.5, and others 1, which represents the score of the line system. For ease of calculation and understanding, the numbers in the following example are simplified and do not represent the actual situation in practical applications: the target static image includes vehicle A, vehicle B, and vehicle C. The two second-target fitting lines are obtained based on the edge image corresponding to vehicle A. as well as , as well as With a total of 500 pixels having a value of 1, and a weight of 5 for vehicle A, the score of the target line system corresponding to vehicle A is 2500; two second target fitted lines are obtained based on the edge image corresponding to vehicle B. as well as , as well as With a total of 600 pixels having a value of 1, and a weight of 4 for vehicle B, the score of the target line system corresponding to vehicle B is 2400; two second target fitted lines are obtained based on the edge image corresponding to vehicle C. as well as , as well as With a total of 400 pixels having a value of 1, and vehicle C having a weight of 8, the score of the target line system corresponding to vehicle C is 3200. By comparing the scores of the target line systems corresponding to vehicles A, B, and C, it can be determined that the intersection point of the second target fitted line in the target line system corresponding to vehicle C is the second vanishing point. The above steps ensure that the two selected straight lines originate from the edge of the same vehicle and guarantee the accuracy of the second vanishing point.
[0078] See Figure 4 In one embodiment of this speed measurement method, the step of obtaining the speed of the vehicle under test based on video and preset speed measurement parameters includes the following steps (S141-S143): Step S141: Perform target tracking on the vehicle under test based on the video to determine multiple positions of the vehicle under test in multiple static images of the video.
[0079] When performing target tracking on the vehicle under test based on video, the ROI sub-image of each vehicle detection box is fed into a convolutional neural network model to extract the appearance feature vector corresponding to the vehicle under test. and calculate Compared with the appearance feature vector of the tracked target minimum cosine distance between The Kalman filter prediction function is executed to generate a predicted value of a motion feature vector for each tracked target. And calculate the measured value Compared with the predicted value Mahalanobis distance between Generate cost matrix ,in , The weighting coefficients are used to calculate the cost matrix using the Hungarian algorithm. The optimal binary matching yields the tracking result for each detection box. Based on this tracking result, the measurement value of the current frame is used... By updating the corresponding Kalman filter, multiple positions of the vehicle in the multi-frame static images of the video can be obtained. Specifically, the positions of the vehicle under test in the current frame, the previous frame, and the images 50 frames ago can be obtained. These positions can be represented by the coordinates of the bottom midpoint of the vehicle detection box, because the displacement of the bottom midpoint of the vehicle detection box best reflects the actual displacement of the vehicle on the road.
[0080] Step S142: Based on preset velocity measurement parameters, map multiple positions to the world coordinate system to obtain the displacement between any two positions.
[0081] Step S143: Obtain the time difference between any two positions, and calculate the speed of the vehicle under test based on the time difference and displacement.
[0082] Specifically, by mapping the position of the vehicle under test in the images corresponding to the current frame, the previous frame, and 50 frames ago, and the coordinates of the bottom midpoint of the vehicle detection box to the world coordinate system, it can be assumed that... For a point on the image, The center point of the image. and These are the first and second vanishing points of the image. This is the scaling factor. First, calculate the focal length. ,in This represents the dot product of vectors. The world coordinates of the two vanishing points can be obtained from the relationship between the vanishing point and the focal length. and Based on the properties of the image center point, the world coordinates of the center point can be obtained. From the knowledge of solid geometry, we can obtain that, with , and Vectors perpendicular to a plane formed by three points ,in Let the cross product of vectors be denoted as and the product of vectors be denoted as . According to the definition of the third vanishing point, its image coordinates Let the desired outcome be... Its world coordinates can be obtained. Find the unit normal vector of the line connecting it to the center point of the image. ,in This represents the length of the vector. Let the point... Coordinates on the focal plane Finally, the point is obtained through affine transformation. World coordinates Suppose that the bottom midpoint of the vehicle detection bounding box in the current frame, the previous frame, and 50 frames ago is mapped to the world coordinate system respectively. , and Then the displacement that occurred in the most recent frame Displacement occurring in nearly 50 frames ,in Indicates the vector length. Retrieves the time elapsed in the last frame and the last 50 frames for the vehicle. and Calculate the instantaneous speed of the vehicle and an average frame rate of nearly 50 frames. .
[0083] As can be seen, the above mainly describes the technical solutions provided by the embodiments of this disclosure from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0084] This disclosure embodiment can divide the speed measuring device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this disclosure embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0085] like Figure 5 As shown, a speed measuring device 500 is provided in an embodiment of this disclosure. The device includes: The video image acquisition module 510 is used to acquire video of the target road captured by the acquisition device, and the video includes multiple frames of still images. The viewing angle determination module 520 is used to determine whether the shooting angle of the target static image is a preset viewing angle when the target static image is included in multiple static images; and whether the vehicle to be tested exists in the target static image. The preset speed measurement parameter update module 530 is used to update the preset speed measurement parameters based on the target static image if it is determined that the shooting angle of the acquisition device is not the preset angle. The motion speed determination module 540 is used to obtain the motion speed of the vehicle under test based on video and preset speed measurement parameters.
[0086] Optionally, in one possible implementation, the viewpoint determination module includes: The standard feature acquisition unit is used to acquire a standard image of the target road taken by the acquisition device based on a preset viewpoint, and to acquire the standard feature points and their standard descriptors of the standard image; The target feature acquisition unit is used to extract image features from the target static image to obtain the target feature points and their target descriptors. The feature matching unit is used to perform feature matching based on the target descriptor and standard descriptor pair, as well as standard feature points and target feature points; The position offset calculation unit is used to calculate the position offset between each matching feature point when there are matching feature points in the target features and preset features; wherein the matching feature points include target feature points with similarity greater than preset similarity and standard feature points; The perspective judgment unit is used to determine that the shooting perspective of the target static image is not the preset perspective when there is no matching feature point in the target features and preset features, or when each offset is greater than the preset offset.
[0087] Alternatively, in one possible implementation, the apparatus further includes: The standard image update module is used to use the target static image as the new standard image when there are no matching feature points in the target features and preset features, or when the offset is greater than the preset offset.
[0088] Alternatively, in one possible implementation, the apparatus further includes: The time difference determination module is used to obtain the time difference between the update time of the standard image and the target time corresponding to the target static image when there are matching feature points in the target features and preset features. The standard image update module is also used to use the target static image as the new standard image when the time difference is greater than the preset time difference.
[0089] Optionally, in one possible implementation, the preset speed measurement parameter update module includes: The first vanishing point determination unit is used to obtain a first vanishing point based on the lane line segmentation map of the target static image; the first vanishing point is the intersection of two first target fitted lines in the lane line segmentation map; the first target fitted line is a line that passes through a number of first target pixels greater than or equal to a first preset threshold; the first target pixels are the pixels corresponding to the lane lines in the lane line segmentation map. The vehicle detection unit is used to determine the motion trajectory, vehicle type, and edge image of the vehicle under test based on the vehicle detection box in the target static image and the video; the edge image is obtained from the region of interest corresponding to the vehicle detection box. The second vanishing point determination unit is used to obtain the second vanishing point based on the edge image; the second vanishing point is the intersection of two second target fitting lines in the edge image; the second target fitting line is a line in the target line system that passes through a number of second target pixels greater than or equal to a second preset threshold and has an angle with the lane line greater than a preset angle; the target line system is obtained based on the edge image fitting; the second target pixel is a pixel in the edge image that represents the edge of the vehicle to be tested; The scaling factor determination unit is used to obtain the scaling factor based on the vehicle's motion trajectory and vehicle type; wherein, the scaling factor is used to represent the scaling ratio between the coordinates of the target static image and the world coordinates; The preset speed measurement parameter update unit is used to determine the first vanishing point, the second vanishing point, and the scaling factor as new preset speed measurement parameters.
[0090] Optionally, in one possible implementation, the target static image includes multiple vehicles to be tested; each vehicle to be tested corresponds to a target line system; the second vanishing point determination unit includes: The second candidate fitting line determination subunit is used to determine two second candidate fitting lines corresponding to each target line system; wherein, the second candidate fitting line is a line in the target line system whose number of second target pixels passing through it is greater than or equal to a second preset threshold and whose angle with the lane line is greater than a preset angle; the target line system is obtained by fitting the edge image of the corresponding vehicle to be tested; the second target pixel is a pixel in the edge image that represents the edge of the vehicle to be tested; The pixel calculation subunit is used to calculate the total number of second target pixels in the edge image that the two candidate second target fitted lines corresponding to each target line system pass through; The scoring calculation subunit is used to calculate the score of the target straight line system by multiplying the total number by the vehicle model weight of the test vehicle corresponding to the target straight line system. The vehicle model weight of the test vehicle is used to represent the edge sharpness of the vehicle model. The second vanishing point determination sub-unit is used to determine the two second candidate fitted lines corresponding to the target line system with the highest score as the two second target fitted lines, and to determine the intersection of the two second target fitted lines as the second vanishing point.
[0091] Optionally, in one possible implementation, the motion speed determination module includes: The target tracking unit is used to track the vehicle under test based on video to determine the multiple positions of the vehicle under test in multiple still images of the video. The displacement determination unit is used to map multiple positions to the world coordinate system based on preset velocity measurement parameters in order to obtain the displacement between any two positions. The motion speed calculation unit is used to obtain the time difference between any two positions and calculate the motion speed of the vehicle under test based on the time difference and displacement.
[0092] This disclosure provides a speed measuring device for executing the method required by any device in the aforementioned data integrity determination system. The speed measuring device may be the speed measuring device described in this disclosure, or a module within a speed measuring apparatus; it may also be a chip within a speed measuring device, or other devices used to execute the speed measuring method; this disclosure does not limit its scope.
[0093] When implemented in hardware, the speed measuring device in this application embodiment is specifically implemented as follows: Figure 6 As shown, Figure 6 This is a schematic diagram of a speed measuring device provided in an embodiment of the present disclosure. The speed measuring device 600 includes at least one processor 601, a communication line 602, and at least one communication interface 604, and may also include a memory 603. The processor 601, memory 603, and communication interface 604 are connected via the communication line 602.
[0094] The processor 601 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).
[0095] Communication line 602 may include a path for transmitting information between the aforementioned components.
[0096] The communication interface 604 is used to communicate with other devices or communication networks. It can use any transceiver-like device, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
[0097] The memory 603 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of including or storing desired program code having the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0098] In one possible design, the memory 603 can exist independently of the processor 601, meaning the memory 603 can be an external memory of the processor 601. In this case, the memory 603 can be connected to the processor 601 via a communication line 602 to store execution instructions or application code, and its execution is controlled by the processor 601 to implement the speed measurement method provided in this embodiment. In another possible design, the memory 603 can also be integrated with the processor 601, meaning the memory 603 can be an internal memory of the processor 601. For example, the memory 603 can be a cache, used to temporarily store some data and instruction information.
[0099] As one possible implementation, processor 601 may include one or more CPUs, for example Figure 6 CPU0 and CPU1 in the example. Alternatively, the speed measuring device 600 may include multiple processors, such as... Figure 6 The processors 601 and 607 are included. Alternatively, the speed measuring device 600 may also include an output device 605 and an input device 606.
[0100] Through the above description of the implementation methods, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the network node can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, modules, and network nodes described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0101] This disclosure also provides a computer-readable storage medium storing instructions that, when executed by a computer, perform each step of the method flow shown in the above method embodiments.
[0102] Embodiments of this disclosure provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the speed measurement method described in the above method embodiments.
[0103] Embodiments of this disclosure provide a chip including a processor and a communication interface, the communication interface and the processor being coupled together, the processor being used to run computer programs or instructions to implement the speed measurement method as described in the above method embodiments.
[0104] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing, or any other form of computer-readable storage medium in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In this embodiment of the disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0105] Since the apparatus, devices, computer-readable storage media, and computer program products in the embodiments of this disclosure can be applied to the above methods, the technical effects they can achieve can also be referred to the above method embodiments. The embodiments of this disclosure will not be repeated here.
[0106] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0107] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0108] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0109] The above are merely specific embodiments of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any changes or substitutions within the technical scope disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A method of speed measurement, characterized by, The method includes: Acquire video footage of the target road captured by the acquisition device, the video including multiple frames of still images; Obtain the target static image at the target time from the multiple static images, and determine whether the shooting angle of the target static image is a preset angle; the target static image contains the vehicle to be tested; Acquire a standard image of the target road taken by the acquisition device from a preset viewpoint, and acquire the standard feature points and standard descriptors of the standard image; Image feature extraction is performed on the target static image to obtain the target feature points and their target descriptors; Feature matching is performed based on the target descriptor and the standard descriptor pair, as well as the standard feature points and the target feature points; If there are no matching feature points in the target features and the preset features, or if there are matching feature points but the positional offset between the matching feature points is greater than the preset offset, the target static image is used as a new standard image, and it is determined that the shooting angle of the target static image is not the preset angle. If a matching feature point exists between the target feature and the preset feature, and the position offset is not greater than the preset offset, the time difference between the update time of the standard image and the target time corresponding to the target static image is obtained; if the time difference is greater than the preset time difference, the target static image is used as the new standard image, and the shooting angle of the target static image is determined to be the preset angle; if the time difference is not greater than the preset time difference, the standard image is not updated. If it is determined that the shooting angle of the acquisition device is not the preset angle, the preset speed measurement parameters are updated based on the target static image; if it is determined that the shooting angle of the acquisition device is the preset angle, the current preset speed measurement parameters are maintained unchanged; the preset speed measurement parameters include a first vanishing point, a second vanishing point, and a scaling factor; the first vanishing point is the intersection of two parallel lane lines in the lane line segmentation image; the second vanishing point is the intersection of two parallel straight lines containing the front and rear edges of the vehicle under test; the scaling factor is the scaling ratio of the size of the vehicle under test in the target static image to its actual size; The speed of the vehicle under test is obtained based on the video and the preset speed measurement parameters.
2. The method of claim 1, wherein, The step of updating the preset speed measurement parameters based on the target static image includes: Based on the lane line segmentation map of the target static image, a first vanishing point is obtained; the first vanishing point is the intersection of two first target fitted lines in the lane line segmentation map; the first target fitted line is a line that passes through a number of first target pixels greater than or equal to a first preset threshold; the first target pixel is the pixel corresponding to the lane line in the lane line segmentation map. Based on the vehicle detection box of the vehicle under test in the target static image and the video, the motion trajectory, vehicle type, and edge image of the vehicle under test are determined; the edge image is obtained based on the region of interest corresponding to the vehicle detection box. Based on the edge image, a second vanishing point is obtained; the second vanishing point is the intersection of two second target fitting lines in the edge image; the second target fitting line is a line in the target line system that passes through a number of second target pixels greater than or equal to a second preset threshold and has an angle with the lane line greater than a preset angle; the target line system is obtained by fitting based on the edge image; the second target pixel is a pixel in the edge image representing the edge of the vehicle under test; Based on the vehicle's trajectory and model, a scaling factor is obtained; wherein, the scaling factor is used to represent the scaling ratio between the coordinates of the target static image and the world coordinates; the first vanishing point, the second vanishing point, and the scaling factor are determined as new preset speed measurement parameters.
3. The method of claim 2, wherein, The target static image includes multiple vehicles to be tested; each vehicle to be tested corresponds to a target straight line system; determining the second vanishing point based on the edge image includes: Two second candidate fitting lines are determined for each target straight line system; wherein, the second candidate fitting line is a straight line in the target straight line system whose number of second target pixels passing through it is greater than or equal to a second preset threshold and whose angle with the lane line is greater than a preset angle; the target straight line system is obtained by fitting the edge image of the corresponding vehicle under test; the second target pixel is a pixel in the edge image that represents the edge of the vehicle under test; Calculate the total number of second target pixels in the edge image that pass through the two candidate second target fitted lines corresponding to each target line system; Based on the pre-established correspondence between vehicle models and vehicle model weights, obtain the vehicle model weight corresponding to the vehicle model under test; The product of the total number and the vehicle type weight of the test vehicle corresponding to the target straight line system is calculated as the score of the target straight line system. The two second candidate fitting lines corresponding to the target straight line system with the highest score are determined as the two second target fitting lines, and the intersection of the two second target fitting lines is determined as the second vanishing point.
4. The method according to claim 1 or 2, characterized in that, The process of obtaining the speed of the vehicle under test based on the video and preset speed measurement parameters includes: Based on the video, target tracking is performed on the vehicle under test to determine multiple positions of the vehicle under test in multiple still images of the video. Based on the preset speed measurement parameters, the multiple positions are mapped to the world coordinate system respectively to obtain the displacement between any two positions; Obtain the time difference between any two positions, and calculate the speed of the vehicle under test based on the time difference and the displacement.
5. A speed measuring device, characterized in that, The device includes: The video image acquisition module is used to acquire video of the target road captured by the acquisition device, the video including multiple frames of still images; The viewing angle determination module is used to acquire a target static image at a target time from the multi-frame static images, determine whether the shooting angle of the target static image is a preset viewing angle, and identify the vehicle to be tested in the target static image. It acquires a standard image of the target road captured by the acquisition device based on the preset viewing angle, and obtains the standard feature points and their standard descriptors of the standard image. It performs image feature extraction on the target static image to obtain the target feature points and their target descriptors. It performs feature matching based on the target descriptors and the standard descriptors, as well as the standard feature points and the target feature points. If no matching feature points are found in the target features and the preset features... If, when matching feature points exist but the positional offset between them is greater than a preset offset, the target static image is used as a new standard image, and the shooting angle of the target static image is determined to be a different angle than the preset angle; if matching feature points exist in the target features and the preset features, and the positional offset is not greater than the preset offset, the time difference between the update time of the standard image and the target time corresponding to the target static image is obtained; if the time difference is greater than a preset time difference, the target static image is used as a new standard image, and the shooting angle of the target static image is determined to be a different angle than the preset angle; if the time difference is not greater than the preset time difference, the standard image is not updated. The preset speed measurement parameter update module is used to update the preset speed measurement parameters based on the target static image if it is determined that the shooting angle of the acquisition device is not the preset angle; if it is determined that the shooting angle of the acquisition device is the preset angle, the current preset speed measurement parameters are kept unchanged. The preset speed measurement parameters include a first vanishing point, a second vanishing point, and a scaling factor. The first vanishing point is the intersection of two parallel lane lines in the lane line segmentation image. The second vanishing point is the intersection of two parallel straight lines containing the front and rear edges of the vehicle under test. The scaling factor is the scaling ratio of the size of the vehicle under test in the target static image to its actual size. The motion speed determination module is used to obtain the motion speed of the vehicle under test based on the video and the preset speed measurement parameters.
6. A speed measuring device, characterized in that, include: A processor and a memory; wherein the memory is used to store computer execution instructions, and when the speed measuring device is running, the processor executes the computer execution instructions stored in the memory to cause the speed measuring device to perform the speed measuring method according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by the processor of the speed measuring device, cause the speed measuring device to perform the speed measuring method according to any one of claims 1-4.