Crop missing detection method and detection device
By extracting the vegetation area and the crop connection area from the regional image, it is determined whether the distance between the crop connection area in the planting row area exceeds the threshold, and the problem of manual detection of missing crops in the prior art is solved, and efficient and accurate detection of missing crops is achieved.
Patent Information
- Application Number
- CN202010538238.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-12
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2040-06-12
AI Technical Summary
In the prior art, the detection of missing crops requires a lot of manpower, is time-consuming and labor-intensive, and is prone to human errors.
By obtaining the regional image of the target area, extracting the vegetation area and generating a binarized image, determining the distance between the crop connecting area and the planting row area. If the distance is greater than the preset threshold, it is determined that the crop is missing.
The timely, efficient and accurate identification of missing crops is achieved, reducing the time and labor cost of manual testing, and reducing the possibility of human error.
Smart Images

Figure CN113807138B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of crop identification, and in particular to a crop missing detection method and a crop missing detection device. Background Art
[0002] In modern agricultural planting, the number of missing crops can not only serve as an important reference for evaluating crop seed quality, operating machine accuracy, farmland environment, etc., but also can promptly detect missing seedlings and take remedial measures such as transplanting to make up for yield losses. Therefore, timely, efficient and accurate detection of missing crops is of great significance.
[0003] The current method for detecting missing crops mainly relies on manual measurement of the number. Manual detection of missing crops requires a lot of manpower participation, is time-consuming and labor-intensive, and is prone to human errors.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a crop missing detection method and a detection device to at least solve the technical problems that manual detection of missing crops requires a large amount of manpower participation, is time-consuming and labor-intensive, and is prone to human errors.
[0006] According to one aspect of an embodiment of the present invention, a method for detecting crop missing is provided, comprising: acquiring a regional image of a target area; extracting a vegetation area from the regional image, and generating a first binary image corresponding to the vegetation area; determining a crop connected domain from a vegetation connected domain in the first binary image, and generating a second binary image based on the crop connected domain; for each planting row area in the second binary image, determining the distance between any two crop connected domains in the planting row area; and determining that the planting row area is in a crop missing state when the distance is greater than a preset threshold.
[0007] Optionally, determining the distance between any two crop connected domains in the planting row area includes: performing a bidirectional detection on the planting row area according to a preset threshold, wherein the bidirectional detection is to compare the distance between each crop connected domain in the planting row area with the preset threshold in one direction, and then compare the distance between each crop connected domain in the opposite direction with the preset threshold; when the distance is greater than the preset threshold, determining that the planting row area is in a crop missing state, including: for any two crop connected domains, when the detection result in any direction in the bidirectional detection result indicates that the distance between any two crop connected domains is greater than the preset threshold, determining that the planting row area is in a crop missing state.
[0008] Optionally, after determining the crop connected domain from the vegetation connected domain of the first binary image, the method also includes: determining the main direction of the crop planting rows in the target area; generating a circumscribed rectangle of the first binary image based on the length of each planting row in the target area in the main direction; and establishing a coordinate system with the width of the rectangle as the vertical coordinate and the length direction as the horizontal coordinate; determining the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generating a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cutting the second binary image according to the peak vertex of the curve and the straight lines in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where non-vegetation pixels are located between adjacent planting rows.
[0009] Optionally, determining the main direction of the crop planting rows in the target area includes: performing a Hough transform on the second binary image, and outputting a list of polar coordinate system parameter pairs of the second binary image in the Hough space through a Hough space accumulator, and determining the main direction of the crop planting rows based on the angle parameters in the polar coordinate system parameter pair list, wherein the polar coordinate system parameter pair list includes at least one polar coordinate system parameter pair, and each polar coordinate system parameter pair includes an angle and a radius.
[0010] Optionally, the main direction of the crop planting row is determined based on the number of occurrences of the polar coordinate parameters in the Hough space in the second binary image, including: when the number of polar coordinate parameter pairs in the polar coordinate parameter pair list is greater than a predetermined value, taking the angle with the largest number of occurrences in the polar coordinate parameter pair list as the main direction of the crop planting row; or, when the number of polar coordinate parameter pairs in the polar coordinate parameter pair list is less than a predetermined value, taking the polar coordinate angle at the first position in the polar coordinate parameter pair list as the main direction of the crop planting row.
[0011] Optionally, before cutting the second binary image to obtain the planting row area based on the straight lines in the straight line set corresponding to the peak vertices of the curve and the main direction, the method also includes: smoothing the curve to obtain a target curve after smoothing; when the curve after smoothing includes non-vegetation pixels, offsetting the straight line set so that the target curve does not contain non-vegetation pixels.
[0012] Optionally, after determining the crop connected domain from the vegetation connected domain of the first binarized image and generating the second binarized image based on the crop connected domain, the method further includes: extracting sample data from the second binarized image, wherein the sample data includes: the crop connected domain; marking the crop connected domain in the sample data to obtain a crop label; and training a crop recognition model based on the crop connected domain and the label assigned to the crop connected domain to obtain a trained crop recognition model.
[0013] Optionally, a vegetation area is extracted from the regional image, and a first binary image corresponding to the vegetation area is generated, including: determining the greenness index of each pixel in the regional image; for each pixel, comparing the greenness index and the greenness threshold; determining whether the pixel is a pixel in the vegetation area based on the comparison result; counting the pixels in the vegetation area, and determining the first binary image based on the statistical results.
[0014] Optionally, a crop connected domain is determined from the vegetation connected domain of the first binary image, and a second binary image is generated based on the crop connected domain, including: obtaining the area of each vegetation connected domain in the first binary image; for each vegetation connected domain, determining whether the area of the vegetation connected domain belongs to a preset value range, and if it belongs to the preset value range, determining that the vegetation connected domain is a crop connected domain; and generating a binary image based on the determined crop connected domain.
[0015] Optionally, before determining that the planting row area is in a crop missing state, the method includes one of the following: counting a set of distances between any two adjacent crop connected areas in the target area; calculating the average of all distances in the distance set, and determining a preset threshold based on the average, wherein the distance is the distance between the centroids of adjacent crop connected domains; receiving a preset threshold input by a user.
[0016] Optionally, determining the preset threshold based on the average value includes: determining the average value as the preset threshold; or, counting the radius of each crop connection area in the target area to obtain the average radius of the crop connection domain, and determining the preset threshold based on the average radius and the average value.
[0017] Optionally, after determining that the planting row area is in a crop missing state, the method further includes: determining a position in the planting row area that is in the crop missing state; and generating a mark for indicating the crop missing state at the position in the crop missing state.
[0018] Optionally, a mark for indicating a crop missing state is generated at a position in a crop missing state, including: generating a circular mark with the position in the missing state as the center and an average radius of the connected domain as the radius, and using the circular mark as the mark for indicating the crop missing state; or generating a rectangular mark with the position in the missing state as the center and a side length of twice the average radius of the connected domain, and using the rectangular mark as the mark for indicating the crop missing state.
[0019] Optionally, obtaining a regional image of the target area includes: receiving a regional image of the target area taken by a drone.
[0020] According to another aspect of an embodiment of the present invention, a crop missing detection method is also provided, characterized in that it includes: acquiring a regional image of a target area; inputting the regional image into a crop recognition model for analysis to obtain each crop connected domain in the target area, and generating a binary image based on the crop connected domain, wherein the crop recognition model is trained based on multiple sets of data, each of the multiple sets of data includes a sample image and a label for marking the connected domain in the sample image; determining the distance between any two crop connected domains in each planting row area; and when the distance is greater than a preset threshold, determining that the planting row area is in a crop missing state.
[0021] Optionally, determining the distance between any two crop connected domains in each planting row area includes: performing a bidirectional detection on the planting row area according to a preset threshold, wherein the bidirectional detection is to compare the distance between each crop connected domain in the planting row area with the preset threshold in one direction, and then compare the distance between each crop connected domain in the opposite direction with the preset threshold; when the distance is greater than the preset threshold, determining that the planting row area is in a crop missing state, including: for any two crop connected domains, when the detection result in any one direction in the bidirectional detection result indicates that the distance between any two crop connected domains is greater than the preset threshold, determining that the planting row area is in a crop missing state.
[0022] Optionally, after the regional image is input into the crop recognition model for analysis and each crop connected domain in the target area is obtained, the method also includes: determining the main direction of the crop planting rows in the target area; generating a circumscribed rectangle of the binary image based on the length of each planting row in the target area in the main direction; and establishing a coordinate system with the width of the rectangle as the vertical coordinate and the length direction as the horizontal coordinate; determining the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generating a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cutting the second binary image according to the peak vertex of the curve and the straight line in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where non-vegetation pixels are located between adjacent planting rows.
[0023] According to another aspect of an embodiment of the present invention, a device for detecting crop missing in a target area is also provided, including: an acquisition module, which acquires a regional image of the target area; a determination module, which extracts a vegetation area from the regional image and generates a first binary image corresponding to the vegetation area, determines a crop connected domain from the vegetation connected domain of the first binary image, and generates a second binary image based on the crop connected domain; for each planting row area in the second binary image, determines the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determines that the planting row area is in a crop missing state.
[0024] According to another aspect of an embodiment of the present invention, a drone is also provided, including: an image acquisition device for acquiring a regional image of a target area; a processor for extracting a vegetation area from the regional image and generating a first binary image corresponding to the vegetation area, determining a crop connected domain from the vegetation connected domain of the first binary image, and generating a second binary image based on the crop connected domain; for each planting row area in the second binary image, determining the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determining that the planting row area is in a crop missing state.
[0025] According to another aspect of an embodiment of the present invention, a method for calculating the number of missing crops is also provided, including: obtaining a regional image of a target area; extracting a vegetation area from the regional image, and generating a first binary image corresponding to the vegetation area; determining a crop connected domain from the vegetation connected domain of the first binary image, and generating a second binary image based on the crop connected domain; for each planting row area in the second binary image, determining the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determining that the planting row area is in a crop missing state, and generating a crop missing mark; based on the missing mark, identifying the missing seedling position, and calculating the number of missing crops.
[0026] According to another aspect of an embodiment of the present invention, a device for calculating the number of missing crops is also provided, including: an acquisition module, which acquires a regional image of a target area; an identification module, which extracts a vegetation area from the regional image and generates a first binary image corresponding to the vegetation area, determines a crop connected domain from the vegetation connected domain of the first binary image, and generates a second binary image based on the crop connected domain, and for each planting row area in the second binary image, determines the distance between any two crop connected domains in the planting row area, and when the distance is greater than a preset threshold, determines that the planting row area is in a crop missing state, and generates a crop missing mark; a calculation module, which identifies the missing seedling position based on the missing mark, and calculates the number of missing crops.
[0027] According to one aspect of an embodiment of the present invention, a replanting method is also provided, comprising: using any crop missing detection method to determine a seedling missing area; and generating a recommended path for agricultural machinery operation according to the seedling missing area.
[0028] According to another aspect of an embodiment of the present invention, there is also provided a method for planning an operation route, comprising: using any crop missing detection method to determine a seedling missing area; and determining an operation route according to the seedling missing area.
[0029] According to another aspect of an embodiment of the present invention, an operating method is also provided, including: an operating equipment executes any crop missing detection method to determine a seedling missing area, wherein the operating equipment includes at least one of the following: a spraying equipment, a sowing equipment and a harvesting equipment; the operating equipment marks the seedling missing area and determines the seedling missing position; when the operating equipment is located at the seedling missing position, the operating equipment is controlled to stop operating at the seedling missing position.
[0030] According to another aspect of an embodiment of the present invention, a yield estimation method is also provided, including: determining a seedling-missing area using any crop missing detection method; determining an area of a non-seedling-missing area based on the seedling-missing area; and determining a total yield of the crop area by multiplying the yield per unit area of the non-seedling-missing area by the total area of the non-seedling-missing area.
[0031] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided. The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any crop missing detection method.
[0032] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein any crop missing detection method is executed when the program is run.
[0033] In an embodiment of the present invention, a method of identifying regional images based on a deep learning algorithm is adopted, by obtaining a regional image of a target area; extracting a vegetation area from the regional image, and generating a first binary image corresponding to the vegetation area; determining a crop connected domain from the vegetation connected domain of the first binary image, and generating a second binary image based on the crop connected domain; for each planting row area in the second binary image, determining the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determining that the planting row area is in a crop missing state, thereby achieving the purpose of identifying missing crops, thereby achieving the technical effect of timely, efficient and accurate identification of missing crops, and further solving the technical problem that manual detection of missing crops requires a large amount of manpower participation, is time-consuming and labor-intensive, and is prone to human errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0035] Figure 1 is a schematic flow chart of a crop missing detection method according to an embodiment of the present invention;
[0036] Figure 2is a schematic diagram of an optional coordinate system established with the width of the circumscribed rectangle as the vertical coordinate according to an embodiment of the present invention;
[0037] Figure 3 is a schematic diagram of an optional curve segmentation framework according to an embodiment of the present invention;
[0038] Figure 4 is a schematic diagram of a framework of an optional smooth curve according to an embodiment of the present invention;
[0039] Figure 5 is a structural schematic diagram of a crop missing detection device according to an embodiment of the present invention;
[0040] Figure 6 is a schematic structural diagram of an optional drone according to an embodiment of the present invention;
[0041] Figure 7 is a flow chart of a method for calculating the number of missing crops according to an embodiment of the present invention;
[0042] Figure 8 is a schematic structural diagram of a device for calculating the number of missing crops according to an embodiment of the present invention;
[0043] Fig. 9 is a flow chart of another crop missing detection method according to an embodiment of the present invention;
[0044] Fig.10 is a schematic diagram of an optional crop missing detection principle according to an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.
[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0047] According to an embodiment of the present invention, a method embodiment for detecting crop missing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0048] Figure 1 is a crop missing detection method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0049] Step S102, obtaining a regional image of the target area;
[0050] Step S104, extracting the vegetation area from the regional image, and generating a first binary image corresponding to the vegetation area;
[0051] Step S106, determining a crop connected domain from the vegetation connected domain of the first binary image, and generating a second binary image based on the crop connected domain;
[0052] Step S108, for each planting row area in the second binary image, determine the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determine that the planting row area is in a crop missing state.
[0053] In the above-mentioned crop missing detection method, first, a regional image of the target area is obtained, and secondly, the vegetation area is extracted from the regional image, and a first binary image corresponding to the vegetation area is generated, and then, the crop connected domain is determined from the vegetation connected domain of the first binary image, and a second binary image is generated based on the crop connected domain, and finally, for each planting row area in the second binary image, the distance between any two crop connected domains in the planting row area is determined; when the distance is greater than a preset threshold, it is determined that the planting row area is in a crop missing state, thereby achieving the technical effect of timely, efficient and accurate identification of missing crops, and further solving the technical problem that manual detection of missing crops requires a large amount of manpower participation, is time-consuming and labor-intensive, and is prone to human errors.
[0054] It should be noted that when the value is less than or equal to the preset threshold, it is determined that the planting row area is not in a crop missing state.
[0055] In an optional embodiment of the present invention, when determining the distance between any two crop connected domains in a planting row area, first, a bidirectional detection can be performed on the planting row area based on a preset threshold, wherein the bidirectional detection is to compare the distance between each crop connected domain in the planting row area with the preset threshold in one direction, and then compare the distance between each crop connected domain in the opposite direction with the preset threshold; then when the distance is greater than the preset threshold, it is determined that the planting row area is in a crop missing state. It should be noted that: for any two crop connected domains, when the detection result in any direction in the bidirectional detection result indicates that the distance between any two crop connected domains is greater than the preset threshold, it is determined that the planting row area is in a crop missing state.
[0056] It should be noted that in the case where a crop connectivity domain is missing at an endpoint, when bidirectional detection is performed on crop domains adjacent to the endpoint using a preset threshold, one of the directions must be the endpoint direction, and the endpoint direction is within the preset threshold range. If no crop connectivity domain is found, it is considered that the crop connectivity domain is missing at this endpoint.
[0057] In an optional embodiment of the present invention, after determining the crop connected domain from the vegetation connected domain of the first binary image, the main direction of the crop planting row in the target area can be determined first, and then the circumscribed rectangle of the second binary image is generated based on the length of each planting row in the target area in the main direction, and a coordinate system is established with the width direction of the rectangle as the ordinate and the length direction as the abscissa, such as Figure 2 As shown;
[0058] like Figure 3As shown, the number of non-vegetation pixels in the main direction can also be determined, and based on the number of non-vegetation pixels, a curve 30 for indicating the distribution of the number of non-vegetation pixels is generated in the coordinate system, and the second binary image is cut according to the peak vertex of the curve 30 and the straight line 32 in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight line 32 in the straight line set is used to indicate the set of position points where the non-vegetation pixels are located between adjacent planting rows.
[0059] In an optional embodiment of the present invention, the main direction of the crop planting rows in the target area can be determined by performing a Hough transform on the second binary image, and outputting a list of polar coordinate system parameter pairs of the second binary image in the Hough space through a Hough space accumulator, and determining the main direction of the crop planting rows based on the angle parameters in the polar coordinate system parameter pair list, wherein the polar coordinate system parameter pair list includes at least one polar coordinate system parameter pair, and each polar coordinate system parameter pair includes an angle and a radius.
[0060] In some embodiments of the present invention, when the number of polar coordinate parameter pairs in the polar coordinate parameter pair list is greater than a preset value, the angle that appears most times in the polar coordinate parameter pair list is used as the main direction of the crop planting row; or, when the number of polar coordinate parameter pairs in the polar coordinate parameter pair list is less than a preset value, the polar coordinate angle ranked first in the polar coordinate parameter pair list is used as the main direction of the crop planting row.
[0061] In an optional embodiment of the present invention, before cutting the second binary image to obtain the planting row area according to the peak vertex of the curve and the straight line in the straight line set corresponding to the main direction, as shown in FIG. Figure 4As shown, the curve 40 can be smoothed to obtain a target curve 42 after smoothing, wherein the smoothing method includes but is not limited to denoising after moving average, denoising after LOWESS smoothing, denoising after Univariate Spline fitting, and denoising after Savitzky_Golay Filter smoothing, and the denoising situation includes but is not limited to correcting the value of negative numbers after Savitzky_Golay Filter smoothing. The peak vertex and width of the smoothed curve can be calculated by using scipy.signal.find_peaks and other similar methods; when the smoothed curve includes non-vegetation pixels, the straight line set is offset so that the target curve does not include non-vegetation pixels. Specifically, if necessary, the straight line set can be offset left and right within a certain neighborhood range, and the trigger condition of the offset can be that there is a horizontal axis point with a cumulative value of zero in the original cumulative curve in the neighborhood. The reason for the offset is that after smoothing, it is possible that a peak point is not offset from the original, true zero point. In that case, its translation is limited. We set an adjacent distance threshold (neighborhood) and search for points in the neighborhood of the peak where the cumulative value of the cumulative curve before smoothing is zero. In addition, if the leftmost and rightmost boundaries are missing, we can add boundary lines.
[0062] In some embodiments of the present application, after determining a crop connected domain from a vegetation connected domain in a first binary image and generating a second binary image based on the crop connected domain, sample data can be extracted from the second binary image, wherein the sample data includes: a crop connected domain; marking the crop connected domain in the sample data to obtain a crop label; training a crop recognition model based on the crop connected domain and the label assigned to the crop connected domain to obtain a trained crop recognition model, and the above-mentioned crop recognition model can be used for recognition based on the crop connected domain, thereby achieving the purpose of identifying missing crops.
[0063] It should be noted that crops can be marked manually or by using deep learning algorithms to generate crop labels, where crop labels can be irregular graphic connected domains, Gaussian circles, rectangular box sets, or polygons and other shapes that conform to the network input.
[0064] In an optional embodiment of the present application, a vegetation area is extracted from a regional image, and a first binary image corresponding to the vegetation area is generated. The greenness index of each pixel in the regional image can be first determined; for each pixel, the greenness index and the greenness threshold are compared; whether the pixel is a pixel in the vegetation area is determined based on the comparison result; the pixel points belonging to the vegetation area are counted, and the first binary image is determined based on the statistical result. Specifically, taking the excess green index (Excess Green) as an example, ExG=2*Green–Red–Blue, where the right side of the formula is a pixel value of the three channels G, R, and B. After calculating the excess green index, the vegetation area is separated by a threshold value, and the pixel point whose excess green index is greater than or equal to the threshold is a non-zero value, and the pixel point whose excess green index is less than the threshold is set to zero, wherein the grayscale value of the non-zero value greater than or equal to the threshold is set to 255, and the grayscale value of the zero value less than the threshold is set to 0, to generate a first binary image.
[0065] It should be noted that the above formula ExG=2*Green–Red–Blue needs to be normalized and other mathematical processing in actual use. The threshold value can be set artificially according to the planting area, type, shape and size, planting experience, etc. of the crop, and can also be obtained by the Ostu method.
[0066] In some embodiments of the present application, a crop connected domain is determined from a vegetation connected domain in a first binary image, and a second binary image is generated based on the crop connected domain. Specifically, the area of each vegetation connected domain in the first binary image is obtained; for each vegetation connected domain, it is determined whether the area of the vegetation connected domain belongs to a preset value range; if it belongs to the preset value range, the vegetation connected domain is determined to be a crop connected domain; and a binary image is generated based on the determined crop connected domain.
[0067] In some embodiments of the present application, methods for screening vegetation connected domains include but are not limited to the following methods: artificially set threshold method, statistical screening method, shape screening method, texture screening method, etc.
[0068] Specifically, for example, the vegetation connected domain is screened by the shape screening method. For example, if there is a green truck parked by the side of the field and the crops are apple trees that are approximately circular in shape, it can be determined through geometric analysis that the car does not belong to the vegetation connected domain.
[0069] Specifically, for example, through the statistical screening method, the areas of all connected domains are counted, and the crop area range is determined by methods such as mode and dense interval, and the vegetation connected domains within the area range are retained for screening. For example, the area interval of the vegetation connected domain is [20, 50] (unit / ㎡), then the vegetation connected domains that meet this area interval are retained. For example, the mode of the area of the vegetation connected domain is 30㎡, then the connected domain with an area of 30 square meters can be retained.
[0070] It should be noted that in order to improve the accuracy of screening, the above screening methods can be used in combination. For example, if a car parked by the field meets the super green index of the vegetation connectivity domain and its shape is similar to that of the crop, the area range can be further combined to determine whether the vehicle is a vegetation connectivity domain.
[0071] In an optional embodiment of the present application, before determining that a planting row area is in a crop missing state, a distance set between any two adjacent crop connected areas in the target area can be counted; the average value of all distances in the distance set can be calculated, and a preset threshold can be determined based on the average value, wherein the distance is the distance between the centroids of the adjacent crop connected domains; or a preset threshold input by a user can be directly accepted.
[0072] In some embodiments of the present application, a preset threshold is determined based on the above-mentioned average value, and the average value can be determined as the preset threshold; the method for determining the preset threshold can also be: counting the radius of each crop connection area in the target area to obtain the average radius of the crop connection domain, and determining the preset threshold based on the average radius and the above-mentioned average value. Specifically, the result obtained by summing the average radius and the average value can be used as the preset threshold.
[0073] In an optional embodiment of the present application, after determining that the planting row area is in a crop missing state, the position in the planting row area in the crop missing state can be determined; and a mark for indicating the crop missing state is generated at the position in the crop missing state.
[0074] In an optional embodiment of the present application, a mark for indicating a crop missing state is generated at a position in a crop missing state, including: generating a circular mark with the position in the missing state as the center and the average radius of the crop connected domain as the radius, and using the circular mark as the mark for indicating the crop missing state; or generating a rectangular mark with the position in the missing state as the center and N times the average radius of the crop connected domain as the side length, and using the rectangular mark as the mark for indicating the crop missing state, in order to prevent the generated rectangular mark from overlapping with the boundary of an adjacent crop connected domain or covering the adjacent crop connected domain, wherein 0<N≤2.
[0075] In some embodiments of the present application, obtaining the regional image of the target area may be receiving the regional image of the target area taken from a drone.
[0076] Figure 5 is a detection device for crop absence in a target area according to an embodiment of the present invention, such as Figure 5 As shown, the device comprises:
[0077] An acquisition module 50 is used to acquire a regional image of a target region;
[0078] A first generating module 52 extracts the vegetation area from the regional image and generates a first binary image corresponding to the vegetation area;
[0079] A second generating module 54 determines a crop connected domain from the vegetation connected domain of the first binary image, and generates a second binary image based on the crop connected domain;
[0080] A first determination module 56 determines, for each planting row region in the second binary image, a distance between any two connected domains of crops in the planting row region;
[0081] The second determination module 58 determines that the planting row area is in a crop missing state when the distance is greater than a preset threshold.
[0082] The above-mentioned crop missing detection device in the target area includes: an acquisition module 50, which is used to acquire a regional image of the target area, a first generation module 52, which is used to extract the vegetation area from the regional image and generate a first binary image corresponding to the vegetation area; a second generation module 54, which is used to determine the crop connected domain from the vegetation connected domain of the first binary image, and generate a second binary image based on the crop connected domain; a first determination module 56, which is used to determine the distance between any two crop connected domains in the planting row area for each planting row area in the second binary image; a second determination module 58, which is used to determine that the planting row area is in a crop missing state when the distance is greater than a preset threshold, thereby achieving the purpose of identifying missing crops, thereby achieving the technical effect of timely, efficient and accurate identification of missing crops, and further solving the technical problems of manual detection of missing crops, which requires a lot of manpower participation, is time-consuming and labor-intensive, and is prone to human errors.
[0083] It should be noted that when the value is less than or equal to the preset threshold, it is determined that the planting row area is not in a crop missing state.
[0084] Figure 6 is a drone according to an embodiment of the present invention, such as Figure 6 As shown, the UAV includes: an image acquisition device 60, used to obtain a regional image of a target area; a processor 62, which extracts a vegetation area from the regional image and generates a first binary image corresponding to the vegetation area; determines a crop connected domain from the vegetation connected domain of the first binary image, and generates a second binary image based on the crop connected domain; for each planting row area in the second binary image, determines the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determines that the planting row area is in a crop missing state.
[0085] It should be noted that when the value is less than or equal to the preset threshold, it is determined that the planting row area is not in a crop missing state.
[0086] Figure 7 A method for calculating the number of missing crops according to an embodiment of the present invention comprises the following steps:
[0087] Step S 702: Acquire a regional image of the target area;
[0088] Step S704, extracting the vegetation area from the regional image, and generating a first binary image corresponding to the vegetation area;
[0089] Step S706, determining a crop connected domain from the vegetation connected domain of the first binary image, and generating a second binary image based on the crop connected domain;
[0090] Step S708, for each planting row region in the second binary image, determining the distance between any two connected domains of crops in the planting row region;
[0091] Step S710, when the distance is greater than a preset threshold, determining that the planting row area is in a crop missing state, and generating a crop missing mark;
[0092] Step S712, identifying the missing seedling positions according to the missing marks, and calculating the number of missing crops.
[0093] In the above-mentioned method for calculating the number of missing crops, first, a regional image of the target area is obtained, and then the vegetation area is extracted from the regional image, and a first binary image corresponding to the vegetation area is generated, and then the crop connected domain is determined from the vegetation connected domain of the first binary image, and a second binary image is generated based on the crop connected domain, and then for each planting row area in the second binary image, the distance between any two crop connected domains in the planting row area is determined, and then when the distance is greater than a preset threshold, it is determined that the planting row area is in a crop missing state, and a crop missing mark is generated, and finally, based on the missing mark, the missing seedling position is identified and the number of missing crops is calculated.
[0094] It should be noted that when the value is less than or equal to the preset threshold, it is determined that the planting row area is not in a crop missing state.
[0095] Figure 8A device for calculating the number of missing crops according to an embodiment of the present invention comprises: an acquisition module 80 for acquiring a regional image of a target area; an identification module 82 for extracting a vegetation area from the regional image and generating a first binary image corresponding to the vegetation area, determining a crop connected domain from a vegetation connected domain in the first binary image, and generating a second binary image based on the crop connected domain; for each planting row area in the second binary image, determining the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determining that the planting row area is in a crop missing state, and generating a crop missing mark; and a calculation module 84 for identifying the missing seedling position based on the missing mark, and calculating the number of missing crops.
[0096] It should be noted that when the value is less than or equal to the preset threshold, it is determined that the planting row area is not in a crop missing state.
[0097] Fig. 9 is another crop missing detection method according to an embodiment of the present invention, such as Fig. 9 As shown, the method comprises the following steps:
[0098] Step S902, obtaining a regional image of the target area;
[0099] Step S904, inputting the regional image into the crop recognition model for analysis, obtaining each crop connected domain in the target area, and generating a binary image based on the crop connected domain, wherein the crop recognition model is obtained by training based on multiple sets of data, each of the multiple sets of data includes a sample image and a label for marking a connected domain in the sample image;
[0100] Step S906, determining the distance between any two connected crop domains in each planting row area;
[0101] Step S908: when the distance is greater than a preset threshold, it is determined that the planting row area is in a crop missing state.
[0102] In the above crop missing detection method, first, a regional image of the target area is obtained; secondly, the regional image is input into a crop recognition model for analysis to obtain various crop connected domains in the target area, and a binary image is generated based on the crop connected domains, wherein the crop recognition model is obtained based on training of multiple sets of data, each of the multiple sets of data includes a sample image, and a label for marking the connected domain in the sample image; finally, the distance between any two crop connected domains in each planting row area is determined, and when the distance is greater than a preset threshold, it is determined that the planting row area is in a crop missing state, thereby achieving the technical effect of timely, efficient and accurate identification of missing crops, thereby solving the technical problem that manual detection of missing crops requires a large amount of manpower participation, is time-consuming and labor-intensive, and is prone to human errors.
[0103] It should be noted that when the value is less than or equal to the preset threshold, it is determined that the planting row area is not in a crop missing state.
[0104] In an optional embodiment of the present invention, the distance between any two crop connected domains in each planting row area is determined, including: performing a bidirectional detection on the planting row area according to a preset threshold, wherein the bidirectional detection is to compare the distance between each crop connected domain in the planting row area with the preset threshold in one direction, and then compare the distance between each crop connected domain with the preset threshold in the opposite direction; when the distance is greater than the preset threshold, it is determined that the planting row area is in a crop missing state, including: for any two crop connected domains, when the detection result in any one direction in the bidirectional detection result indicates that the distance between any two crop connected domains is greater than the preset threshold, it is determined that the planting row area is in a crop missing state.
[0105] In an optional embodiment of the present invention, after the regional image is input into the crop recognition model for analysis and each crop connected domain in the target area is obtained, the method also includes: determining the main direction of the crop planting row in the target area; generating a circumscribed rectangle of the binary image based on the length of each planting row in the target area in the main direction; and establishing a coordinate system with the width of the rectangle as the vertical coordinate and the length direction as the horizontal coordinate; determining the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generating a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cutting the second binary image according to the peak vertex of the curve and the straight line in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where the non-vegetation pixels are located between adjacent planting rows.
[0106] Fig.10 is a schematic diagram of an optional crop missing detection principle of the present invention, such as Fig.10 As shown, the process mainly includes the following steps:
[0107] First, a large number of aerial photos of farmland are taken to form a farmland photo collection. The algorithm is used to extract the area where the vegetation is located in the photo, and all the connected domains of vegetation are screened, leaving the connected domains of crops, generating a binary map of the crops, and then generating crop labels, or directly generating crop labels through manual labeling methods, to obtain training data sets, test data sets, and verification data sets that store the farmland photos and the generated crop labels in pairs; secondly, the training data set is trained through a deep network to obtain a deep learning model. The verification set is used to adjust the hyperparameters and select the parameters corresponding to the optimal model. The test set is used to measure the optimal performance; finally, a crop segmentation model is obtained.
[0108] The crop segmentation model is used to identify the image to be executed, obtain the crop segmentation map, and use the algorithm to obtain the main direction of the crop planting row, wherein the above algorithm includes but is not limited to the method of using Hough to detect straight lines. Specifically, the binary image corresponding to the crop segmentation map is first converted to the polar coordinate system Hough space, and the polar coordinate angle θ and radius ρ list of the front straight line are returned through the Hough space accumulator. The list data is statistically analyzed to obtain the main direction of the planting row. The statistical analysis method includes but is not limited to selecting the angle with the most occurrences as the main direction of the planting row. When fewer results are returned, the angle ranked first is selected as the main direction of the planting row. Then, a bounding rectangle of the binary image is generated with the main direction as the height. The width direction (main direction) of the bounding rectangle is used as the vertical coordinate, and the length direction is used as the horizontal coordinate. The number of non-vegetation pixels in the main direction is accumulated to obtain a cumulative curve. Because in fact the direction of the planting row (main direction) is not necessarily perpendicular to the observation angle of the image, the purpose of the bounding rectangle is to accumulate zero pixels along the main direction to obtain a cumulative curve for waveform analysis. After smoothing the cumulative curve, the peak vertex of the smoothed curve is calculated. According to the set of straight lines determined by the peak vertex and the main direction, the planting row area of the binary image is cut out, and the adjacent distance statistics of all crop connected domains are performed row by row to obtain the crop missing radius; or the crop missing radius is artificially set. What is necessary to count here is the average adjacent distance between the two centroids of the connected domain. The average radius of the connected domain can be further added. In this way, the appearance range of adjacent connected domains should be [adjacent centroid distance - average radius, adjacent centroid distance + average radius]; search each connected domain in the planting row area one by one with the missing seedling distance as the radius to see if there is a connected domain. If not, it is judged as missing and a crop missing mark is generated. The missing mark can be generated by a point where the centroid is at the average adjacent distance on the row direction straight line of the current connected domain centroid, a circle with a radius of the average radius, or a rectangle with a side length of N times the radius, where 0<N≤2.
[0109] During the crop cultivation process, due to human factors such as agricultural machinery failures, there will generally be a phenomenon of missing crop seedlings in certain areas. Therefore, according to another aspect of an embodiment of the present invention, a replanting method is also provided. Specifically, any crop missing detection method can be used to determine the missing seedling area; then, a recommended path for agricultural machinery operation is generated according to the missing seedling area, and the missing seedling area is replanted. For example, when the agricultural machinery is operating, the missing seedling area can be determined based on the crop missing detection method, and then the agricultural machinery can directly replant these several missing seedling areas without having to check the entire crop area one by one and then replant.
[0110] According to another aspect of an embodiment of the present invention, a work route planning method is also provided. Specifically, any crop missing detection method is used to determine the seedling missing area; the work route is determined based on the seedling missing area. For example, when the agricultural machinery is working, the seedling missing area can be first identified based on the crop missing detection method, and then the agricultural machinery can plan a path avoiding the seedling missing area based on these several seedling missing areas.
[0111] In order to facilitate the operation of various types of equipment and save time and cost of various equipment operations, according to another aspect of an embodiment of the present invention, an operation method is also provided. Specifically, the operating equipment first executes any crop missing detection method to determine the missing seedling area; then the operating equipment marks the missing seedling area and determines the missing seedling position; finally, when the operating equipment is located at the missing seedling position, the control device stops operating at the missing seedling position.
[0112] It should be noted that the above-mentioned equipment includes but is not limited to the following types: spraying equipment, sowing equipment and harvesting equipment.
[0113] Specifically, for example, when the spraying equipment is spraying pesticides, the missing seedling area can be obtained according to the crop missing detection method, and when the spraying equipment falls into the range of the missing seedling area, the spraying operation is stopped; for another example, when the sowing equipment is sowing solid fertilizers, when the sowing equipment falls into the range of the missing seedling area, the sowing operation is stopped. For another example, when the harvesting equipment is harvesting crops, when it drives to the missing seedling area, it can automatically retract the harvesting device and suspend the harvesting operation.
[0114] In order to more accurately estimate the yield of crops in a certain area, according to another aspect of an embodiment of the present invention, a yield estimation method is further provided. Specifically: first, the above-mentioned crop missing detection method can be used to determine the seedling missing area; then, the area of the non-seedling missing area is determined according to the seedling missing area; finally, the total yield of the crop area is determined by multiplying the unit area yield of the non-seedling missing area by the total area of the non-seedling missing area. For example, the total area of a certain farmland is 1 hectare, and the unit area yield of the non-seedling missing area is 1 ton. The above-mentioned crop missing detection method is used to identify several seedling missing areas in this farmland, and then the area size of the seedling missing area is obtained to be 0.1 hectare. At this time, the area size of the non-seedling missing area is the total area of the farmland minus the area of the seedling missing area, which is equal to 0.9 hectares. After multiplying it by the above-mentioned unit yield of 1 ton, it can be obtained that the crop yield of the non-seedling missing area is 0.9 tons, that is, the yield of this farmland is 0.9 tons.
[0115] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided. The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any crop missing detection method.
[0116] Specifically, the non-volatile storage medium is used to store program instructions for executing the following functions to achieve the following functions:
[0117] Acquire a regional image of a target area; extract a vegetation area from the regional image, and generate a first binary image corresponding to the vegetation area; determine a crop connected domain from the vegetation connected domain of the first binary image, and generate a second binary image based on the crop connected domain; for each planting row area in the second binary image, determine the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determine that the planting row area is in a crop missing state.
[0118] According to another aspect of an embodiment of the present invention, a processor is further provided, wherein the processor is used to run a program, wherein any crop missing detection method is executed when the program is run.
[0119] Specifically, the processor is used to call the program instructions in the memory to implement the following functions:
[0120] Acquire a regional image of a target area; extract a vegetation area from the regional image, and generate a first binary image corresponding to the vegetation area; determine a crop connected domain from the vegetation connected domain of the first binary image, and generate a second binary image based on the crop connected domain; for each planting row area in the second binary image, determine the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determine that the planting row area is in a crop missing state.
[0121] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0122] In the above embodiments of the present invention, 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.
[0123] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. 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. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0124] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0125] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0126] 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 computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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 a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0127] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for detecting crop loss, characterized in that: include: Acquire a regional image of a target area; Extracting a vegetation area from the regional image, and generating a first binary image corresponding to the vegetation area; Determining a crop connected domain from the vegetation connected domain of the first binary image, and generating a second binary image based on the crop connected domain; Determining the main direction of the crop rows in the target area; Generate a circumscribed rectangle of the second binary image based on the length of each planting row in the target area in the main direction; and establish a coordinate system with the width of the rectangle as the ordinate and the length direction as the abscissa; determine the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generate a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cut the second binary image according to the peak of the curve and the straight lines in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where the non-vegetation pixels are located between adjacent planting rows; For each planting row area in the second binary image, the distance between any two crop connected domains in the planting row area is determined; when the distance is greater than a preset threshold, it is determined that the planting row area is in a crop missing state.
2. The method according to claim 1, characterized in that Determining the distance between any two connected crop domains in the planting row area comprises: Performing bidirectional detection on the planting row area according to the preset threshold, wherein the bidirectional detection is to compare the distance between each crop connection domain in the planting row area with the preset threshold according to one direction, and then compare the distance between each crop connection domain with the preset threshold according to the opposite direction of the direction; When the distance is greater than a preset threshold, determining that the planting row area is in a crop missing state includes: For the any two crop connected domains, when the detection result in any one direction in the bidirectional detection result indicates that the distance between the any two crop connected domains is greater than the preset threshold, it is determined that the planting row area is in a crop missing state.
3. The method according to claim 1, characterized in that Determining the main direction of the crop planting rows in the target area includes: Perform a Hough transform on the second binary image, and output a list of polar coordinate system parameter pairs of the second binary image in the Hough space through a Hough space accumulator, and determine the main direction of the crop planting row based on the angle parameters in the polar coordinate system parameter pair list, wherein the polar coordinate system parameter pair list includes at least one polar coordinate system parameter pair, and each polar coordinate system parameter pair includes an angle and a radius.
4. The method according to claim 3, characterized in that include: When the number of polar coordinate parameter pairs in the polar coordinate system parameter pair list is greater than a predetermined value, the angle that appears most frequently in the polar coordinate parameter pair list is used as the main direction of the crop planting row; or When the number of polar coordinate parameter pairs in the polar coordinate system parameter pair list is less than a predetermined value, the polar coordinate angle at the first position in the polar coordinate system parameter pair list is used as the main direction of the crop planting row.
5. The method according to claim 1, characterized in that Before cutting the second binary image to obtain the planting row area according to the peak vertices of the curve and the straight lines in the straight line set corresponding to the main direction, the method further includes: Smoothing the curve to obtain the target curve after smoothing; When the target curve after smoothing includes non-vegetation pixels, the straight line set is offset so that the target curve does not include the non-vegetation pixels.
6. The method according to claim 1, characterized in that After determining a crop connected domain from the vegetation connected domain of the first binary image and generating a second binary image based on the crop connected domain, the method further includes: Extracting sample data from the second binarized image, wherein the sample data includes: a crop connected domain; Marking the crop connected domain in the sample data to obtain a crop label; A crop recognition model is trained based on the crop connected domain and the label assigned to the crop connected domain to obtain a trained crop recognition model.
7. The method according to claim 1, characterized in that Extracting a vegetation area from the regional image and generating a first binary image corresponding to the vegetation area includes: Determine the greenness index of each pixel in the regional image; For each pixel point, comparing the greenness index with the greenness threshold; Determining whether the pixel point is a pixel point in the vegetation area according to the comparison result; Count the pixel points in the vegetation area, and determine the first binary image based on the statistical result.
8. The method according to claim 1, characterized in that Determining a crop connected domain from the vegetation connected domain of the first binary image, and generating a second binary image based on the crop connected domain, comprising: Acquire the area of each vegetation connected domain in the first binary image; For each vegetation connected domain, determining whether the area of the vegetation connected domain belongs to a preset value range, and if it belongs to the preset value range, determining that the vegetation connected domain is a crop connected domain; The binary image is generated based on the determined crop connected domain.
9. The method according to claim 1, characterized in that: Before determining that the planting row area is in a crop-missing state, the method includes one of the following: Counting a distance set between any two adjacent crop connected areas in the target area; calculating an average value of all distances in the distance set, and determining the preset threshold based on the average value, wherein the distance is the distance between the centroids of the adjacent crop connected areas; The preset threshold value input by a user is received.
10. The method according to claim 9, characterized in that Determining the preset threshold based on the average value includes: Determine the average value as the preset threshold; Alternatively, the radius of each crop connection area in the target area is counted to obtain an average radius of the crop connection area; and the preset threshold is determined based on the average radius and the average value.
11. The method according to claim 1, characterized in that: After determining that the planting row area is in a crop-missing state, the method further includes: A position in the planting row region that is in a crop missing state is determined; and a mark indicating a crop missing state is generated at the position in the crop missing state.
12. The method according to claim 11, characterized in that A mark indicating a crop missing state is generated at a position in the crop missing state, including: Generate a circular mark with the position in the missing state as the center and the average radius of the crop connected domain as the radius, and use the circular mark as the mark for indicating the crop missing state; or A rectangular mark is generated with the position in the missing state as the center and N times the average radius of the crop connected domain as the side length, and the rectangular mark is used as the mark for indicating the crop missing state, wherein 0<N≤2.
13. The method according to any one of claims 1 to 12, characterized in that Get a regional image of the target area, including: Receive an area image of the target area taken by a drone.
14. A method for detecting crop loss, characterized in that: include: Acquire a regional image of a target area; Inputting the regional image into a crop recognition model for analysis to obtain various crop connected domains in the target area, and generating a binary image based on the crop connected domains, wherein the crop recognition model is trained based on multiple sets of data, each of the multiple sets of data includes a sample image and a label for marking a connected domain in the sample image; Determine the main direction of the crop planting rows in the target area; generate the circumscribed rectangle of the binary image based on the length of each planting row in the target area in the main direction; and establish a coordinate system with the width of the rectangle as the ordinate and the length direction as the abscissa; determine the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generate a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cut the binary image according to the peak vertex of the curve and the straight lines in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where the non-vegetation pixels are located between adjacent planting rows; Determine the distance between any two connected crop domains in each planting row area; When the distance is greater than a preset threshold, it is determined that the planting row area is in a crop missing state.
15. The method according to claim 14, characterized in that Determine the distance between any two connected crop domains in each planting row area, including: Performing bidirectional detection on the planting row area according to the preset threshold, wherein the bidirectional detection is to compare the distance between each crop connection domain in the planting row area with the preset threshold according to one direction, and then compare the distance between each crop connection domain with the preset threshold according to the opposite direction of the direction; When the distance is greater than a preset threshold, determining that the planting row area is in a crop missing state includes: For the any two crop connected domains, when the detection result in any one direction in the bidirectional detection result indicates that the distance between the any two crop connected domains is greater than the preset threshold, it is determined that the planting row area is in a crop missing state.
16. A device for detecting crop loss in a target area, characterized in that: include: An acquisition module, which acquires a regional image of a target area; A first generating module extracts a vegetation area from the regional image and generates a first binary image corresponding to the vegetation area; A second generating module, which determines a crop connected domain from the vegetation connected domain of the first binary image, and generates a second binary image based on the crop connected domain; Determining the main direction of the crop rows in the target area; Generate a circumscribed rectangle of the second binary image based on the length of each planting row in the target area in the main direction; and establish a coordinate system with the width of the rectangle as the ordinate and the length direction as the abscissa; determine the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generate a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cut the second binary image according to the peak of the curve and the straight lines in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where the non-vegetation pixels are located between adjacent planting rows; A first determination module determines, for each of the planting row regions in the second binary image, a distance between any two connected domains of crops in the planting row region; The second determination module determines that the planting row area is in a crop missing state when the distance is greater than a preset threshold.
17. A drone, characterized in that: include: An image acquisition device, used to acquire a regional image of a target area; A processor extracts a vegetation area from the regional image and generates a first binary image corresponding to the vegetation area; Determine a crop connected domain from the vegetation connected domain of the first binary image, generate a second binary image based on the crop connected domain, and determine the main direction of the crop planting row in the target area; Generate a circumscribed rectangle of the second binary image based on the length of each planting row in the target area in the main direction; and establish a coordinate system with the width of the rectangle as the ordinate and the length direction as the abscissa; determine the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generate a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cut the second binary image according to the peak of the curve and the straight lines in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where the non-vegetation pixels are located between adjacent planting rows; For each planting row area in the second binary image, the distance between any two crop connected domains in the planting row area is determined; when the distance is greater than a preset threshold, it is determined that the planting row area is in a crop missing state.
18. A method for calculating the number of missing crops, characterized in that: include Acquire a regional image of a target area; Extracting a vegetation area from the regional image, and generating a first binary image corresponding to the vegetation area; Determine a crop connected domain from the vegetation connected domain of the first binary image, generate a second binary image based on the crop connected domain, and determine the main direction of the crop planting row in the target area; Generate a circumscribed rectangle of the second binary image based on the length of each planting row in the target area in the main direction; and establish a coordinate system with the width of the rectangle as the ordinate and the length direction as the abscissa; determine the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generate a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cut the second binary image according to the peak vertices of the curve and the straight lines in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where the non-vegetation pixels are located between adjacent planting rows; for each planting row area in the second binary image, determine the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determine that the planting row area is in a crop missing state, and generate a crop missing mark; According to the missing marks, the positions of missing seedlings are identified and the number of missing crops is calculated.
19. A device for calculating the number of missing crops, characterized in that: include An acquisition module, which acquires a regional image of a target area; A recognition module extracts a vegetation area from the area image and generates a first binary image corresponding to the vegetation area; Determine a crop connected domain from the vegetation connected domain of the first binary image, generate a second binary image based on the crop connected domain, and determine the main direction of the crop planting row in the target area; Generate a circumscribed rectangle of the second binary image based on the length of each planting row in the target area in the main direction; and establish a coordinate system with the width of the rectangle as the ordinate and the length direction as the abscissa; determine the number of non-vegetation pixels in the main direction, and based on the number of non-vegetation pixels, generate a curve in the coordinate system for indicating the distribution of the number of non-vegetation pixels; cut the second binary image according to the peak vertices of the curve and the straight lines in the straight line set corresponding to the main direction to obtain the planting row area, wherein the straight lines in the straight line set are used to indicate the set of position points where the non-vegetation pixels are located between adjacent planting rows; for each planting row area in the second binary image, determine the distance between any two crop connected domains in the planting row area; when the distance is greater than a preset threshold, determine that the planting row area is in a crop missing state, and generate a crop missing mark; The calculation module identifies the missing seedling positions according to the missing marks and calculates the number of missing crops.
20. A method for replanting, characterized in that: include: Determine the missing seedling area using the crop missing detection method according to any one of claims 1 to 15; A recommended path for agricultural machinery operation is generated based on the seedling-deficient area.
21. A method for planning an operation route, characterized in that: include: Determine the missing seedling area using the crop missing detection method according to any one of claims 1 to 15; Determine the operation route according to the seedling-deficient area.
22. A method of operation, characterized in that: include: The operating equipment executes the crop missing detection method according to any one of claims 1 to 15 to determine the missing seedling area, wherein the operating equipment includes at least one of the following: a spraying device, a sowing device, and a harvesting device; The operation equipment marks the seedling-deficient area and determines the seedling-deficient position; When the operating equipment is located at the seedling-deficient position, the operating equipment is controlled to stop operating at the seedling-deficient position.
23. A method for calculating production, characterized in that: include: Determine the missing seedling area using the crop missing detection method according to any one of claims 1 to 15; Determine the area of the non-seedling-deficient area according to the seedling-deficient area; The total yield of the crop area is determined by multiplying the unit area yield of the non-missing seedling area by the total area of the non-missing seedling area.
24. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the crop missing detection method according to any one of claims 1 to 15.
25. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the crop missing detection method described in any one of claims 1 to 15.
Citation Information
Patent Citations
A crop seedling situation and seedling situation collecting and analyzing method and device
CN109886094A
Real-time field robot visual navigation method based on FPGA and real-time field robot visual navigation system based on FPGA
CN110196053A