Vehicle track smoothing method and system, electronic equipment and storage medium
By smoothing the pixel coordinates of the target detection box in the video stream and converting them into latitude and longitude coordinates, the problem of vehicle trajectory coordinate fluctuations is solved and the visual experience is improved.
Patent Information
- Application Number
- CN202410998709.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-07-24
AI Technical Summary
Due to the instability of the image detection frame, the vehicle trajectory fluctuates and instability after the GPS coordinate conversion, which affects the visual experience.
By obtaining the object detection box in the video stream, the original pixel coordinates of the target vehicle are extracted and smoothed, converted into latitude and longitude coordinates, divided into multiple unit groups with continuous acquisition time, calculate the latitude and longitude coordinates of the center point, and calculate the smoothing based on the preset formula. The target latitude and longitude coordinates are then generated to generate a smooth vehicle trajectory.
It reduces the occurrence of coordinate fluctuations, enhances the smoothing effect of vehicle driving trajectory, and improves the visual experience.
Smart Images

Figure CN119091396A_ABST
Abstract
Description
Background Art
[0002] With the rapid development of intelligent transportation, more and more visible light cameras are installed. After the video stream is detected and inferred by the deep learning algorithm, the pixel coordinates of targets such as vehicles or pedestrians on the image can be obtained. After algorithm mapping, the pixel coordinates of each target can be converted into GPS coordinates, which can be displayed in real time on the GIS platform or on the vehicle side, making it easier for users to be familiar with the status of surrounding vehicles, so that vehicles can avoid them in time during driving, creating favorable conditions for safe driving. Due to the instability of the image detection frame, there will generally be a certain amount of pixel noise fluctuations, and the GPS coordinates mapped by the algorithm will also show a certain amount of coordinate fluctuation instability when displayed on the map.
[0003] Therefore, it is urgent to provide a technical solution to solve the above problems. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a vehicle trajectory smoothing method, system, electronic device and storage medium.
[0005] In a first aspect, the present invention provides a vehicle trajectory smoothing method, the technical solution of the method is as follows:
[0006] Acquire a video stream containing a trajectory of a target vehicle, and extract a target detection frame of the target vehicle in each frame of the video stream;
[0007] The original pixel coordinates at the preset position in each target detection frame are converted into original longitude and latitude coordinates and smoothed to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate;
[0008] According to each target longitude and latitude information, a target movement trajectory of the target vehicle is generated.
[0009] The beneficial effects of a vehicle trajectory smoothing method of the present invention are as follows:
[0010] The method of the present invention can smooth the vehicle's driving trajectory, reduce the occurrence of coordinate fluctuations, and enhance the viewing experience.
[0011] Based on the above solution, a vehicle trajectory smoothing method of the present invention can also be improved as follows.
[0012] In an optional manner, the target longitude and latitude information includes: target longitude and latitude coordinates and a heading angle; and the step of smoothing all original longitude and latitude coordinates to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate includes:
[0013] Divide all the original longitude and latitude coordinates into a plurality of unit groups with continuous collection time, and calculate the longitude and latitude coordinates of the center point in each unit group; wherein the number of the original longitude and latitude coordinates in each unit group is the same and an odd number;
[0014] Based on the longitude and latitude coordinates of the center points of any two adjacent unit groups and each original longitude and latitude coordinate, calculate the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in the any two adjacent unit groups, and use the longitude and latitude coordinates of the center point of the first unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate before the midpoint of the first unit group, and use the longitude and latitude coordinates of the center point of the last unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate after the midpoint of the last unit group;
[0015] For any target longitude and latitude coordinates, the angle between the line connecting the target longitude and latitude coordinates and the next adjacent target longitude and latitude coordinates and the clockwise direction of due north is determined as the heading angle of the target longitude and latitude coordinates, until the heading angle of each target longitude and latitude coordinates is obtained.
[0016] In an optional manner, the step of calculating the longitude and latitude coordinates of the center point in any cell group includes:
[0017] The average value of each original longitude and latitude coordinate in any cell group is determined as the longitude and latitude coordinate of the center point in the cell group.
[0018] In an optional manner, based on the longitude and latitude coordinates of the center points in any two adjacent cell groups and each original longitude and latitude coordinate, the step of calculating the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front cell group and the midpoint of the rear cell group in the any two adjacent cell groups includes:
[0019] The longitude and latitude coordinates of the center point in any unit group are determined as the target longitude and latitude coordinates corresponding to the original longitude and latitude coordinates of the midpoint of the unit group, until the target longitude and latitude coordinates of the midpoint of each unit group are determined;
[0020] For each remaining original longitude and latitude coordinate in the any two adjacent unit groups, respectively calculate the target longitude and latitude coordinate corresponding to each remaining original longitude and latitude coordinate in the any two adjacent unit groups according to a preset formula;
[0021] Wherein, when i is the original longitude and latitude coordinates of the preceding unit group in any two adjacent unit groups, the preset formula is: pos[i]=centerPos[n]+K×(centerPos[n+1]-centerPos[n]) / A, When i is the original longitude and latitude coordinates of the latter unit group in any two adjacent unit groups, the preset formula is: pos[i]=centerPos[n-1]+K×(centerPos[n]-centerPos[n-1]) / A; A represents the number of original longitude and latitude coordinates in the unit group, i represents the i-th original longitude and latitude coordinates, n represents the unit group to which the i-th original longitude and latitude coordinates belong, pos[i] represents the target longitude and latitude coordinates corresponding to the i-th original longitude and latitude coordinates, centerPos[n] is the longitude and latitude coordinates of the center point of the n-th unit group, and centerPos[n+1] is the longitude and latitude coordinates of the center point of the n+1-th unit group. In an optional manner, the step of generating the target behavior trajectory of the target vehicle according to each target longitude and latitude information includes:
[0022] Send all target longitude and latitude information to the GIS platform to generate and display the target path of the target vehicle through the GIS platform; or, convert the target longitude and latitude coordinates in each target longitude and latitude information into target pixel coordinates, and generate the target path of the target vehicle based on all target pixel coordinates.
[0023] In a second aspect, the present invention provides a vehicle trajectory smoothing system, the technical solution of the system is as follows:
[0024] Including: acquisition module, processing module and generation module;
[0025] The acquisition module is used to: acquire a video stream containing a trajectory of a target vehicle, and extract a target detection frame of the target vehicle in each frame of the video stream;
[0026] The processing module is used to: convert the original pixel coordinates at the preset position in each target detection frame into original longitude and latitude coordinates and perform smoothing processing to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate;
[0027] The generating module is used to generate a target movement track of the target vehicle according to each target longitude and latitude information.
[0028] The beneficial effects of a vehicle trajectory smoothing system of the present invention are as follows:
[0029] The system of the present invention can smooth the vehicle's driving trajectory, reduce the occurrence of coordinate fluctuations, and enhance the viewing experience.
[0030] Based on the above solution, the vehicle trajectory smoothing system of the present invention can also be improved as follows.
[0031] In an optional manner, the target longitude and latitude information includes: target longitude and latitude coordinates and a heading angle; the step of smoothing all original longitude and latitude coordinates in the processing module to obtain target longitude and latitude information corresponding to each original longitude and latitude coordinate includes:
[0032] Divide all the original longitude and latitude coordinates into a plurality of unit groups with continuous collection time, and calculate the longitude and latitude coordinates of the center point in each unit group; wherein the number of the original longitude and latitude coordinates in each unit group is the same and an odd number;
[0033] Based on the longitude and latitude coordinates of the center points of any two adjacent unit groups and each original longitude and latitude coordinate, calculate the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in the any two adjacent unit groups, and use the longitude and latitude coordinates of the center point of the first unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate before the midpoint of the first unit group, and use the longitude and latitude coordinates of the center point of the last unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate after the midpoint of the last unit group;
[0034] For any target longitude and latitude coordinates, the angle between the line connecting the target longitude and latitude coordinates and the next adjacent target longitude and latitude coordinates and the clockwise direction of due north is determined as the heading angle of the target longitude and latitude coordinates, until the heading angle of each target longitude and latitude coordinates is obtained.
[0035] In an optional manner, the step of calculating the longitude and latitude coordinates of the center point in any cell group in the processing module includes:
[0036] The average value of each original longitude and latitude coordinate in any cell group is determined as the longitude and latitude coordinate of the center point in the cell group.
[0037] In a third aspect, a technical solution of an electronic device of the present invention is as follows:
[0038] The invention comprises a memory, a processor and a program stored in the memory and running on the processor. When the processor executes the program, the steps of the vehicle trajectory smoothing method of the present invention are implemented.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having the following technical solution:
[0040] Instructions are stored in the computer-readable storage medium. When the computer-readable storage medium reads the instructions, the computer-readable storage medium executes the steps of the vehicle trajectory smoothing method of the present invention.
[0041] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0043] Figure 1 A schematic diagram of a flow chart of an embodiment of a vehicle trajectory smoothing method of the present invention;
[0044] Figure 2 A comparison diagram of the detection box trajectory;
[0045] Figure 3 A schematic diagram of the structure of an embodiment of a vehicle trajectory smoothing system of the present invention;
[0046] Figure 4 The figure is a schematic structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION
[0047] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0048] Figure 1 A flow chart of an embodiment of a vehicle trajectory smoothing method provided by the present invention is shown, and the vehicle trajectory smoothing method can be executed by an electronic device such as a terminal device or a server. The terminal device can be any fixed or mobile terminal such as a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be a single server or a server cluster composed of multiple servers. Any electronic device can implement the vehicle trajectory smoothing method by calling computer-readable instructions stored in a memory through a processor. Figure 1 As shown, the following steps are included:
[0049] S1. Obtain a video stream containing a moving track of a target vehicle, and extract a target detection frame of the target vehicle in each frame of the video stream.
[0050] The video stream is captured by a road monitoring device (such as a road camera). The target vehicle is a vehicle that appears within the field of view of the road monitoring device, and each frame of the target vehicle from its appearance to its disappearance is extracted. The target detection frame of each frame of the video stream is extracted using the target detection model.
[0051] S2. Convert the original pixel coordinates at the preset position in each target detection frame into original longitude and latitude coordinates and perform smoothing to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate.
[0052] Among them, the preset position selects the center point of the bottom edge of the target detection frame by default, and can also be selected according to actual needs, and there is no restriction here. The process of converting the original pixel coordinates into longitude and latitude coordinates is a prior art and will not be described in detail here. The original longitude and latitude coordinates are the unsmoothed longitude and latitude coordinates, and the target longitude and latitude coordinates are the smoothed longitude and latitude coordinates. Each original longitude and latitude coordinate corresponds to a target longitude and latitude information, and the target longitude and latitude information includes: target longitude and latitude coordinates and heading angle.
[0053] S3. Generate a target movement trajectory of the target vehicle according to each target longitude and latitude information.
[0054] Specifically, all target longitude and latitude information are sent to the GIS platform, so as to generate and display the target path of the target vehicle through the GIS platform. Alternatively, the target longitude and latitude coordinates in each target longitude and latitude information are converted into target pixel coordinates, and the target path of the target vehicle is generated according to all target pixel coordinates.
[0055] Among them, the GIS platform is used to display the vehicle's trajectory and current status in real time. The process of inversely transforming longitude and latitude coordinates into pixel coordinates is an existing technology and will not be elaborated here. Figure 2 As shown in Figure 1, the detection frame trajectory formed by the original pixel coordinates fluctuates significantly, while the detection frame trajectory formed by the target pixel coordinates is relatively smooth.
[0056] In an optional manner, the step of smoothing all original longitude and latitude coordinates to obtain target longitude and latitude information corresponding to each original longitude and latitude coordinate includes:
[0057] All original longitude and latitude coordinates are divided into multiple unit groups with continuous collection time, and the longitude and latitude coordinates of the center point in each unit group are calculated.
[0058] The number of original longitude and latitude coordinates in each unit group is the same and an odd number. The number of original longitude and latitude coordinates is usually 5, 7, 9, etc., and the number of original longitude and latitude coordinates in this embodiment is 5 as an example.
[0059] Based on the longitude and latitude coordinates of the center points in any two adjacent unit groups and each original longitude and latitude coordinate, calculate the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in the any two adjacent unit groups, and use the longitude and latitude coordinates of the center point of the first unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate before the midpoint of the first unit group, and use the longitude and latitude coordinates of the center point of the last unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate after the midpoint of the last unit group.
[0060] Specifically:
[0061] 1) The step of calculating the longitude and latitude coordinates of the center point in any cell group comprises:
[0062] The average value of each original longitude and latitude coordinate in any cell group is determined as the longitude and latitude coordinate of the center point in the cell group.
[0063] 2) Based on the longitude and latitude coordinates of the center points in any two adjacent unit groups and each original longitude and latitude coordinate, the step of calculating the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in the any two adjacent unit groups comprises:
[0064] The longitude and latitude coordinates of the center point in any unit group are determined as the target longitude and latitude coordinates corresponding to the original longitude and latitude coordinates of the midpoint of the unit group, until the target longitude and latitude coordinates of the midpoint of each unit group are determined.
[0065] For each remaining original longitude and latitude coordinate in the arbitrary two adjacent unit groups, the target longitude and latitude coordinates corresponding to each remaining original longitude and latitude coordinate in the arbitrary two adjacent unit groups are calculated respectively according to a preset formula.
[0066] Wherein, when i is the original longitude and latitude coordinates of the preceding unit group in any two adjacent unit groups, the preset formula is: pos[i]=centerPos[n]+K×(centerPos[n+1]-centerPos[n]) / A, When i is the original longitude and latitude coordinates of the latter unit group in any two adjacent unit groups, the preset formula is: pos[i]=centerPos[n-1]+K×(centerPos[n]-centerPos[n-1]) / A; A represents the number of original longitude and latitude coordinates in the cell group, i represents the i-th original longitude and latitude coordinates, n represents the cell group to which the i-th original longitude and latitude coordinates belong, pos[i] represents the target longitude and latitude coordinates corresponding to the i-th original longitude and latitude coordinates, centerPos[n] is the longitude and latitude coordinates of the center point of the n-th cell group, and centerPos[n+1] is the longitude and latitude coordinates of the center point of the n+1-th cell group.
[0067] For any target longitude and latitude coordinates, the angle between the line connecting the target longitude and latitude coordinates and the next adjacent target longitude and latitude coordinates and the clockwise direction of due north is determined as the heading angle of the target longitude and latitude coordinates, until the heading angle of each target longitude and latitude coordinates is obtained.
[0068] It should be noted that when the light is red, the vehicle stops near the zebra crossing. Due to the jitter of the detection frame, the twinned vehicle target will jitter when displayed on the map. For the coordinate optimization of the stationary vehicle, the process is: when n≥4, m=3, when the straight-line distance between centerPos[n] and centerPos[nm] is less than distance, centerPos[n] directly uses the pixel coordinates of centerPos[nm], which can significantly reduce the jitter phenomenon. According to the characteristics of the scene, it supports flexible configuration of the parameters m and distance.
[0069] It should be noted that data smoothing requires a certain amount of data caching. After acquiring 7 frames of images (7 original pixel coordinates) in succession, pos[1] is output in the 8th frame, pos[2] is output in the 9th frame, and so on. This can maintain the continuity of the intermediate transmission while taking into account real-time performance. At the same time, the coordinates are displayed relatively smoothly on the GIS platform.
[0070] The technical solution of this embodiment can smooth the vehicle's driving trajectory, reduce the occurrence of coordinate fluctuations, and enhance the viewing experience.
[0071] Figure 3 FIG. 2 is a schematic diagram showing a structure of an embodiment of a vehicle trajectory smoothing system 200 provided by the present invention. Figure 3 As shown, the system 200 includes: an acquisition module 210, a processing module 220 and a generation module 230;
[0072] The acquisition module 210 is used to: acquire a video stream containing a trajectory of a target vehicle, and extract a target detection frame of the target vehicle in each frame of the video stream;
[0073] The processing module 220 is used to: convert the original pixel coordinates at the preset position in each target detection frame into original longitude and latitude coordinates and perform smoothing processing to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate;
[0074] The generating module 230 is used to generate a target movement trajectory of the target vehicle according to each target longitude and latitude information.
[0075] In an optional manner, the target longitude and latitude information includes: target longitude and latitude coordinates and heading angle; the step of smoothing all original longitude and latitude coordinates in the processing module 220 to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate includes:
[0076] Divide all the original longitude and latitude coordinates into a plurality of unit groups with continuous collection time, and calculate the longitude and latitude coordinates of the center point in each unit group; wherein the number of the original longitude and latitude coordinates in each unit group is the same and an odd number;
[0077] Based on the longitude and latitude coordinates of the center points of any two adjacent unit groups and each original longitude and latitude coordinate, calculate the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in the any two adjacent unit groups, and use the longitude and latitude coordinates of the center point of the first unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate before the midpoint of the first unit group, and use the longitude and latitude coordinates of the center point of the last unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate after the midpoint of the last unit group;
[0078] For any target longitude and latitude coordinates, the angle between the line connecting the target longitude and latitude coordinates and the next adjacent target longitude and latitude coordinates and the clockwise direction of due north is determined as the heading angle of the target longitude and latitude coordinates, until the heading angle of each target longitude and latitude coordinates is obtained.
[0079] In an optional manner, the step of calculating the longitude and latitude coordinates of the center point in any cell group in the processing module 220 includes:
[0080] The average value of each original longitude and latitude coordinate in any cell group is determined as the longitude and latitude coordinate of the center point in the cell group.
[0081] In an optional manner, the step of calculating the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in any two adjacent unit groups in the processing module 220 based on the longitude and latitude coordinates of the center points in any two adjacent unit groups and each original longitude and latitude coordinate includes:
[0082] The longitude and latitude coordinates of the center point in any unit group are determined as the target longitude and latitude coordinates corresponding to the original longitude and latitude coordinates of the midpoint of the unit group, until the target longitude and latitude coordinates of the midpoint of each unit group are determined;
[0083] For each remaining original longitude and latitude coordinate in the any two adjacent unit groups, respectively calculate the target longitude and latitude coordinate corresponding to each remaining original longitude and latitude coordinate in the any two adjacent unit groups according to a preset formula;
[0084] Wherein, when i is the original longitude and latitude coordinates of the preceding unit group in any two adjacent unit groups, the preset formula is: pos[i]=centerPos[n]+K×(centerPos[n+1]-centerPos[n]) / A, When i is the original longitude and latitude coordinates of the latter unit group in any two adjacent unit groups, the preset formula is: pos[i]=centerPos[n-1]+K×(centerPos[n]-centerPos[n-1]) / A; A represents the number of original longitude and latitude coordinates in the cell group, i represents the i-th original longitude and latitude coordinates, n represents the cell group to which the i-th original longitude and latitude coordinates belong, pos[i] represents the target longitude and latitude coordinates corresponding to the i-th original longitude and latitude coordinates, centerPos[n] is the longitude and latitude coordinates of the center point of the n-th cell group, and centerPos[n+1] is the longitude and latitude coordinates of the center point of the n+1-th cell group. In an optional manner, the generation module 230 is specifically used to:
[0085] Send all target longitude and latitude information to the GIS platform to generate and display the target path of the target vehicle through the GIS platform; or, convert the target longitude and latitude coordinates in each target longitude and latitude information into target pixel coordinates, and generate the target path of the target vehicle based on all target pixel coordinates.
[0086] The technical solution of this embodiment can smooth the vehicle's driving trajectory, reduce the occurrence of coordinate fluctuations, and enhance the viewing experience.
[0087] The above parameters and steps for each module to implement corresponding functions in the vehicle trajectory smoothing system 200 of this embodiment can refer to the parameters and steps in the embodiment of the vehicle trajectory smoothing method above, and will not be repeated here.
[0088] like Figure 4 As shown, an electronic device 300 according to an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the electronic device 300 implements any of the above-mentioned vehicle trajectory smoothing methods, specifically:
[0089] The electronic device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the electronic device 300 implements any vehicle trajectory smoothing method provided in the above embodiments. Of course, the electronic device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the electronic device 300 may also include other components for implementing device functions, which will not be described in detail here.
[0090] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements any of the above-mentioned vehicle trajectory smoothing methods.
[0091] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0092] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs any of the above-mentioned vehicle trajectory smoothing methods.
[0093] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.
[0094] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0095] Any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0096] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A vehicle trajectory smoothing method, It is characterized in that include: Acquire a video stream containing a trajectory of a target vehicle, and extract a target detection frame of the target vehicle in each frame of the video stream; The original pixel coordinates at the preset position in each target detection frame are converted into original longitude and latitude coordinates and smoothed to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate; According to each target longitude and latitude information, a target movement trajectory of the target vehicle is generated.
2. The vehicle trajectory smoothing method according to claim 1, It is characterized in that The target longitude and latitude information includes: target longitude and latitude coordinates and heading angle; the step of smoothing all original longitude and latitude coordinates to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate includes: Divide all the original longitude and latitude coordinates into a plurality of unit groups with continuous collection time, and calculate the longitude and latitude coordinates of the center point in each unit group; wherein the number of the original longitude and latitude coordinates in each unit group is the same and an odd number; Based on the longitude and latitude coordinates of the center points of any two adjacent unit groups and each original longitude and latitude coordinate, calculate the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in the any two adjacent unit groups, and use the longitude and latitude coordinates of the center point of the first unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate before the midpoint of the first unit group, and use the longitude and latitude coordinates of the center point of the last unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate after the midpoint of the last unit group; For any target longitude and latitude coordinates, the angle between the line connecting the target longitude and latitude coordinates and the next adjacent target longitude and latitude coordinates and the clockwise direction of due north is determined as the heading angle of the target longitude and latitude coordinates, until the heading angle of each target longitude and latitude coordinates is obtained.
3. The vehicle trajectory smoothing method according to claim 2, It is characterized in that The steps for calculating the longitude and latitude coordinates of the center point in any cell group include: The average value of each original longitude and latitude coordinate in any cell group is determined as the longitude and latitude coordinate of the center point in the cell group.
4. The vehicle trajectory smoothing method according to claim 2, It is characterized in that The step of calculating the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in any two adjacent unit groups based on the longitude and latitude coordinates of the center points in any two adjacent unit groups and each original longitude and latitude coordinate comprises: The longitude and latitude coordinates of the center point in any unit group are determined as the target longitude and latitude coordinates corresponding to the original longitude and latitude coordinates of the midpoint of the unit group, until the target longitude and latitude coordinates of the midpoint of each unit group are determined; For each remaining original longitude and latitude coordinate in the any two adjacent unit groups, respectively calculate the target longitude and latitude coordinate corresponding to each remaining original longitude and latitude coordinate in the any two adjacent unit groups according to a preset formula; Wherein, when i is the original longitude and latitude coordinates of the preceding unit group in any two adjacent unit groups, the preset formula is: pos[i]=centerPos[n]+K×(centerPos[n+1]-centerPos[n]) / A, When i is the original longitude and latitude coordinates of the latter unit group in any two adjacent unit groups, the preset formula is: pos[i]=centerPos[n-1]+K×(centerPos[n]-centerPos[n-1]) / A; A represents the number of original longitude and latitude coordinates in the cell group, i represents the i-th original longitude and latitude coordinates, n represents the cell group to which the i-th original longitude and latitude coordinates belong, pos[i] represents the target longitude and latitude coordinates corresponding to the i-th original longitude and latitude coordinates, centerPos[n] is the longitude and latitude coordinates of the center point of the n-th cell group, and centerPos[n+1] is the longitude and latitude coordinates of the center point of the n+1-th cell group.
5. The vehicle trajectory smoothing method according to any one of claims 2 to 4, It is characterized in that The step of generating a target path of the target vehicle according to each target longitude and latitude information includes: Send all target longitude and latitude information to the GIS platform to generate and display the target path of the target vehicle through the GIS platform; or, convert the target longitude and latitude coordinates in each target longitude and latitude information into target pixel coordinates, and generate the target path of the target vehicle based on all target pixel coordinates.
6. A vehicle trajectory smoothing system, It is characterized in that include: Acquisition module, processing module and generation module; The acquisition module is used to: acquire a video stream containing a trajectory of a target vehicle, and extract a target detection frame of the target vehicle in each frame of the video stream; The processing module is used to: convert the original pixel coordinates at the preset position in each target detection frame into original longitude and latitude coordinates and perform smoothing processing to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate; The generating module is used to generate a target movement track of the target vehicle according to each target longitude and latitude information.
7. The vehicle trajectory smoothing system according to claim 6, It is characterized in that The target longitude and latitude information includes: target longitude and latitude coordinates and heading angle; the step of smoothing all original longitude and latitude coordinates in the processing module to obtain the target longitude and latitude information corresponding to each original longitude and latitude coordinate includes: Divide all the original longitude and latitude coordinates into a plurality of unit groups with continuous collection time, and calculate the longitude and latitude coordinates of the center point in each unit group; wherein the number of the original longitude and latitude coordinates in each unit group is the same and an odd number; Based on the longitude and latitude coordinates of the center points of any two adjacent unit groups and each original longitude and latitude coordinate, calculate the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate between the midpoint of the front unit group and the midpoint of the rear unit group in the any two adjacent unit groups, and use the longitude and latitude coordinates of the center point of the first unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate before the midpoint of the first unit group, and use the longitude and latitude coordinates of the center point of the last unit group as the target longitude and latitude coordinates corresponding to each original longitude and latitude coordinate after the midpoint of the last unit group; For any target longitude and latitude coordinates, the angle between the line connecting the target longitude and latitude coordinates and the next adjacent target longitude and latitude coordinates and the clockwise direction of due north is determined as the heading angle of the target longitude and latitude coordinates, until the heading angle of each target longitude and latitude coordinates is obtained.
8. The vehicle trajectory smoothing system according to claim 7, It is characterized in that The step of calculating the longitude and latitude coordinates of the center point in any cell group in the processing module includes: The average value of each original longitude and latitude coordinate in any cell group is determined as the longitude and latitude coordinate of the center point in the cell group.
9. An electronic device, It is characterized in that The electronic device includes a processor, the processor is coupled to a memory, at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the vehicle trajectory smoothing method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that the computer-readable storage medium implements the vehicle trajectory smoothing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Smooth processing-oriented numerical control processing track processing method
CN103676788A
High-precision vehicle trajectory data extraction method capable of overcoming shooting disturbance of unmanned aerial vehicle
CN113421289A
Vehicle track and course angle extraction method based on high-altitude unmanned aerial vehicle video
CN114972767A
Multi-target tracking method and device based on multi-frame input and trajectory smoothing
CN114998999A
Method for tracking tire motion tracks
CN115479787A
