A method, device and computer-readable storage medium for generating a trajectory map
By using the conversion relationship between the image coordinate system and the map coordinate system in the target tracking technology, the trajectory point sequence is converted to the map coordinate system, which solves the complex positioning problem in the existing technology and realizes simple and real-time trajectory map generation.
Patent Information
- Application Number
- CN202111617713.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-12-27
AI Technical Summary
When generating trajectory maps, the positioning technology is complex and it is difficult to achieve simple and real-time trajectory display.
By obtaining multi-frame snapped images of the preset geographical area, detecting the trajectory point sequence of the to-process target, and using the conversion relationship between the image coordinate system and the map coordinate system, converting the trajectory point sequence into the map coordinate system to generate motion trajectory information. The conversion relationship is determined based on the first length and the second length of the reference line.
Real-time display of the trajectory of the pending target on the map, and the complexity is reduced through simple transformation relationships, making it easy to achieve.
Smart Images

Figure CN114549582B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of target tracking technology, and in particular to a trajectory map generation method, device and computer-readable storage medium. Background Art
[0002] Object Tracking (OT) can be applied to scenarios such as intelligent monitoring systems, traffic control, pedestrian counting, and behavior analysis. The tracking results can be displayed on the map. For two-dimensional or three-dimensional maps, the human body frame obtained by object detection (OD) is often used to locate the target and draw the trajectory, but there is a problem that the positioning technology used is relatively complex. Summary of the invention
[0003] The present application provides a trajectory map generation method, device and computer-readable storage medium, which can display the trajectory points of the target to be processed on the map in real time and are simple to implement.
[0004] In order to solve the above technical problems, the technical solution adopted in the present application is: to provide a trajectory map generation method, the method comprising: obtaining a plurality of frames of captured images continuously collected for a preset geographical area; performing detection processing on the plurality of frames of captured images for a target to be processed, and determining a trajectory point sequence of the target to be processed; wherein the trajectory point sequence comprises image trajectory points of the target to be processed in each frame of captured images; utilizing the conversion relationship between the image coordinate system and the map coordinate system, converting the trajectory point sequence into the map coordinate system, and generating motion trajectory information of the target to be processed, wherein: the conversion relationship is determined based on a first length of each reference line and a second length of each reference line in the preset geographical area; the first length is determined based on the length of the corresponding reference line in the map coordinate system; the second length is determined based on the length of the corresponding reference line in the image coordinate system.
[0005] To solve the above technical problems, another technical solution adopted in the present application is: to provide a trajectory map generation device, which includes a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the trajectory map generation method in the above technical solution.
[0006] In order to solve the above technical problems, another technical solution adopted in the present application is: providing a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, it is used to implement the trajectory map generation method in the above technical solution.
[0007] Through the above scheme, the beneficial effects of the present application are: first, the length of each reference line of the preset geographical area in the image coordinate system is obtained to obtain a first length; at the same time, the length of each reference line of the preset geographical area in the map coordinate system is obtained to obtain a second length; then, based on the first length and the second length, a conversion relationship between the image coordinate system and the map coordinate system is established; then, multiple frames of captured images of the preset geographical area are obtained and target detection processing is performed to obtain trajectory points of the target to be processed in the captured images; then, the trajectory points are converted to the map coordinate system using a conversion relationship to generate motion trajectory information; since the image trajectory points are obtained in real time, the trajectory of the target to be processed can be displayed online in real time; moreover, the scheme of establishing a conversion relationship through the relationship between the first length and the second length is relatively simple, less complex, and easy to implement. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0009] Figure 1 It is a flowchart of an embodiment of a method for generating a trajectory map provided by the present application;
[0010] Figure 2 It is a flowchart of another embodiment of the trajectory map generation method provided by the present application;
[0011] Figure 3 It is a schematic diagram of the preset geographical area provided by this application;
[0012] Figure 4 is a schematic diagram of the basic image provided by this application;
[0013] Figure 5 It is a flowchart of establishing a conversion relationship provided by this application;
[0014] Figure 6 Yes Figure 4 The schematic diagram of the area D2 shown after adding the extended auxiliary line;
[0015] Figure 7 It is a structural schematic diagram of an embodiment of a trajectory map generating device provided by the present application;
[0016] Figure 8 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0017] The present application is further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present application, but are not intended to limit the scope of the present application. Similarly, the following examples are only some embodiments of the present application rather than all embodiments, and all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0018] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0019] It should be noted that the terms "first", "second" and "third" in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second" and "third" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0020] First, let’s introduce the technical terms involved in this application:
[0021] Target tracking: Perform face or body detection through target detection to obtain the corresponding features of the target, and determine the tracking target through feature matching.
[0022] Positioning technology: obtain the real position of the target in the map scene through coordinate conversion and other methods.
[0023] Trajectory smoothing: The discrete and messy trajectory is processed by algorithm to become a smooth, continuous and differentiable trajectory.
[0024] See also Figure 1 , Figure 1 : is a flow chart of an embodiment of a method for generating a trajectory map provided by the present application, the method comprising:
[0025] S11: Acquire multiple frames of captured images continuously collected for a preset geographical area.
[0026] The preset geographic area is an area pre-set according to application needs. It is an area that the user is concerned about and can be photographed by the camera device. The shape of the preset geographic area can be a rectangle or other shapes. The preset geographic area can be photographed by a camera device (such as a camera) to obtain a basic image.
[0027] Furthermore, a camera device is used to continuously shoot a preset geographical area to generate video data to be processed of the preset geographical area. The video data to be processed includes multiple frames of continuous captured images, and the captured images include a target to be processed. The target to be processed can be a person, other animals or objects.
[0028] S12: Perform detection processing on the target to be processed on the multiple frames of captured images to determine the trajectory point sequence of the target to be processed.
[0029] The trajectory point sequence includes the trajectory points of the target to be processed in each frame of the captured image (recorded as image trajectory points). For the captured image obtained, the target detection method in the relevant technology is used to detect and process the captured image to determine whether there is a target to be processed in the captured image, and the information of the target to be processed when there is a target to be processed, such as: location (i.e., image trajectory points) or type and other information.
[0030] S13: using the conversion relationship between the image coordinate system and the map coordinate system, the trajectory point sequence is converted into the map coordinate system to generate motion trajectory information of the target to be processed.
[0031] After obtaining the position of the target to be processed in the image coordinate system at each moment, the above-mentioned conversion relationship can be used to convert the currently generated image trajectory points to realize the conversion to the map coordinate system and display it in the map corresponding to the preset geographical area, generate the motion trajectory information of the target to be processed, and display the motion trajectory information on the map to obtain the trajectory map, which is a two-dimensional map. For example, assuming that the image trajectory point is denoted as F i (x i ,y i ), use formulas (1)-(3) to map it to the map coordinate system and get the map trajectory point F t i (i=1,2,…,N). It can be understood that the position of each image trajectory point on the map can also be displayed in real time, and each image trajectory point is converted to the map coordinate system after it is obtained; the trajectory map can include the action trajectories of all the targets to be processed, or each target to be processed corresponds to a trajectory map.
[0032] Furthermore, the conversion relationship is determined based on the first length of each reference line and the second length of each reference line in a preset geographic area; the first length is determined based on the length of the corresponding reference line in the map coordinate system; the second length is determined based on the length of the corresponding reference line in the image coordinate system.
[0033] In a specific embodiment, the conversion relationship is obtained in the following manner:
[0034] A basic image including a preset geographical area is acquired; the length of each reference line in the preset geographical area in the basic image is determined as the second length of each reference line; and the length of each reference line in the map coordinate system is determined as the first length of each reference line; based on the relationship between the first length of each reference line and the second length of each reference line, a conversion relationship between the image coordinate system and the map coordinate system is established.
[0035] This embodiment establishes a conversion relationship between an image coordinate system and a map coordinate system; obtains multiple frames of captured images of a preset geographical area and performs target detection processing to obtain image trajectory points of the target to be processed in the captured images; then uses the conversion relationship to convert the image trajectory points to the map coordinate system to generate a trajectory map; since the image trajectory points are obtained in real time, the trajectory of the target to be processed can be displayed online in real time; moreover, the solution of establishing the conversion relationship through the length of the reference line is relatively simple, less complex, and easy to implement.
[0036] See also Figure 2 , Figure 2 : is a flow chart of another embodiment of the trajectory map generation method provided by the present application, the method comprising:
[0037] S21: Establishing the conversion relationship between the image coordinate system and the map coordinate system.
[0038] The reference line of the preset geographic area is the edge of the preset geographic area, and the following scheme is used to construct the conversion relationship:
[0039] 1) Obtain the length of each reference line of the preset geographic area in the image coordinate system to obtain a length set.
[0040] In order to establish a mapping relationship between the image coordinate system and the map coordinate system, the preset geographic area and the basic image can be analyzed to determine the length of each reference line of the preset geographic area in the image coordinate system, and generate a length set. The length set includes multiple image lengths, and the image lengths correspond one-to-one to the reference lines of the preset geographic area.
[0041] 2) Based on the length and length set of the reference lines in the preset geographic area, the conversion relationship between the image coordinate system and the map coordinate system is established.
[0042] After obtaining the length set, the length of the reference line of the preset geographic area (recorded as the actual length) and the image length are processed to establish a corresponding relationship between the image coordinate system and the map coordinate system, forming a conversion relationship, so that the image coordinates can be converted into actual geographic coordinates using this conversion relationship to achieve coordinate conversion.
[0043] In a specific embodiment, under normal circumstances, the camera field of view may have distortion and need to be corrected. In this embodiment, the area of interest (i.e., a preset geographical area in the base image) can be manually selected for map mapping. The area of interest is generally the central area of the picture captured by the camera, and there is no distortion in this area or the distortion can be ignored.
[0044] like Figure 3 As shown, the preset geographical area (denoted as D1) is a rectangular area, the reference lines of the preset geographical area include a first reference line E1, a second reference line E2 and a third reference line E3, the first reference line E1 and the second reference line E2 are arranged opposite to each other, and the length set includes a first image length, a second image length and a first image width. The basic image captured by the camera device is as follows Figure 4 As shown in FIG. 1 , the preset geographical area in the basic image is denoted as D2. Specifically, Figure 5 The scheme shown is used to establish the mapping relationship between the image coordinate system and the map coordinate system, specifically including:
[0045] S31: Determine the length of the first reference line in the basic image as the first image length.
[0046] like Figure 3 and Figure 4 As shown, the length of the first reference line E1 in the basic image (denoted as the first image length) is a.
[0047] S32: Determine the length of the second reference line in the basic image as the second image length.
[0048] like Figure 3 and Figure 4 As shown, the length of the second reference line E2 in the basic image (denoted as the second image length) is c.
[0049] S33: Determine the length of the third reference line in the basic image as the first image width.
[0050] like Figure 3 and Figure 4 As shown, the length of the third reference line E3 in the basic image (recorded as the first image width) is h.
[0051] S34: Calculate the second image width based on the first image width, the first image length and the second image length.
[0052] for Figure 4 Add extended auxiliary lines to the preset geographic area shown in the figure to obtain Figure 6 ,pass Figure 3 and Figure 6 The length and width in the image can be used to calculate the width of the second image; specifically, the ratio of the first image width to the second image length is calculated to obtain a first value; the ratio of the first preset value to the second image length is calculated to obtain a second value; the ratio of the first preset value to the first image length is calculated to obtain a third value; the difference between the second value and the third value is calculated to obtain a fourth value; and then the ratio of the first value to the fourth value is calculated to obtain the second image width; wherein the first preset value may be 1, that is, the second image width is calculated using the following formula:
[0053] Formula (1)
[0054] Wherein, in formula (2), H1 is the width of the second image, a is the length of the first image, b=1 / [2*(ac)], and c is the length of the second image.
[0055] S35: Establishing a conversion relationship based on the second image width.
[0056] The trajectory point sequence includes multiple image trajectory points. The conversion relationship is the correspondence between the image trajectory points and the map trajectory points (i.e., the positions on the map corresponding to the image trajectory points). The image trajectory points include image horizontal coordinates and image vertical coordinates, and the map trajectory points include actual horizontal coordinates and actual vertical coordinates.
[0057] 1) The difference between the width of the second image and the image ordinate can be calculated to obtain the fifth value; the product of the fifth value, the length of the first reference line and the image abscissa can be calculated to obtain the sixth value; the product of the first image length and the second image width can be calculated to obtain the seventh value; and the ratio of the sixth value to the seventh value can be calculated to obtain the actual abscissa, that is, the actual abscissa can be calculated using the following formula:
[0058] Formula (2)
[0059] Wherein, in formula (2), x' is the actual horizontal coordinate, x is the image horizontal coordinate, y is the image vertical coordinate, and L is the length of the first reference line.
[0060] 2) Calculate the product of the second preset value and the image horizontal coordinate to obtain an eighth value; calculate the difference between the first image length and the eighth value to obtain a ninth value; calculate the product of the ninth value, the length of the third reference line, and the image vertical coordinate to obtain a tenth value; then calculate the ratio of the tenth value to the seventh value to obtain the actual vertical coordinate; wherein the second preset value may be 2, that is, the actual vertical coordinate is calculated using the following formula:
[0061] Formula (3)
[0062] Wherein, in formula (3), y' is the actual horizontal coordinate, and H is the length of the third reference line.
[0063] Through the above operations, the corresponding relationship between the map coordinate system and the image coordinate system can be established, and the coordinates in the camera can be mapped to the real map coordinate system, so as to construct a two-dimensional trajectory map.
[0064] S22: Acquire multiple frames of captured images continuously collected for a preset geographical area.
[0065] S22 is the same as S11 in the above embodiment and will not be described again.
[0066] S23: Perform target tracking processing on the captured image to obtain detection frame information of the target to be processed.
[0067] For the captured image, a target tracking method in related technology, such as Tracking Learning Detection (TLD) or optical flow method, is adopted to process the captured image to obtain a tracking result, which includes the identification (ID) of each target to be processed and the detection frame information of the target to be processed. The detection frame information is used to identify the position information of the target to be processed in the captured image. The target detection frame is a rectangular frame that frames the target to be processed, which is composed of an upper frame, a lower frame, a left frame and a right frame. The detection frame information may include the position of the upper left corner of the target detection frame, the length of the target detection frame and the width of the target detection frame, or the detection frame information includes the position of the upper left corner of the target detection frame and the position of the lower right corner of the target detection frame; or the target detection frame position includes the center position of the target detection frame, half of the length of the target detection frame and half of the width of the target detection frame.
[0068] In a specific embodiment, the detection frame information includes the length of the target detection frame and the width of the target detection frame; in the process of drawing the trajectory map, the target detection frame may be missing, resulting in a blank trajectory; therefore, it can be determined whether the detection frame information is obtained at the current moment; if the detection frame information is not obtained at the current moment, the image trajectory points at the current moment are generated based on the image trajectory points at the historical moments before the current moment.
[0069] Further, the time corresponding to the last image trajectory point is obtained to obtain the last moment; it is determined whether the time difference between the last moment and the current moment exceeds the preset time difference; if the time difference between the last moment and the current moment does not exceed the preset time difference, the image trajectory points of a preset number of historical moments are obtained; the image trajectory points of the preset number of historical moments are fitted to obtain a fitting curve, which is used to represent the corresponding relationship between the position and time of the image trajectory point; the current moment is input into the fitting curve to obtain the position of the image trajectory point at the current moment. For example, assuming that the trajectory of the target to be processed is a straight line, a linear fitting process is performed on n image trajectory points at historical moments to obtain a linear function f x (t) and f y (t), f x (t) is the function corresponding to the horizontal axis, f y (t) is the function corresponding to the ordinate; by substituting the current time into f x (t) and f y (t), the image trajectory point at the current moment can be predicted.
[0070] It can be understood that this embodiment only supplements the image trajectory points within the set time, that is, if the target detection frame cannot be obtained in a short time, the image trajectory points at the historical moment are used to predict the image trajectory points at the current moment, and displayed accordingly on the map; if the target detection frame cannot be obtained for a long time, it is considered that the target to be processed is lost, and no supplement will be made at this time. A reminder message can be generated to remind the user that the target to be processed is lost.
[0071] S24: Determine the image trajectory points of the target to be processed based on the detection frame information.
[0072] After obtaining the detection frame information, the midpoint of the lower border of the target detection frame can be directly used as the position of the target to be processed in the image coordinate system (i.e., the image trajectory point); or the midpoint of the set area can be used as the image trajectory point, and the set area is the area close to the lower border.
[0073] In another specific embodiment, since the generated target detection frame may have errors, resulting in jitter in the track points, in order to obtain more accurate map track points, image track points may be generated based on a certain position of the target detection frame (e.g., a position with a relatively high credibility), for example, the following scheme is adopted:
[0074] 1) Calculate the ratio of the width of the target detection box to the length of the target detection box to get the current aspect ratio.
[0075] Assuming that the width of the target detection box is w and the length of the target detection box is d, the current aspect ratio is: w / d.
[0076] 2) Determine whether the current aspect ratio is less than a preset threshold.
[0077] The credibility of the target detection frame can be judged, that is, the size relationship between the current aspect ratio and a preset threshold is judged. The preset threshold is a value set in advance based on the application scenario or experience.
[0078] 3) If the current aspect ratio is less than the preset threshold, the image trajectory point is determined based on the lower border of the target detection box.
[0079] Assuming that the preset threshold is σ, when w / d<σ, it can be considered that the credibility of the border of the foot is relatively high. At this time, the midpoint of the lower border can be determined as the image trajectory point.
[0080] 4) If the current aspect ratio is greater than or equal to the preset threshold, the image trajectory point is determined based on the upper border of the target detection box and the preset range.
[0081] When the current aspect ratio is greater than or equal to the preset threshold, it is determined whether the current aspect ratio falls within the preset range; if the current aspect ratio falls within the preset range, an image trajectory point is generated based on the midpoint of the upper frame and the height of the target to be processed.
[0082] Furthermore, when the current width-to-length ratio falls within a preset range, the credibility of the border on top of the head is considered to be relatively high. At this time, the midpoint of the upper border can be taken to obtain a candidate position, and the vertical coordinate of the candidate position is subtracted from the height of the target to be processed to obtain the image trajectory point, so as to project the candidate position to the feet. The projection operation is used to translate the center of the border on top of the head to the center of the feet.
[0083] Through the above operations, the trajectory is stabilized and smoothed, the impact of target detection frame jitter is reduced, and the trajectory accuracy is improved.
[0084] In other specific embodiments, the following schemes may be used to perform trajectory smoothing processing on the acquired image trajectory points:
[0085] 1) Use the Moving Average Models (MA) algorithm to process the image trajectory points to filter the random noise in the discrete trajectory, that is, use the formula for calculation:
[0086] Formula (4)
[0087] Among them, N is the preset parameter value, F i is the i-th image trajectory point, i ≥ N, and the following formula can be obtained from formula (4):
[0088] Formula (5)
[0089] 2) Use the cubic spline curve function to fit multiple image trajectory points. The formula is as follows:
[0090] Formula (6)
[0091] Among them, in formula (6), 0≤t≤1, by inputting the current time into formula (6), the smoothed image trajectory point can be obtained.
[0092] Since the existence of human body occlusion will cause the target detection frame to be unstable or inaccurate, which will lead to unstable or even incorrect trajectories on the map, the above-mentioned trajectory smoothing scheme is adopted to rationally process the dense image trajectory points. The MA algorithm is first used to filter the random noise errors in the discrete trajectory, and then the trajectory is drawn using the cubic spline curve, so that the trajectory of the target to be processed in the final displayed trajectory map is smoother.
[0093] S25: using the conversion relationship between the image coordinate system and the map coordinate system, the trajectory point sequence is converted into the map coordinate system to generate motion trajectory information of the target to be processed.
[0094] S25 is the same as S13 in the above embodiment and will not be described in detail here.
[0095] In the case of obtaining the image trajectory points of the target to be processed in real time, the position of the target to be processed in the geographic space is obtained by mapping the obtained image trajectory points, and the trajectory of the target to be processed on the map is drawn based on the position, so as to realize the online real-time display of the trajectory of the target to be processed. Moreover, the unstable target detection frame can be repaired by the size relationship between the current width-to-length ratio and the preset threshold, so that the trajectory of the target to be processed will not be unstable or jittery due to the instability of the target detection result; the obtained image trajectory points can also be smoothed to generate a more stable trajectory; and a solution for repairing the trajectory of the target to be processed online is adopted. In the case where there is no target detection frame, the image trajectory points at the historical moment are used for fitting operations, and the image trajectory points at the current moment are predicted for supplementation, so as to generate a stable and smooth trajectory. In addition, this embodiment establishes a mapping relationship between the two coordinate systems through the side length of the preset map area under the image coordinates and the side length of the preset map area under the map coordinates, so as to achieve low complexity.
[0096] See also Figure 7 , Figure 7 It is a structural diagram of an embodiment of a trajectory map generating device provided in the present application. The trajectory map generating device 70 includes a memory 71 and a processor 72 connected to each other, wherein the memory 71 is used to store a computer program. When the computer program is executed by the processor 72, it is used to implement the trajectory map generating method in the above embodiment.
[0097] See also Figure 8 , Figure 8 It is a structural diagram of an embodiment of a computer-readable storage medium provided in the present application. The computer-readable storage medium 80 is used to store a computer program 81. When the computer program 81 is executed by the processor, it is used to implement the trajectory map generation method in the above embodiment.
[0098] The computer-readable storage medium 80 may be a server, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which may store program codes.
[0099] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0100] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0101] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0102] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A trajectory map generation method, characterized in that: The method comprises: Acquire multiple frames of captured images continuously collected for a preset geographical area; Performing detection processing on the multiple frames of captured images for the target to be processed, and determining a trajectory point sequence of the target to be processed; wherein the trajectory point sequence includes image trajectory points of the target to be processed in each frame of the captured images; By using the conversion relationship between the image coordinate system and the map coordinate system, the trajectory point sequence is converted into the map coordinate system to generate the motion trajectory information of the target to be processed, wherein: The conversion relationship is determined based on the first length of each reference line in the preset geographical area and the second length of each reference line; the first length is determined based on the length of the corresponding reference line in the map coordinate system; the second length is determined based on the length of the corresponding reference line in the image coordinate system; The preset geographical area is a rectangular area, the reference line of the preset geographical area is the side of the preset geographical area, the reference line of the preset geographical area includes a first reference line, a second reference line and a third reference line, the first reference line is arranged opposite to the second reference line and corresponds to the length of the preset geographical area, the third reference line corresponds to one of the widths of the preset geographical area, and the method for constructing the conversion relationship is: Acquiring a basic image including the preset geographical area; Determine the length of each reference line in the preset geographical area in the basic image as the second length of each reference line; and Determine the length of each reference line in the map coordinate system as the first length of each reference line; Based on the relationship between the first length of each reference line and the second length of each reference line, a conversion relationship between the image coordinate system and the map coordinate system is established; and the step of establishing the conversion relationship between the image coordinate system and the map coordinate system based on the relationship between the first length of each reference line and the second length of each reference line includes: Determine the length of the first reference line in the base image as the first image length; Determine the length of the second reference line in the base image as the second image length; Determine the length of the third reference line in the base image as the first image width; Calculating a ratio of the first image width to the second image length to obtain a first value; Calculating a ratio of a first preset value to a length of the second image to obtain a second value; Calculating a ratio of the first preset value to the first image length to obtain a third value; Calculate the difference between the second value and the third value to obtain a fourth value; Calculating a ratio of the first value to the fourth value to obtain the second image width; The conversion relationship is established based on the second image width.
2. The method for generating a trajectory map according to claim 1, characterized in that: The conversion relationship is a correspondence relationship between an image trajectory point and a map trajectory point, the image trajectory point includes an image horizontal coordinate and an image vertical coordinate, and the map trajectory point includes an actual horizontal coordinate and an actual vertical coordinate. The step of establishing the conversion relationship based on the second image width includes: Calculate the difference between the second image width and the image ordinate to obtain a fifth value; Calculate the product of the fifth value, the length of the first reference line, and the horizontal coordinate of the image to obtain a sixth value; Calculating the product of the first image length and the second image width to obtain a seventh value; Calculating the ratio of the sixth value to the seventh value to obtain the actual horizontal coordinate; Calculating the product of the second preset value and the horizontal coordinate of the image to obtain an eighth value; Calculating a difference between the first image length and the eighth value to obtain a ninth value; Calculate the product of the ninth value, the length of the third reference line, and the image ordinate to obtain a tenth value; The ratio of the tenth value to the seventh value is calculated to obtain the actual ordinate.
3. The method for generating a trajectory map according to claim 2, characterized in that: The step of performing detection processing on the multiple frames of captured images for the target to be processed and determining the trajectory point sequence of the target to be processed includes: Performing target tracking processing on the captured image to obtain detection frame information of the target to be processed; Based on the detection frame information, the image trajectory points of the target to be processed are determined.
4. The method for generating a trajectory map according to claim 3, characterized in that: The detection frame information includes the length of the target detection frame and the width of the target detection frame. The step of determining the image trajectory point of the target to be processed based on the detection frame information includes: Calculate the ratio of the width of the target detection frame to the length of the target detection frame to obtain a current width-to-length ratio; Determining whether the current width-to-length ratio is less than a preset threshold; If yes, determining the image trajectory point based on the lower border of the target detection frame; If not, the image trajectory point is determined based on the upper border of the target detection frame and a preset range.
5. The method for generating a trajectory map according to claim 4, characterized in that: The step of determining the image trajectory point based on the lower border of the target detection frame includes: Determine the midpoint of the lower border as the image trajectory point; The step of determining the image trajectory point based on the upper border of the target detection frame and the preset range includes: Determining whether the current aspect ratio falls within a preset range; If so, the image trajectory point is generated based on the midpoint of the upper frame and the height of the target to be processed.
6. The method for generating a trajectory map according to claim 3, characterized in that: Before the step of determining the image trajectory point of the target to be processed based on the detection frame information, the method includes: Determine whether the detection frame information is obtained at the current moment; If not, the image trajectory points at the current moment are generated based on the image trajectory points at the historical moments before the current moment.
7. The method for generating a trajectory map according to claim 6, characterized in that: The step of generating the image trajectory points at the current moment based on the image trajectory points at the historical moments before the current moment comprises: Get the time corresponding to the previous image trajectory point to get the previous time; Determine whether the time difference between the previous moment and the current moment exceeds a preset time difference; If not, then obtain the image trajectory points of a preset number of historical moments; Performing fitting processing on the image trajectory points of the preset number of historical moments to obtain a fitting curve, wherein the fitting curve is used to represent the corresponding relationship between the position and time of the image trajectory points; The current moment is input into the fitting curve to obtain the position of the image trajectory point at the current moment.
8. A trajectory map generating device, characterized in that: It comprises a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the trajectory map generation method according to any one of claims 1 to 7.
9. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, it is used to implement the trajectory map generation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Movement track display method and device
CN108257146A