Method, device, terminal equipment and storage medium for capturing speeding of motor vehicles
By collecting video data in the monitoring and alert area and using the Harris corner point detection algorithm to extract the motor vehicle feature points, calculate the driving speed to judge speed, the real-time and robustness of the speed measurement method in the prior art when the scene grayscale changes or the license plate is unclear, achieving efficient and economical motor vehicle speed detection.
Patent Information
- Application Number
- CN202110670063.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-16
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-06-16
AI Technical Summary
Existing video-based motor vehicle speed measurement methods cannot guarantee real-time and robustness when the scene grayscale changes or the license plate is unclear.
By determining the monitoring alert area and collecting video data, the characteristic points of the motor vehicle are extracted using the Harris corner point detection algorithm, and the driving speed is calculated based on the characteristic points to judge the speed.
Real-time and robustness of motor vehicle speed measurement under resource constraints, simple operation, small calculation and low cost.
Smart Images

Figure CN113361438B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent traffic vehicle speed measurement, and in particular to a method, device, terminal equipment and storage medium for capturing speeding of a motor vehicle. Background Art
[0002] With the development of my country's economy, the popularity of cars has also increased rapidly. As the number of vehicles increases, traffic accidents also follow one after another, and speeding is one of the main culprits of the tragedy. Using intelligent speed measurement technology to measure the speed of motor vehicles to determine whether they are speeding, and using the judgment results as the basis for traffic law enforcement, has very important practical significance for ensuring road traffic safety.
[0003] At present, the more mature speed measurement technologies include radar speed measurement technology, laser speed measurement technology, ground sensor coil speed measurement technology and video-based speed measurement technology. Among these speed measurement technologies, video-based speed measurement technology does not require dedicated speed measurement equipment, greatly reducing system costs and becoming a hot research direction in motor vehicle speed measurement technology. Video-based speed measurement technology mainly includes motor vehicle speed measurement methods based on virtual coil method and motor vehicle speed measurement methods based on license plate positioning. Among them, the working principle of the motor vehicle speed measurement method based on virtual coil method is similar to the ground sensing coil speed measurement method. The motor vehicle speed measurement is achieved by setting a single or multiple virtual coils on the lane in the video image. This method has a small amount of calculation and can meet the real-time requirements of speed measurement, but it is easily affected by the sudden change of scene grayscale, resulting in false detection; and the working principle of the motor vehicle speed measurement method based on license plate positioning is to accurately locate and track the license plate in the video image sequence to obtain the coordinate transformation of the license plate in different frames, and then calculate the vehicle speed information. Although the algorithm for license plate positioning and speed detection is relatively mature, this method has high requirements on the camera installation position. The camera position and lane position must be parallel, and the license plate in the scene must be clear enough to achieve accurate positioning.
[0004] Therefore, although there are a variety of video-based speed measurement methods and corresponding improved methods, the above methods still cannot guarantee the real-time and robustness of the speed measurement method at the same time when resources are limited, such as sudden grayscale changes in the scene or unclear license plates. Summary of the invention
[0005] The main purpose of the present invention is to provide a method, device, terminal equipment and storage medium for capturing speeding of a motor vehicle, aiming to solve the technical problem that the current video-based speed measurement method cannot ensure the real-time and robustness of the speed measurement method when resources are limited, such as sudden changes in scene grayscale or unclear license plates.
[0006] To achieve the above object, the present invention provides a method for capturing a speeding vehicle, the method comprising:
[0007] Determine a surveillance warning zone, and collect video data of the surveillance warning zone;
[0008] intercepting a first preset image from the video data, and determining feature points of the motor vehicle in the first preset image using a Harris corner detection algorithm, wherein there are multiple feature points;
[0009] The driving speed of the motor vehicle is determined according to the characteristic points to judge whether the motor vehicle is speeding.
[0010] Further, after the step of determining the monitoring warning area, the following steps are included:
[0011] Determine a marker in the monitoring warning area and a first pixel coordinate corresponding to the marker on the captured image of the monitoring warning area;
[0012] Determine a second pixel coordinate corresponding to the marker on the orthographic image of the monitoring warning area, wherein the orthographic image is formed by converting the image viewing angle of the captured image;
[0013] A perspective transformation matrix is determined according to the first pixel coordinates and the second pixel coordinates, and an image ratio of the orthographic image is determined according to a preset calibration object in the monitoring warning area.
[0014] Furthermore, the step of determining the driving speed of the motor vehicle according to the characteristic points comprises:
[0015] intercepting a second preset image from the video data, wherein the interception time of the second preset image is later than the interception time of the first preset image;
[0016] Determine the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix;
[0017] The driving speed of the motor vehicle is determined according to the pixel movement distance.
[0018] Furthermore, the step of determining the driving speed of the motor vehicle according to the pixel movement distance includes:
[0019] Determining the pixel movement distance of the feature point as the pixel movement distance of the motor vehicle;
[0020] The driving speed of the motor vehicle is determined according to the pixel movement distance of the motor vehicle and the image ratio.
[0021] Furthermore, before the step of determining the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix, the method further includes:
[0022] reducing the resolution of the second preset image;
[0023] The preset corner tracking algorithm includes an online optical flow estimation algorithm. The step of determining the pixel motion distance of the feature point using the preset corner tracking algorithm according to the second preset image and the perspective transformation matrix includes:
[0024] The pixel motion distance of the feature point is determined using the online optical flow estimation algorithm according to the second preset image with reduced resolution and the perspective transformation matrix.
[0025] Further, after the step of determining the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix, the method further includes:
[0026] Determine valid feature points using a robust statistical algorithm according to the movement direction of the feature points and the pixel movement distance;
[0027] The step of determining the driving speed of the motor vehicle according to the pixel movement distance comprises:
[0028] Determine an average pixel movement distance of the effective feature points, and use the average pixel movement distance as the pixel movement distance of the motor vehicle;
[0029] The driving speed of the motor vehicle is determined according to the pixel movement distance of the motor vehicle and the image ratio.
[0030] Further, after the step of determining the driving speed of the motor vehicle according to the feature points to judge whether the motor vehicle is speeding, the method further includes:
[0031] If it is determined that the motor vehicle is speeding, the video data is saved and sent to a preset law enforcement agency at a preset time.
[0032] In addition, to achieve the above-mentioned purpose, the present invention further provides a device for capturing a speeding vehicle, the device comprising:
[0033] A collection module, used to determine a monitoring warning area and collect video data of the monitoring warning area;
[0034] A determination module, configured to capture a first preset image from the video data, and determine feature points of the motor vehicle in the first preset image using a Harris corner detection algorithm, wherein there are multiple feature points;
[0035] The analysis module is used to determine the driving speed of the motor vehicle according to the characteristic points to judge whether the motor vehicle is speeding.
[0036] Each functional module of the device for capturing the speeding of a motor vehicle of the present invention implements the steps of the method for capturing the speeding of a motor vehicle as described above during operation.
[0037] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal device, which includes: a memory, a processor, and a motor vehicle speeding capture program stored in the memory and runable on the processor, and when the motor vehicle speeding capture program is executed by the processor, the steps of the motor vehicle speeding capture method as described above are implemented.
[0038] In addition, to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for capturing speeding of a motor vehicle as described above are implemented.
[0039] The present invention proposes a method for capturing a speeding motor vehicle, which comprises: determining a monitoring warning area and collecting video data of the monitoring warning area; intercepting a first preset image from the video data, and using a Harris corner detection algorithm to determine feature points of the motor vehicle in the first preset image, wherein there are multiple feature points; and determining the driving speed of the motor vehicle based on the feature points to determine whether the motor vehicle is speeding.
[0040] The present invention determines a monitoring warning zone on a road, uses a camera to collect video data of the monitoring warning zone, captures an image from the video data, then uses a Harris corner point detection algorithm to extract feature points from a motor vehicle in the image, then analyzes the feature points to obtain the driving speed of the motor vehicle, and finally determines whether the motor vehicle is speeding according to the driving speed.
[0041] In this way, the method for capturing speeding of a motor vehicle involved in the present invention can realize online analysis of the driving speed of the motor vehicle while the camera is recording the video. It does not require support from other equipment, has simple operation, small amount of calculation and low cost, and ensures the real-time and robustness of motor vehicle speed measurement under resource-constrained conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1It is a schematic diagram of the structure of the hardware operating environment of the terminal device involved in the embodiment of the present invention;
[0043] Figure 2 It is a flow chart of a first embodiment of a method for capturing speeding of a motor vehicle according to the present invention;
[0044] Figure 3 It is a detailed flow chart of step S300 in the first embodiment of a method for capturing speeding of a motor vehicle according to the present invention;
[0045] Figure 4 It is a schematic diagram of the effect of converting a captured image into a front projection image according to an embodiment of a method for capturing a speeding motor vehicle of the present invention;
[0046] Figure 5 The present invention is a schematic diagram of the module structure of a device for capturing speeding of a motor vehicle.
[0047] Figure 6 is a relational expression involved in an embodiment of a method for capturing speeding of a motor vehicle according to the present invention;
[0048] Figure 7 is a perspective transformation matrix involved in an embodiment of a method for capturing speeding of a motor vehicle according to the present invention;
[0049] Figure 8 It is a pyramid relationship involved in an embodiment of a method for capturing speeding of a motor vehicle of the present invention;
[0050] Fig. 9 is a relational expression involved in an embodiment of a method for capturing speeding of a motor vehicle according to the present invention;
[0051] Fig.10 This is a relationship involved in an embodiment of a method for capturing speeding of a motor vehicle according to the present invention.
[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0054] like Figure 1 As shown, Figure 1 It is a structural diagram of the hardware operating environment of the terminal device involved in the embodiment of the present invention.
[0055] It should be noted that Figure 1That is, it is a schematic diagram of the structure of the hardware operating environment of the terminal device. The terminal device of the embodiment of the present invention can be a desktop computer, a portable computer, an embedded system or other terminal devices.
[0056] like Figure 1 As shown, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0057] Those skilled in the art will understand that Figure 1 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0058] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a distributed task processing program. The operating system is a program that manages and controls the hardware and software resources of the sample terminal device, and supports the operation of the distributed task processing program and other software or programs.
[0059] exist Figure 1 In the terminal device shown, the user interface 1003 is mainly used to communicate data with various terminals; the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; and the processor 1001 can be used to call the speeding capture program of the motor vehicle stored in the memory 1005, and perform the following operations:
[0060] Determine a surveillance warning zone, and collect video data of the surveillance warning zone;
[0061] intercepting a first preset image from the video data, and determining feature points of the motor vehicle in the first preset image using a Harris corner detection algorithm, wherein there are multiple feature points;
[0062] The driving speed of the motor vehicle is determined according to the characteristic points to judge whether the motor vehicle is speeding.
[0063] Furthermore, the processor 1001 may call a speeding capture program of a motor vehicle stored in the memory 1005, and after the step of determining the monitoring warning zone, further perform the following operations:
[0064] Determine a marker in the monitoring warning area and a first pixel coordinate corresponding to the marker on the captured image of the monitoring warning area;
[0065] Determine a second pixel coordinate corresponding to the marker on the orthographic image of the monitoring warning area, wherein the orthographic image is formed by converting the image viewing angle of the captured image;
[0066] A perspective transformation matrix is determined according to the first pixel coordinates and the second pixel coordinates, and an image ratio of the orthographic image is determined according to a preset calibration object in the monitoring warning area.
[0067] Furthermore, the processor 1001 may call the speeding capture program of the motor vehicle stored in the memory 1005, and further perform the following operations:
[0068] intercepting a second preset image from the video data, wherein the interception time of the second preset image is later than the interception time of the first preset image;
[0069] Determine the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix;
[0070] The driving speed of the motor vehicle is determined according to the pixel movement distance.
[0071] Furthermore, the processor 1001 may call the speeding capture program of the motor vehicle stored in the memory 1005, and further perform the following operations:
[0072] Determining the pixel movement distance of the feature point as the pixel movement distance of the motor vehicle;
[0073] The driving speed of the motor vehicle is determined according to the pixel movement distance of the motor vehicle and the image ratio.
[0074] Further, the processor 1001 may call a speeding capture program of a motor vehicle stored in the memory 1005, and before the step of determining the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix, further perform the following operations:
[0075] reducing the resolution of the second preset image;
[0076] The preset corner tracking algorithm includes an online optical flow estimation algorithm. The step of determining the pixel motion distance of the feature point using the preset corner tracking algorithm according to the second preset image and the perspective transformation matrix includes:
[0077] The pixel motion distance of the feature point is determined using the online optical flow estimation algorithm according to the second preset image with reduced resolution and the perspective transformation matrix.
[0078] Further, the processor 1001 may call a speeding capture program of a motor vehicle stored in the memory 1005, and after the step of determining the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix, further perform the following operations:
[0079] Determine valid feature points using a robust statistical algorithm according to the movement direction of the feature points and the pixel movement distance;
[0080] The step of determining the driving speed of the motor vehicle according to the pixel movement distance comprises:
[0081] Determine an average pixel movement distance of the effective feature points, and use the average pixel movement distance as the pixel movement distance of the motor vehicle;
[0082] The driving speed of the motor vehicle is determined according to the pixel movement distance of the motor vehicle and the image ratio.
[0083] Further, the processor 1001 may call a speeding capture program of a motor vehicle stored in the memory 1005, and after the step of determining the driving speed of the motor vehicle according to the feature points to determine whether the motor vehicle is speeding, further perform the following operations:
[0084] If it is determined that the motor vehicle is speeding, the video data is saved and sent to a preset law enforcement agency at a preset time.
[0085] Based on the above structure, various embodiments of the method for capturing speeding of a motor vehicle of the present invention are proposed.
[0086] Please refer to Figure 2 , Figure 2 The figure is a flow chart of a first embodiment of a method for capturing a speeding motor vehicle according to the present invention.
[0087] The embodiment of the present invention provides an embodiment of a method for capturing speeding of a motor vehicle. It should be noted that although a logical sequence is shown in the flow chart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0088] The method for capturing a speeding vehicle in this embodiment is applied to a camera. The method for capturing a speeding vehicle in this embodiment includes:
[0089] Step S100, determining a surveillance warning zone, and collecting video data of the surveillance warning zone.
[0090] It should be noted that, in this embodiment, the monitoring warning area is a speed measurement area subjectively set by the user to measure the speed of motor vehicles passing through a certain area, such as a motor vehicle driving area before and after a crosswalk.
[0091] The camera receives the command issued by the user, determines the monitoring warning area on the road according to the command, and shoots the monitoring warning area to collect video data.
[0092] Specifically, for example, when the user needs to measure the speed of motor vehicles passing through the area before and after the sidewalk, an instruction encapsulated with the instruction content of "setting the motor vehicle driving area before and after the crosswalk as a monitoring warning area" is triggered, and the instruction is uploaded to the camera monitoring the area before and after the sidewalk. After receiving the instruction, the camera sets the motor vehicle driving area before and after the crosswalk as a monitoring warning area according to the instruction content encapsulated in the instruction, and starts to loop record the monitoring warning area to collect video data, thereby realizing 7×24 hours of uninterrupted monitoring of the monitoring warning area.
[0093] Furthermore, in order to reduce the memory occupied by each video and improve operating efficiency, the camera can set the duration of each video to be less than or equal to 10 seconds. In the present embodiment, the duration of each video recorded by the camera is 8 seconds. At the same time, the camera sets identification information for each video, and the identification information includes year, month, day, hour, minute and second, so as to facilitate later viewing by users.
[0094] Step S200 , capturing a first preset image from the video data, and using a Harris corner detection algorithm to determine feature points of a motor vehicle in the first preset image, wherein there are multiple feature points.
[0095] It should be noted that, in this embodiment, the first preset image is an image automatically captured by the camera in each video recording; the Harris corner detection algorithm is any mature corner detection algorithm, and the basic principle is to use a window to move the detection in the image and determine the corner points in the image according to the average change value of the grayscale of the image.
[0096] After collecting video data of the monitoring warning area, the camera automatically captures a first preset image from the video data and uses the Harris corner point detection algorithm to detect the first preset image, thereby determining multiple feature points of the motor vehicle in the first preset image.
[0097] Specifically, for example, when the camera records the 8-second video cached by recording the motor vehicle driving area before and after the determined monitoring warning area - the crosswalk, the camera automatically captures the image at the 2nd second of the video, and then uses the Harris corner detection algorithm to detect the image to determine multiple feature points of the motor vehicle and the positions of the multiple feature points from the image.
[0098] Furthermore, if Figure 3 As shown in the effect diagram, in a feasible embodiment, in the above step S100, after the step of "determining the monitoring warning area", it also includes:
[0099] Step A: determine the marker in the monitoring and warning area and the first pixel coordinates corresponding to the marker on the captured image of the monitoring and warning area.
[0100] It should be noted that, in this embodiment, the captured image is image data directly obtained after the camera records the monitored warning area without any processing.
[0101] After the camera determines the monitoring warning zone on the road, it receives the selection instruction issued by the user, determines an object in the monitoring warning zone as a marker, and determines the first pixel coordinates corresponding to the marker on the captured image of the camera.
[0102] Specifically, for example, when a user selects a tree in a surveillance zone as a landmark, an instruction encapsulated with the instruction content of "set tree A as a landmark" is triggered, and the instruction is uploaded to a camera that monitors the surveillance zone. After the camera receives the instruction, it determines tree A as the landmark of the surveillance zone according to the instruction content encapsulated in the instruction, and determines the first pixel coordinates [u, v] corresponding to the tree on the captured image of the camera.
[0103] Step B, determining the second pixel coordinates corresponding to the marker on the orthographic image of the monitoring warning area, wherein the orthographic image is formed by converting the image viewing angle of the captured image.
[0104] It should be noted that, in this embodiment, the front projection image is an image formed after the camera performs a front projection process on the captured image by converting the image viewing angle.
[0105] After determining the marker, the camera further determines a second pixel coordinate corresponding to the marker on the orthographic image formed after the captured image is processed by converting the image viewing angle.
[0106] Specifically, for example, after the camera determines that tree A is a landmark in the monitoring warning zone, it further determines the second pixel coordinates [x, y] corresponding to tree A on the orthographic image formed by converting the captured image into an image perspective.
[0107] Step C: determining a perspective transformation matrix according to the first pixel coordinates and the second pixel coordinates, and determining an image ratio of the orthographic image according to a preset calibration object in the monitoring warning area.
[0108] It should be noted that, in this embodiment, the perspective transformation matrix is a matrix that can convert the first pixel coordinates and the second pixel coordinates into each other; the preset calibration object is an object with a known actual length selected by the user, which is used as a standard to calibrate the actual distance within the monitoring warning area and the actual length of other objects.
[0109] After determining the first pixel coordinate and the second pixel coordinate of the marker, the camera obtains a matrix that can convert the first pixel coordinate and the second pixel coordinate to each other based on the first pixel coordinate corresponding to the marker in the captured image and the second pixel coordinate corresponding to the marker in the orthographic image after analysis and calculation; and, the user selects an object with a known actual length as a preset calibration object, and the camera determines the preset calibration object after receiving the user's selection instruction, and analyzes the proportional relationship between the pixel distance and the actual length based on the actual length of the preset calibration object and the pixel distance of the preset calibration object in the orthographic image, thereby obtaining the image ratio of the orthographic image.
[0110] Specifically, for example, after the camera determines that tree A is a landmark in the surveillance warning zone, the first pixel coordinates of tree A on the captured image of the camera are [u, v], and the second pixel coordinates of tree A on the orthographic image are [x = x' / w', y = y' / w']. Figure 6 The relationship shown in the following can be obtained Figure 7 The perspective transformation matrix Transform is shown.
[0111] Also, the user selects a stick B with an actual length L' of 3 meters as the preset calibration object, triggering an instruction encapsulated with the instruction content of "set stick B as the preset calibration object", and uploads the instruction to the camera monitoring the surveillance warning area. After receiving the instruction, the camera determines stick B as the preset calibration object according to the instruction content encapsulated in the instruction, and the pixel distance l' occupied by stick B in the orthographic image is 30 units. According to the formula: L'=K×l', it can be obtained that the image ratio K is 0.1.
[0112] Step S300: determining the driving speed of the motor vehicle according to the feature points to determine whether the motor vehicle is speeding.
[0113] After determining the feature point of the motor vehicle, the camera determines the pixel movement distance of the feature point between the two frames of projection images respectively captured from the video data based on the position change of the feature point of the motor vehicle on the two frames of projection images, and determines the driving speed of the motor vehicle based on the pixel movement distance and the capture time difference between the two frames of projection images.
[0114] Furthermore, if Figure 4 As shown in the detailed flow chart, in a feasible embodiment, in the above step S300, the step of determining the driving speed of the motor vehicle according to the feature point may include:
[0115] Step S301 : capturing a second preset image from the video data, wherein the capturing time of the second preset image is later than the capturing time of the first preset image.
[0116] It should be noted that, in the present embodiment, the second preset image is an image automatically captured by the camera in each video recording, and the capture time of the second preset image is later than the capture time of the first preset image. Specifically, the capture time of the second preset image is separated from the capture time of the first preset image by a specific number of frames. For example, the specific number of frames can be 2 frames, 3 frames, 4 frames or 5 frames, etc., and is not specifically limited here.
[0117] After the camera automatically captures a first preset image from the video data obtained by recording, it captures an image from the video data again after a specific number of frames as a second preset image.
[0118] Specifically, for example, the camera has automatically captured the image at the second second of the 8-second video obtained through the video buffer as the first preset image, and then captured another image after an interval of 5 frames in the video as the second preset image.
[0119] Step S302: Determine the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix.
[0120] After the camera captures the second preset image in the video data, the second preset image is converted into an orthographic image through a perspective transformation matrix, and the preset corner point tracking algorithm is used to determine the position of the feature point on the second preset image, thereby determining the pixel movement distance of the feature point according to the position of the feature point on the first preset image and the position of the feature point on the second preset image respectively.
[0121] Furthermore, in a feasible embodiment, before the above step S302, the following is further included:
[0122] Step S304: reducing the resolution of the second preset image.
[0123] It should be noted that, in this embodiment, the second preset image is processed to reduce the resolution by downsampling. The basic principle of downsampling is: for an image I of size M×N, the image I is downsampled s times, that is, a resolution image of size (M / s)×(N / s) is obtained, where s is a common divisor of M and N.
[0124] After the camera captures the second preset image from the video data, it performs a resolution reduction process on the second preset image through down sampling.
[0125] Further, in a feasible embodiment, the preset corner tracking algorithm includes an online optical flow estimation algorithm, and the above step S302 may include:
[0126] Step S3021, determining the pixel motion distance of the feature point using the online optical flow estimation algorithm according to the second preset image with reduced resolution and the perspective transformation matrix.
[0127] It should be noted that, in this embodiment, the basic principle of the online optical flow estimation algorithm is: respectively set an image pyramid for the first preset image and the second preset image. In this embodiment, the image pyramid is set to a three-layer image pyramid, the top layer is the maximum scale image, the bottom layer is the original image, and the image pyramid is a three-layer image pyramid. Figure 8 In the pyramid relationship shown in the figure, L is the number of layers, [x, y] is the coordinates of each pixel point, the position information of the feature point on the current layer is calculated from top to bottom, and the position information is substituted into the next layer relationship as the initial value to calculate, and finally the position of the feature point on the original image, that is, the second preset image without reducing the resolution is determined, and finally the pixel movement distance of the feature point is calculated according to the position information of the feature point in the first preset image and the position information of the second preset image.
[0128] After the camera reduces the resolution of the second preset image, it first determines the position range of the feature point in the second preset image after the resolution is reduced, then continuously narrows the position range of the feature point through the image pyramid, and finally accurately determines the position information of the feature point; and calculates the pixel movement distance of the feature point according to the position information of the feature point in the first preset image and the position information of the second preset image.
[0129] Specifically, for example, the camera first reduces the resolution of the original second preset image with a resolution of 50×50, and then determines the position range of the feature point in the second preset image after the resolution is reduced, that is, the resolution is 5×5, and then further reduces the position range of the feature point in the second preset image restored to a certain resolution, that is, the resolution is 25×25, and finally accurately determines the position information of the feature point in the original second preset image without resolution reduction processing, that is, the resolution of 50×50, and calculates the pixel movement distance of the feature point according to the position information of the feature point in the first preset image and the position information of the second preset image.
[0130] Step S303: determining the travel speed of the motor vehicle according to the pixel movement distance.
[0131] After determining the pixel movement distance of the feature point of the motor vehicle, the camera first determines the pixel movement distance of the feature point of the motor vehicle as the pixel movement distance of the motor vehicle, and then determines the driving speed of the motor vehicle based on the pixel movement distance of the motor vehicle and the image ratio determined according to the preset calibration object.
[0132] Furthermore, in a feasible embodiment, the above step S303 may include:
[0133] Step S3031: Determine the pixel movement distance of the feature point as the pixel movement distance of the motor vehicle.
[0134] Step S3032: determining the travel speed of the motor vehicle according to the pixel movement distance of the motor vehicle and the image ratio.
[0135] After the camera determines the pixel movement distance of the feature point as the pixel movement distance l' of the motor vehicle, it multiplies the pixel movement distance l' of the motor vehicle by the image ratio K to obtain the actual driving distance L' of the motor vehicle, and determines the driving speed V of the motor vehicle based on the interception time difference t between the first preset image and the second preset image.
[0136] Specifically, for example, the camera determines the pixel movement distance of the feature point of 50 units as the pixel movement distance of the motor vehicle l'=50, and multiplies the pixel movement distance of the motor vehicle l' by the image ratio K, K=0.1, then the actual driving distance of the motor vehicle L'=50×0.1=5 meters, and based on the interception time difference t=0.1 second between the first preset image and the second preset image, the driving speed of the motor vehicle V=5 / 0.1=50 meters / second is determined.
[0137] In this embodiment, a camera receives instructions from a user, determines a monitoring warning area on the road, and records the monitoring warning area to collect video data; the camera automatically captures a first preset image from the video data obtained through the recording, and uses a Harris corner detection algorithm to detect the first preset image, thereby determining feature points of a motor vehicle in the first preset image, and the number of the feature points is multiple; the camera determines a pixel movement distance of the feature point between two frames of projection images captured from the video data based on a position change of the feature point of the motor vehicle on the two frames of projection images captured from the front and back, and determines the driving speed of the motor vehicle based on the pixel movement distance and the capture time difference between the two frames of projection images.
[0138] The method for capturing speeding of a motor vehicle involved in the present invention can realize online analysis of the driving speed of the motor vehicle while the camera is recording the video, does not require support from other equipment, is simple to operate, requires little calculation and is low in cost, and ensures the real-time and robustness of the motor vehicle speed measurement under resource-constrained conditions.
[0139] Furthermore, based on the first embodiment of the method for capturing a speeding motor vehicle, a second embodiment of the method for capturing a speeding motor vehicle of the present invention is proposed.
[0140] In the second embodiment of the method for capturing speeding of a motor vehicle of the present invention, after the above step S302, the method further includes:
[0141] Step S305 : determining valid feature points using a robust statistical algorithm according to the movement direction of the feature points and the pixel movement distance.
[0142] After the camera determines the pixel movement distance of the feature point of the motor vehicle using a preset corner tracking algorithm, it then calculates the movement direction of the feature point and screens the feature point according to the movement direction, thereby retaining only the feature points whose angles with the driving line of the motor vehicle are within a specific angle range; then, the camera calculates the average pixel movement distance of the feature point, and further screens the above feature points according to the average pixel movement distance of the feature point, thereby retaining only the feature points whose difference with the average pixel distance of the feature point is within a specific distance range.
[0143] It should be noted that, in the present embodiment, the specific angle range may be an angle range of 0 to 5 degrees, 0 to 10 degrees or 0 to 20 degrees, etc., and no specific limitation is made herein; the specific distance range may be within 0.5 times the average pixel movement distance, within 0.6 times the average pixel movement distance or within 0.7 times the average pixel movement distance, and no specific limitation is made herein.
[0144] Specifically, for example, the camera is configured as shown in the attached Fig. 9 The relationship shown in the figure calculates the moving direction angle of each feature point, and the above feature points are screened according to the moving direction angle, and the feature points with an angle within 10 degrees with the driving line are retained; in addition, the camera is as shown in the attached figure. Fig.10 The relationship shown is used to calculate the average pixel distance dis of each feature point, and the above feature points are further screened according to the average pixel distance dis, and feature points whose difference with the average pixel distance is less than 0.5 times the average pixel distance are retained.
[0145] Furthermore, in a feasible embodiment, the above step S303 may include:
[0146] Step S3033: determine the average pixel movement distance of the effective feature points, and use the average pixel movement distance as the pixel movement distance of the motor vehicle.
[0147] After the camera screens and determines the valid feature points among the feature points, it further determines the average pixel movement distance of the valid feature points according to the pixel movement distance of the valid feature points, and uses the average pixel movement distance as the pixel movement distance of the motor vehicle.
[0148] Specifically, for example, the camera adds the pixel motion distances of each valid feature point to obtain the sum of the pixel motion distances of the valid feature points, and divides the sum of the pixel motion distances by the number of valid feature points to obtain the average pixel motion distance of the valid feature points as the pixel motion distance of the motor vehicle.
[0149] Step S3034: determining the travel speed of the motor vehicle according to the pixel movement distance of the motor vehicle and the image ratio.
[0150] After the camera determines the average pixel movement distance of the effective feature points as the pixel movement distance l" of the motor vehicle, it multiplies the pixel movement distance l" of the motor vehicle by the image ratio K to obtain the actual driving distance L" of the motor vehicle, and determines the driving speed V' of the motor vehicle based on the interception time difference t between the first preset image and the second preset image.
[0151] In this embodiment, the camera calculates the movement direction of each feature point, and the feature points are screened according to the movement direction, and only the feature points whose angles with the driving line of the motor vehicle are within a specific angle range are retained; in addition, the pixel movement distance of each feature point is calculated, and the feature points are further screened according to the pixel movement distance, and only the feature points whose differences with the average pixel distances of the feature points are within a specific distance range are retained; the camera determines the average pixel movement distance of the valid feature points according to the pixel movement distances of each valid feature point, and uses it as the pixel movement distance of the motor vehicle; after the camera determines the average pixel movement distance of the valid feature points as the pixel movement distance l" of the motor vehicle, it multiplies the pixel movement distance l" of the motor vehicle by the image ratio K to obtain the actual driving distance L" of the motor vehicle, and determines the driving speed V' of the motor vehicle according to the interception time difference t between the first preset image and the second preset image.
[0152] The second embodiment of the present invention achieves improved accuracy in determining the feature points and the pixel movement distances of the motor vehicles corresponding to the feature points by screening the feature points, thereby improving the accuracy of the calculation results of the driving speed of the motor vehicle.
[0153] Furthermore, based on the first embodiment of the method for capturing a speeding motor vehicle, a third embodiment of the method for capturing a speeding motor vehicle of the present invention is proposed.
[0154] In the third embodiment of the method for capturing speeding of a motor vehicle of the present invention, after the above step S300, the method further includes:
[0155] Step S400: If it is determined that the motor vehicle is speeding, the video data is saved and sent to a preset law enforcement agency at a preset time.
[0156] It should be noted that, in this embodiment, the preset time is a specific time for sending the recorded video set by the user according to actual needs, such as any time such as 19:00 on Monday, 13:00 on Tuesday or 07:00 on Wednesday, and no specific restrictions are made here; and, in this embodiment, the retention period of the recorded video is set to 30 days. If the time point when the motor vehicle speeds is close to the starting position or the ending position of the segmented recorded video, the previous segmented recorded video or the next segmented recorded video at the current time is correspondingly saved at the same time to ensure the integrity of the motor vehicle speeding record; the preset law enforcement agency is a public agency with relevant law enforcement powers.
[0157] After the camera determines the speed of the motor vehicle, if the speed of the motor vehicle exceeds the preset value range, the motor vehicle is judged to be speeding, and the corresponding video data of the motor vehicle speeding is saved, and the video data is sent to the preset law enforcement agency via the network at a preset time.
[0158] Specifically, for example, the camera determines that the speed of a motor vehicle is 50 meters per second, and the preset value range is less than 45 meters per second. The camera then determines that the motor vehicle is speeding, and saves the corresponding video recording of the motor vehicle speeding, and sends the video recording to the receiving address of the traffic police brigade via the network at 19:00 on Monday.
[0159] In this embodiment, the camera determines that the motor vehicle is speeding if the driving speed of the motor vehicle exceeds a preset value range, and saves the corresponding video data of the motor vehicle speeding, and sends the video data to the law enforcement agency through the network at a preset time.
[0160] It realizes the timely preservation of evidence of motor vehicle speeding and sends the evidence to law enforcement agencies for use in collecting evidence during traffic enforcement. At the same time, sending evidence at a preset time can avoid multiple cameras / related electronic equipment sending information to law enforcement agencies at the same time, thereby preventing network congestion or data loss, thereby ensuring the stability of the process of sending evidence to law enforcement agencies.
[0161] In addition, please refer to Figure 5 The embodiment of the present invention further provides a device for capturing a speeding vehicle. The device for capturing a speeding vehicle of the present invention comprises:
[0162] A collection module, used to determine a monitoring warning area and collect video data of the monitoring warning area;
[0163] A determination module, configured to capture a first preset image from the video data, and determine feature points of the motor vehicle in the first preset image using a Harris corner detection algorithm, wherein there are multiple feature points;
[0164] The analysis module is used to determine the driving speed of the motor vehicle according to the characteristic points to judge whether the motor vehicle is speeding.
[0165] Preferably, the acquisition module includes:
[0166] A first determination unit is used to determine a marker in the monitoring warning zone and a first pixel coordinate corresponding to the marker on the captured image of the monitoring warning zone, and to determine a second pixel coordinate corresponding to the marker on the orthographic image of the monitoring warning zone;
[0167] A conversion unit, used for converting the captured image into a front-projected image by converting the image viewing angle;
[0168] The second determining unit is used to determine a perspective transformation matrix according to the first pixel coordinates and the second pixel coordinates, and to determine an image ratio of the orthographic image according to a preset calibration object in the monitoring warning area.
[0169] Preferably, the analysis module comprises:
[0170] A capture unit, configured to capture a second preset image from the video data, wherein the capture time of the second preset image is later than the capture time of the first preset image;
[0171] The first calculation unit is used to determine the pixel movement distance of the feature point according to the second preset image and the perspective transformation matrix using a preset corner point tracking algorithm, and to determine the driving speed of the motor vehicle according to the pixel movement distance.
[0172] Preferably, the analysis module further includes:
[0173] The third determination unit is used to determine the pixel movement distance of the feature point as the pixel movement distance of the motor vehicle, and to determine the driving speed of the motor vehicle according to the pixel movement distance of the motor vehicle and the image ratio.
[0174] Preferably, the preset corner tracking algorithm includes an online optical flow estimation algorithm, and the analysis module according to the second preset image and the perspective transformation matrix further includes:
[0175] A reducing unit, configured to reduce the resolution of the second preset image;
[0176] The second calculation unit is used to determine the pixel movement distance of the feature point by using the online optical flow estimation algorithm according to the second preset image with reduced resolution and the perspective transformation matrix.
[0177] Preferably, the analysis module further includes:
[0178] a fourth determining unit, configured to determine a valid feature point using a robust statistical algorithm according to a movement direction of the feature point and a pixel movement distance;
[0179] The fifth determination unit is used to determine the average pixel movement distance of the effective feature points, and use the average pixel movement distance as the pixel movement distance of the motor vehicle, and determine the driving speed of the motor vehicle according to the pixel movement distance of the motor vehicle and the image ratio.
[0180] Preferably, the device for capturing speeding of a motor vehicle of the present invention further comprises:
[0181] The sending module is used to save the video data if the motor vehicle exceeds the speed limit, and send the video data to the law enforcement agency at a preset time.
[0182] In addition, an embodiment of the present invention further proposes a terminal device, which includes: a memory, a processor, and a motor vehicle speeding capture program stored in the memory and executable on the processor, wherein the motor vehicle speeding capture program, when executed by the processor, implements the steps of the motor vehicle speeding capture method as described above.
[0183] Among them, the steps implemented when the motor vehicle speeding capture program running on the processor is executed can refer to the various embodiments of the motor vehicle speeding capture method of the present invention, and will not be repeated here.
[0184] In addition, an embodiment of the present invention further proposes a storage medium, which is applied to a computer. The storage medium may be a non-volatile computer-readable storage medium, which stores a program for capturing a speeding motor vehicle. When the program for capturing a speeding motor vehicle is executed by a processor, the steps of the method for capturing a speeding motor vehicle as described above are implemented.
[0185] Among them, the steps implemented when the motor vehicle speeding capture program running on the processor is executed can refer to the various embodiments of the motor vehicle speeding capture method of the present invention, and will not be repeated here.
[0186] In addition, an embodiment of the present invention further proposes a computer program product, which includes a program for capturing a speeding motor vehicle. When the program for capturing a speeding motor vehicle is executed by a processor, the steps of the method for capturing a speeding motor vehicle are implemented as described above.
[0187] Among them, the steps implemented when the motor vehicle speeding capture program running on the processor is executed can refer to the various embodiments of the motor vehicle speeding capture method of the present invention, and will not be repeated here.
[0188] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0189] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0190] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0191] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for capturing speeding of a motor vehicle, characterized in that: The method for capturing speeding of a motor vehicle comprises: Determine a surveillance warning zone, and collect video data of the surveillance warning zone; intercepting a first preset image from the video data, and determining feature points of the motor vehicle in the first preset image using a Harris corner detection algorithm, wherein there are multiple feature points; Determining the driving speed of the motor vehicle according to the characteristic points to determine whether the motor vehicle is speeding; After the step of determining the monitoring warning area, the following steps are included: Determine a marker in the monitoring warning area and a first pixel coordinate corresponding to the marker on the captured image of the monitoring warning area; Determine a second pixel coordinate corresponding to the marker on the orthographic image of the monitoring warning area, wherein the orthographic image is formed by converting the image viewing angle of the captured image; Determining a perspective transformation matrix according to the first pixel coordinates and the second pixel coordinates, and determining an image ratio of the orthographic image according to a preset calibration object in the monitoring warning area; intercepting a second preset image from the video data, wherein the interception time of the second preset image is later than the interception time of the first preset image; Determine the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix; Determining the travel speed of the motor vehicle according to the pixel movement distance; Before the step of determining the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix, the method further includes: reducing the resolution of the second preset image; The preset corner tracking algorithm includes an online optical flow estimation algorithm. The step of determining the pixel motion distance of the feature point using the preset corner tracking algorithm according to the second preset image and the perspective transformation matrix includes: Determining the pixel motion distance of the feature point using the online optical flow estimation algorithm according to the second preset image with reduced resolution and the perspective transformation matrix; Determining the pixel movement distance of the feature point as the pixel movement distance of the motor vehicle; The driving speed of the motor vehicle is determined according to the pixel movement distance of the motor vehicle and the image ratio.
2. The method for capturing speeding of a motor vehicle as claimed in claim 1, characterized in that: After the step of determining the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix, the method further includes: Determine valid feature points using a robust statistical algorithm according to the movement direction of the feature points and the pixel movement distance; The step of determining the driving speed of the motor vehicle according to the pixel movement distance comprises: Determine an average pixel movement distance of the effective feature points, and use the average pixel movement distance as the pixel movement distance of the motor vehicle; The driving speed of the motor vehicle is determined according to the pixel movement distance of the motor vehicle and the image ratio.
3. The method for capturing speeding of a motor vehicle as claimed in claim 1, characterized in that: After the step of determining the driving speed of the motor vehicle according to the feature points to judge whether the motor vehicle is speeding, the method further includes: If it is determined that the motor vehicle is speeding, the video data is saved and sent to a preset law enforcement agency at a preset time.
4. A device for capturing speeding of a motor vehicle, characterized in that: The device for capturing speeding of a motor vehicle comprises: A collection module, used to determine a monitoring warning area and collect video data of the monitoring warning area; A determination module, configured to capture a first preset image from the video data, and determine feature points of the motor vehicle in the first preset image using a Harris corner detection algorithm, wherein there are multiple feature points; an analysis module, used to determine the driving speed of the motor vehicle according to the characteristic points to judge whether the motor vehicle is speeding; A calculation module, used for determining, after the step of determining a surveillance warning zone, a marker in the surveillance warning zone and a first pixel coordinate corresponding to the marker on the captured image of the surveillance warning zone; determining a second pixel coordinate corresponding to the marker on the orthographic image of the surveillance warning zone, wherein the orthographic image is formed by converting the image perspective of the captured image; determining a perspective transformation matrix according to the first pixel coordinates and the second pixel coordinates, and determining an image ratio of the orthographic image according to a preset calibration object in the surveillance warning zone; intercepting a second preset image in the video data, wherein the interception time of the second preset image is later than the interception time of the first preset image; and determining the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix; The driving speed of the motor vehicle is determined according to the pixel movement distance; before the step of determining the pixel movement distance of the feature point using a preset corner tracking algorithm according to the second preset image and the perspective transformation matrix, it also includes: reducing the resolution of the second preset image; the preset corner tracking algorithm includes an online optical flow estimation algorithm, and the step of determining the pixel movement distance of the feature point using the preset corner tracking algorithm according to the second preset image and the perspective transformation matrix includes: determining the pixel movement distance of the feature point using the online optical flow estimation algorithm according to the second preset image with reduced resolution and the perspective transformation matrix; determining the pixel movement distance of the feature point as the pixel movement distance of the motor vehicle; and determining the driving speed of the motor vehicle according to the pixel movement distance of the motor vehicle and the image ratio.
5. A terminal device, characterized in that: The terminal device includes: a memory, a processor, and a motor vehicle speeding capture program stored in the memory and executable on the processor. When the motor vehicle speeding capture program is executed by the processor, the steps of the motor vehicle speeding capture method as described in any one of claims 1 to 3 are implemented.
6. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for capturing speeding of a motor vehicle as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Method for measuring speed through vehicle road traffic videos based on image perspective projection transformation
CN102254318A
Moving vehicle speed measurement method based on target tracking and feature point matching
CN104050818A