Unmanned aerial vehicle coverage area distribution method based on k-means
Through the k-means-based drone coverage area allocation method, the problem of unsuitable regional allocation in the planning of multiple drone regional coverage tasks in the prior art is solved, and the uniform decomposition and automated allocation of target areas are achieved, and the task efficiency is improved.
Patent Information
- Application Number
- CN202510289466.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-13
AI Technical Summary
In the prior art, in the multi-unmanned aerial vehicle area coverage task planning, it is difficult to effectively allocate the target area, making the allocation area unsuitable and affecting the task efficiency.
The drone coverage area allocation method based on k-means is adopted. By clustering the boundary point coordinates of the target area by k-means, a uniformly distributed random points are generated, and the boundary point coordinates of each center point are calculated using the Voronoi graph algorithm to obtain sub-regions with approximately equal areas.
Decompose the target area into multiple sub-regions with approximately equal areas according to the number of drones, which facilitates the allocation of each drone, is suitable for any two-dimensional area, and can realize automated processing.
Smart Images

Figure CN120143880A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unmanned aerial vehicles, and particularly to a method for allocating coverage areas of unmanned aerial vehicles based on k-means. Background Art
[0002] Unmanned aerial vehicles are widely used in security monitoring, battlefield reconnaissance, target search, topographic mapping, mineral exploration, etc. Multi-unmanned aerial vehicle area coverage means that multiple unmanned aerial vehicles can traverse and scan a target area without omission under certain constraints. When performing unmanned aerial vehicle mission planning, since multiple unmanned aerial vehicles are involved, it is necessary to consider dividing the area to be covered and allocating it to each unmanned aerial vehicle for scanning. To minimize the scanning time, the allocated areas should be as equal as possible in size. Currently, the commonly used method is to divide the target area into convex polygons, and the divided areas usually vary greatly in size, which is not suitable for multi-unmanned aerial vehicle mission planning. Summary of the Invention
[0003] To solve the existing problems, the present invention provides an algorithm for allocating coverage areas of unmanned aerial vehicles based on k-means. The specific scheme is as follows:
[0004] A method for allocating coverage areas of unmanned aerial vehicles based on k-means includes the following steps:
[0005] S1, taking the number of unmanned aerial vehicles and the binary image of the target area as the input of the algorithm, and denoting the number of unmanned aerial vehicles as n;
[0006] S2, extracting the coordinate C of the boundary points of the target area, then calculating the minimum circumscribed rectangle R of C, and randomly generating a number of points according to a uniform distribution within R, and denoting the coordinate set of all points in C as P;
[0007] S3, using the k-means algorithm to divide P into n classes, and denoting the set composed of the center point coordinates of the n classes as center;
[0008] S4, using the Voronoi diagram algorithm to calculate the boundary point coordinates of each center point in center to obtain Voronoi polygons, denoted as V;
[0009] S5, finding the intersection of the Voronoi polygons and the target area C to obtain the boundary point coordinate sequences of n sub-areas with approximately equal areas.
[0010] Preferably, 5000 points are randomly generated according to a uniform distribution within R in step S2.
[0011] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. After the computer program runs, it executes the method described in any one of the above.
[0012] The present invention also discloses a computer system, which includes a processor and a storage medium. A computer program is stored on the storage medium, and the processor reads and runs the computer program from the storage medium to execute the method described in any one of the above.
[0013] The beneficial effects of the present invention are as follows:
[0014] The present invention can decompose the target area to be covered according to the number of drones into multiple sub-areas with approximately equal areas, which is convenient for the allocation of each drone. This algorithm is applicable to any two-dimensional area and can be implemented in any programming language. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0016] Figure 1 For the target area in Embodiment 1;
[0017] Figure 2 For the 6 sub-areas in Embodiment 1. DETAILED DESCRIPTION OF THE INVENTION
[0018] In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0019] A method for allocating the coverage area of drones based on k-means includes the following steps:
[0020] S1. Take the number of drones and the binary image of the target area as the input of the algorithm, and denote the number of drones as n;
[0021] S2. Extract the coordinate C of the boundary points of the target area, then calculate the minimum circumscribed rectangle R of C, and randomly generate several points according to a uniform distribution within R. Denote the coordinate set of all points in C as P;
[0022] S3. Use the k-means algorithm to divide P into n categories, and denote the set composed of the center point coordinates of the n categories as center;
[0023] S4. Use the Voronoi diagram algorithm to calculate the boundary point coordinates of each center point in center, obtaining a Voronoi polygon, denoted as V.
[0024] S5. Intersect the Voronoi polygon with the target area C to obtain the boundary point coordinate sequences of n sub-areas with approximately equal areas.
[0025] Example 1:
[0026] Suppose the number of drones n = 6, and the target area is as Figure 1 shown. Implement the algorithm in Python language. The Python libraries used are random, numpy, sklearn.cluster.KMeans, scipy.spatial.Voronoi, cv2, and shapely.geometry. Read the image and use the cv2.findContours function to extract the target area boundary C as follows:
[0027] C=[[304,41],[303,42],[302,42],[301,43],[300,43],[298,45],[297,45],[296,46],[295,46],[293,48],[292,48],[291,49],[290,49],[289,50],[288,50],[286,52],[285,52],[284,53],[283,53],[281,55],[280,55],[279,56],[278,56],[276,58],[275,58],[274,59],[273,59],[271,61],[270,61],[269,62],[268,62],[267,63],[266,63],[264,65],[263,65],[262,66],[261,66],[259,68],[258,68],[257,69],[256,69],[254,71],[253,71],[252,72],[251,72],[250,73],[249,73],[247,75],[246,75],[245,76],[244,76],[242,78],[241,78],[240,79],[239,79],[237,81],[236,81],[235,82],[234,82],[232,84],[231,84],[230,85],[229,85],[228,86],[227,86],[225,88],[224,88],[224,89],[223,90],[223,102],[222,103],[222,123],[221,124],[221,144],[220,145],[220,164],[219,165],[219,185],[218,186],[218,206],[217,207],[217,227],[216,228],[216,248],[215,249],[215,268],[214,269],[214,289],[213,290],[213,310],[212,311],[212,331],[211,332],[211,352],[210,353],[210,372],[209,373],[209,381],[210,382],[210,383],[228,383],[229,382],[260,382],[261,381],[292,381],[293,380],[323,380],[324,379],[355,379],[356,378],[387,378],[388,377],[418,377],[419,376],[450,376],[451,375],[482,375],[483,374],[499,374],[500,373],[502,373],[503,372],[504,372],[505,371],[507,371],[508,370],[509,370],[510,369],[512,369],[513,368],[514,368],[515,367],[517,367],[518,366],[519,366],[520,365],[522,365],[523,364],[524,364],[525,363],[527,363],[528,362],[529,362],[530,361],[532,361],[533,360],[534,360],[535,359],[537,359],[538,358],[539,358],[540,357],[542,357],[543,356],[544,356],[545,355],[547,355],[548,354],[549,354],[550,353],[552,353],[553,352],[554,352],[555,351],[557,351],[558,350],[559,350],[560,349],[562,349],[563,348],[564,348],[565,347],[567,347],[568,346],[569,346],[570,345],[572,345],[573,344],[574,344],[575,343],[577,343],[578,342],[579,342],[580,341],[582,341],[583,340],[584,340],[585,339],[587,339],[588,338],[589,338],[590,337],[592,337],[593,336],[594,336],[595,335],[597,335],[598,334],[599,334],[600,333],[602,333],[603,332],[604,332],[605,331],[607,331],[608,330],[609,330],[610,329],[612,329],[613,328],[614,328],[614,324],[613,323],[613,322],[612,321],[612,320],[611,319],[611,318],[610,317],[610,316],[609,315],[609,314],[608,313],[608,312],[607,311],[607,309],[606,308],[606,307],[605,306],[605,305],[604,304],[604,303],[603,302],[603,301],[602,300],[602,299],[601,298],[601,297],[600,296],[600,295],[599,294],[599,293],[598,292],[598,291],[597,290],[597,289],[596,288],[596,287],[595,286],[595,285],[594,284],[594,283],[593,282],[593,280],[592,279],[592,278],[591,277],[591,276],[590,275],[590,274],[589,273],[589,272],[588,271],[588,270],[587,269],[587,268],[586,267],[586,266],[585,265],[585,264],[584,263],[584,262],[583,261],[583,260],[582,259],[582,258],[581,257],[581,256],[580,255],[580,254],[579,253],[579,252],[578,251],[578,249],[577,248],[577,247],[576,246],[576,245],[575,244],[575,243],[574,242],[574,241],[573,240],[573,239],[572,238],[572,237],[571,236],[571,235],[570,234],[570,233],[569,232],[569,231],[568,230],[568,229],[567,228],[567,227],[566,226],[566,225],[565,224],[565,223],[564,222],[564,221],[563,220],[563,218],[562,217],[562,216],[561,215],[561,214],[560,213],[560,212],[559,211],[559,210],[558,209],[558,208],[557,207],[557,206],[556,205],[556,204],[555,203],[555,202],[554,202],[553,201],[552,202],[549,202],[548,203],[545,203],[544,204],[542,204],[541,205],[538,205],[537,206],[535,206],[534,207],[531,207],[530,208],[528,208],[527,209],[524,209],[523,210],[520,210],[519,211],[517,211],[516,212],[513,212],[512,213],[510,213],[509,214],[506,214],[505,215],[503,215],[502,216],[499,216],[498,217],[496,217],[495,218],[492,218],[491,219],[488,219],[487,220],[485,220],[484,221],[481,221],[480,222],[478,222],[477,223],[474,223],[473,224],[471,224],[470,225],[467,225],[466,226],[463,226],[462,227],[460,227],[459,228],[456,228],[455,229],[453,229],[452,230],[449,230],[448,231],[446,231],[445,232],[440,232],[439,231],[439,229],[438,228],[438,227],[437,226],[437,225],[436,224],[436,223],[435,222],[435,220],[434,219],[434,218],[433,217],[433,216],[432,215],[432,214],[431,213],[431,211],[430,210],[430,209],[429,208],[429,207],[428,206],[428,205],[427,204],[427,202],[426,201],[426,200],[425,199],[425,198],[424,197],[424,196],[423,195],[423,193],[422,192],[422,191],[421,190],[421,189],[420,188],[420,187],[419,186],[419,184],[418,183],[418,182],[417,181],[417,180],[416,179],[416,178],[415,177],[415,175],[414,174],[414,173],[413,172],[413,171],[412,170],[412,169],[411,168],[411,166],[410,165],[410,164],[409,163],[409,162],[408,161],[408,160],[407,159],[407,157],[406,156],[406,155],[405,154],[405,153],[404,152],[404,151],[403,150],[403,148],[402,147],[402,146],[401,145],[401,144],[400,143],[400,142],[399,141],[399,139],[398,138],[398,137],[397,136],[397,135],[396,134],[396,133],[395,132],[395,130],[394,129],[394,128],[393,127],[393,126],[392,126],[391,125],[390,126],[388,126],[387,127],[385,127],[384,128],[383,128],[382,129],[380,129],[379,130],[377,130],[376,131],[374,131],[373,132],[372,132],[371,133],[369,133],[368,134],[366,134],[365,135],[363,135],[362,136],[361,136],[360,137],[358,137],[357,138],[355,138],[354,139],[352,139],[351,140],[350,140],[349,141],[347,141],[346,142],[344,142],[343,143],[341,143],[340,144],[339,144],[338,145],[337,145],[326,134],[325,134],[299,108],[298,108],[285,95],[286,94],[286,92],[287,91],[287,90],[288,89],[288,87],[289,86],[289,85],[290,84],[290,83],[291,82],[291,80],[292,79],[292,78],[293,77],[293,76],[294,75],[294,73],[295,72],[295,71],[296,70],[296,69],[297,68],[297,66],[298,65],[298,64],[299,63],[299,61],[300,60],[300,59],[301,58],[301,57],[302,56],[302,54],[303,53],[303,52],[304,51],[304,50],[305,49],[305,47],[306,46],[306,42],[305,42]],
[0028] Then, use the cv2.minAreaRect function to calculate the minimum bounding rectangle R of the target area. Then, use the random.uniform function to randomly generate 5000 points within the minimum bounding rectangle. Next, call the KMeans function to calculate the center coordinates center of the 6 sub-regions obtained as follows:
[0029] center=[[265.26465812144.04604089],[452.63674176319.28261569],[256.70369838 306.93477539],[538.00293861 278.57668636],[345.26458476322.77572176],[361.11623315208.06951244]]
[0030] Then call the Voronoi function to obtain the following Voronoi polygons:
[0031] V=[[(279.5214675522034,226.4646743322052),(717.8633028845416,-429.7908254028399),(1144.106516943401,-1293.927326547298),(-682.6935399485733,175.8934425725109),(279.5214675522034,226.4646743322052)],[(458.3220681728835,221.3399941601407),(397.3401206048342,271.5238186785713),(414.9491410128565,812.7952437846068),(691.4143187988466,710.1680170211179),(458.3220681728835,221.3399941601407)],[(279.5214675522034,226.4646743322052),(310.8722427776368,259.5745231368155),(186.3794146350747,955.5679912905593),(-426.5439066747377,189.355924833204),(279.5214675522034,226.4646743322052)],[(717.8633028845416,-429.7908254028399),(458.3220681728835,221.3399941601407),(981.1305459170344,1317.744674385766),(1255.19932061162,-1519.149320699506),(717.8633028845416,-429.7908254028399)],[(397.3401206048342,271.5238186785713),(310.8722427776368,259.5745231368155),(217.0226093212815,784.2531961881425),(414.6710775750049,804.2480452586019),(397.3401206048342,271.5238186785713)],[(397.3401206048342,271.(5238186785713),(458.3220681728835,221.3399941601407),(717.8633028845416,-429.7908254028399),(279.5214675522034,226.4646743322052),(310.8722427776368,259.5745231368155),(397.3401206048342,271.5238186785713)]].
[0032] Finally, call the Polygon.intersection function to find the intersection of V and C, and the coordinate sequences of the boundary points of 6 sub-regions are obtained as follows:
[0033] polygon1 = [(279.5214675522034, 226.46467433220516), 335.1625862683907, 143.16258626839073), (326.0, 134.0), (325.0, 134.0), (299.0, 108.0), (298.0, 108.0), (285.0, 95.0), (286.0, 94.0), (286.0, 92.0), (287.0, 91.0), (287.0, 90.0), (288.0, 89.0), (288.0, 87.0), (289.0, 86.0), (289.0, 85.0), (290.0, 84.0), (290.0, 83.0), (291.0, 82.0), (291.0, 80.0), (292.0, 79.0), (292.0, 78.0), (293.0, 77.0), (293.0, 76.0), (294.0, 75.0), (294.0, 73.0), (295.0, 72.0), (295.0, 71.0), (296.0, 70.0), (296.0, 69.0), (297.0, 68.0), (297.0, 66.0), (298.0, 65.0), (298.0, 64.0), (299.0, 63.0), (299.0, 61.0), (300.0, 60.0), (300.0, 59.0), (301.0, 58.0), (301.0, 57.0), (302.0, 56.0), (302.0, 54.0), (303.0, 53.0), (303.0, 52.0), (304.0, 51.0), (304.0, 50.0), (305.0, 49.0), (305.0, 47.0), (306.0, 46.0), (306.0, 42.0), (305.0, 42.0), (304.0, 41.0), (303.0, 42.0), (302.0, 42.0), (301.0, 43.0), (300.0, 43.0), (298.0, 45.0), (297.0, 45.0), (296.0, 46.0), (295.0, 46.0), (293.0, 48.0), (292.0, 48.0), (291.0, 49.0), (290.0, 49.0), (289.0, 50.0), (288.0, 50.0), (286.0, 52.0), (285.0, 52.0), (284.0, 53.0), (283.0, 53.0), (281.0, 55.0), (280.0, 55.0), (279.0, 56.0),(278.0,56.0),(276.0,58.0),(275.0,58.0),(274.0,59.0),(273.0,59.0),(271.0,61.0),(270.0,61.0),(269.0,62.0),(268.0,62.0),(267.0,63.0),(266.0,63.0),(264.0,65.0),(263.0,65.0),(262.0,66.0),(261.0,66.0),(259.0,68.0),(258.0,68.0),(257.0,69.0),(256.0,69.0),(254.0,71.0),(253.0,71.0),(252.0,72.0),(251.0,72.0),(250.0,73.0),(249.0,73.0),(247.0,75.0),(246.0,75.0),(245.0,76.0),(244.0,76.0),(242.0,78.0),(241.0,78.0),(240.0,79.0),(239.0,79.0),(237.0,81.0),(236.0,81.0),(235.0,82.0),(234.0,82.0),(232.0,84.0),(231.0,84.0),(230.0,85.0),(229.0,85.0),(228.0,86.0),(227.0,86.0),(225.0,88.0),(224.0,88.0),(224.0,89.0),(223.0,90.0),(223.0,102.0),(222.0,103.0),(222.0,123.0),(221.0,124.0),(221.0,144.0),(220.0,145.0),(220.0,164.0),(219.0,165.0),(219.0,185.0),(218.0,186.0),(218.0,206.0),(217.0,207.0),(217.0,223.17872721966637),(279.5214675522034,226.46467433220516)]].
[0034] polygon2 = [[(446.58350549285103, 231.0), (397.34012060483417, 271.52381867857133), (400.77154547468655, 377.0), (418.0, 377.0), (419.0, 376.0), (450.0, 376.0), (451.0, 375.0), (482.0, 375.0), (483.0, 374.0), (499.0, 374.0), (500.0, 373.0), (502.0, 373.0), (503.0, 372.0), (504.0, 372.0), (505.0, 371.0), (507.0, 371.0), (508.0, 370.0), (509.0, 370.0), (510.0, 369.0), (512.0, 369.0), (513.0, 368.0), (514.0, 368.0), (515.0, 367.0), (517.0, 367.0), (518.0, 366.0), (519.0, 366.0), (520.0, 365.0), (522.0, 365.0), (523.0, 364.0), (524.0, 364.0), (525.0, 363.0), (525.8710793601794, 363.0), (461.0209795242568, 227.0), (460.0, 227.0), (459.0, 228.0), (456.0, 228.0), (455.0, 229.0), (453.0, 229.0), (452.0, 230.0), (449.0, 230.0), (448.0, 231.0), (446.58350549285103, 231.0)]]
[0035] polygon3 = [[(289.1527846003111, 381.0), (310.8722427776368, 259.57452313681546), (279.5214675522034, 226.46467433220516), (217.0, 223.17872721966637), (217.0, 227.0), (216.0, 228.0), (216.0, 248.0), (215.0, 249.0), (215.0, 268.0), (214.0, 269.0), (214.0, 289.0), (213.0, 290.0), (213.0, 310.0), (212.0, 311.0), (212.0, 331.0), (211.0, 332.0), (211.0, 352.0), (210.0, 353.0), (210.0, 372.0), (209.0, 373.0), (209.0, 381.0), (210.0, 382.0), (210.0, 383.0), (228.0, 383.0), (229.0, 382.0), (260.0, 382.0), (261.0, 381.0), (289.1527846003111, 381.0)]]
[0036] polygon4 = [[(461.0209795242568, 227.0), (525.8710793601794, 363.0), (527.0, 363.0), (528.0, 362.0), (529.0, 362.0), (530.0, 361.0), (532.0, 361.0), (533.0, 360.0), (534.0, 360.0), (535.0, 359.0), (537.0, 359.0),
[0037] (538.0, 358.0), (539.0, 358.0), (540.0, 357.0), (542.0, 357.0), (543.0,
[0038] 356.0), (544.0, 356.0), (545.0, 355.0), (547.0, 355.0), (548.0, 354.0),
[0039] (549.0, 354.0), (550.0, 353.0), (552.0, 353.0), (553.0, 352.0), (554.0,
[0040] 352.0),(555.0,351.0),(557.0,351.0),(558.0,350.0),(559.0,350.0),
[0041] (560.0,349.0),(562.0,349.0),(563.0,348.0),(564.0,348.0),(565.0,
[0042] 347.0),(567.0,347.0),(568.0,346.0),(569.0,346.0),(570.0,345.0),
[0043] (572.0,345.0),(573.0,344.0),(574.0,344.0),(575.0,343.0),(577.0,
[0044] 343.0),(578.0,342.0),(579.0,342.0),(580.0,341.0),(582.0,341.0),
[0045] (583.0,340.0),(584.0,340.0),(585.0,339.0),(587.0,339.0),(588.0,
[0046] 338.0),(589.0,338.0),(590.0,337.0),(592.0,337.0),(593.0,336.0),
[0047] (594.0,336.0),(595.0,335.0),(597.0,335.0),(598.0,334.0),(599.0,
[0048] 334.0),(600.0,333.0),(602.0,333.0),(603.0,332.0),(604.0,332.0),
[0049] (605.0,331.0),(607.0,331.0),(608.0,330.0),(609.0,330.0),(610.0,
[0050] 329.0),(612.0,329.0),(613.0,328.0),(614.0,328.0),(614.0,324.0),
[0051] (613.0,323.0),(613.0,322.0),(612.0,321.0),(612.0,320.0),(611.0,
[0052] 319.0),(611.0,318.0),(610.0,317.0),(610.0,316.0),(609.0,315.0),
[0053] (609.0,314.0),(608.0,313.0),(608.0,312.0),(607.0,311.0),(607.0,
[0054] 309.0),(606.0,308.0),(606.0,307.0),(605.0,306.0),(605.0,305.0),
[0055] (604.0,304.0),(604.0,303.0),(603.0,302.0),(603.0,301.0),(602.0,
[0056] 300.0),(602.0,299.0),(601.0,298.0),(601.0,297.0),(600.0,296.0),
[0057] (600.0,295.0),(599.0,294.0),(599.0,293.0),(598.0,292.0),(598.0,
[0058] 291.0),(597.0,290.0),(597.0,289.0),(596.0,288.0),(596.0,287.0),
[0059] (595.0,286.0),(595.0,285.0),(594.0,284.0),(594.0,283.0),(593.0,
[0060] 282.0),(593.0,280.0),(592.0,279.0),(592.0,278.0),(591.0,277.0),
[0061] (591.0,276.0),(590.0,275.0),(590.0,274.0),(589.0,273.0),(589.0,
[0062] 272.0),(588.0,271.0),(588.0,270.0),(587.0,269.0),(587.0,268.0),
[0063] (586.0,267.0),(586.0,266.0),(585.0,265.0),(585.0,264.0),(584.0,
[0064] 263.0),(584.0,262.0),(583.0,261.0),(583.0,260.0),(582.0,259.0),
[0065] (582.0,258.0),(581.0,257.0),(581.0,256.0),(580.0,255.0),(580.0,
[0066] 254.0),(579.0,253.0),(579.0,252.0),(578.0,251.0),(578.0,249.0),
[0067] (577.0,248.0),(577.0,247.0),(576.0,246.0),(576.0,245.0),(575.0,
[0068] 244.0),(575.0,243.0),(574.0,242.0),(574.0,241.0),(573.0,240.0),
[0069] (573.0,239.0),(572.0,238.0),(572.0,237.0),(571.0,236.0),(571.0,
[0070] 235.0),(570.0,234.0),(570.0,233.0),(569.0,232.0),(569.0,231.0),
[0071] (568.0,230.0),(568.0,229.0),(567.0,228.0),(567.0,227.0),(566.0,
[0072] 226.0),(566.0,225.0),(565.0,224.0),(565.0,223.0),(564.0,222.0),
[0073] (564.0,221.0),(563.0,220.0),(563.0,218.0),(562.0,217.0),(562.0,
[0074] 216.0),(561.0,215.0),(561.0,214.0),(560.0,213.0),(560.0,212.0),
[0075] (559.0,211.0),(559.0,210.0),(558.0,209.0),(558.0,208.0),(557.0,
[0076] 207.0),(557.0,206.0),(556.0,205.0),(556.0,204.0),(555.0,203.0),
[0077] (555.0,202.0),(554.0,202.0),(553.0,201.0),(552.0,202.0),(549.0,
[0078] 202.0),(548.0,203.0),(545.0,203.0),(544.0,204.0),(542.0,204.0),
[0079] (541.0,205.0),(538.0,205.0),(537.0,206.0),(535.0,206.0),(534.0,
[0080] (207.0),(531.0,207.0),(530.0,208.0),(528.0,208.0),(527.0,209.0),(524.0,209.0),(523.0,210.0),(520.0,210.0),(519.0,211.0),(517.0,211.0),(516.0,212.0),(513.0,212.0),(512.0,213.0),(510.0,213.0),(509.0,214.0),(506.0,214.0),(505.0,215.0),(503.0,215.0),(502.0,216.0),(499.0,216.0),(498.0,217.0),(496.0,217.0),(495.0,218.0),(492.0,218.0),(491.0,219.0),(488.0,219.0),(487.0,220.0),(485.0,220.0),(484.0,221.0),(481.0,221.0),(480.0,222.0),(478.0,222.0),(477.0,223.0),(474.0,223.0),(473.0,224.0),(471.0,224.0),(470.0,225.0),(467.0,225.0),(466.0,226.0),(463.0,226.0),(462.0,227.0),(461.0209795242568,227.0)]
[0081] polygon5 = [[(397.34012060483417,271.52381867857133),(310.8722427776368,259.57452313681546),(289.1527846003112,381.0),(292.0,381.0),(293.0,380.0),(323.0,380.0),(324.0,379.0),(355.0,379.0),(356.0,378.0),(387.0,378.0),(388.0,377.0),(400.77154547468655,377.0),(397.34012060483417,271.52381867857133)]]
[0082] polygon6 = [[(397.34012060483417, 271.52381867857133), (446.58350549285103, 231.0), (446.0, 231.0), (445.0, 232.0), (440.0, 232.0), (439.0, 231.0), (439.0, 229.0), (438.0, 228.0), (438.0, 227.0), (437.0, 226.0), (437.0, 225.0), (436.0, 224.0), (436.0, 223.0), (435.0, 222.0), (435.0, 220.0), (434.0, 219.0), (434.0, 218.0), (433.0, 217.0), (433.0, 216.0), (432.0, 215.0), (432.0, 214.0), (431.0, 213.0), (431.0, 211.0), (430.0, 210.0), (430.0, 209.0), (429.0, 208.0), (429.0, 207.0),
[0083] (428.0, 206.0), (428.0, 205.0), (427.0, 204.0), (427.0, 202.0), (426.0,
[0084] 201.0), (426.0, 200.0), (425.0, 199.0), (425.0, 198.0), (424.0, 197.0),
[0085] (424.0, 196.0), (423.0, 195.0), (423.0, 193.0), (422.0, 192.0), (422.0,
[0086] 191.0), (421.0, 190.0), (421.0, 189.0), (420.0, 188.0), (420.0, 187.0),
[0087] (419.0, 186.0), (419.0, 184.0), (418.0, 183.0), (418.0, 182.0), (417.0,
[0088] 181.0), (417.0, 180.0), (416.0, 179.0), (416.0, 178.0), (415.0, 177.0),
[0089] (415.0,175.0),(414.0,174.0),(414.0,173.0),(413.0,172.0),(413.0,
[0090] 171.0),(412.0,170.0),(412.0,169.0),(411.0,168.0),(411.0,166.0),
[0091] (410.0,165.0),(410.0,164.0),(409.0,163.0),(409.0,162.0),(408.0,
[0092] 161.0),(408.0,160.0),(407.0,159.0),(407.0,157.0),(406.0,156.0),
[0093] (406.0,155.0),(405.0,154.0),(405.0,153.0),(404.0,152.0),(404.0,
[0094] 151.0),(403.0,150.0),(403.0,148.0),(402.0,147.0),(402.0,146.0),
[0095] (401.0,145.0),(401.0,144.0),(400.0,143.0),(400.0,142.0),(399.0,
[0096] 141.0),(399.0,139.0),(398.0,138.0),(398.0,137.0),(397.0,136.0),
[0097] (397.0,135.0),(396.0,134.0),(396.0,133.0),(395.0,132.0),(395.0,
[0098] 130.0),(394.0,129.0),(394.0,128.0),(393.0,127.0),(393.0,126.0),
[0099] (392.0,126.0),(391.0,125.0),(390.0,126.0),(388.0,126.0),(387.0,
[0100] (127.0),(385.0,127.0),(384.0,128.0),(383.0,128.0),(382.0,129.0),
[0101] (380.0,129.0),(379.0,130.0),(377.0,130.0),(376.0,131.0),(374.0,
[0102] 131.0),(373.0,132.0),(372.0,132.0),(371.0,133.0),(369.0,133.0),
[0103] (368.0,134.0),(366.0,134.0),(365.0,135.0),(363.0,135.0),(362.0,
[0104] 136.0),(361.0,136.0),(360.0,137.0),(358.0,137.0),(357.0,138.0),(355.0,138.0),(354.0,139.0),(352.0,139.0),(351.0,140.0),(350.0,140.0),(349.0,141.0),(347.0,141.0),(346.0,142.0),(344.0,142.0),(343.0,143.0),(341.0,143.0),(340.0,144.0),(339.0,144.0),(338.0,145.0),(337.0,145.0),(335.1625862683907,143.16258626839073),(279.5214675522034,226.46467433220516),(310.8722427776368,259.57452313681546),(397.34012060483417,271.52381867857133)]]
[0105] Finally, each sub-region is as Figure 2 shown.
[0106] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. After the computer program runs, it executes the method described in any one of the above.
[0107] The present invention also discloses a computer system, including a processor and a storage medium. A computer program is stored on the storage medium, and the processor reads and runs the computer program from the storage medium to execute the method described in any one of the above.
[0108] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, the various illustrative components, blocks, modules, circuits, and steps are described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and the design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
[0109] The various illustrative logical blocks, modules, and circuits described in connection with the embodiments disclosed herein can be implemented using a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors cooperating with a DSP core, or any other such configuration.
[0110] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of both. The software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read from, and write to, the storage medium. In the alternative, the storage medium may be integrated into the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
[0111] In one or more exemplary embodiments, the described functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software as a computer program product, the functions may be stored on or transmitted via a computer-readable medium as one or more instructions or code. The computer-readable medium includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. The storage media may be any available media that can be accessed by a computer. By way of example and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a web site, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc where disks typically reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0112] The foregoing description of the disclosure has been provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0113] Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for allocating UAV coverage areas based on k-means, characterized in that: The following steps are involved: S1, the number of drones and the binary image of the target area are used as the input of the algorithm, and the number of drones is recorded as n; S2, extract the coordinates C of the boundary points of the target area, then calculate the minimum circumscribed rectangle R of C, and randomly generate several points in R according to uniform distribution, and record the coordinate set of all points in C as P; S3, use the k-means algorithm to divide P into n categories, and record the set of center point coordinates of n categories as center; S4, using the Voronoi diagram algorithm to calculate the coordinates of the boundary points of each center point in center, and obtain the Voronoi polygon, denoted as V; S5, the Voronoi polygon intersects with the target area C to obtain a coordinate sequence of boundary points of n sub-areas of equal area.
2. The method according to claim 1, characterized in that: In step S2, 5000 points are randomly generated in R according to uniform distribution.
3. A computer-readable storage medium, characterized in that: A computer program is stored on the medium, and after the computer program is run, the method according to any one of claims 1 to 2 is executed.
4. A computer system, characterized in that: The method comprises a processor and a storage medium, wherein a computer program is stored in the storage medium, and the processor reads and runs the computer program from the storage medium to execute the method as claimed in any one of claims 1 to 2.