Method, device, equipment and medium for generating drone performance patterns

Automatically generate drone performance patterns through Poisson disc algorithm and elimination uniformization method, solving the problems of manual drag and uneven distribution points in the prior art, realizing automatic generation and better pattern aesthetics.

CN118967855BActive Publication Date: 2025-04-25SHENZHEN DAMO DAZHI CONTROL TECH CO LTD

Patent Information

Application Number
CN202411022372.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2025-04-25
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

The existing drone performance pattern generation method requires manual dragging of points or spheres, and the pattern layout is uneven, making it difficult to ensure the safe distance between drones and the aesthetics of patterns.

Method used

By obtaining the path, number of drones, safe distance and actual distance of the image to be aligned, the Poisson disc algorithm is used to fill the internal area of ​​the image, and the internal points are removed and uniformized in combination with the culling uniformization method to generate target edge coordinates and internal coordinates, and the drone performance pattern is automatically generated.

Benefits of technology

The automatic generation of drone performance patterns is realized, avoiding the steps of manual dragging, the pattern layout is more uniform and the edges are clear, ensuring a safe distance between drones.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967855B_ABST
    Figure CN118967855B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for generating a drone performance pattern, wherein the method comprises: converting a to-be-aligned image to obtain a to-be-aligned target image, and processing the to-be-aligned target image to obtain an edge point set; traversing the edge point set according to a starting point and an actual distance to obtain an edge count value and an edge coordinate; using a Poisson disk algorithm to fill the internal area of ​​the image wrapped by the edge point set in the to-be-aligned target image to obtain internal coordinates and internal count values; eliminating and homogenizing the internal points in the internal area of ​​the image according to the number of drones to be aligned, the edge count value, the internal count value, the safety distance and the actual distance by a elimination and homogenization method, and scaling the edge coordinates and the internal coordinates to obtain the target edge coordinates and the target internal coordinates to generate a drone performance pattern. The present invention can automatically generate a drone performance pattern, and the generated performance pattern has a more uniform distribution of points.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of unmanned aerial vehicles, and in particular to a method, device, equipment and medium for generating a performance pattern of an unmanned aerial vehicle. Background Art

[0002] In the field of drone performances, drones are needed to form various patterns and shapes in the air. For the purpose of performance, it is necessary to ensure absolute safety, a certain number of drones, and beautiful patterns. When filling the pattern, it is hoped that the interior of the pattern is uniform and the border is clearly discernible. In the current method of generating drone performance patterns, 3D software is often used to edit the performance pattern, and points or spheres are used to represent real drones for simulation. Through functions such as translation, rotation, and scaling, the points or spheres representing the drones are placed in specific positions to form a performance pattern. If you want to obtain uniform distribution of points in the performance pattern, you need to drag the points or spheres by hand in the 3D software to ensure that the points of each drone have no collisions, and are evenly distributed and beautiful. In addition to manual dragging, you can also use horizontal and vertical matrix filling and dot distribution, two-dimensional dot distribution algorithms and other dot distribution methods. Matrix filling and dot distribution is the simplest way to align and implement, but people's aesthetics are not static, and not every performance pattern is suitable for horizontal and vertical matrix filling. The two-dimensional dot distribution algorithm does not consider the safety distance between drones, the distinction between the edge and the interior of the performance pattern, and the uniform dot distribution problem. Other dot distribution methods directly start to extract the edge of the performance pattern, and only degrade the performance pattern after the edge processing. This makes the edge wrong when processing low-pixel images, resulting in the edge of the image being smaller than the inside of the edge, and the edge and the inside cannot be adapted. Summary of the invention

[0003] The embodiments of the present invention provide a method, device, equipment and medium for generating a drone performance pattern, aiming to solve the problems that manual dragging is required when generating existing drone performance patterns and the performance pattern is unevenly distributed.

[0004] In a first aspect, an embodiment of the present invention provides a method for generating a drone performance pattern, comprising:

[0005] Get the path of the image to be aligned, the number of drones to be aligned, the safe distance, and the actual distance;

[0006] Inputting the path of the image to be aligned into a preset plug-in, so that the preset plug-in converts the image to be aligned to obtain a target image to be aligned, and processes the target image to be aligned to obtain an edge point set;

[0007] An edge point is randomly selected from the edge point set as a starting point, and the edge point set is traversed according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set;

[0008] Based on the actual distance, the internal area of ​​the image enclosed by the edge point set in the target image to be aligned is filled using the Poisson disk algorithm to obtain internal coordinates and internal count values ​​corresponding to the internal points;

[0009] According to the number of drones to be aligned, the edge count value, the internal count value, the safety distance, and the actual distance, the internal points in the internal area of ​​the image are eliminated and homogenized by a elimination and homogenization method, and the edge coordinates and the internal coordinates are scaled to obtain target edge coordinates and target internal coordinates;

[0010] A drone performance pattern is generated according to the target edge coordinates and the target internal coordinates.

[0011] In a second aspect, an embodiment of the present invention further provides a device for generating a drone performance pattern, comprising:

[0012] An acquisition unit, used to acquire the path of the image to be aligned, the number of drones to be aligned, the safety distance, and the actual distance;

[0013] A conversion processing unit, used for inputting the path of the image to be aligned into a preset plug-in, so that the preset plug-in converts the image to be aligned to obtain a target image to be aligned, and processes the target image to be aligned to obtain an edge point set;

[0014] A traversal unit, configured to arbitrarily select an edge point from the edge point set as a starting point, and traverse the edge point set according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set;

[0015] A filling unit, configured to fill, based on the actual distance, an internal area of ​​the image enclosed by the edge point set in the target image to be aligned using a Poisson's disk algorithm to obtain internal coordinates and internal count values ​​corresponding to the internal points;

[0016] a uniform scaling unit, configured to eliminate and uniformize the internal points in the internal area of ​​the image according to the number of drones to be aligned, the edge count value, the internal count value, the safety distance, and the actual distance by a elimination uniformization method, and to scale the edge coordinates and the internal coordinates to obtain target edge coordinates and target internal coordinates;

[0017] A generating unit is used to generate a drone performance pattern according to the target edge coordinates and the target internal coordinates.

[0018] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.

[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.

[0020] The embodiments of the present invention provide a method, device, equipment and medium for generating a drone performance pattern. The method includes: obtaining the path of the image to be aligned, the number of drones to be aligned, the safety distance and the actual distance; inputting the path of the image to be aligned into a preset plug-in so that the preset plug-in converts the image to be aligned to obtain a target image to be aligned, and processes the target image to be aligned to obtain an edge point set; arbitrarily selecting an edge point from the edge point set as a starting point, and traversing the edge point set according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set; based on the actual distance, filling the internal area of ​​the image wrapped by the edge point set in the target image to be aligned using the Poisson disk algorithm to obtain internal coordinates and internal count values ​​corresponding to the internal points; according to the number of drones to be aligned, the edge count value, the internal count value, the safety distance and the actual distance, the internal points in the internal area of ​​the image are eliminated and homogenized by a elimination and homogenization method, and the edge coordinates and the internal coordinates are scaled to obtain target edge coordinates and target internal coordinates; and generating a drone performance pattern according to the target edge coordinates and the target internal coordinates. The technical solution of the embodiment of the present invention is to first fill the internal area of ​​the image using the Poisson disk algorithm, then eliminate and equalize the internal points in the internal area of ​​the image through the elimination and equalization method, and finally automatically generate a drone performance pattern according to the target edge coordinates and the target internal coordinates. In the process of generating the drone performance pattern, there is no need to manually drag the points or spheres representing the drone; and because the internal area of ​​the image is filled with the Poisson disk algorithm, the internal points are eliminated and the equalization operations are performed, the distribution of the generated performance pattern is more uniform. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0022] Figure 1 A schematic diagram of a flow chart of a method for generating a drone performance pattern provided by an embodiment of the present invention;

[0023] Figure 2 A schematic diagram of a sub-process of a method for generating a drone performance pattern provided by an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of a sub-process of a method for generating a drone performance pattern provided by an embodiment of the present invention;

[0025] Figure 4 The Voronoi diagram generated by the embodiment of the present invention;

[0026] Figure 5 A schematic diagram of a pattern generated from a picture to be aligned, a pattern after using the Poisson disk algorithm, and a pattern generated after using the Lloyd algorithm after 1000 iterations provided by an embodiment of the present invention;

[0027] Figure 6 A schematic block diagram of a device for generating a drone performance pattern provided by an embodiment of the present invention;

[0028] Figure 7 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0031] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0032] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0033] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0034] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a method for generating a drone performance pattern provided by an embodiment of the present invention. The method for generating a drone performance pattern is described in detail below. Figure 1 As shown, the method includes the following steps S110-S160.

[0035] S110, obtaining the path of the image to be aligned, the number of drones to be aligned, the safety distance, and the actual distance.

[0036] In the embodiment of the present invention, firstly, the path of the image to be aligned, the number of drones to be aligned, the safety distance and the actual distance are input into the 3D software. It should be noted that in the present embodiment, the format of the image to be aligned can be a variety of formats, such as JPG format, PNG format, etc. It should also be noted that in the present embodiment, the actual distance needs to be initialized as the safety distance, and in subsequent steps, the actual distance will be updated; the safety distance is the distance between drones; the actual distance is the distance between drones in the 3D software.

[0037] S120: Input the path of the image to be aligned into a preset plug-in, so that the preset plug-in converts the image to be aligned to obtain a target image to be aligned, and processes the target image to be aligned to obtain an edge point set.

[0038] In an embodiment of the present invention, the path of the image to be aligned is input into a preset plug-in, wherein the preset plug-in is a plug-in obtained by encapsulating OpenCV, and the preset plug-in is integrated in the 3D software, so that the preset plug-in converts the image to be aligned to obtain the target image to be aligned, wherein the target image to be aligned is an image in binary format; after obtaining the target image to be aligned, the target image to be aligned is processed to obtain an edge point set, specifically, the target image to be aligned is pixel-enhanced to obtain a pixel image to be aligned; the pixel image to be aligned is converted into a grayscale image to obtain a grayscale image to be aligned; and the edge extraction function is used to extract the edge of the grayscale image to be aligned to obtain the edge point set. It should be noted that, in the present embodiment, the pixel of the target image to be aligned is increased by the cv::resize function to avoid the problems caused by low-pixel images. It should also be noted that, in the present embodiment, the edge extraction function is cv::findContours; the edge point set is stored in std::vector <std::vector <cv::point>>Marginal variables.

[0039] S130, arbitrarily selecting an edge point from the edge point set as a starting point, and traversing the edge point set according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set.

[0040] In the embodiment of the present invention, after obtaining the edge point set, an edge point is arbitrarily selected from the edge point set as a starting point, and the edge point set is traversed according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set. Specifically, Figure 2 As shown, step S130 may specifically include steps S131-S134: S131, using the actual distance as the search step length, searching for the next collision-free point in the edge point set from the starting point; S132, if the next collision-free point can be found in the edge point set, saving the coordinates corresponding to the collision-free point; S133, if the next collision-free point cannot be found in the edge point set, modifying the search step length to obtain a modified search step length, and using the modified search step length as the search step length, returning to execute the step of searching for the next collision-free point in the edge point set from the starting point until the next collision-free point can be found in the edge point set; S134, if all edge points in the edge point set have not been traversed, using the collision-free point as the starting point, and returning to execute the step of searching for the next collision-free point in the edge point set from the starting point with the actual distance as the search step length, until all edge points in the edge point set have been traversed, so as to obtain the edge count value and the edge coordinates. For ease of understanding, it is assumed that the number of drones to be aligned is n, the safety distance is s, the actual distance is s', and s' is used as the search step size. Starting from the starting point, the next collision-free point is searched in the edge point set; if the next collision-free point can be found in the edge point set, the coordinates corresponding to the collision-free point are saved; if the next collision-free point cannot be found in the edge point set, the search step size is modified to obtain a modified search step size, wherein the modified search step size is 0.001s', and s'=0.001s', and the step of searching for the next collision-free point in the edge point set from the starting point is returned to perform a fine search until the next collision-free point can be found in the edge point set. The coordinates corresponding to the non-collision points found in the detailed search are saved. At this time, it is determined whether all edge points in the edge point set have been traversed. If not all edge points in the edge point set have been traversed, the non-collision point is used as the starting point, and the step of searching for the next non-collision point in the edge point set from the starting point with the actual distance as the search step is returned to be executed until all edge points in the edge point set have been traversed, so as to obtain the edge count value and the edge coordinates. That is, if not all edge points in the edge point set have been traversed, the non-collision point is used as the starting point, and the search step is restored to s' to continue searching until all edge points in the edge point set have been traversed, so as to obtain the edge count value n1 and the edge coordinates.

[0041] S140: Based on the actual distance, fill the internal area of ​​the image enclosed by the edge point set in the target image to be aligned by using the Poisson disk algorithm to obtain internal coordinates and internal count values ​​corresponding to the internal points.

[0042] In an embodiment of the present invention, based on the actual distance s', the internal area of ​​the image enclosed by the edge point set in the target image to be aligned is filled using the Poisson disk algorithm to obtain internal coordinates and internal count values ​​corresponding to the internal points, wherein the internal count value is n2. It should be noted that, in the present embodiment, when the Poisson disk algorithm is used to uniformly fill the internal area of ​​the image, the uniform filling is started from any position inside the image. It should also be noted that, in the present embodiment, the Poisson disk algorithm, also known as Poisson disk sampling, is a random sampling method for generating uniformly distributed points. It is characterized in that the distance between any two sampling points will not be too close, thereby producing a more natural sampling pattern.

[0043] S150, according to the number of drones to be aligned, the edge count value, the internal count value, the safety distance and the actual distance, the internal points in the internal area of ​​the image are eliminated and homogenized by a elimination and homogenization method, and the edge coordinates and the internal coordinates are scaled to obtain target edge coordinates and target internal coordinates.

[0044] In the embodiment of the present invention, after obtaining the edge count value n1 and the internal count value n2, the internal points in the internal area of ​​the image are eliminated and homogenized according to n, n1, n2, s and s' by a elimination and homogenization method, and the edge coordinates and the internal coordinates are scaled to obtain the target edge coordinates and the target internal coordinates. Specifically, Figure 3 As shown, step S150 may specifically include steps S151-S158: S151, calculating the sum of the edge count value and the internal count value to obtain a total count value; S152, calculating a count interval according to the number of drones to be aligned and a preset allowable deviation; S153, if the total count value is not within the count interval, updating the actual distance according to the ratio of the total count value to the number of drones to be aligned to obtain an actual updated distance; S154, taking the actual updated distance as the actual distance, and returning to execute the step of traversing the edge point set according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set; S155, if the total count value is within the count interval, determining whether the total count value is equal to the number of drones to be aligned; S156. If the total value is equal to the number of drones to be aligned, the edge coordinates and the internal coordinates are scaled according to the ratio of the safety distance to the actual distance to obtain the target edge coordinates and the target internal coordinates; S157. If the total value is not equal to the number of drones to be aligned, the difference between the total value and the number of drones to be aligned is calculated to obtain the number of eliminations, and the internal points of the elimination number in the internal area of ​​the image are eliminated to obtain the image elimination internal points; S158. According to the number of drones to be aligned, the improved Lloyd algorithm is used to homogenize the image elimination internal points, and the step of scaling the edge coordinates and the internal coordinates according to the ratio of the safety distance to the actual distance to obtain the target edge coordinates and the target internal coordinates is returned to execute.It should be noted that, in this embodiment, the total value is n1+n2, and the preset allowable deviation is δ. It can be understood that δ indicates that removing δ points inside the image does not affect the final display effect; the counting interval is [n, n+δ], and it is determined whether n1+n2 is in the interval [n, n+δ]; if n1+n2 is not in the interval [n, n+δ], s' is updated according to the ratio of n1+n2 to n, that is, s'=(n1+n2)s' / n, and the process returns to step S130; if n1+n2 is in the interval [n, n+δ], it is determined whether n1+n2 is equal to n; if n1+n2 is equal to n, the ratio of s to s' is updated. The edge coordinates and the internal coordinates are scaled to obtain the target edge coordinates and the target internal coordinates, that is, the edge coordinates are multiplied by s / s' to obtain the target edge coordinates, and the internal coordinates are multiplied by s / s' to obtain the target internal coordinates; if n1+n2 is not equal to n, the difference between n1+n2 and n is calculated to obtain the number of eliminations (n1+n2-n), and (n1+n2-n) of the internal points are eliminated to obtain the image elimination internal points, that is, the image elimination internal points are n1+n; the image elimination internal points are homogenized using the improved Lloyd algorithm according to the number of drones to be aligned, and the process returns to step S156.

[0045] Furthermore, the method of homogenizing the internal points of the image by using the improved Lloyd algorithm according to the number of drones to be aligned includes: generating a Voronoi diagram by using the improved Lloyd algorithm according to the internal coordinates corresponding to the internal points of the image, wherein the number of iterations of the improved Lloyd algorithm is set according to the number of drones to be aligned; and moving each of the internal coordinates in the Voronoi diagram to the center of the polygon where the internal point corresponding to the internal coordinate is located, so as to homogenize the internal points of the image. It should be noted that in this embodiment, if Figure 4 As shown, the Voronoi diagram, also known as Thiessen polygons or Dirichlet diagram, is composed of a set of continuous polygons composed of perpendicular bisectors connecting two adjacent straight lines; the Lloyd algorithm, also known as the k-means clustering algorithm, is an iterative data partitioning algorithm; in this embodiment, the improved Lloyd algorithm changes the search space so that the improved Lloyd algorithm can search in a limited space; the improved Lloyd algorithm is used to uniformly distribute the internal points removed from the image, the main purpose of which is to uniformize the internal points after removing n1+n2-n points, so that the final whole pattern looks beautiful and coordinated. It should also be noted that in this embodiment, as Figure 5 As shown, Figure 5 (a) represents the image to be aligned; Figure 5 (b) shows the pattern generated using the Poisson disk algorithm; Figure 5 (c) shows the pattern generated after removing the internal points in the internal area of ​​the image and using the Lloyd algorithm to iterate 1000 times to homogenize the image after removing the internal points. Figure 5 It can be seen that Figure 5 (c) Compared to Figure 5 (b) The internal points are more uniform and the distance between the internal points is safer. In practical applications, the distance between UAVs is safer.

[0046] S160: Generate a drone performance pattern according to the target edge coordinates and the target internal coordinates.

[0047] In an embodiment of the present invention, a drone performance pattern is generated according to the target edge coordinates and the target internal coordinates. It should be noted that in this embodiment, since the internal area of ​​the image is first filled using the Poisson disk algorithm, and then the internal points in the internal area of ​​the image are eliminated and homogenized by the elimination and homogenization method, and finally the drone performance pattern is automatically generated according to the target edge coordinates and the target internal coordinates, in the process of generating the drone performance pattern, there is no need to manually drag the points or spheres representing the drones; and since the internal area of ​​the image is filled with the Poisson disk algorithm, the internal points are eliminated and homogenized, the points of the generated performance pattern are more evenly distributed, and not only that, but the edges, that is, the contours, of the performance pattern are also clearer.

[0048] Figure 6 FIG. 2 is a schematic block diagram of a device 200 for generating a drone performance pattern provided by an embodiment of the present invention. Figure 6 As shown, corresponding to the above-mentioned method for generating a drone performance pattern, the present invention further provides a device 200 for generating a drone performance pattern. The device 200 for generating a drone performance pattern includes a unit for executing the above-mentioned method for generating a drone performance pattern, and the device can be configured in a computer device. Figure 6 The device 200 for generating a drone performance pattern includes an acquisition unit 201, a conversion processing unit 202, a traversal unit 203, a filling unit 204, a uniform scaling unit 205 and a generation unit 206.

[0049] The acquisition unit 201 is used to acquire the path of the image to be aligned, the number of drones to be aligned, the safety distance and the actual distance; the conversion processing unit 202 is used to input the path of the image to be aligned into a preset plug-in, so that the preset plug-in converts the image to be aligned to obtain the target image to be aligned, and processes the target image to be aligned to obtain an edge point set; the traversal unit 203 is used to arbitrarily select an edge point from the edge point set as a starting point, and traverse the edge point set according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set; the filling unit 204 is used to calculate the edge coordinates of the edge point set based on the starting point. At the actual distance, the internal area of ​​the image wrapped by the edge point set in the target image to be aligned is filled using the Poisson disk algorithm to obtain internal coordinates and internal count values ​​corresponding to the internal points; the uniform scaling unit 205 is used to eliminate and uniformize the internal points in the internal area of ​​the image through a elimination and uniformization method according to the number of drones to be aligned, the edge count value, the internal count value, the safety distance and the actual distance, and scale the edge coordinates and the internal coordinates to obtain target edge coordinates and target internal coordinates; the generation unit 206 is used to generate a drone performance pattern according to the target edge coordinates and the target internal coordinates.

[0050] In some embodiments, such as this embodiment, the conversion processing unit 202 includes a pixel enhancement unit, a conversion unit, and an edge extraction unit.

[0051] Among them, the pixel enhancement unit is used to perform pixel enhancement on the target image to be aligned to obtain the pixel image to be aligned; the conversion unit is used to convert the pixel image to be aligned into a grayscale image to obtain the grayscale image to be aligned; the edge extraction unit is used to perform edge extraction on the grayscale image to be aligned through an edge extraction function to obtain the edge point set.

[0052] In some embodiments, such as the present embodiment, the traversal unit 203 includes a search unit, a save unit, a modification execution unit, and a first return execution unit.

[0053] Among them, the search unit is used to use the actual distance as the search step length to search for the next collision-free point in the edge point set starting from the starting point; the saving unit is used to save the coordinates corresponding to the collision-free point if the next collision-free point can be found in the edge point set; the modification execution unit is used to modify the search step length to obtain a modified search step length if the next collision-free point cannot be found in the edge point set, and use the modified search step length as the search step length to return to execute the step of searching for the next collision-free point in the edge point set starting from the starting point until the next collision-free point can be found in the edge point set; the return execution unit is used to use the collision-free point as the starting point if all edge points in the edge point set have not been traversed, and return to execute the step of searching for the next collision-free point in the edge point set starting from the starting point with the actual distance as the search step length until all edge points in the edge point set are traversed, so as to obtain the edge count value and the edge coordinates.

[0054] In some embodiments, such as the present embodiment, the uniform scaling unit 205 includes a first computing unit, a second computing unit, an updating unit, a second return execution unit, a judging unit, a scaling unit, a culling unit, and a uniform execution unit.

[0055] Among them, the first calculation unit is used to calculate the sum of the edge count value and the internal count value to obtain a total count value; the second calculation unit is used to calculate the counting interval according to the number of drones to be aligned and the preset allowable deviation; the updating unit is used to update the actual distance according to the ratio of the total count value to the number of drones to be aligned to obtain an actual updated distance if the total count value is not within the counting interval; the second return execution unit is used to take the actual updated distance as the actual distance, and return to execute the step of traversing the edge point set according to the starting point and the actual distance to obtain the edge count value and the edge coordinates corresponding to all edge points in the edge point set; the judging unit is used to judge whether the total count value is equal to the number of drones to be aligned if the total count value is within the counting interval; the scaling unit The unit is used for scaling the edge coordinates and the internal coordinates according to the ratio of the safety distance to the actual distance to obtain the target edge coordinates and the target internal coordinates if the total value is equal to the number of drones to be aligned; the elimination unit is used for calculating the difference between the total value and the number of drones to be aligned to obtain the number of eliminations if the total value is not equal to the number of drones to be aligned, and eliminating the internal points of the elimination number in the internal area of ​​the image to obtain the image elimination internal points; the uniform execution unit is used for uniformizing the image elimination internal points using the improved Lloyd algorithm according to the number of drones to be aligned, and returning to execute the step of scaling the edge coordinates and the internal coordinates according to the ratio of the safety distance to the actual distance to obtain the target edge coordinates and the target internal coordinates.

[0056] In some embodiments, such as the present embodiment, the uniform execution unit includes a generation subunit and a moving uniform unit.

[0057] The generating subunit is used to generate a Voronoi diagram by using an improved Lloyd algorithm according to the internal coordinates corresponding to the internal points removed from the image, wherein the number of iterations of the improved Lloyd algorithm is set according to the number of drones to be aligned; the moving uniform unit is used to move each of the internal coordinates in the Voronoi diagram to the center of the polygon where the internal point corresponding to the internal coordinate is located, so as to uniformize the internal points removed from the image.

[0058] The above-mentioned device for generating the drone performance pattern can be implemented in the form of a computer program, which can be used in a computer program such as Figure 7 Runs on the computer device shown.

[0059] See also Figure 7 , Figure 7 300 is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device 300 is a device having a function of generating a drone performance pattern.

[0060] See also Figure 7 The computer device 300 includes a processor 302 , a memory and a network interface 305 connected via a system bus 301 , wherein the memory may include a non-volatile storage medium 303 and an internal memory 304 .

[0061] The non-volatile storage medium 303 can store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, the processor 302 can execute a method for generating a drone performance pattern.

[0062] The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300 .

[0063] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a method for generating a drone performance pattern.

[0064] The network interface 305 is used to communicate with other devices over the network. Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 300 to which the solution of the present invention is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0065] The processor 302 is used to run a computer program 3032 stored in the memory to implement any embodiment of the above-mentioned method for generating a drone performance pattern.

[0066] It should be understood that in the embodiment of the present invention, the processor 302 may be a central processing unit (CPU), and the processor 302 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0067] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0068] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, the processor executes any embodiment of the method for generating a drone performance pattern.

[0069] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0070] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0071] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0072] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0073] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device to execute all or part of the steps of the method described in each embodiment of the present invention.

[0074] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0075] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

[0076] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.< / cv::point>

Claims

1. A method for generating a drone performance pattern, characterized in that: include: Get the path of the image to be aligned, the number of drones to be aligned, the safe distance, and the actual distance; Inputting the path of the image to be aligned into a preset plug-in, so that the preset plug-in converts the image to be aligned to obtain a target image to be aligned, and processes the target image to be aligned to obtain an edge point set; An edge point is randomly selected from the edge point set as a starting point, and the edge point set is traversed according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set; Based on the actual distance, the internal area of ​​the image enclosed by the edge point set in the target image to be aligned is filled using the Poisson disk algorithm to obtain internal coordinates and internal count values ​​corresponding to the internal points; According to the number of drones to be aligned, the edge count value, the internal count value, the safety distance, and the actual distance, the internal points in the internal area of ​​the image are eliminated and homogenized by a elimination and homogenization method, and the edge coordinates and the internal coordinates are scaled to obtain target edge coordinates and target internal coordinates; Generate a drone performance pattern according to the target edge coordinates and the target internal coordinates; The method of eliminating and homogenizing the internal points in the internal area of ​​the image by a elimination and homogenization method according to the number of drones to be aligned, the edge count value, the internal count value, the safety distance, and the actual distance, and scaling the edge coordinates and the internal coordinates to obtain the target edge coordinates and the target internal coordinates, includes: Calculating the sum of the edge count value and the internal count value to obtain a total count value; Calculate the counting interval according to the number of drones to be aligned and the preset allowable deviation; If the total value is not within the counting interval, updating the actual distance according to the ratio of the total value to the number of the drones to be aligned to obtain an actual updated distance; Taking the actual updated distance as the actual distance, and returning to the step of traversing the edge point set according to the starting point and the actual distance to obtain edge count values ​​and edge coordinates corresponding to all edge points in the edge point set; If the total value is within the counting interval, determining whether the total value is equal to the number of drones to be aligned; If the total value is equal to the number of the drones to be aligned, scaling the edge coordinates and the internal coordinates according to the ratio of the safety distance to the actual distance to obtain the target edge coordinates and the target internal coordinates; If the total value is not equal to the number of the drones to be aligned, the difference between the total value and the number of the drones to be aligned is calculated to obtain the number of points to be eliminated, and the internal points of the number of points to be eliminated in the internal area of ​​the image are eliminated to obtain the image eliminated internal points; According to the number of drones to be aligned, the improved Lloyd algorithm is used to homogenize the image by removing internal points, and the step of scaling the edge coordinates and the internal coordinates according to the ratio of the safety distance to the actual distance to obtain the target edge coordinates and the target internal coordinates is returned to execute.

2. The method according to claim 1, characterized in that The step of processing the target image to be aligned to obtain an edge point set includes: Performing pixel enhancement on the target image to be aligned to obtain a pixel image to be aligned; Converting the pixel image to be aligned into a grayscale image to obtain a grayscale image to be aligned; The edge extraction function is used to extract the edge of the grayscale image to be aligned to obtain the edge point set.

3. The method according to claim 1, characterized in that The traversing the edge point set according to the starting point and the actual distance to obtain edge count values ​​and edge coordinates corresponding to all edge points in the edge point set includes: Using the actual distance as the search step length, searching for the next collision-free point in the edge point set starting from the starting point; If the next non-collision point can be found in the edge point set, the coordinates corresponding to the non-collision point are saved; If all edge points in the edge point set have not been traversed, the non-collision point is used as the starting point, and the step of searching for the next non-collision point in the edge point set starting from the starting point with the actual distance as the search step is returned to be executed until all edge points in the edge point set are traversed, so as to obtain the edge count value and the edge coordinates.

4. The method according to claim 3, characterized in that After the step of using the actual distance as the search step length and searching for the next collision-free point in the edge point set from the starting point, the method further includes: If the next collision-free point cannot be found in the edge point set, the search step length is modified to obtain a modified search step length, and the modified search step length is used as the search step length, and the step of searching for the next collision-free point in the edge point set starting from the starting point is returned to execute until the next collision-free point can be found in the edge point set.

5. The method according to claim 1, characterized in that: The step of using an improved Lloyd algorithm to homogenize the image by removing internal points according to the number of the drones to be aligned includes: Generate a Voronoi diagram by using an improved Lloyd algorithm according to the internal coordinates corresponding to the internal points removed from the image, wherein the number of iterations of the improved Lloyd algorithm is set according to the number of drones to be aligned; Each of the internal coordinates in the Voronoi diagram is moved to the center of the polygon where the internal point corresponding to the internal coordinate is located, so as to homogenize the image by eliminating internal points.

6. A device for generating a drone performance pattern, characterized in that: include: An acquisition unit, used to acquire the path of the image to be aligned, the number of drones to be aligned, the safety distance, and the actual distance; A conversion processing unit, used for inputting the path of the image to be aligned into a preset plug-in, so that the preset plug-in converts the image to be aligned to obtain a target image to be aligned, and processes the target image to be aligned to obtain an edge point set; A traversal unit, configured to arbitrarily select an edge point from the edge point set as a starting point, and traverse the edge point set according to the starting point and the actual distance to obtain an edge count value and edge coordinates corresponding to all edge points in the edge point set; A filling unit, configured to fill, based on the actual distance, an internal area of ​​the image enclosed by the edge point set in the target image to be aligned using a Poisson's disk algorithm to obtain internal coordinates and internal count values ​​corresponding to the internal points; a uniform scaling unit, configured to eliminate and uniformize the internal points in the internal area of ​​the image according to the number of drones to be aligned, the edge count value, the internal count value, the safety distance, and the actual distance by a elimination uniformization method, and to scale the edge coordinates and the internal coordinates to obtain target edge coordinates and target internal coordinates; A generating unit, configured to generate a drone performance pattern according to the target edge coordinates and the target internal coordinates; Wherein, the uniform scaling unit comprises: A first calculation unit, used for calculating the sum of the edge count value and the internal count value to obtain a total count value; A second calculation unit, configured to calculate a counting interval according to the number of the drones to be aligned and a preset allowable deviation; an updating unit, configured to update the actual distance according to a ratio of the total value to the number of the drones to be aligned to obtain an actual updated distance if the total value is not within the counting interval; a second return execution unit, configured to take the actual updated distance as the actual distance, and return to execute the step of traversing the edge point set according to the starting point and the actual distance to obtain edge count values ​​and edge coordinates corresponding to all edge points in the edge point set; A judging unit, configured to judge whether the total value is equal to the number of drones to be aligned if the total value is within the counting interval; a scaling unit, configured to scale the edge coordinates and the internal coordinates according to a ratio of the safety distance to the actual distance to obtain the target edge coordinates and the target internal coordinates if the total value is equal to the number of the drones to be aligned; a culling unit, configured to calculate the difference between the total value and the number of drones to be aligned to obtain a culling number if the total value is not equal to the number of drones to be aligned, and to cull the internal points of the culling number in the internal area of ​​the image to obtain image culling internal points; A uniform execution unit is used to uniformize the image by removing internal points using an improved Lloyd algorithm according to the number of drones to be aligned, and return to execute the step of scaling the edge coordinates and the internal coordinates according to the ratio of the safety distance to the actual distance to obtain the target edge coordinates and the target internal coordinates.

7. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 can be implemented.

Citation Information

Patent Citations

  • Controlling method for group formation fast transformation

    CN110209191A

  • Performance character picture generation method and system, cluster unmanned aerial vehicle, medium and terminal

    CN112581566A

Cited By

  • Unmanned aerial vehicle performance pattern generation method and device, computer equipment and storage medium

    CN120747288A

  • Unmanned aerial vehicle performance pattern generation method and device, computer device, and storage medium

    CN120747288B