A crop region identification method, device, computer equipment and storage medium

By generating a crop binary map, obtaining the main direction of the planting row, combining rectangular strips and performing reverse rotation processing, the problem of identifying crop areas in the prior art is solved, and fast and accurate crop area identification is achieved, which is suitable for non-linear planting.

CN113807129BActive Publication Date: 2025-03-04GUANGZHOU XAIRCRAFT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010537126.8
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

Technical Problem

The prior art relies on manual intervention in identifying crop areas, which is costly, inefficient, and can only be used for crops grown strictly linearly.

Method used

By generating a crop binary map based on farmland images, obtaining the main direction of the planting row, obtaining the rectangular bars of the planting row, combining the rectangular bars to generate a crop area mask map, and performing reverse rotation and backfilling treatments to obtain the crop area map.

Benefits of technology

It realizes rapid identification of crop areas, reduces identification costs, improves identification efficiency, and is suitable for crops that are not strictly linearly grown.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113807129B_ABST
    Figure CN113807129B_ABST
Patent Text Reader

Abstract

The present invention discloses a crop region identification method, device, computer equipment and storage medium. The method comprises: generating a crop binary map according to a farmland image, and obtaining the main direction of a planting row according to the crop binary map; obtaining at least one planting row rectangular strip according to the crop binary map and the main direction of the planting row; combining the planting row rectangular strips to generate a crop region mask map; performing inverse rotation and inverse filling processing on the crop region mask map to obtain a crop region map. The technical solution of the embodiment of the present invention can realize rapid identification of crop regions, and is also applicable to crops that are not strictly planted in a straight line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to data processing technology, and more particularly to a crop region identification method, device, computer equipment and storage medium. Background Art

[0002] my country is a large agricultural country. The number of crop plants has a significant impact on crop yield. Only when the density of crop plants reaches a certain value can the crop yield be increased. The ability to quickly identify crop areas plays an important role in identifying the location of missing seedlings and marking them.

[0003] In the prior art, crop area recognition is performed on the obtained farmland images mainly through image analysis or by training a neural network model. In the process of realizing the present invention, the inventor found that the prior art has the following defects: it relies on manual intervention, is costly, is inefficient, and can only be applied to recognize crops planted in a strict straight line. Summary of the invention

[0004] The embodiments of the present invention provide a crop region identification method, apparatus, computer equipment and storage medium to realize rapid identification of crop regions, and are also applicable to crops that are not planted in a strictly straight line.

[0005] In a first aspect, an embodiment of the present invention provides a crop region identification method, the method comprising:

[0006] Generate a crop binary map according to the farmland image, and obtain the main direction of the planting row according to the crop binary map;

[0007] Acquire at least one planting row rectangular strip according to the crop binary image and the main direction of the planting row;

[0008] Combine various planting row rectangles to generate a crop area mask map;

[0009] The crop region mask image is subjected to inverse rotation and inverse filling processing to obtain a crop region image.

[0010] In a second aspect, an embodiment of the present invention further provides a method for identifying a crop area, the method comprising:

[0011] Acquire multiple farmland images to be labeled;

[0012] Using the crop region recognition method described in any one of the embodiments of the present invention, a crop region map is identified in each of the farmland images to be labeled, and each of the farmland images to be labeled is labeled using the crop region map to obtain a plurality of training samples;

[0013] Using each of the training samples to train a preset machine learning model to obtain a crop region recognition model;

[0014] The farmland image to be identified is input into the crop region identification model to obtain a crop region identification result for the farmland image to be identified.

[0015] In a third aspect, an embodiment of the present invention further provides a plant growth detection method, the method comprising:

[0016] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0017] Determining geographical location information matching each of the crop regions according to an image position of the crop region in each of the crop region maps and geographical location information respectively matching each of the crop region maps;

[0018] Calculating crop height information within each of the crop areas based on geographic location information matching each of the crop areas and a digital surface model matching the planting area;

[0019] The growth potential of crops matching the planting area is estimated based on the crop height information in each of the crop areas.

[0020] In a fourth aspect, an embodiment of the present invention further provides a yield prediction method, the method comprising:

[0021] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0022] Calculate the total area of ​​regions matching all crop regions in the planting area according to the area of ​​each crop region in the crop region map;

[0023] The regional yield matching the planting area is estimated based on the total area of ​​the region and the preset yield per unit area.

[0024] In a fifth aspect, an embodiment of the present invention further provides a weed identification method, the method comprising:

[0025] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0026] In each of the crop area maps, a non-planting area excluding the crop area is obtained, and vegetation points are identified in the non-planting area;

[0027] Acquire at least one non-crop connected domain corresponding to the non-planting area according to the identified vegetation points;

[0028] Whether each of the non-crop connected domains is a weed is determined based on at least one of the shape features of each of the non-crop connected domains, the texture features of the non-planted connected domains in the farmland image, and the color information.

[0029] In a sixth aspect, an embodiment of the present invention further provides a crop region identification device, the device comprising:

[0030] A crop binary image acquisition module is used to generate a crop binary image according to the farmland image, and to acquire the main direction of the planting row according to the crop binary image;

[0031] A planting row rectangular strip acquisition module, used for acquiring at least one planting row rectangular strip according to the crop binary image and the main direction of the planting row;

[0032] The crop area mask map generation module is used to combine various planting row rectangular strips to generate a crop area mask map;

[0033] The crop area map acquisition module is used to perform inverse rotation and inverse filling processing on the crop area mask image to obtain a crop area map.

[0034] In a seventh aspect, an embodiment of the present invention further provides a device for identifying a crop area, the device comprising:

[0035] A module for acquiring farmland images to be labeled, used for acquiring multiple farmland images to be labeled;

[0036] A training sample acquisition module, used to use the crop region recognition method as described in any embodiment of the present invention to identify a crop region map in each of the farmland images to be labeled, and use the crop region map to label each of the farmland images to be labeled to obtain a plurality of training samples;

[0037] A crop region recognition model acquisition module, used to train a preset machine learning model using each of the training samples to obtain a crop region recognition model;

[0038] The crop region recognition result acquisition module is used to input the farmland image to be recognized into the crop region recognition model to obtain the crop region recognition result of the farmland image to be recognized.

[0039] In an eighth aspect, an embodiment of the present invention further provides a plant growth detection device, the device comprising:

[0040] A crop area map determination module, used to obtain at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0041] A geographic location information determination module, used to determine the geographic location information matching each of the crop areas according to the image position of the crop area in each of the crop area maps and the geographic location information respectively matching each of the crop area maps;

[0042] A crop height information calculation module, used to calculate the crop height information in each of the crop areas according to the geographical location information matching the crop areas and the digital surface model matching the planting area;

[0043] The crop growth prediction module is used to estimate the growth of crops matching the planting area according to the crop height information in each of the crop areas.

[0044] In a ninth aspect, an embodiment of the present invention further provides a yield prediction device, the device comprising:

[0045] A crop area map determination module, used to obtain at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0046] A region total area determination module, used to calculate the total area of ​​regions matching all crop regions in the planting area according to the area of ​​each crop region in the crop region map;

[0047] The regional yield estimation module is used to estimate the regional yield matching the planting area based on the total area of ​​the area and the preset unit area yield.

[0048] In a tenth aspect, an embodiment of the present invention further provides a weed identification device, the device comprising:

[0049] A crop area map determination module, used to obtain at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0050] A vegetation point identification module, used to obtain non-planting areas excluding crop areas in each of the crop area maps, and identify vegetation points in the non-planting areas;

[0051] A non-crop connected domain acquisition module, used to acquire at least one non-crop connected domain corresponding to the non-planting area according to the identified vegetation points;

[0052] The weed identification module is used to determine whether each of the non-crop connected domains is a weed according to at least one of the shape characteristics of each of the non-crop connected domains, the texture characteristics of the non-planted connected domains in the farmland image, and the color information.

[0053] In the eleventh aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the crop area identification method, the crop area identification method, the plant growth detection method, the yield prediction method, or the weed identification method as described in any one of the embodiments of the present invention are implemented.

[0054] In a twelfth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a crop area identification method, or a crop area identification method, or a plant growth detection method, or a yield prediction method, or a weed identification method as described in any one of the embodiments of the present invention.

[0055] The embodiment of the present invention obtains a binary image based on a farmland image and obtains the main direction of a planting row, thereby obtaining a planting row rectangular strip, obtains a crop area mask map based on the planting row rectangular strip, and obtains a crop area map based on the crop area mask map. The problem of relying on manual labor, high cost and low efficiency in the prior art when identifying crop areas based on farmland images is solved. Rapid identification of crop areas is achieved, and it is also applicable to crops that are not strictly planted in a straight line, and has a wider range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1a is a flow chart of a crop region identification method in Embodiment 1 of the present invention;

[0057] Figure 1b is a schematic diagram of a farmland image applicable to an embodiment of the present invention;

[0058] Figure 1c is a schematic diagram of a crop area map applicable to an embodiment of the present invention;

[0059] Figure 2a is a flow chart of a crop region identification method in Embodiment 2 of the present invention;

[0060] Figure 2b is a schematic diagram of a circumscribed rectangle of a crop binary image applicable to an embodiment of the present invention;

[0061] Figure 2c is a schematic diagram of an accumulation curve applicable to an embodiment of the present invention;

[0062] Figure 3a is a flow chart of a crop area identification method in Embodiment 3 of the present invention;

[0063] Figure 3b is a flow chart of a method for identifying a crop area in a farmland image to be identified;

[0064] Figure 4 is a flow chart of a plant growth detection method in Embodiment 4 of the present invention;

[0065] Figure 5 is a flow chart of a yield prediction method in Embodiment 5 of the present invention;

[0066] Figure 6 is a flow chart of a weed identification method in Embodiment 6 of the present invention;

[0067] Figure 7 is a structural schematic diagram of a crop region identification device in Embodiment 7 of the present invention;

[0068] Figure 8 is a schematic structural diagram of a crop region identification device in Embodiment 8 of the present invention;

[0069] Fig. 9 It is a structural schematic diagram of a plant growth detection device in Embodiment 9 of the present invention;

[0070] Fig.10 It is a structural schematic diagram of a yield prediction device in Embodiment 10 of the present invention;

[0071] Fig.11 is a schematic structural diagram of a weed identification device in Embodiment 11 of the present invention;

[0072] Fig.12 It is a structural diagram of a computer device in Embodiment 12 of the present invention. DETAILED DESCRIPTION

[0073] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0074] Embodiment 1

[0075] Figure 1aThis is a flow chart of a crop region identification method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where crop regions in farmland images need to be identified. The method can be executed by a crop region identification device, which can be implemented by software and / or hardware and is generally integrated in a server.

[0076] like Figure 1a As shown, the technical solution of the embodiment of the present invention specifically includes the following steps:

[0077] S110, generating a crop binary map according to the farmland image, and acquiring a main direction of a planting row according to the crop binary map.

[0078] The farmland image may be an image taken by a drone while patrolling the farmland. In a specific example, Figure 1b A schematic diagram of a farmland image is provided, such as Figure 1b As shown, the farmland image is an overhead image of the farmland.

[0079] A binary image means that each pixel in the image has only two possible values ​​or grayscale levels, that is, the grayscale value of any pixel in the image is 0 or 255, representing black and white respectively.

[0080] The crop binary image may refer to any pixel in the image that can only represent crops or non-crops. In a specific example, a pixel with a gray value of 255 may represent a crop, and a pixel with a gray value of 0 may represent a non-crop. Alternatively, a pixel with a gray value of 255 may represent a non-crop, and a pixel with a gray value of 0 may represent a crop. This embodiment does not limit whether pixels with different gray values ​​represent crops or non-crops.

[0081] The main direction of the planting row may refer to the planting direction of the crop. In the embodiment of the present invention, the main direction of the planting row may be perpendicular or non-perpendicular to the observation direction of the farmland image. When the main direction of the planting row is not perpendicular to the observation direction of the farmland image, the main direction of the planting row needs to be obtained. In a specific example, Figure 1b As shown, Figure 1b The main direction of the crop rows in the image is not perpendicular to the viewing angle of the farmland image.

[0082] In an optional embodiment of the present invention, generating a crop binary map based on a farmland image may include: generating a vegetation binary map based on vegetation points included in the farmland image; obtaining at least one vegetation connected domain in the vegetation binary map, and screening and retaining crop connected domains in the vegetation connected domains to obtain the crop binary map.

[0083] Among them, the vegetation point indicates that the pixel point in the image represents vegetation, and whether the pixel point in the image is a vegetation point can be determined by color space conversion, color index, and vegetation index. In a specific example, the excess green index (EXG) in the vegetation index can be used to determine whether the pixel point in the image is a vegetation point. Specifically, the excess green index of the pixel point is calculated by the following formula: EXG = 2*Green-Red-Blue, where Green, Red, and Blue represent the values ​​obtained after the normalization of the RGB index of the pixel point. If the excess green index of the pixel point is greater than a certain threshold, it is judged as vegetation, otherwise it is non-vegetation. The vegetation binary map may refer to any pixel point in the image that can only represent vegetation or non-vegetation.

[0084] The vegetation connected domain may be a set of pixels whose grayscale values ​​are connected to each other and represent vegetation. The crop connected domain may be selected in the vegetation connected domain by selecting by connected domain area, selecting by shape, selecting by shape, selecting by texture, and the like.

[0085] In a specific example, the crop connected domain can be screened according to the area of ​​the connected domain. Specifically, the area of ​​all vegetation connected domains can be counted, and the area range of the crop connected domain can be determined by the average, mode, and dense interval of the vegetation connected domain area, or the area range of the crop connected domain can be set artificially. Vegetation connected domains whose area is obviously smaller than the area range of the crop connected domain are deleted, and the retained vegetation connected domains are the crop connected domains.

[0086] In an embodiment of the present invention, it is determined whether a pixel point in a farmland image is a vegetation point, different grayscale values ​​are assigned to the vegetation point and other pixel points, a vegetation binary map is generated, the vegetation connected domain in the vegetation binary map is screened, the crop connected domain is retained, and a crop binary map is obtained.

[0087] In an optional embodiment of the present invention, obtaining the main direction of the planting row according to the crop binary map may include: obtaining at least one straight line corresponding to each crop connected domain in the crop binary map according to a preset straight line detection algorithm, and identifying the main direction of the planting row according to the angle value of each straight line relative to a reference direction.

[0088] Among them, the preset straight line detection algorithm can be an algorithm for obtaining a straight line and an angle value corresponding to the straight line relative to a reference direction. In a specific example, the straight line detection algorithm can be a Hough transform straight line detection method, which converts the crop binary image into the polar coordinate system Hough space, and uses the Hough space accumulator to count the relative angles corresponding to a reference direction and the radius of the circle of a number of straight lines. The present invention does not limit the type of straight line detection algorithm and the specific detection process. The crop binary image includes a number of crop connected domains, and the crop connected domain can be a set of pixels whose grayscale values ​​are connected to each other and represent the crop.

[0089] In an embodiment of the present invention, the crop binary image is processed by a preset straight line detection algorithm to obtain at least one straight line corresponding to each crop connected domain, and the main direction of the planting row is obtained based on the statistical results of the angle values ​​of each straight line relative to the reference direction.

[0090] In an optional embodiment of the present invention, according to a preset straight line detection algorithm, at least one straight line corresponding to each crop connected domain in the crop binary map is obtained, and the main direction of the planting row is identified according to the angle value of each straight line relative to the reference direction, which may include: mapping the pixel points in the connected domain of each crop to the Hough space of the polar coordinate system to obtain the crop point mapping result; obtaining the straight line detection result fed back by the Hough space accumulator for the crop point mapping result, performing statistical analysis on the straight line detection result, and obtaining the main direction of the planting row of the farmland; wherein the straight line detection result includes a target number of straight lines and the straight line angle corresponding to each straight line.

[0091] The polar coordinate system Hough space may be a parameter space obtained by performing a Hough transform on a Cartesian coordinate system. The crop point mapping result may be a result obtained in the Hough space after the pixel points in each crop connected domain are subjected to a Hough transform, and the crop point mapping result may be a straight line. The Hough space accumulator may be used to count the straight line angles corresponding to each crop point mapping result. The straight line angle may be the angle between the straight line and the observation angle of the image. In a specific example, the straight line angle may be the angle between the wide direction of the crop binary image and the straight line.

[0092] In an embodiment of the present invention, pixel points within each crop connected domain are mapped to the Hough space of the polar coordinate system to obtain corresponding lines as crop point mapping results. The target number of straight lines and the straight line angles corresponding to each straight line are counted through a Hough space accumulator. Statistical analysis is performed on each straight line and its corresponding straight line angle to obtain the main direction of the planting row.

[0093] In an optional embodiment of the present invention, the straight line detection results are statistically analyzed to obtain the main direction of the planting rows of the farmland, including: if the target number is greater than or equal to a first quantity threshold, then the number of straight lines corresponding to each of the straight line angles is counted, and the straight line angle with the largest number of straight lines is obtained as the main direction of the planting row; if the target number is less than or equal to a second quantity threshold, then the straight line angle of the first straight line in the straight line detection result is obtained as the main direction of the planting row.

[0094] In the embodiment of the present invention, the angle of the line with the largest number of lines can be selected as the main direction of the planting row, or the angle of the first line can be selected as the main direction of the planting row. The embodiment of the present invention is only a method of obtaining the main direction of the planting row based on the line detection results. Any statistical analysis method that can obtain the main direction of the planting row based on the line detection results is within the protection scope of the embodiment of the present invention.

[0095] S120. Obtain at least one planting row rectangular strip according to the crop binary image and the main direction of the planting row.

[0096] The planting row rectangle indicates that the area within the rectangle is a crop area. The advantage of using the planting row rectangle to represent the crop area is that for crops that are not planted in a strictly straight line, the crop area can be fully and accurately obtained.

[0097] In the embodiment of the present invention, after obtaining a crop binary image based on a farmland image and obtaining the main direction of a planting row, a planting row rectangular strip is generated along the main direction of the planting row in the crop binary image.

[0098] S130, combining various planting row rectangular strips to generate a crop area mask map.

[0099] The crop region mask image is also called a mask image, and the mask image may be an image generated after a specific region is extracted from an original image.

[0100] In the embodiment of the present invention, after the planting row rectangular strips are generated, the planting row rectangular strips are combined to obtain a crop area mask map.

[0101] S140, performing inverse rotation and inverse filling processing on the crop region mask image to obtain a crop region image.

[0102] Among them, inverse rotation and inverse filling refer to the reverse operation of generating an enclosing rectangle based on the crop binary image and the main direction of the planting row. The advantage of this setting is that the crop area map obtained after the inverse rotation and inverse filling operations can correspond to the original farmland image, which is more accurate and intuitive.

[0103] The crop area map may be an image formed by combining all the planting row rectangles, corresponding to the farmland image. Figure 1c A schematic diagram of the crop area map is provided, e.g. Figure 1c As shown, the crop area map includes a number of planting row rectangles, and the planting row rectangles are within the crop areas.

[0104] In the embodiment of the present invention, after obtaining the crop region mask image, it is necessary to perform inverse rotation and inverse filling operations to obtain the crop region image corresponding to the farmland image.

[0105] The technical solution of this embodiment obtains a binary image based on a farmland image and obtains the main direction of a planting row, thereby obtaining a planting row rectangular strip, obtains a crop area mask map based on the planting row rectangular strip, and obtains a crop area map based on the crop area mask map. This solves the problem of relying on manual labor, high cost, and low efficiency when identifying crop areas based on farmland images in the prior art. It achieves rapid identification of crop areas, and is also applicable to crops that are not strictly planted in a straight line, and has a wider range of applications.

[0106] Embodiment 2

[0107] Figure 2a It is a flow chart of a crop area identification method provided in the second embodiment of the present invention. Based on the above embodiments, the embodiment of the present invention further specifies the process of generating a crop binary map based on a farmland image, the process of obtaining the main direction of a planting row based on the crop binary map, the process of obtaining a planting row rectangular strip, and the process of obtaining a crop area map based on the planting row rectangular strip.

[0108] Correspondingly, such as Figure 2a As shown, the technical solution of the embodiment of the present invention specifically includes the following steps:

[0109] S210: Generate a vegetation binary map according to the vegetation points included in the farmland image.

[0110] S220, obtaining at least one vegetation connected domain in the vegetation binary map, and screening and retaining crop connected domains in the vegetation connected domains to obtain the crop binary map.

[0111] S230, mapping the pixel points in each crop connected domain to the polar coordinate system Hough space to obtain a crop point mapping result.

[0112] S240, obtaining a straight line detection result fed back by a Hough space accumulator for the crop point mapping result, wherein the straight line detection result includes a target number of straight lines and a straight line angle corresponding to each straight line.

[0113] S250. Determine whether the target quantity is greater than or equal to a first quantity threshold. If so, execute S260; otherwise, execute S270.

[0114] S260, counting the number of straight lines corresponding to each of the straight line angles, and obtaining the straight line angle with the largest number of straight lines as the main direction of the planting row.

[0115] S270, obtaining the straight line angle of the first straight line in the straight line detection result as the main direction of the planting row.

[0116] S280. Generate a circumscribed rectangle of the crop binary image according to the crop binary image and the main direction of the planting row; wherein the height direction of the circumscribed rectangle is the main direction of the planting row.

[0117] The function of the circumscribed rectangle is to arrange the connected domain of the crops in the crop binary image along the main direction of the planting row, so as to establish the coordinate axis, count the number of pixels and generate the cumulative curve. Figure 2b A schematic diagram of the bounding rectangle of the crop binary image is provided, such as Figure 2b As shown, the main direction of the planting row is perpendicular to the viewing angle of the image.

[0118] In the embodiment of the present invention, after the crop binary image and the main direction of the planting row are obtained, the circumscribed rectangle of the crop binary image is generated with the main direction of the planting row as the height direction.

[0119] S290, establishing a coordinate system with the height direction of the circumscribed rectangle as the vertical coordinate direction, and projecting the crop binary image into the coordinate system.

[0120] In the embodiment of the present invention, after the bounding rectangle of the crop binary image is generated with the main direction of the planting row as the height direction, a coordinate system can be established with the height direction of the bounding rectangle as the longitudinal axis direction and the length direction of the bounding rectangle as the horizontal and vertical directions. Then, the crop binary image can be projected into the coordinate system.

[0121] S2100, counting the number of pixel points in the crop connected domain in the vertical coordinate direction to generate a cumulative curve.

[0122] The cumulative curve is a curve formed by connecting the number of pixel points in the crop connected domain in the main direction of the planting row corresponding to each point on the horizontal coordinate. The higher the vertical coordinate value corresponding to the point on the horizontal coordinate on the cumulative curve, the more crop points in the main direction of the planting row corresponding to the point on the horizontal coordinate. In a specific example, Figure 2c A schematic diagram of the cumulative curve is provided, such as Figure 2c As shown, the ordinate is the height of the circumscribed rectangle and the abscissa is the length of the circumscribed rectangle.

[0123] In an optional embodiment of the present invention, the accumulated curve may be smoothed. The method for smoothing the accumulated curve may be denoising after moving average, denoising after LOWESS smoothing, denoising after Univariate Spline fitting, and denoising after Savitzky_Golay Filter smoothing, etc. The denoising method may be correcting the value of the negative number after Savitzky_Golay Filter smoothing, etc. This embodiment does not limit the specific type and process of smoothing, and the specific process of denoising.

[0124] In the embodiment of the present invention, the accumulated curve is smoothed. The advantage of such a setting is that the jagged edges of the accumulated curve are reduced so as to obtain the peak vertices and thus accurately divide the planting rows into rectangular strips.

[0125] S2110, obtaining the horizontal coordinates of the vertices of each wave peak in the cumulative curve, and generating a straight line along the main direction of the planting row.

[0126] In the embodiment of the present invention, a straight line is generated along the main direction of the planting row at the abscissa of each wave peak vertex, with the purpose of determining the center line of the rectangular strip of each planting row.

[0127] S2120, using the straight line generated by each wave peak vertex as the center line and the width of each wave peak as the width to generate at least one planting row rectangular strip.

[0128] In the embodiment of the present invention, each wave crest vertex corresponds to a planting row rectangular strip, and the planting row rectangular strip has a straight line generated along the main direction of the planting row at the horizontal coordinate of each wave crest vertex as the center line and a width of each wave crest as the width.

[0129] S2130, combining the planting row rectangles generated according to the vertices of each wave peak to generate a crop area mask map.

[0130] S2140, performing inverse rotation and inverse filling processing on the crop region mask image to obtain a crop region image.

[0131] The technical solution of the embodiment of the present invention generates a crop binary map according to the farmland image, obtains the main direction of the planting row, establishes a coordinate axis according to the crop binary map and the main direction of the planting row, generates a cumulative curve, generates planting row rectangular strips according to each peak vertex and peak width on the cumulative curve, combines the planting row rectangular strips generated by each peak vertex to generate a crop area mask map, and obtains a crop area map after reverse rotation and reverse expansion operations. The problem of high cost and low efficiency caused by excessive reliance on manual labor when identifying crop areas in the prior art is solved. Automatic and rapid identification of crop areas in farmland images is achieved, which reduces identification costs and improves identification efficiency. It is also applicable to crops that are not strictly planted in a straight line, expanding the scope of application.

[0132] Embodiment 3

[0133] Figure 3a This is a flow chart of a crop area recognition method provided in Example 3 of the present invention. This embodiment is applicable to the situation where crop areas in farmland images to be recognized are recognized through training models. The method can be executed by a crop area recognition device, which can be implemented by software and / or hardware and is generally integrated in a server.

[0134] like Figure 3a As shown, the technical solution of the embodiment of the present invention specifically includes the following steps:

[0135] S310: Acquire multiple farmland images to be labeled.

[0136] The farmland images to be labeled may be farmland images taken by drones during farmland inspections, and the purpose is to label them so as to serve as samples for training crop region recognition models.

[0137] S320. Using the crop region recognition method described in any one of the embodiments of the present invention, a crop region map is identified in each of the farmland images to be labeled, and each of the farmland images to be labeled is labeled using the crop region map to obtain a plurality of training samples.

[0138] In an embodiment of the present invention, crop region identification is performed on each farmland image to be labeled, a crop region map corresponding to each farmland image to be labeled is obtained, each farmland image to be labeled is labeled using the crop region map corresponding to it, and the labeled farmland images are used as training samples.

[0139] The crop region recognition method described in any one of the embodiments of the present invention is used to perform crop region recognition on the labeled farmland image. The advantage of such a setting is that it saves the time for obtaining training samples, saves labor costs, and improves the efficiency of crop region recognition.

[0140] S330: Use each of the training samples to train a preset machine learning model to obtain a crop region recognition model.

[0141] The crop region recognition model may be a model trained based on the labeled farmland image and a preset machine learning model and used for crop region recognition of the farmland image to be recognized. This embodiment does not limit the type of machine learning model and the training process of the machine learning model.

[0142] Optionally, several farmland images to be detected can be selected as test samples, and after the test results are obtained through the crop region recognition model, the parameters of the crop region recognition model are optimized according to the test results, so as to further improve the crop region recognition model. This embodiment does not limit the number and ratio of training samples and test samples.

[0143] S340, inputting the farmland image to be identified into the crop region identification model to obtain a crop region identification result for the farmland image to be identified.

[0144] The farmland image to be identified may be a farmland image that requires crop area identification, and the crop area identification result may be a crop area map corresponding to the farmland image to be identified.

[0145] In the embodiment of the present invention, after the crop region recognition model is trained, the crop region recognition can be quickly performed on the farmland image to be recognized. The crop region recognition model in the embodiment of the present invention can be applied to the crop region recognition of farmland that is not planted in a strictly straight line, and can fully and accurately display the crop region.

[0146] In an optional embodiment of the present invention, Figure 3b A flow chart of a method for identifying crop areas in a farmland image to be identified is provided. Figure 3b As shown in the figure, the label corresponding to the crop area is obtained according to the farmland image. The method is as follows: extract the area where the vegetation is located and generate a binary image; find the main direction of the planting row, fill it into a square with a side length equal to the diagonal length of the original image, and rotate the planting row to vertical according to the main direction angle; generate a cumulative curve with zero vegetation pixel counts in the vertical direction, smooth the cumulative curve, and calculate the peak vertex and width of the smoothed curve; cover the planting row rectangles row by row according to the peak vertex and width, generate a planting row area mask, and de-rotate and de-expand the mask to obtain the label.

[0147] After obtaining the labels corresponding to each farmland image using the above method, the farmland images and the corresponding labels are stored in pairs and divided into training data and test data. The pre-trained deep learning network is trained using the training data to obtain a trained deep learning network model. The trained deep learning network model is tested using the test data, and the network parameters are optimized based on the test performance to finally obtain the target model. The data to be identified is input into the target model to obtain the identification result.

[0148] The technical solution of the embodiment of the present invention is to obtain a crop area map by performing crop area recognition on the farmland image to be labeled, and to label the farmland image to be labeled according to the crop area map, and to train the crop area recognition model using the labeled image as a training sample, and to input the farmland image to be identified into the trained crop area recognition model to obtain the recognition result. The problem of over-reliance on manual labeling, high labor cost and low efficiency when training the crop area recognition model in the prior art, and the problem of the narrow application scope of the existing crop area recognition model are solved. The crop area in the image is quickly labeled, which saves labor cost, improves labeling efficiency, and the trained crop area recognition model has a wider application scope.

[0149] Embodiment 4

[0150] Figure 4 This is a flow chart of a plant growth detection method provided in Example 4 of the present invention. This embodiment can be applied to predicting the growth of farmland crops in a planting area. The method can be executed by a plant growth detection device, which can be implemented by software and / or hardware and is generally integrated in a computer device.

[0151] like Figure 4 As shown, the technical solution of the embodiment of the present invention specifically includes the following steps:

[0152] S410, obtaining at least one farmland image matching the set planting area, and determining the crop area map corresponding to each of the farmland images by using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention.

[0153] The planting area is set to be a planting area where plant growth detection is required. After acquiring each farmland image corresponding to the planting area, a crop area recognition method or a crop area recognition method is used to obtain multiple crop area maps corresponding to the planting area.

[0154] S420: Determine geographical location information matching each of the crop regions according to the image position of the crop region in each of the crop region maps and the geographical location information respectively matching each of the crop region maps.

[0155] In the embodiment of the present invention, the geographical location information of each crop area can be determined according to the geographical location information of each crop area map and the image position of each crop area in the crop area map.

[0156] For example, the longitude and latitude range corresponding to the crop area map can be obtained first, and then the coordinates of the center of each crop area in the crop area map can be obtained to obtain the longitude and latitude of the center of each crop area, but the embodiment of the present invention does not limit the method of determining the geographic location information of the crop area.

[0157] S430: Calculate crop height information within each of the crop areas based on geographic location information matching each of the crop areas and a digital surface model matching the planting area.

[0158] In the embodiment of the present invention, after determining the geographical location information of each crop area, the location of the crop area can be determined in the digital surface model of the planting area, and the crop height information in the crop area can be obtained.

[0159] The Digital Surface Model (DSM) refers to a ground elevation model that includes the heights of surface buildings, bridges, and trees. In the embodiment of the present invention, the Digital Surface Model includes the heights of each plant in the planting area, but the plants in the planting area also include non-crops. Therefore, it is necessary to identify the location of the crop area in the Digital Surface Model and estimate the crop growth based on the crop height information in the crop area.

[0160] The advantage of this setting is that it can improve the accuracy of crop height identification and eliminate the impact of non-crop plant height information on crop growth.

[0161] S440: Estimate the growth potential of crops matching the planting area based on the crop height information in each of the crop areas.

[0162] In the embodiment of the present invention, after the crop height information of the crop area is determined, the crop height information of each crop area in the planting area can be compared with the standard crop height information to judge the growth of the crop.

[0163] The technical solution of the embodiment of the present invention obtains multiple crop area maps of the planting area through a crop area recognition method or a crop area recognition method, determines the geographical location information of the crop area, obtains the crop height information of the crop area based on the digital surface model and the geographical location information of the crop area, and estimates the crop growth based on the crop height information of the crop area. The problem of inaccurate detection results caused by the presence of non-crop plants in the planting area when estimating crop growth in the prior art is solved, and the effect of eliminating the influence of non-crop plant height information on crop growth judgment is achieved, thereby improving the accuracy of crop growth detection.

[0164] Embodiment 5

[0165] Figure 5 This is a flow chart of a yield prediction method provided in Example 5 of the present invention. This embodiment can be applied to predicting the yield of farmland crops in a planting area. The method can be executed by a yield prediction device, which can be implemented by software and / or hardware and is generally integrated in a computer device.

[0166] S510, obtaining at least one farmland image matching the set planting area, and determining the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention.

[0167] The planting area is set to be a planting area for which yield prediction is required. After acquiring each farmland image corresponding to the planting area, a crop area recognition method or a crop area recognition method is used to obtain a plurality of crop area maps corresponding to the planting area.

[0168] S520: Calculate the total area of ​​regions matching all crop regions in the planting area according to the area of ​​each crop region in the crop region map.

[0169] In an embodiment of the present invention, the total area of ​​all crop areas in the planting area can be calculated based on the area of ​​each crop area in the crop area map. For example, the number of pixels occupied by each crop area in the crop area map can be obtained first, and then the farmland area in the planting area represented by each crop area can be calculated based on the farmland area in the planting area represented by each pixel, and the sum of the farmland areas in the planting area represented by each crop area is used as the total area of ​​the area, but the embodiment of the present invention does not limit the specific method of calculating the total area of ​​the area.

[0170] S530: Estimate the regional yield that matches the planting area based on the total area of ​​the area and the preset yield per unit area.

[0171] In the embodiment of the present invention, the product of the total area of ​​the region and the preset yield per unit area is the predicted value of the regional yield of the planting area.

[0172] The technical solution of the embodiment of the present invention obtains multiple crop area maps of the planting area through a crop area recognition method or a crop area recognition method, determines the area of ​​the crop area in the crop area map, thereby calculating the total area of ​​all crop areas in the planting area, and estimates the regional yield based on the total area and the yield per unit area. The problem of inaccurate prediction results caused by the presence of non-crop plants in the planting area when estimating regional yield in the prior art is solved, and the effect of eliminating the influence of non-crop areas on regional yield prediction is achieved, thereby improving the accuracy of regional yield prediction.

[0173] Embodiment 6

[0174] Figure 6 1 is a flow chart of a weed identification method provided in Embodiment 6 of the present invention. This embodiment is applicable to the case of identifying weeds in a planting area. The method can be executed by a weed identification device, which can be implemented by software and / or hardware and is generally integrated in a computer device.

[0175] S610, obtaining at least one farmland image matching the set planting area, and determining the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention.

[0176] The planting area is set to be a planting area where weed identification is required. After acquiring each farmland image corresponding to the planting area, a crop area identification method or a crop area identification method is used to obtain a plurality of crop area maps corresponding to the planting area.

[0177] S620: In each of the crop area maps, obtain non-planting areas excluding the crop areas, and identify vegetation points in the non-planting areas.

[0178] The non-planting area is an area other than the crop area in the crop area map. In the embodiment of the present invention, after the crop area is identified, it can be known that weeds grow in the area other than the crop area.

[0179] S630: Acquire at least one non-crop connected domain corresponding to the non-planting area according to the identified vegetation points.

[0180] In the embodiment of the present invention, the vegetation points may form a connected domain. Since the vegetation points are vegetation points in a non-planting area, the connected domain formed by the vegetation points is a non-crop connected domain.

[0181] S640: Determine whether each of the non-crop connected domains is a weed based on at least one of a shape feature of each of the non-crop connected domains, a texture feature of the non-planting connected domain in the farmland image, and color information.

[0182] The shape feature of the non-crop connected domain may refer to feature information such as shape and area of ​​the non-crop connected domain. Weeds may be screened in the non-planted connected domain according to the shape feature. For example, a non-planted connected domain with an area greater than a certain value may be regarded as a weed.

[0183] The texture features of the non-planting connected domain in the farmland image may refer to the texture features of the plants displayed by the non-planting connected domain. The texture features are an important factor in distinguishing plants. Crops and weeds can be distinguished based on whether the texture features of the non-planting connected domain in the farmland image are the same as those of crops.

[0184] The color information of the non-crop connected domain may refer to information such as the average of the color index of each vegetation point in the non-crop connected domain. Whether the non-crop connected domain is a weed can be determined based on whether the color information of the non-crop connected domain is within a set range.

[0185] The technical solution of the embodiment of the present invention obtains multiple crop area maps of the planting area through a crop area recognition method or a crop area recognition method, obtains non-planting areas according to the crop areas in the crop area map, identifies vegetation points in the non-planting areas, and determines whether the non-crop connected domain formed by the vegetation points is weeds. The problem that crops and weeds cannot be accurately distinguished in the prior art is solved, and the effect of automatically identifying weed areas is achieved.

[0186] Embodiment 7

[0187] Figure 7 7 is a schematic diagram of the structure of a crop region identification device provided in Embodiment 7 of the present invention, the device comprising: a crop binary image acquisition module 710, a planting row rectangular strip acquisition module 720, a crop region mask image generation module 730 and a crop region image acquisition module 740, wherein:

[0188] The crop binary image acquisition module 710 is used to generate a crop binary image according to the farmland image, and to acquire the main direction of the planting row according to the crop binary image;

[0189] A planting row rectangular strip acquisition module 720 is used to acquire at least one planting row rectangular strip according to the crop binary image and the main direction of the planting row;

[0190] The crop area mask map generation module 730 is used to combine various planting row rectangular strips to generate a crop area mask map;

[0191] The crop area map acquisition module 740 is used to perform inverse rotation and inverse filling processing on the crop area mask image to obtain a crop area map.

[0192] The technical solution of the embodiment of the present invention obtains a binary image based on a farmland image and obtains the main direction of a planting row, thereby obtaining a planting row rectangular strip, obtains a crop area mask map based on the planting row rectangular strip, and obtains a crop area map based on the crop area mask map. The problem of relying on manual labor, high cost and low efficiency in the prior art when identifying crop areas based on farmland images is solved. Rapid identification of crop areas is achieved, and it is also applicable to crops that are not strictly planted in a straight line, and has a wider range of applications.

[0193] Based on the above embodiment, the planting row rectangular strip acquisition module 720 includes:

[0194] A circumscribed rectangle generating unit, used to generate a circumscribed rectangle of the crop binary image according to the crop binary image and the main direction of the planting row; wherein the height direction of the circumscribed rectangle is the main direction of the planting row;

[0195] A crop binary image projection unit, used to establish a coordinate system with the height direction of the circumscribed rectangle as the ordinate direction, and project the crop binary image into the coordinate system;

[0196] An accumulation curve generating unit, used for counting the number of pixel points in the crop connected domain in the ordinate direction to generate an accumulation curve;

[0197] The planting row rectangular strip acquisition unit is used to acquire at least one planting row rectangular strip according to the accumulated curve.

[0198] Based on the above embodiment, the planting row rectangular strip obtaining unit includes:

[0199] A wave crest abscissa acquisition subunit is used to acquire the abscissa of each wave crest in the cumulative curve and generate a straight line along the main direction of the planting row;

[0200] The planting row rectangular strip generating subunit is used to generate at least one planting row rectangular strip using the straight line generated by each wave peak vertex as the center line and the width of each wave peak as the width.

[0201] Based on the above embodiment, the crop binary image acquisition module 710 includes:

[0202] A vegetation binary map generating unit, used for generating a vegetation binary map according to the vegetation points included in the farmland image;

[0203] The crop connected domain screening unit is used to obtain at least one vegetation connected domain in the vegetation binary map, and screen and retain the crop connected domain in the vegetation connected domain to obtain the crop binary map.

[0204] Based on the above embodiment, the crop binary image acquisition module 710 further includes:

[0205] The planting row main direction identification unit is used to obtain at least one straight line corresponding to each crop connected domain in the crop binary image according to a preset straight line detection algorithm, and identify the planting row main direction according to the angle value of each straight line relative to the reference direction.

[0206] Based on the above embodiment, the planting row main direction identification unit includes:

[0207] A crop point mapping result acquisition subunit is used to map the pixel points in each crop connected domain to the Hough space of the polar coordinate system to obtain a crop point mapping result;

[0208] A line detection result acquisition subunit is used to obtain the line detection result fed back by the Hough space accumulator for the crop point mapping result, and to perform statistical analysis on the line detection result to obtain the main direction of the planting row of the farmland; wherein the line detection result includes a target number of lines and a line angle corresponding to each line;

[0209] Based on the above embodiment, the line detection result acquisition subunit is specifically used for:

[0210] If the target number is greater than or equal to a first number threshold, the number of straight lines corresponding to each of the straight line angles is counted, and the straight line angle with the largest number of straight lines is obtained as the main direction of the planting row;

[0211] If the target quantity is less than a second quantity threshold, the straight line angle of the first straight line in the straight line detection result is obtained as the main direction of the planting row.

[0212] The crop region identification device provided in the embodiment of the present invention can execute the crop region identification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0213] Embodiment 8

[0214] Figure 8 8 is a schematic diagram of a crop region recognition device provided by Embodiment 8 of the present invention, the device comprising: a farmland image acquisition module 810 to be labeled, a training sample acquisition module 820, a crop region recognition model acquisition module 830 and a crop region recognition result acquisition module 840. Among them:

[0215] The farmland image acquisition module 810 is used to acquire multiple farmland images to be labeled;

[0216] A training sample acquisition module 820 is used to identify a crop area map in each of the farmland images to be labeled using the method described in any embodiment of the present invention, and to label each of the farmland images to be labeled using the crop area map to obtain a plurality of training samples;

[0217] A crop region recognition model acquisition module 830 is used to train a preset machine learning model using each of the training samples to obtain a crop region recognition model;

[0218] The crop region recognition result acquisition module 840 is used to input the farmland image to be recognized into the crop region recognition model to obtain the crop region recognition result of the farmland image to be recognized.

[0219] The technical solution of the embodiment of the present invention is to obtain a crop area map by performing crop area recognition on the farmland image to be labeled, and to label the farmland image to be labeled according to the crop area map, and to train the crop area recognition model using the labeled image as a training sample, and to input the farmland image to be identified into the trained crop area recognition model to obtain the recognition result. The problem of over-reliance on manual labeling, high labor cost and low efficiency when training the crop area recognition model in the prior art, and the problem of the narrow application scope of the existing crop area recognition model are solved. The crop area in the image is quickly labeled, which saves labor cost, improves labeling efficiency, and the trained crop area recognition model has a wider application scope.

[0220] The crop region recognition device provided in the embodiment of the present invention can execute the crop region recognition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0221] Embodiment 9

[0222] Fig. 9 It is a structural schematic diagram of a plant growth detection device provided in Embodiment 9 of the present invention, the device comprising: a crop area map determination module 910, a geographic location information determination module 920, a crop height information calculation module 930 and a crop growth estimation module 940.

[0223] The crop region map determination module 910 is used to obtain at least one farmland image matching the set planting area, and determine the crop region map corresponding to each of the farmland images by using the crop region recognition method or crop region recognition method as described in the embodiment of the present invention;

[0224] A geographic location information determination module 920, configured to determine geographic location information matching each crop region according to an image position of the crop region in each crop region map and geographic location information matching each crop region map;

[0225] The crop height information calculation module 930 is used to calculate the crop height information in each of the crop areas according to the geographical location information matching the crop areas and the digital surface model matching the planting area;

[0226] The crop growth prediction module 940 is used to estimate the growth of crops matching the planting area according to the crop height information in each of the crop areas.

[0227] The technical solution of the embodiment of the present invention obtains multiple crop area maps of the planting area through a crop area recognition method or a crop area recognition method, determines the geographical location information of the crop area, obtains the crop height information of the crop area based on the digital surface model and the geographical location information of the crop area, and estimates the crop growth based on the crop height information of the crop area. The problem of inaccurate detection results caused by the presence of non-crop plants in the planting area when estimating crop growth in the prior art is solved, and the effect of eliminating the influence of non-crop plant height information on crop growth judgment is achieved, thereby improving the accuracy of crop growth detection.

[0228] The plant growth detection device provided in the embodiment of the present invention can execute the plant growth detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0229] Embodiment 10

[0230] Fig.10 10 is a schematic diagram of a yield prediction device provided by the tenth embodiment of the present invention, the device comprises: a crop area map determination module 1010, a regional total area determination module 1020 and a regional yield estimation module 1030. Among them:

[0231] The crop region map determination module 1010 is used to obtain at least one farmland image matching the set planting area, and determine the crop region map corresponding to each of the farmland images by using the crop region recognition method or crop region recognition method as described in the embodiment of the present invention;

[0232] A region total area determination module 1020, for calculating the total area of ​​regions matching all crop regions in the planting region according to the area of ​​each crop region in the crop region map;

[0233] The regional yield estimation module 1030 is used to estimate the regional yield that matches the planting area based on the total area of ​​the area and the preset unit area yield.

[0234] The technical solution of the embodiment of the present invention obtains multiple crop area maps of the planting area through a crop area recognition method or a crop area recognition method, determines the area of ​​the crop area in the crop area map, thereby calculating the total area of ​​all crop areas in the planting area, and estimates the regional yield based on the total area and the yield per unit area. The problem of inaccurate prediction results caused by the presence of non-crop plants in the planting area when estimating regional yield in the prior art is solved, and the effect of eliminating the influence of non-crop areas on regional yield prediction is achieved, thereby improving the accuracy of regional yield prediction.

[0235] The yield prediction device provided in the embodiment of the present invention can execute the yield prediction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0236] Embodiment 11

[0237] Fig.11 11 is a schematic diagram of the structure of a weed identification device provided in the eleventh embodiment of the present invention, the device comprises: a crop area map determination module 1110, a vegetation point identification module 1120, a non-crop connected domain acquisition module 1130 and a weed identification module 1140. Among them:

[0238] The crop region map determination module 1110 is used to obtain at least one farmland image matching the set planting area, and determine the crop region map corresponding to each of the farmland images by using the crop region recognition method or crop region recognition method as described in the embodiment of the present invention;

[0239] The vegetation point identification module 1120 is used to obtain non-planting areas other than the crop areas in each of the crop area maps, and identify vegetation points in the non-planting areas;

[0240] A non-crop connected domain acquisition module 1130 is used to acquire at least one non-crop connected domain corresponding to the non-planting area according to the identified vegetation points;

[0241] The weed identification module 1140 is used to determine whether each of the non-crop connected domains is a weed according to at least one of the shape features of each of the non-crop connected domains, the texture features of the non-crop connected domains in the farmland image, and the color information.

[0242] The technical solution of the embodiment of the present invention obtains multiple crop area maps of the planting area through a crop area recognition method or a crop area recognition method, obtains non-planting areas according to the crop areas in the crop area map, identifies vegetation points in the non-planting areas, and determines whether the non-crop connected domain formed by the vegetation points is weeds. The problem that crops and weeds cannot be accurately distinguished in the prior art is solved, and the effect of automatically identifying weed areas is achieved.

[0243] The weed identification device provided in the embodiment of the present invention can execute the weed identification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0244] Embodiment 12

[0245] Fig.12 A schematic diagram of the structure of a computer device provided in Embodiment 12 of the present invention is shown in FIG. Fig.12As shown, the computer device includes a processor 70, a memory 71, an input device 72 and an output device 73; the number of processors 70 in the computer device can be one or more. Fig.12 A processor 70 is taken as an example; the processor 70, memory 71, input device 72 and output device 73 in the computer device can be connected by a bus or other means. Fig.12 The example of connecting through bus is taken in the following.

[0246] The memory 71 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as the modules corresponding to the crop region identification method in the embodiment of the present invention (for example, the crop binary image acquisition module 710, the planting row rectangular strip acquisition module 720, the crop region mask image generation module 730 and the crop region map acquisition module 740 in the crop region identification device), or the modules corresponding to the crop region identification method in the embodiment of the present invention (for example, the to-be-annotated farmland image acquisition module 810, the training sample acquisition module 820, the crop region identification model acquisition module 830 and the crop region identification result acquisition module 840 in the crop region identification device). Or the modules corresponding to the plant growth detection method in the embodiment of the present invention (for example, the crop region map determination module 910, the geographic location information determination module 920, the crop height information calculation module 930 and the crop growth estimation module 940 in the plant growth detection device). Or the modules corresponding to the yield prediction method in the embodiment of the present invention (for example, the crop region map determination module 1010, the regional total area determination module 1020 and the regional yield estimation module 1030). Or the modules corresponding to the weed identification method in the embodiment of the present invention (for example, the crop area map determination module 1110, the vegetation point identification module 1120, the non-crop connected domain acquisition module 1130 and the weed identification module 1140 in the weed identification device). The processor 70 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 71, that is, realizing the above-mentioned crop area identification method. The method includes:

[0247] Generate a crop binary map according to the farmland image, and obtain the main direction of the planting row according to the crop binary map;

[0248] Acquire at least one planting row rectangular strip according to the crop binary image and the main direction of the planting row;

[0249] Combine various planting row rectangles to generate a crop area mask map;

[0250] The crop region mask image is subjected to inverse rotation and inverse filling processing to obtain a crop region image.

[0251] Alternatively, the above-mentioned crop area recognition method is implemented. The method comprises:

[0252] Acquire multiple farmland images to be labeled;

[0253] Using the crop region recognition method described in any one of the embodiments of the present invention, a crop region map is identified in each of the farmland images to be labeled, and each of the farmland images to be labeled is labeled using the crop region map to obtain a plurality of training samples;

[0254] Using each of the training samples to train a preset machine learning model to obtain a crop region recognition model;

[0255] The farmland image to be identified is input into the crop region identification model to obtain a crop region identification result for the farmland image to be identified.

[0256] Alternatively, the above-mentioned plant growth detection method is implemented. The method comprises:

[0257] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0258] Determining geographical location information matching each of the crop regions according to an image position of the crop region in each of the crop region maps and geographical location information respectively matching each of the crop region maps;

[0259] Calculating crop height information within each of the crop areas based on geographic location information matching each of the crop areas and a digital surface model matching the planting area;

[0260] The growth potential of crops matching the planting area is estimated based on the crop height information in each of the crop areas.

[0261] Alternatively, the above-mentioned yield prediction method is implemented. The method comprises:

[0262] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0263] Calculate the total area of ​​regions matching all crop regions in the planting area according to the area of ​​each crop region in the crop region map;

[0264] The regional yield matching the planting area is estimated based on the total area of ​​the region and the preset yield per unit area.

[0265] Alternatively, the above-mentioned weed identification method is implemented. The method comprises:

[0266] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0267] In each of the crop area maps, a non-planting area excluding the crop area is obtained, and vegetation points are identified in the non-planting area;

[0268] Acquire at least one non-crop connected domain corresponding to the non-planting area according to the identified vegetation points;

[0269] Whether each of the non-crop connected domains is a weed is determined based on at least one of the shape features of each of the non-crop connected domains, the texture features of the non-planted connected domains in the farmland image, and the color information.

[0270] The memory 71 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 71 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 71 may further include a memory remotely arranged relative to the processor 70, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0271] The input device 72 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device. The output device 73 may include a display device such as a display screen.

[0272] Embodiment 13

[0273] Embodiment 13 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute a crop region identification method when executed by a computer processor, the method comprising:

[0274] Generate a crop binary map according to the farmland image, and obtain the main direction of the planting row according to the crop binary map;

[0275] Acquire at least one planting row rectangular strip according to the crop binary image and the main direction of the planting row;

[0276] Combine various planting row rectangles to generate a crop area mask map;

[0277] The crop region mask image is subjected to inverse rotation and inverse filling processing to obtain a crop region image.

[0278] The method can also be used to perform a method for identifying a crop area, the method comprising:

[0279] Acquire multiple farmland images to be labeled;

[0280] Using the crop region recognition method described in any one of the embodiments of the present invention, a crop region map is identified in each of the farmland images to be labeled, and each of the farmland images to be labeled is labeled using the crop region map to obtain a plurality of training samples;

[0281] Using each of the training samples to train a preset machine learning model to obtain a crop region recognition model;

[0282] The farmland image to be identified is input into the crop region identification model to obtain a crop region identification result for the farmland image to be identified.

[0283] The invention can also be used to perform a method for detecting plant growth, the method comprising:

[0284] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0285] Determining geographical location information matching each of the crop regions according to an image position of the crop region in each of the crop region maps and geographical location information respectively matching each of the crop region maps;

[0286] Calculating crop height information within each of the crop areas based on geographic location information matching each of the crop areas and a digital surface model matching the planting area;

[0287] The growth potential of crops matching the planting area is estimated based on the crop height information in each of the crop areas.

[0288] It can also be used to perform a yield forecasting method, the method comprising:

[0289] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0290] Calculate the total area of ​​regions matching all crop regions in the planting area according to the area of ​​each crop region in the crop region map;

[0291] The regional yield matching the planting area is estimated based on the total area of ​​the region and the preset yield per unit area.

[0292] It can also be used to perform a weed identification method, the method comprising:

[0293] Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the crop area recognition method or crop area recognition method as described in the embodiment of the present invention;

[0294] In each of the crop area maps, a non-planting area excluding the crop area is obtained, and vegetation points are identified in the non-planting area;

[0295] Acquire at least one non-crop connected domain corresponding to the non-planting area according to the identified vegetation points;

[0296] Whether each of the non-crop connected domains is a weed is determined based on at least one of the shape features of each of the non-crop connected domains, the texture features of the non-planted connected domains in the farmland image, and the color information.

[0297] Of course, the storage medium containing computer executable instructions provided by an embodiment of the present invention is not limited to the method operations described above, and can also execute the crop area identification method provided by any embodiment of the present invention or related operations in the crop area identification method.

[0298] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0299] It is worth noting that in the above-mentioned crop area identification device or the embodiment of the crop area identification device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0300] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A crop region identification method, characterized in that: include: Generate a crop binary map according to the farmland image, and obtain the main direction of the planting row according to the crop binary map; Acquire at least one planting row rectangular strip according to the crop binary image and the main direction of the planting row; Combine various planting row rectangles to generate a crop area mask map; Performing inverse rotation and inverse filling processing on the crop region mask image to obtain a crop region image; According to the crop binary image and the main direction of the planting row, at least one planting row rectangular strip is obtained, including: Generate a bounding rectangle of the crop binary image according to the crop binary image and the main direction of the planting row; wherein the height direction of the bounding rectangle is the main direction of the planting row; A coordinate system is established with the height direction of the circumscribed rectangle as the ordinate direction, and the crop binary image is projected into the coordinate system; Counting the number of pixel points in the crop connected domain in the ordinate direction to generate a cumulative curve; and performing smoothing on the cumulative curve; At least one planting row rectangular strip is obtained according to the accumulated curve.

2. The method according to claim 1, characterized in that According to the accumulated curve, obtaining at least one planting row rectangular strip comprises: Obtaining the horizontal coordinates of each peak in the cumulative curve, and generating a straight line along the main direction of the planting row; At least one planting row rectangular strip is generated with the straight line generated by each wave crest vertex as the center line and the width of each wave crest as the width.

3. The method according to claim 1, characterized in that Generate crop binary images based on farmland images, including: Generate a vegetation binary map according to the vegetation points included in the farmland image; At least one vegetation connected domain is obtained from the vegetation binary map, and a crop connected domain is screened and retained from the vegetation connected domain to obtain the crop binary map.

4. The method according to claim 1, characterized in that Obtaining the main direction of the planting row according to the crop binary image includes: According to a preset straight line detection algorithm, at least one straight line corresponding to each crop connected domain in the crop binary map is obtained, and the main direction of the planting row is identified according to the angle value of each straight line relative to the reference direction.

5. The method according to claim 4, characterized in that According to a preset straight line detection algorithm, at least one straight line corresponding to each crop connected domain in the crop binary map is obtained, and the main direction of the planting row is identified according to the angle value of each straight line relative to the reference direction, including: Mapping the pixel points in each crop connected domain to the polar coordinate system Hough space to obtain a crop point mapping result; Obtaining a straight line detection result fed back by a Hough space accumulator for the crop point mapping result, performing statistical analysis on the straight line detection result, and obtaining a main direction of the planting row of the farmland; The straight line detection result includes a target number of straight lines and a straight line angle corresponding to each straight line.

6. The method according to claim 5, characterized in that Statistical analysis is performed on the straight line detection results to obtain the main direction of the planting rows of the farmland, including: If the target number is greater than or equal to a first number threshold, the number of straight lines corresponding to each of the straight line angles is counted, and the straight line angle with the largest number of straight lines is obtained as the main direction of the planting row; If the target quantity is less than a second quantity threshold, the straight line angle of the first straight line in the straight line detection result is obtained as the main direction of the planting row.

7. A method for identifying a crop area, characterized in that: include: Acquire multiple farmland images to be labeled; Using the method described in any one of claims 1 to 6, identifying a crop area map in each of the farmland images to be labeled, and using the crop area map to label each of the farmland images to be labeled, to obtain a plurality of training samples; Using each of the training samples to train a preset machine learning model to obtain a crop region recognition model; The farmland image to be identified is input into the crop region identification model to obtain a crop region identification result for the farmland image to be identified.

8. A method for detecting plant growth, characterized in that: include: Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the method described in any one of claims 1 to 7; Determining geographical location information matching each of the crop regions according to an image position of the crop region in each of the crop region maps and geographical location information respectively matching each of the crop region maps; Calculating crop height information within each of the crop areas based on geographic location information matching each of the crop areas and a digital surface model matching the planting area; The growth potential of crops matching the planting area is estimated based on the crop height information in each of the crop areas.

9. A yield prediction method, characterized in that: include: Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the method described in any one of claims 1 to 7; Calculate the total area of ​​regions matching all crop regions in the planting area according to the area of ​​each crop region in the crop region map; The regional yield matching the planting area is estimated based on the total area of ​​the region and the preset yield per unit area.

10. A weed identification method, characterized in that: include: Acquire at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the method described in any one of claims 1 to 7; In each of the crop area maps, a non-planting area excluding the crop area is obtained, and vegetation points are identified in the non-planting area; Acquire at least one non-crop connected domain corresponding to the non-planting area according to the identified vegetation points; Whether each of the non-crop connected domains is a weed is determined based on at least one of a shape feature of each of the non-crop connected domains, a texture feature of the non-crop connected domain in the farmland image, and color information.

11. A crop area identification device, characterized in that: include: A crop binary image acquisition module is used to generate a crop binary image according to the farmland image, and to acquire the main direction of the planting row according to the crop binary image; A planting row rectangular strip acquisition module, used for acquiring at least one planting row rectangular strip according to the crop binary image and the main direction of the planting row; The crop area mask map generation module is used to combine various planting row rectangular strips to generate a crop area mask map; A crop area map acquisition module, used for performing inverse rotation and inverse filling processing on the crop area mask image to obtain a crop area map; The planting row rectangular strip acquisition module includes: A circumscribed rectangle generating unit, used to generate a circumscribed rectangle of the crop binary image according to the crop binary image and the main direction of the planting row; wherein the height direction of the circumscribed rectangle is the main direction of the planting row; A crop binary image projection unit, used to establish a coordinate system with the height direction of the circumscribed rectangle as the ordinate direction, and project the crop binary image into the coordinate system; An accumulation curve generating unit is used to count the number of pixel points in the crop connected domain in the ordinate direction to generate an accumulation curve; and to perform smoothing on the accumulation curve; The planting row rectangular strip acquisition unit is used to acquire at least one planting row rectangular strip according to the accumulated curve.

12. A crop area identification device, characterized in that: include: A module for acquiring farmland images to be labeled, used for acquiring multiple farmland images to be labeled; A training sample acquisition module, used to use the method described in any one of claims 1 to 6 to identify a crop area map in each of the farmland images to be labeled, and use the crop area map to label each of the farmland images to be labeled to obtain multiple training samples; A crop region recognition model acquisition module, used to train a preset machine learning model using each of the training samples to obtain a crop region recognition model; The crop region recognition result acquisition module is used to input the farmland image to be recognized into the crop region recognition model to obtain the crop region recognition result of the farmland image to be recognized.

13. A plant growth detection device, characterized in that: include: A crop area map determination module, used to obtain at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the method described in any one of claims 1 to 7; A geographic location information determination module, used to determine the geographic location information matching each of the crop areas according to the image position of the crop area in each of the crop area maps and the geographic location information respectively matching each of the crop area maps; A crop height information calculation module, used to calculate the crop height information in each of the crop areas according to the geographical location information matching the crop areas and the digital surface model matching the planting area; The crop growth prediction module is used to estimate the growth of crops matching the planting area according to the crop height information in each of the crop areas.

14. A yield prediction device, characterized in that: include: A crop area map determination module, used to obtain at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the method described in any one of claims 1 to 7; A region total area determination module, used to calculate the total area of ​​regions matching all crop regions in the planting area according to the area of ​​each crop region in the crop region map; The regional yield estimation module is used to estimate the regional yield matching the planting area based on the total area of ​​the area and the preset unit area yield.

15. A weed identification device, characterized in that: include: A crop area map determination module, used to obtain at least one farmland image matching the set planting area, and determine the crop area map corresponding to each of the farmland images using the method described in any one of claims 1 to 7; A vegetation point identification module, used to obtain non-planting areas excluding crop areas in each of the crop area maps, and identify vegetation points in the non-planting areas; A non-crop connected domain acquisition module, used to acquire at least one non-crop connected domain corresponding to the non-planting area according to the identified vegetation points; The weed identification module is used to determine whether each of the non-crop connected domains is a weed according to at least one of the shape features of each of the non-crop connected domains, the texture features of the non-crop connected domains in the farmland image, and the color information.

16. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the crop area identification method according to any one of claims 1 to 6, or the crop area identification method according to claim 7, or the plant growth detection method according to claim 8, or the yield prediction method according to claim 9, or the weed identification method according to claim 10.

17. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions, when executed by a computer processor, are used to execute the crop area identification method according to any one of claims 1 to 6, or the crop area identification method according to claim 7, or the plant growth detection method according to claim 8, or the yield prediction method according to claim 9, or the weed identification method according to claim 10.

Citation Information

Patent Citations

  • Crop distribution extraction method and device

    CN110298366A