Disclosure of Invention
The embodiment of the invention provides an automatic planning method and system for an unmanned aerial vehicle air route.
The technical scheme is as follows:
on one hand, the method for automatically planning the air route of the unmanned aerial vehicle is used for the auxiliary pollination operation of the unmanned aerial vehicle, plants in a field needing auxiliary pollination are planted in rows, and male parent rows and female parent rows of the plants are mutually spaced, and the method comprises the following steps: dividing an auxiliary pollination operation area on a satellite map; acquiring an unmanned aerial vehicle aerial image of an auxiliary pollination operation area; making an orthographic image from an aerial image of an unmanned aerial vehicle, and extracting and determining a field image needing auxiliary pollination from the orthographic image; determining respective images of a male parent line and a female parent line in the field image through image segmentation; performing linear fitting on the image boundaries of the male parent row and the female parent row to obtain the segmentation straight lines of the male parent row and the female parent row; determining the center line of the parent line according to the obtained segmentation straight line, and extracting a waypoint; converting the pixel coordinates of the extracted waypoints into coordinates of a geodetic coordinate system; and planning the unmanned aerial vehicle operation route based on the waypoint coordinates in the geodetic coordinate system.
Optionally, use unmanned aerial vehicle operation region of taking photo by plane, the preparation orthophoto image of taking photo by plane includes: the optical camera and the satellite positioning equipment carried by the unmanned aerial vehicle are utilized to acquire the aerial image of the unmanned aerial vehicle in the auxiliary pollination operation area, and the aerial image of the unmanned aerial vehicle is made into a orthographic image by utilizing the photogrammetric technology.
Optionally, before extracting the field image needing supplementary pollination from the ortho image, the method further includes: and enhancing the color image of the orthoimage by adopting a histogram equalization method, thereby improving the contrast.
Optionally, extracting the field image needing supplementary pollination from the ortho image comprises: selecting at least one regional image sample representing the color and texture characteristics of the male parent and the female parent of a plant from the orthographic images, wherein each regional image sample simultaneously comprises images of the male parent and the female parent; and extracting a field image needing auxiliary pollination from the aerial orthographic image of the unmanned aerial vehicle by adopting a region growing algorithm based on the color and texture characteristics of male parent lines and female parent lines of rice in the region image sample.
Optionally, extracting a field image needing supplementary pollination from the aerial orthographic image of the unmanned aerial vehicle by using a region growing algorithm comprises: adopting a region growing algorithm, selecting one of the obtained region image samples as a seed pixel, taking the texture and the color of the region image sample as a similarity criterion, starting growing from the position of the region image sample until a communicated region meeting the texture and the color characteristics of the sample is marked, performing morphological dilation treatment, removing holes in the region, then calculating the ratio of the area of the grown region to the total area of the image, identifying the growing region meeting a certain condition as a field needing auxiliary pollination, and extracting a field image.
Optionally, determining respective images of the male parent row and the female parent row in the field image by image segmentation includes: converting the extracted field image from an RGB color space to an HSV color space; acquiring a histogram of the field image, wherein two peak values of the histogram represent a male parent row and a female parent row respectively; and generating a corresponding binary image based on the histogram, wherein according to the constraint condition, the binary image with a large area is a female parent, and the binary image with a small area is a male parent.
Optionally, performing linear fitting on the image boundaries of the male parent row and the female parent row to obtain the segmentation straight lines of the male parent row and the female parent row includes: extracting the edges of the image areas of the male parent line and the female parent line by setting an area threshold constraint condition, fitting straight lines of the edges by using a Hough transformation method to obtain the slope of each straight line, and calculating the probability distribution of the slopes to find out the straight lines in a threshold range to serve as segmentation straight lines of the male parent line and the female parent line.
Optionally, determining a centerline of the parent line according to the obtained segmentation straight line, and extracting the waypoint includes: according to the condition constraint of the line width of the male parent, the area between two adjacent straight lines with smaller distance between the segmentation straight lines of the male parent line and the segmentation straight line of the female parent line is determined as the male parent, so that the central line of the male parent line is obtained, and a waypoint is extracted from the central line, wherein the waypoint refers to the intersection point of the central line and the field boundary or the intersection point of the central line and the central line.
Optionally, planning the unmanned aerial vehicle operation route based on the waypoint coordinates in the geodetic coordinate system includes: and selecting a nearest waypoint according to the position of the unmanned aerial vehicle and the central line constraint of the male parent, starting to sequentially traverse other waypoints by defaulting on the principle of priority on the left side, starting to traverse the right waypoint closest to the last waypoint on the left side after traversing the left waypoint if the waypoint on the right side exists, continuing traversing until the reciprocating route planning is completed, and finally uploading the completed planned route of the unmanned aerial vehicle to guide the unmanned aerial vehicle to operate.
On the other hand, provide an unmanned aerial vehicle airline automatic planning system for unmanned aerial vehicle supplementary pollination operation, the plant branch row in the field piece that needs supplementary pollination is planted, and the male parent row and female parent row of plant separate each other, the system includes: the marking module is used for dividing an auxiliary pollination operation area on the satellite map; the acquisition module is used for acquiring an unmanned aerial vehicle aerial image of the auxiliary pollination operation area; the image processing module is used for making an orthographic image from the aerial image of the unmanned aerial vehicle, extracting and determining a field image needing auxiliary pollination, determining images of a male parent line and a female parent line in the field image through image segmentation, and performing linear fitting on image boundaries of the male parent line and the female parent line to obtain segmentation straight lines of the male parent line and the female parent line; the data processing module is used for determining the center line of the parent line, extracting the pixel coordinate of the center line and converting the extracted pixel coordinate of the navigation point into the coordinate under a geodetic coordinate system; and the route planning module is used for planning the unmanned aerial vehicle operation route based on the coordinates of the waypoint in the geodetic coordinate system.
According to the technical scheme, the embodiment of the invention has the following advantages:
by using the method of remote sensing mapping and image analysis, the automatic planning of the auxiliary pollination operation air route of the hybrid rice of the unmanned aerial vehicle can be realized.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," and the like in the description and in the claims, and in the above-described drawings, are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The following are detailed descriptions of the respective embodiments.
The invention provides an automatic planning method for an unmanned aerial vehicle air route, which is used for the auxiliary pollination operation of an unmanned aerial vehicle. Referring to fig. 1, a plant, such as a rice plant, in a field 10 in need of supplementary pollination is planted in rows with male parent rows 11 and female parent rows 12 of the plant spaced apart.
Referring to fig. 2, in an embodiment of the present invention, an automatic unmanned aerial vehicle route planning method is provided for implementing automatic planning of a working route of a pollination-assisted unmanned aerial vehicle, and the method may include:
21. and dividing an auxiliary pollination operation area on the satellite map.
22. And (3) using the unmanned aerial vehicle aerial photography operation area, acquiring an unmanned aerial vehicle aerial photography image of the auxiliary pollination operation area, and making an orthographic image.
In some embodiments, the step may specifically include acquiring an unmanned aerial vehicle aerial image of the supplementary pollination work area using an optical camera and satellite positioning equipment carried by the unmanned aerial vehicle, and making the unmanned aerial image into an ortho image using photogrammetry techniques.
Optionally, after obtaining the aerial photography orthographic image and before performing the next step, the method further comprises the step of performing color image enhancement on the aerial photography orthographic image of the unmanned aerial vehicle by using a histogram equalization method, so that the contrast is improved.
23. And extracting a field image which is determined to need to be subjected to auxiliary pollination from the aerial orthographic image of the unmanned aerial vehicle.
In some embodiments, the step may specifically include framing at least one area image sample representing color and texture characteristics of the male parent and the female parent of the plant from the aerial orthophoto image of the unmanned aerial vehicle, wherein each area image sample includes images of the male parent and the female parent at the same time; and extracting a field image needing auxiliary pollination from the aerial orthographic image of the unmanned aerial vehicle by adopting a region growing algorithm based on the color and texture characteristics of male parent lines and female parent lines of rice in the region image sample.
Optionally, extracting a field image needing supplementary pollination from the aerial orthographic image of the unmanned aerial vehicle by using a region growing algorithm may include: adopting a region growing algorithm, selecting one of the obtained region image samples as a seed pixel, taking the texture and the color of the region image sample as a similarity criterion, starting growing from the position of the region image sample until a communicated region meeting the texture and the color characteristics of the sample is marked, performing morphological dilation treatment, removing holes in the region, then calculating the ratio of the area of the grown region to the total area of the image, identifying the growing region meeting a certain condition as a field needing auxiliary pollination, and extracting a field image.
24. And determining respective images of a male parent row and a female parent row in the field image through image segmentation.
In some embodiments, this step may specifically include converting the extracted field image from an RGB color space to an HSV color space; acquiring a histogram of the field image, wherein two peak values of the histogram represent a male parent row and a female parent row respectively; and generating a corresponding binary image based on the histogram, wherein according to the constraint condition, the binary image with a large area is a female parent, and the binary image with a small area is a male parent.
25. And performing linear fitting on the image boundaries of the male parent row and the female parent row to obtain the segmentation straight lines of the male parent row and the female parent row.
In some embodiments, the step may specifically include extracting edges of the image regions of the male parent line and the female parent line by setting an area threshold, fitting straight lines of the edges by using a Hough (Hough) transformation method to obtain slopes of the straight lines, and calculating probability distribution of the slopes to find out straight lines within a threshold range as segmentation straight lines of the male parent line and the female parent line.
26. And determining the central line of the parent line according to the obtained segmentation straight line, and extracting the waypoint.
Optionally, determining a centerline of the parent line according to the obtained segmentation straight line, and extracting the waypoint includes: and according to the condition constraint of the line width of the male parent, recognizing the area between two adjacent straight lines with smaller distance of the segmentation straight lines of the male parent line and the female parent line as the male parent, thereby obtaining the central line of the male parent line. The waypoints refer to the intersection points of the center lines and the field boundaries or the intersection points of the center lines and the center lines.
27. And converting the extracted navigation point pixel coordinates into coordinates in a geodetic coordinate system.
28. And planning the unmanned aerial vehicle operation route based on the waypoint coordinates in the geodetic coordinate system.
In some embodiments, the step may specifically include selecting a nearest waypoint according to the unmanned aerial vehicle position and the male parent centerline constraint, starting to sequentially traverse other waypoints by default in a left-side-first principle, starting with a right waypoint closest to the left-side last waypoint after traversing the left-side waypoint if waypoints exist on the right side, continuing the traversal until the reciprocating route planning is completed, and finally uploading the completed unmanned aerial vehicle planned route to the unmanned aerial vehicle to guide the unmanned aerial vehicle to operate.
Referring to fig. 3, an embodiment of the present invention further provides an unmanned aerial vehicle route automatic planning system for unmanned aerial vehicle supplementary pollination operation, wherein a plant in a field needing supplementary pollination is planted in rows, and a male parent row and a female parent row of the plant are spaced from each other, the system comprising:
the marking module 31 is used for dividing an auxiliary pollination operation area on the satellite map;
the acquisition module 32 is used for acquiring an unmanned aerial vehicle aerial image of the auxiliary pollination operation area;
the image processing module 33 is configured to make an orthographic image from the aerial image of the unmanned aerial vehicle, extract and determine a field image that needs to be pollinated in an auxiliary manner, determine respective images of a male parent line and a female parent line in the field image by image segmentation, and perform linear fitting on image boundaries of the male parent line and the female parent line to obtain segmentation straight lines of the male parent line and the female parent line;
the data processing module 34 is used for determining the center line of the parent line, extracting the waypoint, and converting the pixel coordinate of the extracted waypoint into the coordinate under the geodetic coordinate system;
and the route planning module 35 is used for planning the unmanned aerial vehicle operation route based on the waypoint in the geodetic coordinate system.
For a more detailed description of the system, reference is made to the description of the method embodiments above.
In order to facilitate understanding of the present invention, the method of the present invention is further described in detail below with reference to a specific application scenario:
as shown in figure 1, the growth distribution of male parent and female parent plants in typical hybrid rice seed production can be realized by manually controlling a rotor unmanned aerial vehicle to move along the male parent in the air in a row so as to realize high-quality auxiliary pollination. For the application scenario, the method for automatically planning the unmanned aerial vehicle route of the invention, as shown in fig. 4, may include the following processes:
s1, an approximate range of an auxiliary pollination operation area is drawn on a high-resolution satellite image map in advance, and the on-site positioning accuracy of a range line is better than 50 meters.
S2, acquiring an aerial image of information to be positioned, namely an aerial image of the approximate range of the auxiliary pollination operation area, by using a small optical camera and Beidou satellite positioning equipment carried by the auxiliary pollination unmanned aerial vehicle; and (3) utilizing a photogrammetry technology to manufacture an orthographic image of the working area with the plane precision better than 10 cm.
And a histogram equalization method is adopted to enhance the color image and improve the contrast so as to adapt to the condition that the color difference between the male parent and the female parent of the rice is small.
And S3, selecting the area image samples representing the color and texture characteristics of the male parent and the female parent of the rice in a frame mode. And considering the image frame as a field to be planned, wherein the center of the field is close to the center of the image. Therefore, in order to ensure that the sample is representative as much as possible, 1,4 or 9 square image samples are collected in the form of 1 square grid, 2 × 2 square grid or 3 × 3 square grid according to the orthographic image scale and rough line width data of the rice father and mother parents by taking the image center as a sampling center, and the collection follows the following principle:
(1) each sample contains images of male parent and female parent, and interference of non-crop objects in the field is avoided as much as possible
(2) The total pixel width of the sample is less than or equal to half of the width of the narrow side of the image;
length d of edge of single sample image for the above principleepAnd (3) carrying out dynamic adjustment:
in the above formula (1), wpWidth of narrow side of image, wmp,wfpThe approximate line widths of the male parent and the female parent respectively, and the variable units are pixel points.
And S4, segmenting and extracting the field to be planned. And adopting a region growing algorithm, firstly taking a sample from the obtained samples as a seed pixel, taking the texture and the color of the sample as similarity criteria, and growing from the position of the sample in an 8-communication mode until a communication region meeting the texture and the color characteristics of the sample is marked. And performing morphological expansion treatment to remove small holes in the region. Then, the ratio rho of the area of the grown region to the total area of the image is calculatednAnd determining the growing area meeting the following conditions as the area of the field to be detected:
(1)ρn+ the area ratio of the cavity in the middle is more than or equal to 80 percent;
(2) the growth area comprises a ratio of image edge pixels to image edge total pixels < 5%;
and S5, if the extraction of the field to be planned in the step S4 is not accurate due to the fact that the boundary of the field is not obvious, the adjacent field has the same or similar crops and the like, adopting a manual frame selection method to assist the extraction of the field image.
S6, segmenting the male parent and the female parent. The image information of the rice crop basically remains in the extracted image area image of the field, the male parent and the female parent often have differences in color, the differences are converted into gray-scale images which may not be obvious, and the male parent and the female parent of the rice are easily removed from the color by naked eyes in reality.Therefore, firstly, the image is converted from RGB color space to HSV space which is more intuitively corresponding to human perception, namely the chroma h belongs to [0,360 ]]The saturation s ∈ [0,1 ]]The brightness v ∈ [0,1 ]]Is expressed in terms of the form. Assume a pixel value (r, g, b) of the image RGB color space, where r, g, b ∈ [0,255 ]]Define { Cmax,CminThe method is as follows:
Cmax=max(r,g,b) (2)
Cmin=min(r,g,b) (3)
thus having v ═ Cmax/255,s=(Cmax-Cmin)/CmaxThen, h is calculated:
then, the h, s and v 3 components are quantized at unequal intervals according to the perception of human color, and the chrominance component h is divided into 8 areas: h: [0,20] → 0, [21,40] → 1, [41,75] → 2, [75,155] → 3, [156,190] → 4, [191,270] → 5, [271,295] → 6, [296,360] → 7; the saturation s and the brightness v are divided into 3 regions, respectively: s, v: [0,0.2) → 0, [0.2,0.7) → 1, [0.7,1.0] → 2. The 3 component synthesized pixel's dominant hue l is then 9h +3s + v. And then obtaining global color distribution by using a dominant hue histogram method, wherein the histogram can present a double-peak form at the moment, h corresponding to two peak values respectively represents the dominant hues of the male parent and the female parent, selecting the hue value with the highest peak value and 3-5 neighborhood values left and right of the hue value as a threshold range of image binarization for carrying out image binarization, filtering the binarized image, and according to the constraint condition of the planting proportion of the rice male parent and the rice female parent, taking the binary image with a large area as the female parent and taking the binary image with a small area as the male parent.
S7, performing straight line fitting on the parent and female parent boundaries based on Hough transformation. Setting the edge of an area threshold extraction area, discarding the edge of an undersized noise area, wherein the rest is the boundary of the male parent and the female parent of the rice, fitting the straight line of the edge by using Hough transformation to obtain the slope of each straight line, calculating the probability distribution of the slope to find out a proper slope threshold, and deleting the straight line with overlarge deviation, so that the straight line for segmenting the male parent and the female parent of the rice is obtained.
And S8, determining the line center line of the male parent from the boundary straight line, and extracting a navigation point. The line width of the male parent is smaller than that of the female parent, and two adjacent straight lines with smaller distance in the obtained straight lines can be regarded as the male parent, so that the central line of the two straight lines is obtained and is the central line of the parent line, and the intersection point of the central line and the previously divided field boundary or other central lines is used as the navigation point of unmanned aerial vehicle operation.
And S9, converting into the geodetic coordinates WGS 84. And (5) converting the pixel coordinates of the extracted waypoints into coordinates in a geodetic coordinate system WGS84 by using a two-dimensional plane coordinate conversion formula (5).
Wherein: (dx, dy) is the position translation, scale is the magnification factor, and α is the rotation angle.
S10, planning a reciprocating operation air route. And in the process of extracting the waypoints, selecting a nearest waypoint according to the position of the unmanned aerial vehicle and the central line constraint of the male parent to start traversing other waypoints in a left-side-first principle by default, and if the waypoint exists on the right side, starting with the right waypoint closest to the last waypoint on the left side after traversing the left-side waypoint, and continuing traversing until the reciprocating route planning is finished. And finally, uploading the air route to the unmanned aerial vehicle, and guiding the unmanned aerial vehicle to automatically operate.
The embodiment of the invention discloses an unmanned aerial vehicle air route automatic planning method and system, and the unmanned aerial vehicle hybrid rice supplementary pollination operation air route automatic planning can be realized by using a method of remote sensing mapping and image analysis.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; those of ordinary skill in the art will understand that: the technical solutions described in the above embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.