A trajectory simulation and dataset construction method and system for a flying target
Patent Information
- Application Number
- CN202611183784.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]然而,上述现有方案在更广泛的飞行目标轨迹仿真应用中仍存在显著局限
[0025]与现有技术相比,本发明及其优选方案同时兼容可见光和红外场景及各种飞行目标素材,能够广泛适用于深度学习目标检测系统的通用数据构建;通过引入物理向像素转化模型、空间深度平滑缩放随机游走以及姿态微扰截断算法,仿真生成的飞行目标轨迹、尺寸渐变及空中摆动姿态高度契合现实透视规律,保证了数据集的真实性;建立了基于逆变换矩阵的动态交互遮挡剔除机制,支持用户在数据流生成过程中通过界面动态绘制遮挡区域,实时过滤不符合客观现实的废标区域目标,显著提高了数据集构建的效率和纯净度;实现了图像、标注标签和视频数据的一体化自动输出,消除了多工具协同带来的数据一致性风险,显著提升了数据集构建的自动化程度和工程应用价值。
Smart Images

Figure CN123015600A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing and simulation data generation technology, specifically relating to a method and system for simulating the trajectory of a flight target and constructing a dataset. Background Technology
[0002] In research on deep learning-based target detection and tracking algorithms for aerial targets such as drones, high-quality, multi-scenario labeled training datasets are crucial for determining the model's detection accuracy and generalization ability. However, the collection and labeling of flight target data in real-world scenarios faces numerous challenges. On the one hand, due to objective constraints such as aircraft application and approval, site control, and weather conditions, acquiring large-scale real-world footage is extremely difficult and costly. On the other hand, manually labeling target bounding boxes in frame-by-frame images requires significant manpower, and labeling consistency is difficult to guarantee. Manual labeling errors are particularly pronounced in complex scenarios such as small targets, rapid movement, or partial occlusion, resulting in a severe shortage of high-quality datasets.
[0003] To address the challenges of data acquisition, simulation dataset generation technology has been widely explored. Several existing technologies have developed methods for generating labeled training datasets in batches using simulation. For example, Chinese Patent CN120318626B discloses a method for creating an infrared sequence multi-target dataset. This method, geared towards infrared small target detection, divides a large infrared background image into several sub-images, creates point-like and spot-like simulated targets, and fuses them into the sub-images. Then, based on a composite motion trajectory equation and a viewpoint switching and motion state inheritance mechanism, it simulates the motion state of multiple targets, generating an infrared sequence multi-target dataset. Another Chinese Patent CN114419146B discloses a method and system for generating multi-source optical samples. This method constructs simulation scenes corresponding to various optical types, such as visible light, infrared, and dynamic vision, based on input parameters. It generates optical images and their annotation information within the corresponding simulation scenes and outputs the optical images and annotation information as batch optical samples.
[0004] However, the existing solutions mentioned above still have significant limitations in broader applications of flight target trajectory simulation. First, existing motion simulations are mostly based on predefined trajectory equations or random walks, lacking correlation modeling between the trajectory and the target's visual scale and attitude. They also fail to consider the gradual changes in visual size caused by the target's depth motion and the attitude sway caused by airflow disturbances, resulting in trajectories that differ from real flight patterns. Second, most systems use offline batch processing, making the generation process invisible to the user. Users cannot observe the simulation effects in real time or dynamically intervene in the simulation process. More importantly, in real-world scenarios, obstructions such as buildings, mountains, and trees affect target visibility. Existing solutions, including those mentioned in the two papers, do not include a mechanism for user-defined obstruction areas during simulation and for removing targets falling into these areas. This easily leads to erroneous labeled samples, such as targets passing through buildings, which do not conform to realistic logic. Furthermore, while some solutions can generate annotation information simultaneously, the integrated organization of multiple output data types, such as images, annotations, and videos, still relies on multiple software tools working together, making the process cumbersome and prone to human error.
[0005] Therefore, there is an urgent need for a flight target dataset construction scheme that can perform trajectory simulation based on physical laws, support dynamic interactive occlusion control, and automatically generate standardized training datasets. Summary of the Invention
[0006] To address the shortcomings and deficiencies of existing flight target simulation dataset construction schemes, such as the lack of physical quantity coupling modeling in motion simulation, the inability to observe and intervene in the generation process in real time, the lack of interactive occlusion region definition and target removal mechanisms, and the reliance on multiple tools for data output, this invention provides a method and system for flight target trajectory simulation and dataset construction. It can perform trajectory simulation based on physical laws, support dynamic interactive occlusion control, and automatically generate standardized training datasets, ensuring the purity and labeling consistency of the dataset from the source.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0008] A method for simulating the trajectory of a flight target and constructing a dataset includes the following steps:
[0009] The configuration information includes a simulation background image, a flight target material image, and motion parameters; wherein, the motion parameters include flight target physical motion characteristic parameters, motion mode parameters, and data export configuration parameters, and the simulation background image is a visible light image or an infrared image.
[0010] The kinematics of the flight target are solved based on the motion parameters, and the position, spatial scaling ratio and attitude angle of the target in the original image coordinate system are updated. Through modeling based on physical quantities, the displacement, scale changes and attitude changes of the target are correlated with their true motion laws, which is different from the random deployment method.
[0011] The background image and the flying target are rendered in real time. The view state parameters required for the inverse transformation matrix between the screen coordinates and the original image coordinates are dynamically calibrated, and the inverse transformation matrix is updated in real time as the view state changes. Since the view supports zoom and pan operations, the mapping relationship between the screen coordinates and the original image coordinates changes with the view state. The accuracy of coordinate mapping in any view state can be guaranteed by the dynamic calibration of the inverse transformation matrix.
[0012] The system captures user interactions when drawing occluded areas on the graphical user interface. The occluded areas in the screen coordinate system are then transformed to the original image coordinate system using the inverse transformation matrix and added to the global occluded area set. Maintaining the occluded areas in the original image coordinate system ensures that they are not affected by subsequent view scaling or translation operations, thus maintaining the stability of their spatial position.
[0013] In each simulation cycle, the position of each flying target is determined in the original image coordinate system to see if it falls into any occlusion region in the global occlusion region set, and the visibility state of each target is updated. The determination of each flying target is independent of each other, and each flying target has its own visibility state, thereby supporting real-time processing in multi-target concurrent scenarios.
[0014] The visibility state is used as a unified criterion for rendering and annotation. Occluded targets are synchronously removed in both the rendering and annotation output stages. The same state bit is used to control two pipelines simultaneously, which ensures the consistency between the rendering result and the annotation content from a mechanism perspective, and avoids the problem of state asynchrony caused by separate processing.
[0015] The bounding box position information of the visible target is associated with the single-frame image data to output a standardized training dataset; the standardized training dataset includes clean serialized image files, text annotation files and simulation scene videos.
[0016] Furthermore, the view state parameters include a view scaling factor, a view translation amount, an adaptive rendering centering offset, and an image physical scaling ratio. The view scaling factor is multiplied or divided by a fixed factor when the scroll wheel zoom event is triggered, and is constrained within a preset boundary range to avoid excessive scaling of the interface; as a preferred implementation, the fixed factor is 1.1, and the preset boundary range is [0.2, 5.0]. The view translation amount is updated in a linked manner with the current mouse screen coordinates as a fixed anchor point, ensuring that the original image position pointed to by the mouse remains unchanged on the screen before and after scaling. The adaptive rendering centering offset is dynamically calculated based on the comparison result of the window aspect ratio and the background image aspect ratio, so that the background image is displayed proportionally in the center of the window, ensuring that the background image is fully visible under different window sizes. The image physical scaling ratio is the ratio of the actual drawn width of the background image to the original pixel width, representing the conversion factor from the original image pixels to the current window physical pixels. The above four parameters are updated in real time with user interaction operations, forming the basis for the dynamic calibration of the inverse transformation matrix.
[0017] Furthermore, the inverse transformation matrix transforms the occluded region in the screen coordinate system to the original image coordinate system. Specifically, this includes performing inverse transformations of viewpoint translation and interactive scaling, as well as inverse transformations of center offset and physical scaling, on the screen coordinates in two steps to convert them into absolute coordinates of the original image. This two-step inverse transformation decouples view interaction transformations from physical scaling, making the calibration logic of each parameter clearer and more independent. After transforming the start and end points corresponding to the mouse press and release times, a rectangular occluded region is generated through normalization, ensuring that the representation of the occluded region is independent of the drawing direction. Invalid occluded regions with widths or heights less than a preset threshold are filtered out, and valid occluded regions are added to the global occluded region set; as a preferred implementation, the preset threshold is 2 pixels.
[0018] Furthermore, using visibility state as the unified criterion for rendering and annotation specifically includes: setting a visibility state for each flying target, with the visibility state being simultaneously input into both the rendering pipeline and the annotation pipeline; the rendering pipeline deciding whether to render the target image based on the visibility state; the annotation pipeline deciding whether to include the target bounding box information in the current frame's annotation output based on the visibility state; and the rendering pipeline and the annotation pipeline sharing the same visibility state. Since the two pipelines share the same state source, the possibility of inconsistencies between the rendered display and the annotation output is eliminated from the mechanism, avoiding the generation of erroneous samples where the target and annotation in the image do not match.
[0019] Furthermore, the kinematic solution for the flying target includes pixel displacement calculation: based on the ratio between the target's pixel scale in the image and its maximum physical axis distance, the set real motion speed is dynamically converted into the pixel displacement of the current frame; the pixel displacement is directly proportional to the target's current pixel height and real motion speed, and inversely proportional to the target's maximum physical axis distance and timer update frequency. This proportional relationship is established based on the perspective principle of similar triangles, ensuring that the pixel movement speed of the target at different depth positions matches its visual scale, conforming to the laws of real observation.
[0020] Further, the updating of the target's spatial scaling ratio and attitude angle specifically includes: updating the target's height proportion using a spatial depth smooth scaling random walk algorithm, accumulating a small-scale perturbation amount on the basis of the current height proportion, and constraining it within a preset scaling boundary to simulate the visual size change caused by the target flying along the depth direction; achieving a smooth and continuous size change effect by frame-by-frame accumulation of the small perturbation amount and boundary truncation, avoiding abrupt changes; as a preferred implementation, the value range of the small-scale perturbation amount is [-0.005, 0.005]. The target's attitude rotation angle is updated based on the attitude angle perturbation model, accumulating a random perturbation amount on the basis of the original attitude rotation angle, and truncating it within a preset physically reasonable sway range to simulate the body swaying effect caused by airflow disturbance; as a preferred implementation, the physically reasonable sway range is [-15.0°, 15.0°], and the value range of the random perturbation amount is [-1.0°, 1.0°].
[0021] Furthermore, the kinematic solution supports a completely random mode and a left-right reciprocating mode: In the completely random mode, the motion direction is randomly sampled within a preset angle range, and the unit direction vector is updated to cover the requirements of omnidirectional random motion; as a preferred implementation, the preset angle range is [0°, 360°]. In the left-right reciprocating mode, the main trajectory maintains horizontal movement, and a small perturbation bias is applied to the longitudinal component before normalization correction to simulate the flight pattern of the target reciprocating horizontally while accompanied by slight up-and-down floating; as a preferred implementation, the small perturbation bias value range is [-0.05, 0.05]. When the predicted position of the target exceeds the boundary of the background image, boundary collision bounce processing is performed, and the velocity component in the direction exceeding the boundary is inverted to ensure that the target always moves within the background image range.
[0022] Furthermore, the output standardized training dataset specifically includes: for targets in the visible state, using the YOLO annotation normalization algorithm, converting the target bounding box position information into the bounding box center coordinates and the normalized ratio values of width and height relative to the background image size, and writing them into a text annotation file according to the YOLO standard format; during the simulation run, clean single-frame images are written to the disk temporary cache directory in real time; after the simulation ends, a standard video encoding tool is called through an asynchronous subprocess scheduling mechanism to synthesize the serialized image frames into a standard MP4 format video in the background. The frame rate of the synthesized video is consistent with the timer update frequency. After synthesis is completed, the temporary cache directory is automatically cleaned up, thereby outputting three types of standard dataset files: clean serialized image files, text annotation files, and simulation scene videos.
[0023] Furthermore, determining whether the position of each flying target falls within the occlusion area includes: using the percentage of the intersection area between the target's bounding box and the occlusion area as the criterion; when the percentage of the intersection area exceeds a preset threshold, the target is determined to be occluded. This area percentage determination method can handle scenarios where targets are partially occluded, and is more precise than a simple center point determination method, allowing for flexible adjustment of the strictness of the occlusion determination according to actual needs.
[0024] On the other hand, this invention also provides a system for simulating the trajectory of a flight target and constructing a dataset, including a human-computer interaction and parameter configuration module, a target physics and kinematics modeling module, a scene rendering and interactive occlusion module, and an automatic dataset construction module. The human-computer interaction and parameter configuration module is responsible for receiving configuration information input by the user and providing a simulation control interface; the target physics and kinematics modeling module is responsible for performing kinematic solutions for the flight target and outputting the target state; the scene rendering and interactive occlusion module is responsible for inverse transformation matrix calibration, interactive management of occlusion areas, visibility determination, and composite rendering; the automatic dataset construction module is responsible for annotation generation, image saving, and video encoding output. These modules work collaboratively to achieve the aforementioned method for simulating the trajectory of a flight target and constructing a dataset.
[0025] Compared with existing technologies, this invention and its preferred solutions are compatible with both visible light and infrared scenes and various flight target materials, making them widely applicable to general data construction for deep learning target detection systems. By introducing a physics-to-pixel transformation model, spatial depth smooth scaling random walk, and attitude perturbation truncation algorithm, the simulated flight target trajectories, size gradients, and aerial swaying attitudes closely match real-world perspective, ensuring the authenticity of the dataset. A dynamic interactive occlusion removal mechanism based on the inverse transformation matrix is established, allowing users to dynamically draw occlusion areas through the interface during data stream generation, filtering out invalid target areas that do not conform to objective reality in real time, significantly improving the efficiency and purity of dataset construction. Integrated automatic output of image, label, and video data is achieved, eliminating the data consistency risks brought about by multi-tool collaboration, and significantly improving the automation level and engineering application value of dataset construction. Attached Figure Description
[0026] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0027] Figure 1 A flowchart illustrating the overall architecture of the flight target trajectory simulation and dataset construction system provided in this embodiment of the invention;
[0028] Figure 2 This is a flowchart of the dynamic solution process for the target physics and kinematics modeling module provided in an embodiment of the present invention.
[0029] Figure 3 This is a flowchart illustrating the interactive drawing process for occluded areas provided in an embodiment of the present invention.
[0030] Figure 4 The flowchart for target occlusion determination and dual-path elimination provided in the embodiments of the present invention is shown. Detailed Implementation
[0031] To make the features and advantages of the present invention more apparent and understandable, specific embodiments are described below in detail:
[0032] like Figure 1As shown in the figure, this invention proposes a method and system for simulating the trajectory of flying targets and constructing a dataset. Through the collaborative work of four modules—human-computer interaction and parameter configuration, target physics and kinematic modeling, scene rendering and interactive occlusion, and automatic dataset construction—high-fidelity trajectory simulation of flying targets and automatic generation of standardized datasets are achieved. The system is compatible with visible light and infrared scenes and various flying target materials. It introduces a realistic physics-to-pixel transformation model, spatial depth smooth scaling random walk, and attitude perturbation truncation algorithm. The simulated flight target trajectories, size gradations, and aerial swaying attitudes highly conform to real-world perspective laws. Simultaneously, a dynamic interactive occlusion removal mechanism based on the inverse transformation matrix is established, allowing users to dynamically draw occlusion areas through the interface during data stream generation, filtering out undesirable target areas that do not conform to objective reality in real time. Finally, integrated automatic output of image, label, and video data is achieved.
[0033] The operation of this scheme begins with acquiring configuration information. Based on the human-computer interaction and parameter configuration module, the system acquires the user-configured simulation background image, target material image, flight target physical motion characteristic parameters, motion mode parameters, and data export configuration parameters through a graphical user interface. It also supports user control over the simulation process, including starting, pausing, continuing, and stopping, and allows dynamic adjustment of parameter configurations during operation. After acquiring the configuration, the system enters the physical and kinematic modeling stage. Based on the target physical and kinematic modeling module, the system solves the dynamic equations of the flight target under the trigger of the system's periodic timer clock cycle signal, calculating and updating the target's pixel coordinate position, attitude angle, spatial scaling ratio, and corresponding image frame index in real time within the current frame. Figure 2 The complete dynamic solution algorithm flow is demonstrated under the timer clock drive, from receiving configuration parameters and the previous frame state, converting physical velocity to pixel displacement, updating spatial depth scaling ratio, handling motion mode branches, boundary collision bounce, updating target center coordinates, truncation of attitude angle perturbation, to outputting the target state set.
[0034] Specifically, firstly, based on the target's current pixel height in the image, maximum physical distance (i.e., the physical dimension between the two farthest points on the target body), the set real motion speed, and the timer update frequency, the target's pixel displacement is calculated using a dynamic conversion model from real physical velocity to pixel displacement. The calculation formula is:
[0035]
[0036] in, The pixel displacement of the target in the current frame. The current pixel height of the target in the image. The actual speed of movement of the target. For the target maximum physical wheelbase, Set the timer update frequency. As a preferred implementation, the current pixel height... It is dynamically determined by the product of the current frame height percentage and the original total height of the background image, and its calculation formula is as follows:
[0037]
[0038] in, This represents the current frame's height percentage. The original total height of the background image is given. Subsequently, a spatial depth smoothing scaling random walk algorithm is used to simulate the visual size variation caused by the target flying along the depth direction. A small-scale perturbation following a uniform random distribution is accumulated based on the current frame height proportion, and constrained within a set scaling boundary using a truncation function. The calculation formula is as follows:
[0039]
[0040] in, The height percentage for the next frame. This represents the current frame's height percentage. These are small-scale perturbations. and These represent the upper and lower boundaries of the scaling ratio. As a preferred implementation, The value ranges from [-0.005, 0.005]. Next, branching is performed according to the set motion pattern. In a completely random mode, angles are randomly sampled within [0, 360°) to calculate the unit direction vector component of the two-dimensional plane. In a left-right back-and-forth mode, the main trajectory maintains horizontal movement, and a small perturbation bias is applied to the longitudinal component with a set probability in each frame before normalization correction.
[0041] As a preferred implementation, this small perturbation bias The value range is between [-0.05, 0.05]. When the predicted target position exceeds the original resolution boundary of the background image, a mirror boundary collision bounce process is performed, and the velocity component in the direction exceeding the boundary is inverted. The latest absolute center coordinates of the flying target in the pixel coordinate system of the original background image are calculated by combining the updated unit direction vector and pixel displacement. At the same time, the body swaying effect of the aircraft caused by airflow disturbance is simulated based on the attitude angle perturbation model. The random perturbation is accumulated on the original rotation angle and truncated within a physically reasonable range. The calculation formula is:
[0042]
[0043] in, The updated attitude rotation angle, The original attitude rotation angle, This refers to a random perturbation that follows a uniform distribution. As a preferred implementation, The value range is [-1.0°, 1.0°]. The absolute center coordinates, spatial scaling ratio, pose rotation angle, and image frame index are packaged and output to the scene rendering module.
[0044] During the scene rendering and interactive occlusion phase, the original environment background and the flying target are rendered in real time using multi-layered image canvases, while simultaneously capturing user mouse interaction events from the graphical user interface. Users can use the mouse wheel to zoom the interface view, right-click to return the view to center, and hold down the left mouse button to draw any rectangle on the screen and release to generate an occlusion mask. Since the window size can be freely stretched and the viewpoint can be varied, the screen coordinates will change. The system needs to use an inverse transformation matrix to inversely map the screen coordinates back to the original image logical coordinates, and then determine and remove targets covered by the occlusion mask in real time. Figure 3 It demonstrates the complete process of users drawing occluded areas on a graphical interface by dragging and dropping with the mouse, including mapping the press and release points to the original image coordinates through the inverse transformation matrix, normalizing the occluded area, filtering for validity, and finally adding it to the global occluded area set. Figure 4 The demonstration shows the process by which the system performs visibility determination on all flying targets one by one within each timer cycle, as well as the dual-path unified culling mechanism that applies the same visibility status bit to both the rendering pipeline and the annotation pipeline.
[0045] Before rendering each frame, the scene rendering and interactive occlusion module dynamically calibrates the four geometric parameters required for the inverse transformation matrix.
[0046] The first is the viewpoint translation. When the user scrolls the mouse wheel to zoom in and out, the viewpoint is updated using the current mouse screen coordinates as a fixed anchor point to ensure that the original image position pointed to by the mouse remains unchanged on the screen before and after zooming. The calculation formula is:
[0047]
[0048] in, This is the updated view translation amount. This represents the view translation amount before the update. The current mouse screen coordinates, Scaling to the updated view space The scaling factor for the view space before the update.
[0049] Secondly, the view space scaling ratio is calculated by multiplying or dividing by a fixed factor each time a scroll wheel event is triggered, and a truncation function is used to constrain the scaling within a preset scaling boundary to avoid over-scaling. As a preferred implementation, the fixed factor is 1.1, and the scaling boundary is [0.2, 5.0].
[0050] Thirdly, there's the adaptive rendering center offset, used to center images with different aspect ratios within the software window. This is dynamically calculated based on a comparison between the current window's aspect ratio and the original aspect ratio of the background image. When the window's aspect ratio is greater than the background image's, the background image's width is calculated proportionally to the window height and centered horizontally. The calculation formula is:
[0051]
[0052]
[0053] When the aspect ratio of the window is not greater than that of the background image, the height of the background image is calculated proportionally based on the window width, and it is then centered vertically. The calculation formula is as follows:
[0054]
[0055]
[0056] in, The aspect ratio of the window ( ), The original aspect ratio of the background image ( ), and These are the width and height of the window, respectively. and These are the original pixel width and height of the background image, respectively. and These represent the actual width and height of the background image drawn in the window, respectively. The origin of the background image is located at the top left corner of the window coordinate system.
[0057] Fourthly, the physical scaling ratio is calculated as the ratio of the actual drawing width to the original pixel width of the background image. It represents the conversion factor from the original image pixels to the current window's physical pixels. The calculation formula is:
[0058]
[0059] in, This is the physical scaling ratio of the image.
[0060] These four parameters are updated in real time with user interaction, forming the basis for the dynamic calibration of the inverse transformation matrix.
[0061] Based on the parameters obtained from calibration, an inverse transformation matrix is established to inversely derive the original image's logical absolute coordinates from the user's mouse screen click coordinates on the graphical user interface. First, an inverse transformation of viewpoint translation and interactive scaling is performed, followed by an inverse transformation of background image centering offset and physical scaling. The calculation formula is as follows:
[0062]
[0063]
[0064] in, Set the mouse screen click coordinates. For the amount of viewpoint translation, To scale the view space, For intermediate transition coordinates, To adaptively render the center offset from the origin, The physical scaling ratio of the image. The original image uses logical absolute coordinates. This inverse transformation is executed once when the mouse is pressed and once when it is released, mapping the start and end points of the screen rectangle drawn by dragging to the start and end points in the original image coordinate system, and then generating a direction-independent rectangular occlusion region after normalization.
[0065] The system further filters invalid rectangles whose width or height is less than a preset threshold. As a preferred implementation, the preset threshold is 2 pixels. Then, the effective occlusion area is added to the global occlusion area set.
[0066] The system maintains a global set of occlusion regions. Within each timer cycle, it performs occlusion determination for each flying target in the current scene. The determination process for each target is independent, and each target has its own visibility member variable, thus supporting linear-time real-time processing in multi-target concurrent scenarios. The absolute center coordinates of the target in the original image coordinate system are extracted, and it is determined whether these coordinates fall within any occlusion region in the set. If so, the visibility state is set to false; otherwise, it is set to true.
[0067] As a preferred implementation, for partially occluded scenes, the determination criterion can be expanded to the percentage of the intersection area between the target bounding box and the occluded region. When the intersection area exceeds a preset percentage threshold, the visibility state is also set to false to more accurately handle partial occlusion logic in real-world scenes. This visibility state also serves as a unified determination criterion for both the scene rendering pipeline and the dataset construction pipeline. The rendering engine uses this state to determine whether to render the target image and its detection box, while the dataset construction module uses this state to determine whether to include the target's bounding box information in the annotation output of the current frame. This achieves unified control of both rendering culling and annotation culling paths, avoiding erroneous samples where the display and annotation do not match due to inconsistent states between the two modules.
[0068] During the automatic dataset construction phase, the system associates the real bounding box location information of visible targets in the current frame with clean single-frame image data during simulation, automatically converting it into a standard deep learning dataset.
[0069] For visible targets, the YOLO annotation normalization algorithm is used. Combining the total width and height of the original background image, the normalized ratio of the target center point and bounding box size relative to the overall image size is calculated. The formula is as follows:
[0070]
[0071]
[0072]
[0073]
[0074] in, and The coordinates of the top left corner of the target bounding box. and The width and height of the target bounding box. and This represents the total width and total height of the original background image. and Normalized coordinates for the target center point and Normalize the width and height of the bounding box.
[0075] The system automatically writes the normalization ratio values to the corresponding text files in the YOLO standard format. Simultaneously, during simulation, clean single-frame images are written to the disk's temporary cache directory in real time. After the simulation ends, an external standard video encoding tool is invoked through an asynchronous subprocess scheduling mechanism to concatenate the serialized image frames into a standard high-definition simulation scene video in the background.
[0076] As the preferred implementation, FFmpeg is used as the video encoding tool, and the frame rate of the synthesized video is kept consistent with the timer update frequency. The encoding process does not block the main interface response. After the synthesis is completed, the temporary cache directory is automatically cleaned up, and finally, three types of standard dataset files are output: clean serialized image files, text annotation files, and simulation scene videos.
[0077] To demonstrate the feasibility of the occlusion culling mechanism of the present invention, a specific verification embodiment is given below.
[0078] Assuming the original resolution of the background image is 3840×2160 pixels, and the initial window size after program startup is 1200×800 pixels, with no interactive scaling operations yet (view space scaling ratio 1.0 and view translation (0,0)). Since the window aspect ratio of 1.5 is less than the background image's aspect ratio of approximately 1.778, the drawing height is calculated based on the window width. This results in an adaptive rendering center offset origin at (0,62.5), a drawing width of 1200 pixels, a drawing height of 675 pixels, and an image physical scaling ratio of 0.3125. When the user presses the left mouse button at screen coordinates (300,300), the inverse transformation calculates the drag starting point in the original image coordinate system to be (960.0,760.0).
[0079] The user drags the image to screen coordinates (500, 450) and releases it. Similarly, the drag endpoint is calculated to be (1600.0, 1240.0). After normalization, the occlusion area is obtained, with its origin in the original pixel coordinate system of the background image at (960.0, 760.0), a width of 640 pixels, and a height of 480 pixels. This area is then added to the global occlusion area set.
[0080] After completing the drawing of the occluded area, the user can drag the window border to adjust the window size to 1600×1000 pixels and perform a scroll wheel zoom operation to change the view space scaling ratio to 1.5. The view translation is then updated to (150, 100) according to the anchor point formula. Due to the change in window size, the system recalibrates the offset and scaling ratio, resulting in a new origin at (0, 50.0), a drawing width of 1600 pixels, a drawing height of 900 pixels, and an updated physical scaling ratio of approximately 0.4167.
[0081] Suppose the absolute center coordinates of a flying target in the original pixel coordinate system of the background image are (1200, 900). Since these coordinates satisfy the condition that both the horizontal and vertical coordinates fall within the aforementioned occlusion area, it is determined to be invisible. This determination process is completed entirely in the original pixel coordinate system of the background image, without depending on the current view state parameters. This indicates that once the occlusion area is generated, it remains fixed in the original coordinate system and is not affected by subsequent window size adjustments or interactive scaling operations.
[0082] To further verify the correctness of the inverse mapping, the target coordinates were transformed in the forward direction according to the current view parameters to the screen coordinates (900.0, 737.5), and then the screen coordinates were transformed inversely. The original coordinates were found to be completely consistent with the original target coordinates, which verified that the inverse transformation matrix maintains the self-consistency and invertibility of the coordinate mapping in any interactive state.
[0083] Furthermore, when the user presses down at screen coordinates (700, 600) and releases at (1000, 800) in the current zoom state, the occluded area is redrawn. After inverse transformation calculation, the origin of the new occluded area in the original pixel coordinate system of the background image is (880.0, 680.0), with a width of 480 pixels and a height of 320 pixels. This area is also correctly added to the global set, supporting the accuracy and robustness of occluded area drawing in any interactive state.
[0084] To verify the effect of the occlusion removal mechanism on improving the purity of the dataset, a control experiment was also designed in this invention.
[0085] Several simulated occlusion regions were pre-set in the same background image. Maintaining the same target physical configuration parameters and motion patterns, the simulation system was run under two conditions: occlusion region rendering and no occlusion region rendering. For each condition, 1000 sets of image-annotation data pairs were continuously generated. The number of invalid annotations—where the target center point was located within the pre-set occlusion region but was still rendered and annotated by the system—was counted. Experimental results showed that the control group without occlusion region rendering generated 182 invalid annotations, with an invalid annotation rate of 18.2%; the experimental group with occlusion region rendering did not produce any invalid annotations, with an invalid annotation rate of 0%. This mechanism can eliminate invalid samples caused by occlusion relationships at the source of rendering and annotation, reducing the invalid annotation rate of the dataset from 18.2% to 0%, significantly improving the purity of the dataset.
[0086] In summary, the methods and systems of this invention are compatible with both visible light and infrared scenes and various flying target materials, making them widely applicable to general data construction for deep learning target detection systems. By introducing a realistic physical-to-pixel transformation model, spatial depth smoothing scaling random walk, and attitude perturbation truncation algorithm, the simulated flight target trajectories, size gradients, and aerial swaying attitudes closely match real-world perspective, ensuring the authenticity of the dataset. A unique dynamic interactive occlusion removal mechanism based on the inverse transformation matrix is established, allowing users to dynamically draw occluded areas through the interface during data stream generation, filtering out undesirable target areas that do not conform to objective reality in real time, significantly improving the efficiency and purity of dataset construction. Integrated automatic output of image, label, and video data is achieved, eliminating the data consistency risks associated with multi-tool collaboration and significantly enhancing the automation level and engineering application value of dataset construction.
Claims
1. A method for simulating the trajectory of a flight target and constructing a dataset, characterized in that, Includes the following steps: Obtain configuration information, which includes simulation background image, flight target material image, and motion parameters; Based on the motion parameters, the kinematics of the flight target are solved, and the position, spatial scaling ratio and attitude angle of the target in the original image coordinate system are updated. The background image and the flying target are rendered in real time. The view state parameters required for the inverse transformation matrix between the screen coordinates and the original image coordinates are dynamically calibrated, and the inverse transformation matrix is updated in real time as the view state changes. The user's interactive operation of drawing occluded areas on the graphical user interface is captured, and the occluded areas in the screen coordinate system are transformed to the original image coordinate system through the inverse transformation matrix and added to the global occluded area set. In each simulation cycle, it is determined whether the position of each flying target falls into any occlusion region in the global occlusion region set under the original image coordinate system, and the visibility status of each target is updated. The visibility status is used as a unified criterion for rendering and annotation, and the occluded targets are simultaneously removed in both the rendering and annotation output stages. The bounding box location information of visible targets is associated with single-frame image data to output a standardized training dataset.
2. The method for simulating the trajectory of a flight target and constructing a dataset according to claim 1, characterized in that: The view state parameters include view scaling factor, view translation amount, adaptive rendering center offset, and image physical scaling ratio; The view scaling factor is multiplied or divided by a fixed factor when the scroll wheel scaling event is triggered, and is constrained within a preset boundary range; The view translation amount is updated in a linked manner with the current mouse screen coordinates as the fixed anchor point. The adaptive rendering center offset is dynamically calculated based on the comparison between the window aspect ratio and the background image aspect ratio, so that the background image is displayed proportionally centered in the window; The physical scaling ratio of the image is the ratio of the actual drawn width of the background image to the original pixel width.
3. The method for simulating the trajectory of a flight target and constructing a dataset according to claim 2, characterized in that: The occluded region in screen coordinates is transformed to the original image coordinates using an inverse transformation matrix, specifically including: The screen coordinates are converted into the original image absolute coordinates in two steps by sequentially performing inverse transformations of view translation and interactive scaling, as well as inverse transformations of center offset and physical scaling. After converting the start and end points corresponding to the mouse press and release times respectively, a rectangular occlusion area is generated through normalization. Filter out invalid occlusion areas whose size is smaller than a preset threshold, and add the valid occlusion areas to the global occlusion area set.
4. The method for simulating the trajectory of a flight target and constructing a dataset according to claim 1, characterized in that: Visibility status is used as the unified criterion for rendering and annotation, specifically including: A visibility state is set for each flight target, and the visibility state is simultaneously input into the rendering pipeline and the annotation pipeline; The rendering pipeline determines whether to render the target image based on the visibility state. The annotation pipeline determines whether to include the target bounding box information in the current frame annotation output based on the visibility status. The rendering pipeline and the annotation pipeline share the same visibility state.
5. The method for simulating the trajectory of a flight target and constructing a dataset according to claim 1, characterized in that: Performing kinematics calculations on a flying target includes calculating pixel displacements: Based on the ratio between the pixel scale of the target in the image and the target's maximum physical axis distance, the set real motion speed is dynamically converted into the pixel displacement of the current frame; The pixel displacement is directly proportional to the target's current pixel height and actual movement speed, and inversely proportional to the target's maximum physical axis distance and timer update frequency.
6. The method for simulating the trajectory of a flight target and constructing a dataset according to claim 1, characterized in that: Updating the target's spatial scaling and attitude angle specifically includes: The spatial depth smooth scaling random walk algorithm is used to update the height ratio of the target. A small-scale perturbation is accumulated on the basis of the current height ratio and constrained within the preset scaling boundary. The target's attitude rotation angle is updated based on the attitude angle perturbation model. Random perturbation is added to the original attitude rotation angle and truncated within a preset physically reasonable swing range.
7. The method for trajectory simulation and dataset construction of a flight target according to claim 1, characterized in that: The kinematics solution supports both a completely random mode and a left-right traverse mode. In fully random mode, the motion direction is randomly selected within a preset angle range, and the unit direction vector is updated. In the left-right reciprocating mode, the main trajectory maintains horizontal movement, and the longitudinal component is normalized after being subjected to a small perturbation bias. When the predicted target position exceeds the boundary of the background image, boundary collision bounce processing is performed, and the velocity components in the direction exceeding the boundary are inverted.
8. The method for simulating the trajectory of a flight target and constructing a dataset according to claim 1, characterized in that: The output standardized training dataset specifically includes: For targets that are visible, the YOLO annotation normalization algorithm is used to convert the target bounding box position information into the bounding box center coordinates and the normalized ratio values of width and height relative to the background image size, and write them into the text annotation file in the YOLO standard format. During simulation, clean single-frame images are written to the temporary disk cache directory in real time. After the simulation is completed, the standard video encoding tool is invoked through the asynchronous subprocess scheduling mechanism to synthesize the serialized image frames into a standard MP4 format video in the background. The frame rate of the synthesized video is consistent with the update frequency of the timer. After the synthesis is completed, the temporary cache directory is automatically cleaned up.
9. The method for simulating the trajectory of a flight target and constructing a dataset according to claim 1, characterized in that: Determining whether the position of each flying target falls within the occlusion area includes: using the percentage of the intersection area between the target bounding box and the occlusion area as the determination criterion; when the percentage of the intersection area exceeds a preset threshold, it is determined that the target is occluded.
10. A trajectory simulation and dataset construction system for a flight target, comprising a human-computer interaction and parameter configuration module, a target physics and kinematics modeling module, a scene rendering and interactive occlusion module, and an automatic dataset construction module; The modules work together to implement the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
A method and system for generating multi-source optical samples
CN114419146B
Method for creating infrared sequence multi-target dataset
CN120318626B
