Method and device for determining target width

By obtaining the mask image and preset sampling points of the target object in the planting area, determining the width information of crops and mulch films, the problems of low detection efficiency and poor accuracy in the prior art are solved, and more efficient and accurate width detection is achieved, supporting the implementation of subsequent regulation strategies.

CN114693766BActive Publication Date: 2025-08-08GUANGZHOU XAIRCRAFT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210346601.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2025-08-08
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

In the prior art, crop and mulch width detection efficiency is low and the accuracy is poor, which affects the selection and implementation of subsequent regulation techniques.

Method used

By acquiring the target mask image of the planting area to be detected, the mask image of the target object and the preset sampling point are used to determine the width information of the target object, including the width detection of crops and mulch films.

Benefits of technology

It improves detection efficiency and accuracy, and provides more reliable detection results as the basis for subsequent regulation technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114693766B_ABST
    Figure CN114693766B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a method and related apparatus for determining the width of a target object, relating to the field of agricultural automation technology. First, a mask image of a target object in a planting area to be inspected is obtained; then, based on the mask image of the target object and the preset sampling points of the target object, width information of the target object corresponding to the planting area to be inspected is obtained. Because the embodiments of the present invention determine the width information of the target object based on the mask image of the target object and the preset sampling points of the target object, the influence of human factors on the objectivity of the detection results is reduced, and the detection efficiency and accuracy of the detection results are improved. The detection results can then be used as a basis for the selection and implementation of subsequent control technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural automation technology, and in particular to a method for determining the width of a target object and a related device. Background Art

[0002] In actual planting, the width of crops and mulch film is usually measured manually. With the continuous increase in crop density, the promotion of sub-mulch drip irrigation technology, and the popularization of various new planting methods, manual measurement methods are not only inefficient, but also difficult to ensure the accuracy and objectivity of the test results. This is also not conducive to the selection and implementation of subsequent control technologies. Summary of the Invention

[0003] In order to overcome the shortcomings of the existing technology, the embodiments of the present invention provide a method and related devices for determining the width of a target object to improve the efficiency of width detection of crops and mulch films, as well as the accuracy and objectivity of the detection results, thereby providing a basis for the selection and implementation of subsequent control technologies.

[0004] The embodiments of the present invention can be implemented as follows:

[0005] In a first aspect, the present invention provides a method for determining the width of an object, the method comprising:

[0006] Acquire a mask image of a target object in a planting area to be inspected;

[0007] According to the mask image of the target object and the preset sampling points of the target object, width information of the target object corresponding to the planting area to be detected is obtained.

[0008] In an optional embodiment, the target object includes crops and / or ground film, and the step of obtaining width information of the target object corresponding to the planting area to be detected based on the mask image of the target object and the preset sampling points of the target object includes:

[0009] Obtaining width information of the crops corresponding to the planting area to be detected based on the mask image of the crops and the preset sampling points of the crops; and / or

[0010] According to the mask image of the crops, the mask image of the ground film and the preset sampling points of the ground film, the width information of the ground film corresponding to the planting area to be detected is obtained.

[0011] In an optional embodiment, there are multiple preset sampling points for the crop, and the step of obtaining the width information of the crop corresponding to the planting area to be detected based on the mask image of the crop and the preset sampling points of the crop includes:

[0012] determining a width of the preset sampling point of the crop according to the coordinates of the preset sampling point of the crop and the mask image of the crop;

[0013] The width information of the crops is obtained according to the widths of the preset sampling points of all the crops.

[0014] In an optional embodiment, the mask image of the crop includes a plurality of pixel points, and the step of determining the width of the preset sampling point of the crop according to the coordinates of the preset sampling point of the crop and the mask image of the crop includes:

[0015] For the preset sampling point of the crop, determining a starting pixel point corresponding to the preset sampling point of the crop from the plurality of pixel points according to the coordinates of the preset sampling point of the crop;

[0016] Taking the starting pixel point as the starting point, taking the pixel point before the first pixel point in the preset direction whose pixel value is different from the pixel value of the starting pixel point as the end point;

[0017] The width of the preset sampling point of the crop is calculated according to the number of pixels between the starting point and the end point.

[0018] In an optional embodiment, the ground film has a plurality of preset sampling points, and the step of obtaining the width information of the ground film corresponding to the planting area to be detected according to the mask image of the crop, the mask image of the ground film, and the preset sampling points of the ground film includes:

[0019] Determining the width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film, the mask image of the crop, and the mask image of the ground film;

[0020] According to the widths of all preset sampling points of the ground films, the width information of the ground films corresponding to the planting area to be detected is obtained.

[0021] In an optional embodiment, the step of determining the width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film, the mask image of the crop, and the mask image of the ground film includes:

[0022] For the preset sampling point of the ground film, according to the coordinates of the preset sampling point of the ground film and the mask image of the crop, a first width of the preset sampling point of the ground film is obtained;

[0023] Obtaining a second width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film and the mask image of the ground film;

[0024] The width of the preset sampling point of the ground film is determined according to the first width and the second width.

[0025] In an optional embodiment, the step of determining the width of the preset sampling point of the ground film according to the first width and the second width includes:

[0026] If the first width is not greater than the product of the second width and a preset coefficient, the first width is used as the width of the preset sampling point of the ground film;

[0027] If the first width is greater than the product of the second width and a preset coefficient, the width of the preset sampling point of the ground film is calculated according to the first width and a preset weight factor.

[0028] In an optional embodiment, the target objects include crops and mulch films, and the method further includes:

[0029] The ventilation and light transmittance of the planting area to be detected are determined according to the width information of the crops and the width information of the ground film.

[0030] In an optional embodiment, the method further comprises:

[0031] generating a crop width variation curve based on the crop width information within a preset time period; and / or

[0032] A ground film width variation curve is generated according to the ground film width information within a preset time period.

[0033] In an optional embodiment, the method further comprises:

[0034] A target farming management strategy is determined based on the crop width variation curve and / or the mulch film width variation curve.

[0035] In an optional embodiment, the step of determining the target farming management strategy based on the crop width variation curve and the mulch film width variation curve includes at least one of the following methods:

[0036] First way:

[0037] comparing the crop width variation curve with a first threshold curve, wherein the first threshold curve represents a standard variation trend of the crop width;

[0038] determining a target farming management strategy based on a comparison result of the crop width variation curve and the first threshold curve;

[0039] Second way:

[0040] Comparing the ground film width variation curve with a second threshold curve, wherein the second threshold curve represents a standard variation trend of the ground film width;

[0041] determining a target agricultural management strategy based on a comparison result of the mulch film width variation curve and the second threshold curve;

[0042] The third way:

[0043] comparing the width information of at least one of the crops in the crop width variation curve with standard width information of the crops;

[0044] determining a target farming management strategy based on a comparison result of width information of at least one of the crops in the crop width variation curve and standard width information of the crops;

[0045] The fourth way:

[0046] comparing the width information of at least one of the ground films in the ground film width variation curve with the standard width information of the ground film;

[0047] determining a target agricultural management strategy according to a comparison result of at least one piece of mulch width information in the mulch width variation curve and standard mulch width information;

[0048] The fifth way:

[0049] The crop width variation curve and / or the mulch film width variation curve are input into a farming strategy generation model to determine a target farming management strategy.

[0050] In an optional embodiment, the method further includes:

[0051] The crop width variation curve and / or the mulch film width variation curve are displayed via a planting area display interface.

[0052] In an optional embodiment, the method further comprises:

[0053] The target farming management strategy is displayed through the planting area display interface.

[0054] In an optional embodiment, the step of displaying the crop width variation curve and / or the mulch film width variation curve through the planting area display interface includes:

[0055] Dividing the planting area to be detected into regions;

[0056] For each sub-region of the planting area to be detected, a crop width change curve and / or a ground film width change curve corresponding to the sub-region is displayed.

[0057] In a second aspect, the present invention provides an agricultural management system, comprising a processing module and an output module;

[0058] The processing module is configured to perform at least one of the following operations:

[0059] Obtaining width information of the target object corresponding to the planting area to be detected according to the method of the aforementioned embodiment, obtaining ventilation and light transmittance of the planting area to be detected according to the method of the aforementioned embodiment, and determining the target agricultural management strategy according to the method of the aforementioned embodiment;

[0060] The output module is used to output the processing results of the processing module.

[0061] In a third aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the method described in any one of the aforementioned embodiments when calling the computer program.

[0062] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method described in any one of the aforementioned embodiments.

[0063] Compared to existing technologies, the present invention provides a method and related apparatus for determining the width of a target object. First, a mask image of the target object in the planting area to be inspected is acquired. Then, based on the mask image and the preset sampling points of the target object, the width information of the target object corresponding to the planting area to be inspected is obtained. Because the present invention determines the target object's width information based on the mask image and the preset sampling points of the target object, the impact of human factors on the objectivity of the inspection results is reduced, and the inspection efficiency and accuracy of the inspection results are improved. The inspection results can then serve as a basis for the selection and implementation of subsequent control technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0065] Figure 1 A schematic diagram of a planting area image provided by an embodiment of the present invention;

[0066] Figure 2 A schematic flow chart of a method for determining the width of an object provided by an embodiment of the present invention;

[0067] Figure 3 A schematic diagram of a four-valued mask image provided by an embodiment of the present invention;

[0068] Figure 4 A schematic block diagram of the structure of an agricultural management system provided by an embodiment of the present invention;

[0069] Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present invention.

[0070] Icon: 200-agricultural management system; 210-processing module; 220-output module; 300-computer equipment; 310-memory; 320-processor. DETAILED DESCRIPTION

[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0072] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.

[0073] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0074] In addition, the terms "first", "second", etc., if used, are merely used to distinguish and describe, and should not be understood as indicating or implying relative importance.

[0075] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0076] Crops usually include oil crops, food crops, cash crops, etc. Figure 1As shown, in actual production, many crops are often planted in neat, parallel rows, forming multiple rows. The unplanted area between rows is partially covered with plastic film, meaning the crops are planted on both sides of the film. As the crops grow, their leaves gradually cover the film. When the two rows of crops grow to the point where they overlap and completely cover the film between them, this phenomenon is called row sealing. If row sealing occurs prematurely, it can easily lead to poor ventilation and light transmission in the planting area, impairing crop photosynthesis, resulting in shriveled grains, fallen flowers and fruits, and lodging.

[0077] The ventilation and light transmittance of the planting area can be determined based on the occurrence of the "row closure" phenomenon in the planting area. Currently, the main method to determine whether "row closure" occurs is to manually measure the width of each row of crops and the width of the ground film. For larger planting areas, this method is not only inefficient but also has low accuracy, which is not conducive to the selection and implementation of subsequent planting area regulation strategies.

[0078] In view of this, the embodiments of this aspect provide a method for determining the width of a target object, an agricultural management system, a computer device and a storage medium to overcome the problems of low efficiency and low accuracy in the existing technology, which are described in detail below.

[0079] Please refer to Figure 2 , Figure 2 A flowchart of a method for determining the width of an object provided by an embodiment of the present invention specifically includes the following steps S101 to S102.

[0080] S101, obtaining a mask image of a target object in a planting area to be detected.

[0081] The target object can be crops planted within the inspected planting area, mulch covering an unplanted area, or bare soil in an unplanted area not covered with mulch. The mask image can be obtained by performing a masking operation on an image captured by a drone during a patrol of the inspected planting area.

[0082] Mask images include binary mask images, four-valued mask images, etc. Figure 3 is a four-valued mask image. The target mask image in the embodiment of the present invention is a binary mask image. A binary mask image is composed of a number of pixels with values of 0 and 1, where the pixel value of the pixel corresponding to the target area is 1, and the pixel value of the pixel corresponding to the non-target area is 0.

[0083] For example, when the target object is crops, in the crop mask image, pixels with a value of 1 represent crops, and pixels with a value of 0 represent non-crops. Similarly, when the target object is mulch, in the mulch mask image, pixels with a value of 1 represent mulch, and pixels with a value of 0 represent non-mulch.

[0084] S102 , obtaining width information of the target object corresponding to the planting area to be detected according to the mask image of the target object and the preset sampling points of the target object.

[0085] Among them, such as Figure 1 As shown, the objects within the planting area are distributed in rows, with the preset sampling points located on the centerline of each row. For any row of objects, there are multiple preset sampling points along its centerline. The width information for the objects corresponding to the planting area to be inspected includes the width of the objects at each preset sampling point. Based on the changes in the pixel values of the pixels on the mask image of the objects, the width of each object at the preset sampling point is determined, thereby obtaining the width information for the objects corresponding to the planting area to be inspected.

[0086] The method provided in the above embodiment has the beneficial effect of determining the width information of the target object through the mask image of the target object and the preset sampling points of the target object, thereby reducing the influence of human factors on the objectivity of the detection results, and improving the detection efficiency and accuracy of the detection results. The detection results can then be used as the basis for the selection and implementation of subsequent control technologies.

[0087] Since the target object may be crops, ground film or bare soil, when the target object is crops, an embodiment of the present invention provides an implementation method for determining the width information of the crops corresponding to the planting area to be detected, that is, step S102 includes sub-step S102-1.

[0088] S102-1, obtaining width information of the crops corresponding to the planting area to be detected according to the mask image of the crops and the preset sampling points of the crops.

[0089] Among them, such as Figure 1 As shown in the figure, multiple rows of crops are distributed within the planting area, and multiple sampling points are pre-selected along the center line of any row of crops. Based on the changes in pixel values within a certain area at each pre-set sampling point on the crop mask image, the width of each crop at that pre-set sampling point is determined, thereby obtaining the width information of the crop corresponding to the planting area to be detected.

[0090] When the target object is a ground film, an embodiment of the present invention provides an implementation method for determining width information of the ground film corresponding to the planting area to be detected as follows, that is, step S102 includes sub-step S102-2.

[0091] S102-2: Obtaining width information of the ground film corresponding to the planting area to be detected based on the mask image of the ground film and the preset sampling points of the ground film.

[0092] Among them, such as Figure 1 As shown, the mulch within the planting area is distributed in rows, just like the crops, and multiple sampling points are pre-selected along the centerline of any row of mulch. Similarly, the width of each mulch at that pre-set sampling point is determined based on the change in pixel values within a certain area of the mulch mask image. This allows the width of the mulch corresponding to the planting area to be inspected to be determined.

[0093] Although the above method can obtain the width information of the ground film corresponding to the planting area to be detected, the pixel values of the pixel points in the damaged area of the ground film on the mask image of the ground film do not represent the ground film, so there is an error in the ground film width determined based on the change in the pixel values of the pixel points.

[0094] In order to further improve the accuracy of the detection result, the embodiment of the present invention further provides another implementation method for determining the width information of the ground film corresponding to the planting area to be detected, that is, step S102 includes sub-step S102-3:

[0095] S102-3, obtaining width information of the ground film corresponding to the planting area to be detected according to the mask image of the crops, the mask image of the ground film, and the preset sampling points of the ground film.

[0096] Among them, the width of the ground film at the preset sampling point of each ground film is determined based on the changes in the pixel values of the pixel points in a certain area at the preset sampling point of each ground film on the mask image of the ground film and the mask image of the crop, and then the width information of the ground film corresponding to the planting area to be detected is obtained.

[0097] Furthermore, sub-step S102-1 is implemented as follows:

[0098] S102-1-1, determining the width of the preset sampling point of the crop according to the coordinates of the preset sampling point of the crop and the mask image of the crop.

[0099] The position of each crop's preset sampling point in the crop mask image is determined according to the coordinates of the crop's preset sampling point, and the width of the crop at the crop's preset sampling point is determined according to the change of pixels within a certain range around the position.

[0100] S102-1-2, obtaining crop width information based on the widths of preset sampling points of all crops.

[0101] The widths of the crops at the preset sampling points on the center line of the same row of crops are grouped into a set, with each row of crops corresponding to one set. All sets constitute the width information of the crops corresponding to the planting area to be detected.

[0102] In the embodiment of the present invention, sub-step S102-1-1 includes sub-steps S102-1-1a, S102-1-1b, and S102-1-1c.

[0103] S102-1-1a, for a preset sampling point of a crop, determine a starting pixel point corresponding to the preset sampling point of the crop from a plurality of pixel points according to the coordinates of the preset sampling point of the crop.

[0104] Since the number of pixels in an image is affected by image resolution, there may not be any pixels at the preset sampling points of the crop. The preset sampling points of the crop can be compared with the coordinates of each pixel in the crop mask image in sequence. The pixel with the smallest difference and a pixel value representing "crop" is used as the starting pixel corresponding to the preset sampling points of the crop. In other words, the starting pixel on the mask image is matched with the preset sampling points of the actual crop.

[0105] S102-1-1b, taking the starting pixel point as the starting point, and taking the pixel point before the first pixel point in the preset direction whose pixel value is different from the pixel value of the starting pixel point as the end point.

[0106] Among them, each row of crops is divided into a left half and a right half by its center line, and the preset direction is perpendicular to the center line of each row of crops. It can be understood that there are two such preset directions on the plane. The starting pixel point is used as the starting point, and pixel sequences of a certain length in the two preset directions are obtained respectively. The previous pixel point of the first pixel point in each pixel point sequence whose pixel value is different from the pixel value of the starting pixel point is used as the end point. The length of the pixel point sequence can be set according to the planting parameters of the planting area to be detected or according to the GSD of the image of the planting area to be detected taken by the drone.

[0107] For example, the length of the pixel sequence is 66, and the pixel sequence in a preset direction is [1 1 1 1 1 11 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], since the pixel value of the starting pixel is 1 (representing crops) and the first pixel with a pixel value of 0 (representing non-crops) is the 11th pixel, the pixel before the 11th pixel is taken as the end point, that is, the end point is the 10th pixel.

[0108] S102-1-1c, calculating the width of the preset sampling point of the crop according to the number of pixels between the starting point and the end point.

[0109] Among them, the number of pixels between the starting point and the end points in the two preset directions is counted respectively, and then according to the conversion relationship (for example, 1 pixel is approximately equivalent to 2 centimeters), the left half width and the right half width of the crop at the preset sampling point are obtained respectively, and the sum of the left half width and the right half width is used as the width of the crop at the preset sampling point.

[0110] It can be understood that the implementation method of sub-step S102-2 is the same as that of sub-step S102-1, that is, the implementation process of "obtaining the width information of the ground film corresponding to the planting area to be detected based on the mask image of the ground film and the preset sampling points of the ground film" can refer to the implementation process of "obtaining the width information of the crops corresponding to the planting area to be detected based on the mask image of the crops and the preset sampling points of the crops".

[0111] Furthermore, sub-step S102-3 is implemented as follows:

[0112] S102-3-1, determining the width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film, the mask image of the crop, and the mask image of the ground film.

[0113] The coordinates of each preset sampling point for each mulch film are used to determine the position of that point in the crop mask image and the mulch film mask image. Generally, the position of the preset sampling point in the crop mask image is the same as its position in the mulch film mask image. The width of the mulch film at the preset sampling point is determined based on the changes in pixel values of pixels in the crop mask image and the mulch film mask image within a certain range around that location.

[0114] S102-3-2, obtaining the width information of the ground film corresponding to the planting area to be detected based on the width of the preset sampling points of all ground films.

[0115] The widths of the ground films at the preset sampling points on the center line of the same row of ground films are grouped into a set, each row of ground films corresponds to a set, and all sets constitute the width information of the ground films corresponding to the planting area to be detected.

[0116] In the embodiment of the present invention, sub-step S102-3-1 includes sub-steps S102-3-1a, S102-3-1b and S102-3-1c.

[0117] S102-3-1a, for the preset sampling point of the ground film, obtain the first width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film and the mask image of the crop.

[0118] Among them, the preset sampling points of the ground film can be compared with the coordinates of each pixel point in the mask image of the crops in turn, and the pixel point with the smallest difference and the pixel value representing "non-crop" can be used as the starting pixel point corresponding to the preset sampling point of the ground film, that is, the starting pixel point on the mask image is matched with the preset sampling point of the actual ground film.

[0119] Since each row of ground film is divided into a left half and a right half by its center line, the preset direction is perpendicular to the center line of each row of ground film. It can be understood that there are two such preset directions on the plane. The starting pixel point is used as the starting point, and pixel sequences of a certain length in the two preset directions are obtained respectively. The previous pixel point of the first pixel point in each pixel sequence whose pixel value is different from the pixel value of the starting pixel point is used as the end point. The length of the pixel sequence can be set according to the planting parameters of the planting area to be detected or according to the GSD of the image of the planting area to be detected taken by the drone.

[0120] For example, the length of the pixel sequence is 66, and the pixel sequence in a preset direction is [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1], since the pixel value of the starting pixel is 0 (representing non-crop) and the first pixel with a pixel value of 1 (representing crop) is the 57th pixel, the pixel before the 57th pixel is taken as the end point, that is, the end point is the 56th pixel.

[0121] The number of pixels between the starting point and the end points in the two preset directions is counted respectively, and then according to the conversion relationship (for example, 1 pixel is approximately equivalent to 2 centimeters), the left half width and the right half width of the ground film at the preset sampling point are obtained respectively, and the sum of the left half width and the right half width is used as the first width of the ground film at the preset sampling point.

[0122] S102-3-1b: Obtain a second width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film and the mask image of the ground film.

[0123] Among them, the preset sampling points of the ground film can be compared with the coordinates of each pixel point in the mask image of the ground film in turn, and the pixel point with the smallest difference and the pixel value representing "ground film" is used as the starting pixel point corresponding to the preset sampling point of the ground film, that is, the starting pixel point on the mask image is matched with the preset sampling point of the actual ground film.

[0124] Taking the starting pixel as the starting point, obtain pixel sequences of a certain length in two preset directions respectively, and take the pixel before the first pixel whose pixel value is different from the starting pixel in each pixel sequence as the end point.

[0125] For example, the length of the pixel sequence is 66, and the pixel sequence in a preset direction is [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0], since the pixel value of the starting pixel is 1 (representing ground film) and the first pixel with a pixel value of 0 (representing non-ground film) is the 57th pixel, the pixel before the 57th pixel is taken as the end point, that is, the end point is the 56th pixel.

[0126] S102-3-1c, determining the width of the preset sampling point of the ground film based on the first width and the second width.

[0127] Optionally, the implementation process of sub-step S102-3-1c is as follows:

[0128] First, determine whether the first width is greater than the product of the second width and a preset coefficient;

[0129] If the first width is not greater than the product of the second width and the preset coefficient, the first width is used as the width of the preset sampling point of the ground film;

[0130] If the first width is greater than the product of the second width and the preset coefficient, the width of the preset sampling point of the ground film is calculated according to the first width and the preset weight factor.

[0131] The first width is obtained based on the crop mask pattern, and the second width is obtained based on the ground film mask image. When the first width is not greater than the product of the second width and a preset coefficient, the ground film covering the unplanted areas distributed by row is not damaged, and the second width can be directly used as the width of the preset sampling point of the ground film. When the first width is greater than the product of the second width and the preset coefficient, the ground film covering the unplanted areas distributed by row is damaged. Since the first width is the sum of the left and right half widths of each row of ground film, the smaller of the left and right half widths is multiplied by a preset weighting factor, and the result is used as the width of the preset sampling point of the ground film. In one embodiment, the preset coefficient is set to 1.5, and the preset weighting factor is set to 2.

[0132] Furthermore, the method provided by the embodiment of the present invention may further include step S103.

[0133] S103, determining the ventilation and light transmittance of the planting area to be detected based on the width information of the crops and the width information of the ground film in the planting area to be detected.

[0134] Among them, such as Figure 1 As shown, the preset sampling points on any row of crops and the preset sampling points on the adjacent row of ground film are one-to-one corresponding. According to the width of the preset sampling points of each crop and the width of the preset sampling points of the corresponding ground film, the situation of the "row closure" phenomenon in the planting area to be tested is judged, and then the ventilation and light transmittance of the planting area to be tested are known.

[0135] Furthermore, the method provided by the embodiment of the present invention may further include steps S104 and / or S105.

[0136] S104: Generate a crop width variation curve based on crop width information within a preset time period.

[0137] Aerial images of the crop area to be inspected, taken at different time points, can be masked to obtain mask images of the crops at those time points. The method of the aforementioned embodiment can then be applied to the mask images of the crops at each time point to obtain crop width information corresponding to the crop area to be inspected at each time point. Based on the crop width information corresponding to the crop area to be inspected at each time point within a preset time period, a crop width variation curve over time can be generated.

[0138] It should be noted that the crop width change curve can be a curve that represents the change in the width of the crop at the preset sampling point of any crop over time, or it can be a curve that represents the change in the average width / maximum width / minimum width of the preset sampling points of all crops in a row of crops over time, or it can be a curve that represents the change in the average width / maximum width / minimum width of the preset sampling points of all crops in a rectangular area over time.

[0139] S105 , generating a ground film width variation curve according to width information of a plurality of ground films at preset sampling points within a preset time period.

[0140] Aerial images of the crop area to be inspected, taken at different time points, can be masked to obtain crop and ground film mask images at different time points. The method of the aforementioned embodiment can be applied to each crop and ground film mask image at each time point to obtain ground film width information corresponding to the crop area to be inspected at each time point. Based on the ground film width information corresponding to the crop area to be inspected at each time point within a preset time period, a ground film width variation curve over time can be generated.

[0141] It should be noted that the film width change curve can be a curve that represents the change in the width of the film at the preset sampling point of any film over time, or it can be a curve that represents the change in the average width / maximum width / minimum width of the preset sampling points of all films on a row of films over time, or it can be a curve that represents the change in the average width / maximum width / minimum width of the preset sampling points of all films in a rectangular area over time.

[0142] The crop width variation curve and the mulch film width variation curve can be displayed to the planting area manager, so that the manager can obtain crop growth information based on the two curves and formulate corresponding agricultural management strategies. However, in order to achieve intelligent unmanned management of the planting area, the method provided in the embodiment of the present invention can also include step S106.

[0143] S106 , determining a target farming management strategy based on the crop width variation curve and / or the mulch film width variation curve.

[0144] In the embodiment of the present invention, step S106 has the following five implementation methods.

[0145] First way:

[0146] First, the crop width variation curve is compared with a first threshold curve, which represents the standard variation trend of the crop width;

[0147] Then, the target farming management strategy is determined based on the comparison result between the crop width variation curve and the first threshold curve.

[0148] Second way:

[0149] First, the mulch film width variation curve is compared with the second threshold curve, which represents the standard variation trend of the mulch film width;

[0150] Then, the target agricultural management strategy is determined according to the comparison result between the mulch film width variation curve and the second threshold curve.

[0151] The third way:

[0152] First, the width information of at least one crop in the crop width variation curve is compared with the standard width information of the crop;

[0153] Then, a target farming management strategy is determined based on a comparison result between the width information of at least one crop in the crop width variation curve and the standard width information of the crop.

[0154] The fourth way:

[0155] First, the width information of at least one ground film in the ground film width variation curve is compared with the standard width information of the ground film;

[0156] Then, the target farming management strategy is determined according to the comparison result of the width information of at least one mulch film in the mulch film width variation curve and the standard width information of the mulch film.

[0157] The fifth way:

[0158] The crop width variation curve and / or the mulch film width variation curve are input into the farming strategy generation model to determine the target farming management strategy.

[0159] The obtained crop width variation curve and / or mulch film width variation curve, along with the target agricultural management strategy, can be displayed on a planting area display interface for monitoring by planting area managers. The target agricultural management strategy can include a weeding strategy, a fertilization strategy, or a drip irrigation strategy. The planting area display interface can be a display interface on an automated planting area management device or on a terminal device that is communicatively connected to the automated management device.

[0160] Furthermore, when the planting area is large, in order to more finely manage the planting area, an embodiment of the present invention provides the following implementation method for displaying the crop width change curve and / or the mulch film width change curve and the target agricultural management strategy.

[0161] First, the planting area to be tested is divided into regions;

[0162] Then, for each sub-region of the planting area to be detected, the crop width change curve and / or the mulch film width change curve corresponding to the sub-region are displayed.

[0163] It can be understood that the planting area display interface can display the crop width change curve and / or ground film width change curve corresponding to each sub-area of the planting area to be detected, or display them one by one according to the sub-area number, or only display the crop width change curve and / or ground film width change curve corresponding to the sub-area selected by the management personnel.

[0164] At the same time, when the crop width variation curve and / or mulch film width variation curve corresponding to each sub-area of the planting area to be detected is displayed on the planting area display interface, the target farming management strategy corresponding to the sub-area can also be displayed together.

[0165] In order to further implement the corresponding steps in the above embodiments and various possible implementations, an implementation method of the agricultural management system 200 is given below. Figure 4 , Figure 4This is a structural schematic block diagram of an agricultural management system 200 provided by an embodiment of the present invention. It should be noted that the basic principles and technical effects of the agricultural management system 200 provided by the embodiment of the present invention are the same as those of the above embodiments, and will not be described in detail here.

[0166] The agricultural management system 200 includes a processing module 210 and an output module 220 .

[0167] The processing module 210 is used to obtain a mask image of the target object in the planting area to be detected; and obtain width information of the target object corresponding to the planting area to be detected based on the mask image of the target object and the preset sampling points of the target object.

[0168] In one implementation, the target object includes crops and / or ground film, and the processing module 210 is also used to obtain the width information of the crops corresponding to the planting area to be detected based on the mask image of the crops and the preset sampling points of the crops; and / or obtain the width information of the ground film corresponding to the planting area to be detected based on the mask image of the crops, the mask image of the ground film and the preset sampling points of the ground film.

[0169] In one implementation, there are multiple preset sampling points for crops. When the processing module 210 is used to obtain the width information of the crops corresponding to the planting area to be detected based on the mask image of the crops and the preset sampling points of the crops, it is also specifically used to obtain the width information of the crops corresponding to the planting area to be detected based on the mask image of the crops and the preset sampling points of the crops.

[0170] In one implementation, the mask image of the crop includes multiple pixel points. When the processing module 210 is used to determine the width of the preset sampling point of the crop based on the coordinates of the preset sampling point of the crop and the mask image of the crop, it is further specifically used to determine, for the preset sampling point of the crop, a starting pixel point corresponding to the preset sampling point of the crop from multiple pixel points based on the coordinates of the preset sampling point of the crop; using the starting pixel point as the starting point, using the pixel point before the first pixel point in a preset direction whose pixel value is different from the pixel value of the starting pixel point as the end point; and calculating the width of the preset sampling point of the crop based on the number of pixels between the starting point and the end point.

[0171] In one implementation, there are multiple preset sampling points for the ground film. When the processing module 210 is used to obtain the width information of the ground film corresponding to the planting area to be detected based on the mask image of the crops, the mask image of the ground film and the preset sampling points of the ground film, it is also specifically used to determine the width of the preset sampling points of the ground film based on the coordinates of the preset sampling points of the ground film and the mask image of the crops and the mask image of the ground film; and obtain the width information of the ground film corresponding to the planting area to be detected based on the widths of the preset sampling points of all the ground films.

[0172] In one implementation, when the processing module 210 is used to determine the width of the preset sampling point of the ground film based on the coordinates of the preset sampling point of the ground film, the mask image of the crop, and the mask image of the ground film, it is also specifically used to obtain, for the preset sampling point of the ground film, a first width of the preset sampling point of the ground film based on the coordinates of the preset sampling point of the ground film and the mask image of the crop; obtain a second width of the preset sampling point of the ground film based on the coordinates of the preset sampling point of the ground film and the mask image of the ground film; and determine the width of the preset sampling point of the ground film based on the first width and the second width.

[0173] In one implementation, when determining the width of the preset sampling point of the ground film based on the first width and the second width, the processing module 210 is further configured to, if the first width is not greater than the product of the second width and a preset coefficient, use the first width as the width of the preset sampling point of the ground film. If the first width is greater than the product of the second width and the preset coefficient, calculate the width of the preset sampling point of the ground film based on the first width and a preset weighting factor.

[0174] In one implementation, the target objects include crops and ground film, and the processing module 210 is further used to determine the ventilation and light transmittance of the planting area to be detected based on the width information of the crops and the width information of the ground film.

[0175] In one implementation, the processing module 210 is also used to generate a crop width change curve based on the width information of multiple crops within a preset time period; and / or generate a mulch width change curve based on the width information of a preset sampling point of the mulch within a preset time period.

[0176] In one implementation, the processing module 210 is further configured to determine a target farming management strategy based on the crop width variation curve and / or the mulch film width variation curve.

[0177] Optionally, when determining the target farming management strategy based on the crop width variation curve and the mulch film width variation curve, the processing module 210 is further configured to execute at least one of the following methods:

[0178] The first method is to compare the crop width variation curve with a first threshold curve; the first threshold curve represents the standard variation trend of the crop width; and determine the target farming management strategy based on the comparison result between the crop width variation curve and the first threshold curve.

[0179] The second method is to compare the mulch film width variation curve with a second threshold curve; the second threshold curve represents the variation trend of the mulch film width standard; and the target agricultural management strategy is determined based on the comparison result between the mulch film width variation curve and the second threshold curve.

[0180] A third method is to compare the width information of at least one crop in the crop width variation curve with the standard width information of the crop; and determine a target farming management strategy based on the comparison result of the width information of at least one crop in the crop width variation curve with the standard width information of the crop;

[0181] A fourth method is to compare the width information of at least one mulch film in the mulch film width variation curve with the standard width information of the mulch film; and determine a target agricultural management strategy based on the comparison result of the width information of at least one mulch film in the mulch film width variation curve with the standard width information of the mulch film;

[0182] The fifth method is to input the crop width variation curve and / or the mulch film width variation curve into the farming strategy generation model to determine the target farming management strategy.

[0183] The output module 220 is used to display the crop width variation curve and / or the mulch film width variation curve through the planting area display interface.

[0184] In one implementation, the output module 220 is further configured to display the target farming management strategy via a planting area display interface.

[0185] In one implementation, the output module 220 is specifically used to divide the planting area to be detected into regions; for each sub-region of the planting area to be detected, the crop width change curve and / or the mulch film width change curve corresponding to the sub-region are displayed.

[0186] It should be noted that the output module 220 can be a display module or a communication module. When the output module 220 is a communication module, the result obtained by the processing module 210 can be sent to the user terminal for display.

[0187] For further information, please refer to Figure 5 , Figure 5 This is a schematic block diagram of the structure of a computer device 300 provided in an embodiment of the present invention. The computer device 300 may include a memory 310 and a processor 320.

[0188] Among them, the processor 320 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the planting area ventilation and light transmittance detection method provided in the above-mentioned method embodiment.

[0189] The memory 310 can be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this. The memory 310 can exist independently and be connected to the processor 320 via a communication bus. The memory 310 can also be integrated with the processor 320. Among them, the memory 310 is used to store machine executable instructions for executing the scheme of the present application. The processor 320 is used to execute the machine executable instructions stored in the memory 310 to implement the aforementioned method embodiment.

[0190] Since the computer device 300 provided in the embodiment of the present invention is another implementation form of the target width determination method provided in the aforementioned method embodiment, the technical effects that can be obtained can refer to the aforementioned method embodiment and will not be repeated here.

[0191] An embodiment of the present invention further provides a readable storage medium containing computer-executable instructions. When the computer-executable instructions are executed, they can be used to perform the relevant operations in the target object determination method provided by the aforementioned method embodiment.

[0192] In summary, the embodiments of the present invention provide a method and related apparatus for determining the width of a target object. First, a mask image of the target object in the planting area to be inspected is obtained. Then, based on the mask image of the target object and the preset sampling points of the target object, the width information of the target object corresponding to the planting area to be inspected is obtained. Because the embodiments of the present invention determine the width information of the target object based on the mask image of the target object and the preset sampling points of the target object, the influence of human factors on the objectivity of the detection results is reduced, and the detection efficiency and accuracy of the detection results are improved. The detection results can then serve as the basis for the selection and implementation of subsequent control technologies.

[0193] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for determining the width of a target object, characterized in that: The method comprises: Acquire a mask image of a target object in a planting area to be detected; the target object includes crops and / or ground film; Obtaining width information of the crops corresponding to the to-be-detected planting area based on the crop mask image and the preset sampling points of the crops; and / or obtaining width information of the ground film corresponding to the to-be-detected planting area based on the crop mask image, the ground film mask image, and the preset sampling points of the ground film; There are multiple preset sampling points of the ground film, and the step of obtaining the width information of the ground film corresponding to the planting area to be detected according to the mask image of the crop, the mask image of the ground film and the preset sampling points of the ground film includes: Determining the width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film, the mask image of the crop, and the mask image of the ground film; According to the widths of all preset sampling points of the ground films, the width information of the ground films corresponding to the planting area to be detected is obtained.

2. The method according to claim 1, wherein There are multiple preset sampling points of the crop, and the step of obtaining the width information of the crop corresponding to the planting area to be detected according to the mask image of the crop and the preset sampling points of the crop includes: determining a width of the preset sampling point of the crop according to the coordinates of the preset sampling point of the crop and the mask image of the crop; The width information of the crops is obtained according to the widths of the preset sampling points of all the crops.

3. The method according to claim 2, wherein The crop mask image includes a plurality of pixel points, and the step of determining the width of the preset sampling point of the crop according to the coordinates of the preset sampling point of the crop and the crop mask image includes: For the preset sampling point of the crop, determining a starting pixel point corresponding to the preset sampling point of the crop from the plurality of pixel points according to the coordinates of the preset sampling point of the crop; Taking the starting pixel point as the starting point, taking the pixel point before the first pixel point in the preset direction whose pixel value is different from the pixel value of the starting pixel point as the end point; The width of the preset sampling point of the crop is calculated according to the number of pixels between the starting point and the end point.

4. The method according to claim 1, wherein The step of determining the width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film, the mask image of the crop, and the mask image of the ground film comprises: For the preset sampling point of the ground film, according to the coordinates of the preset sampling point of the ground film and the mask image of the crop, a first width of the preset sampling point of the ground film is obtained; Obtaining a second width of the preset sampling point of the ground film according to the coordinates of the preset sampling point of the ground film and the mask image of the ground film; The width of the preset sampling point of the ground film is determined according to the first width and the second width.

5. The method according to claim 4, wherein The step of determining the width of the preset sampling point of the ground film according to the first width and the second width includes: If the first width is not greater than the product of the second width and a preset coefficient, the first width is used as the width of the preset sampling point of the ground film; If the first width is greater than the product of the second width and a preset coefficient, the width of the preset sampling point of the ground film is calculated according to the first width and a preset weight factor.

6. The method according to any one of claims 2 to 5, wherein When the target objects include crops and mulch films, the method further comprises: The ventilation and light transmittance of the planting area to be detected are determined according to the width information of the crops and the width information of the ground film.

7. The method according to any one of claims 2 to 5, wherein The method further comprises: generating a crop width variation curve based on the crop width information within a preset time period; and / or A ground film width variation curve is generated according to the ground film width information within a preset time period.

8. The method according to claim 7, wherein The method further comprises: A target farming management strategy is determined based on the crop width variation curve and / or the mulch film width variation curve.

9. The method according to claim 8, wherein The step of determining the target agricultural management strategy based on the crop width variation curve and the mulch film width variation curve includes at least one of the following methods: First way: comparing the crop width variation curve with a first threshold curve, wherein the first threshold curve represents a standard variation trend of the crop width; determining a target farming management strategy based on a comparison result of the crop width variation curve and the first threshold curve; Second way: Comparing the ground film width variation curve with a second threshold curve, wherein the second threshold curve represents a standard variation trend of the ground film width; determining a target agricultural management strategy based on a comparison result of the mulch film width variation curve and the second threshold curve; The third way: comparing the width information of at least one of the crops in the crop width variation curve with standard width information of the crops; determining a target farming management strategy based on a comparison result of width information of at least one of the crops in the crop width variation curve and standard width information of the crops; The fourth way: comparing the width information of at least one of the ground films in the ground film width variation curve with the standard width information of the ground film; determining a target agricultural management strategy according to a comparison result of at least one piece of mulch width information in the mulch width variation curve and standard mulch width information; The fifth way: The crop width variation curve and / or the mulch film width variation curve are input into a farming strategy generation model to determine a target farming management strategy.

10. The method according to claim 7, wherein: Also includes: The crop width variation curve and / or the mulch film width variation curve are displayed via a planting area display interface.

11. The method according to claim 9, wherein The method further comprises: The target farming management strategy is displayed through the planting area display interface.

12. The method according to claim 10, wherein The step of displaying the crop width variation curve and / or the mulch film width variation curve through the planting area display interface includes: Dividing the planting area to be detected into regions; For each sub-region of the planting area to be detected, a crop width change curve and / or a ground film width change curve corresponding to the sub-region is displayed.

13. An agricultural management system, characterized in that: Includes processing module and output module; The processing module is configured to perform at least one of the following operations: Obtaining width information of a target object corresponding to a planting area to be detected according to the method described in any one of claims 1 to 5, obtaining ventilation and light transmittance of a planting area to be detected according to the method described in claim 6, and determining a target agricultural management strategy according to the method described in any one of claims 7 to 9; The output module is used to output the processing results of the processing module.

14. A computer device, characterized in that: The computer device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the method according to any one of claims 1 to 12 when calling the computer program.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Non-woven fabric fiber diameter measuring method

    CN113538489A