A method and device for measuring the phenotype of wheat awn in a field environment
By using mobile terminals and deep learning models to process wheat ear images in the field, combined with a specified size scale, rapid and accurate measurement of wheat awn phenotypic traits was achieved. This solved the problems of inconvenient measurement and destructive sampling in existing technologies, and provided an automated method for measuring wheat awn area, quantity, and length.
Patent Information
- Application Number
- CN202411444962.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-10-16
AI Technical Summary
Existing methods for measuring wheat awn phenotypic traits rely on manual measurement or destructive sampling, which cannot efficiently and automatically obtain various phenotypic traits of wheat awns in the field, especially awn area, number, and length.
By acquiring images of wheat ears in the field using a mobile terminal, and combining them with a specified size scale and a deep learning model for image segmentation and processing, the phenotypic traits of wheat awns, including area, number, and average length, can be measured using image processing technology without damaging wheat growth.
This technology enables rapid and accurate measurement of the surface area, number, and average length of wheat awns without damaging wheat growth, solving the problems of inconvenient measurement and destructive sampling in existing technologies.
Smart Images

Figure CN119417881B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing, in particular to a wheat awn phenotype measurement method and device in field environment. BACKGROUND
[0002] This section is intended to provide background information to facilitate an understanding of embodiments of the application as set forth in the claims. The description herein does not constitute admission of prior art.
[0003] Wheat awn is a bristly extension of the lower glume, composed of three vascular bundles and green tissue that confers photosynthetic capacity. The wheat awn increases the photosynthetic area of the ear by 50%, intercepts about 4% of the light, and doubles the net rate of photosynthesis of the ear. The development of the awn is later than the flag leaf, which makes it senesce later, and the presence of the awn appears to be the main contributor to the photosynthesis of the ear. However, the development of the awn and the floret overlaps in the young ear before flowering, the awn is a sink organ of assimilates, while the floret is also highly sensitive to these assimilates at this time. Therefore, the presence of the awn can not only affect the fertility of the floret, but also the number and size of the grains. Some studies report that the presence of the awn can be positive or negative for wheat yield, depending on the growth conditions and genotype, and the question of whether the presence of the awn promotes grain yield is still controversial. Therefore, further research on the awn in grain weight and yield is still the direction of future research. In this case, evaluating any possible effects of the awn on photosynthesis, carbohydrate storage, and improved water use efficiency not only requires determining the presence or absence of the awn, but also quantifying the sensitivity of its phenotypic traits. Therefore, developing an efficient and automated method for measuring the phenotypic traits of wheat awns in the field is of great significance for studying wheat yield increase.
[0004] The existing method for measuring the phenotypic traits of wheat awns still relies on manual methods, such as using a ruler or tape measure to measure the length of the awn. The more advanced method is to use a root scanner or a camera to collect images for measurement. These methods require destructive sampling after awn removal and laboratory measurement, which is extremely disadvantageous for small sample size breeding fields. Sampling grains and awns at the mature stage is prone to falling off, which is not conducive to sampling and measurement. In addition, the image measurement method can only obtain the number of wheat awns, and cannot obtain more phenotypic traits of wheat awns. SUMMARY
[0005] The embodiments of the present application provide a method for measuring the phenotypic traits of wheat awns in field environment, which can obtain wheat awn ear images without damaging the growth of wheat, and obtain more phenotypic traits of wheat awns through image processing technology. The method comprises:
[0006] acquiring the ear image in the field environment through a mobile terminal; the ear image includes a specified size scale, and the specified size scale is used to determine the size and position of the wheat awn ear in the ear image.
[0007] performing image segmentation extraction of the spike image and the image of the specified size scale to obtain the image of the spike and the image of the specified size scale;
[0008] determining the actual size represented by each pixel in the spike image according to the image of the specified size scale;
[0009] performing image processing on the image of the spike to obtain a binary image of the spike;
[0010] determining the spike phenotypic trait according to the pixel data occupied by the spike and the spike in the binary image of the spike and the actual size represented by each pixel; the spike phenotypic trait includes spike area, spike number and average spike length.
[0011] In an embodiment, the spike image in the field environment is obtained by a mobile terminal, including: obtaining an imaging image of the spike in the field environment by the mobile terminal, the spike being placed in front of a preset background plate; the preset background plate is marked with a spike placement area and a specified size scale.
[0012] In an embodiment, the image segmentation extraction of the spike image and the image of the specified size scale is performed to obtain the image of the spike and the image of the specified size scale, including: using a deep learning model to perform image extraction of the spike and the specified size scale on a plurality of spike images to obtain a plurality of images of the spike and the specified size scale; the deep learning model is obtained by training a YOLOv8n model using historical spike images, spikes extracted from the historical spike images, and specified size scales extracted from the historical spike images.
[0013] In an embodiment, the actual size represented by each pixel in the spike image is determined according to the image of the specified size scale, including: performing local adaptive thresholding, binarization, closing operation and filling operation on the image of the specified size scale to obtain a binary image of the scale; determining the area of the scale in the image according to the binary image of the scale; determining the actual size represented by each pixel according to the area of the scale in the image and the actual area of the scale.
[0014] In an embodiment, the actual size represented by each pixel is determined according to the area of the scale in the image and the actual area of the scale, including: determining the actual size represented by each pixel according to the area of the scale in the image and the actual area of the scale according to the following formula:
[0015]
[0016] In the formula, SSOP is the actual size represented by each pixel, S 图像 is the area of the scale in the image, S 实际 is the actual area of the scale.
[0017] In an embodiment, the method for determining the phenotype of wheat awn includes: performing an opening operation on the binary image of the wheat awn and ear to obtain a binary image of the wheat ear without the wheat awn; subtracting the binary image of the wheat ear without the wheat awn from the binary image of the wheat awn and ear to obtain a binary image of the wheat awn without the wheat ear; and determining the actual area of the wheat awn according to the number of pixels with a gray value of 1 in the binary image of the wheat awn without the wheat ear and the actual size of each pixel.
[0018] In an embodiment, after the actual area of the wheat awn is determined, the method further includes: performing skeleton extraction on the binary image of the wheat awn without the wheat ear to obtain a binary image of the skeleton of the wheat awn; performing inflation processing and convex hull calculation on the binary image of the wheat ear without the wheat awn to obtain a binary image of the convex hull of the wheat ear; calculating the number of intersection points between the convex hull of the wheat ear and the skeleton of the wheat awn; and determining the number of wheat awns according to the number of intersection points.
[0019] In an embodiment, after the number of wheat awns is determined according to the number of intersection points, the method further includes: calculating the number of pixels with a gray value of 1 in the binary image of the skeleton of the wheat awn; determining the total length of the wheat awn according to the number of pixels with a gray value of 1 in the binary image of the skeleton of the wheat awn and the actual size of each pixel; and determining the average length of the wheat awn according to the total length of the wheat awn and the number of wheat awns.
[0020] Embodiments of the present application also provide a device for measuring the phenotype of wheat awn in a field environment, which is used to obtain the image of the wheat awn and ear without damaging the growth of the wheat, and to obtain more phenotype of the wheat awn through image processing technology. The device includes:
[0021] An image acquisition module is configured to acquire the image of the wheat ear in the field environment through a mobile terminal. The image of the wheat ear includes a specified size scale, which is used to determine the size and position of the wheat awn and ear in the image.
[0022] An image extraction module is configured to perform image segmentation and extraction of the wheat awn and ear and the specified size scale on the image of the wheat ear to obtain the image of the wheat awn and ear and the specified size scale.
[0023] A pixel actual size determination module is configured to determine the actual size of each pixel in the image of the wheat ear according to the image of the specified size scale.
[0024] A wheat awn phenotype extraction module is configured to perform image processing on the image of the wheat awn and ear to obtain a binary image of the wheat awn and ear; and determine the phenotype of the wheat awn according to the pixel data of the wheat awn and ear in the binary image of the wheat awn and ear and the actual size of each pixel. The phenotype of the wheat awn includes the area of the wheat awn, the number of wheat awns, and the average length of the wheat awn.
[0025] The embodiment of the present application also provides a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the wheat awn phenotype trait measurement method in a field environment when executing the computer program.
[0026] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program implements the wheat awn phenotype trait measurement method in a field environment when executed by a processor.
[0027] The embodiment of the present application also provides a computer program product, which comprises a computer program, and the computer program implements the wheat awn phenotype trait measurement method in a field environment when executed by a processor.
[0028] In the embodiment of the present application, the wheat ear image in the field environment is acquired by the mobile terminal, so that the wheat awn ear image is acquired without damaging the growth of the wheat, the specified size scale is included in the wheat ear image, then the actual size represented by each pixel in the wheat ear image is determined by using the specified size scale, and the wheat awn phenotype traits including the wheat awn area, the wheat awn quantity and the wheat awn average length are determined by using the pixel data occupied by the wheat awn and the wheat ear in the binary image of the wheat awn ear and the actual size represented by each pixel, compared with the prior art, in the embodiment of the present application, the specified size scale is shot when the wheat ear image is acquired, so that the wheat awn phenotype traits including the wheat awn area, the wheat awn quantity and the wheat awn average length are obtained by image processing according to the specified size scale, and the rapid and accurate measurement of the wheat awn surface area, the quantity and the length is realized. BRIEF DESCRIPTION OF DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description only constitute some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort. In the drawings:
[0030] Figure 1 It is a flowchart of the wheat awn phenotype trait measurement method in a field environment in the embodiment of the present application;
[0031] Figure 2 It is a schematic diagram of the preset background plate in the embodiment of the present application;
[0032] Figure 3 It is a schematic diagram of the deep learning model identification and extraction in the embodiment of the present application;
[0033] Figure 4A schematic diagram of image processing of the rectangular scale in the embodiment of the present application;
[0034] Figure 5 A schematic diagram of image preprocessing of the wheat ear in the embodiment of the present application;
[0035] Figure 6 A schematic diagram of measurement of the wheat awn phenotypic trait in the embodiment of the present application;
[0036] Figure 7 A schematic diagram of progressive processing of the inflation threshold in the embodiment of the present application;
[0037] Figure 8 A schematic diagram of the wheat awn phenotypic trait measurement device in the field environment in the embodiment of the present application. DETAILED DESCRIPTION
[0038] To make the purpose, technical scheme and advantages of the embodiment of the present application more clear, the embodiment of the present application is further described in detail below with reference to the drawings. Herein, the schematic embodiment of the present application and the description thereof are used to explain the present application, but not as a limitation on the present application.
[0039] Figure 1 A flowchart of the wheat awn phenotypic trait measurement method in the field environment in the embodiment of the present application, as shown in Figure 1 The method comprises:
[0040] Step 101, obtaining the wheat ear image in the field environment through the mobile terminal; the wheat ear image comprises a specified size scale, and the specified size scale is used to determine the size and position of the wheat awn and wheat ear in the wheat ear image;
[0041] Step 102, performing image segmentation and extraction of the wheat awn and wheat ear and the specified size scale of the wheat ear image to obtain the image of the wheat awn and wheat ear and the specified size scale;
[0042] Step 103, determining the actual size of each pixel in the wheat ear image according to the image of the specified size scale;
[0043] Step 104, performing image processing on the image of the wheat awn and wheat ear to obtain the binary image of the wheat awn and wheat ear;
[0044] Step 105, determining the wheat awn phenotypic trait according to the pixel data of the wheat awn and wheat ear in the binary image of the wheat awn and wheat ear and the actual size of each pixel; the wheat awn phenotypic trait comprises the wheat awn area, the wheat awn quantity and the average length of the wheat awn.
[0045] From Figure 1As shown in the flow, in the embodiment of the present application, the ear image of wheat spike under the field environment is obtained through the mobile terminal, so that the ear image of wheat spike is obtained without damaging the growth of wheat, the specified size scale is included in the ear image of wheat spike, and then the actual size of each pixel in the ear image of wheat spike is determined by using the specified size scale, so that the spikelet phenotype traits, including the spikelet area, the spikelet number and the average length of spikelet, are determined through the pixel data of spikelet and wheat spike in the binary image of wheat spike and the actual size of each pixel. Compared with the prior art, the specified size scale is shot when the ear image of wheat spike is obtained in the embodiment of the present application, so that the spikelet phenotype traits of the spikelet area, the spikelet number and the average length of spikelet are obtained through image processing according to the specified size scale, and the rapid and accurate measurement of the spikelet area, the spikelet number and the length of spikelet is realized.
[0046] The field environment under which the wheat spikelet phenotype trait measurement method shown in the embodiment of the present application is explained in detail. Figure 1 The field environment under which the wheat spikelet phenotype trait measurement method shown in the embodiment of the present application is explained in detail.
[0047] Firstly, the ear of wheat is imaged without damaging the growth of wheat in the field. The growing ear of wheat is directly shot by using a mobile terminal, such as a mobile phone or a tablet computer.
[0048] The ear image of wheat shot in the embodiment of the present application includes a specified size scale, which is used to determine the size and position of the wheat spikelet and wheat spike in the ear image of wheat.
[0049] In an embodiment, the ear image of wheat under the field environment is obtained through the mobile terminal, which can include: obtaining the imaging image of the ear of wheat placed in front of a preset background plate through the mobile terminal; and the preset background plate is marked with a specified size scale and a region for placing the shot ear of wheat.
[0050] Figure 2 The schematic diagram of the preset background plate in the embodiment of the present application is shown in FIG. 2. Figure 2 In the embodiment shown in FIG. 2, the size of the preset background plate is 210mm*297mm, which includes an image acquisition region of 140mm*210mm, a rectangular scale of 10mm*100mm and a thumb pressing region. When shooting, the whole ear of wheat in the field is placed in the image acquisition region of the customized background plate, the lower stem of the ear of wheat is gently pressed by using the thumb to fix the ear of wheat, and the ear of wheat in the image acquisition region is shot and obtained by using the smart phone.
[0051] When shooting, a large number of ear image samples of wheat field can be collected through the mobile terminal, which are then used for model training and measurement of the wheat spikelet phenotype traits.
[0052] In step 102, the image segmentation and extraction of the wheat spikelet and the specified size scale are performed on the ear image of wheat, so as to obtain the image of the wheat spikelet and the specified size scale.
[0053] For example, the image extraction of the wheat ear and the specified size scale is performed by using a conventional image processing technique.
[0054] To improve the accuracy of image extraction, in an embodiment, the image segmentation extraction of the wheat ear and the specified size scale is performed on the wheat ear image to obtain the image of the wheat ear and the specified size scale, which can include: performing the image extraction of the wheat ear and the specified size scale on a plurality of wheat ear images by using a deep learning model to obtain a plurality of images of the wheat ear and the specified size scale; and the deep learning model is trained by using historical wheat ear images, wheat ears extracted from the historical wheat ear images, and specified size scales extracted from the historical wheat ear images to obtain a YOLOv8n model.
[0055] In the implementation of the present embodiment, a large number of wheat ear image samples are collected by a mobile terminal to construct a training set, a test set, and a validation set, and a YOLOv8n model architecture is built. The YOLOv8n model is trained using the training set. During training, the image is labeled with a rectangular frame using Labelme. The labeled targets include awnless ears, awned ears, and rectangular scales. The YOLOv8n deep learning model is selected to perform transfer learning training and validation on the data. The model capable of automatically identifying awnless ears, awned ears, and rectangular scales is trained. The awned wheat ear and the rectangular scale are extracted according to the recognized position information. For example, the imcrop function is used to crop and segment the awned ear and the rectangular scale position in the image.
[0056] Figure 3 For the deep learning model identification and extraction schematic diagram in the embodiment of the present application, Figure 3
[0057] Backbone network: the main part of the deep learning model, used to extract basic features from the original input.
[0058] Multi-scale fusion network: used to fuse feature maps from different stages of the backbone network to enhance the feature representation capability.
[0059] Head network: a network used to process feature maps to produce model output results.
[0060] Loss calculation: composed of detection loss and classification loss, used for final object detection and classification tasks.
[0061] Decoupled head: decomposes the original detection head into two parts.
[0062] Intersection over union: the ratio of the intersection to the union of the detection box and the true box.
[0063] Distribution focal loss: solves the flexibility and accuracy problem in boundary box regression by allowing the coordinates of the boundary box to have a wider distribution.
[0064] Binary cross-entropy: Used for binary classification problems, it measures the difference between the probability distribution predicted by the model and the probability distribution of the true labels.
[0065] Next, in order to obtain the actual phenotypic trait data of wheat awns, it is necessary to determine the conversion formula between image size and actual size. In step 103, based on the image with a specified size scale, the actual size represented by each pixel in the wheat ear image is determined.
[0066] During implementation, the size of the scale is known, and the number of pixels occupied by the scale on the image can be obtained. Based on the imaging principle, the actual size represented by each pixel in the wheat ear image can be obtained.
[0067] In one embodiment, determining the actual size represented by each pixel in the wheat ear image based on an image with a specified size scale includes the following steps:
[0068] Step 1: Perform local adaptive thresholding, binarization, closing operation, and filling operation on the image of the specified size scale to obtain the binarized image of the scale;
[0069] Step 2: Determine the area of the scale in the image based on the binarized image of the scale;
[0070] Step 3: Determine the actual size represented by each pixel based on the area of the ruler in the image and the actual area of the ruler.
[0071] Figure 4 This is a schematic diagram of rectangular ruler image processing in an embodiment of the present invention, for reference. Figure 4 Using a rectangular ruler in a preset background as a basis, the extracted rectangular ruler image is first processed. For example, the adaptthresh, imbinarize, imclose, and imfill functions are used to perform local adaptive thresholding, binarization, closing, and filling operations on the original image in sequence to obtain a complete binary image of the rectangular ruler. Then, the number of all values of 1 in the binary image of the rectangular ruler is calculated, which is the area of the rectangular ruler image, denoted as S. 图像 .
[0072] Furthermore, the actual size represented by each pixel can be determined using the following formula, based on the area of the ruler in the image and the actual area of the ruler:
[0073]
[0074] In the formula, SSOP represents the actual size of each pixel, and S 图像 S is the area of the scale in the image. 实际 The actual area on the scale.
[0075] After that, the formal wheat spike phenotype trait measurement is carried out. Firstly, the extracted wheat spike image needs to be further preprocessed. In step 104, the image of the wheat spike is processed to obtain a binary image of the wheat spike.
[0076] Figure 5 For the schematic diagram of the wheat spike image preprocessing in the embodiment of the present application, reference is made to Figure 5 , firstly, the gray value of the wheat spike image is extracted by the formula 2.7*B-R-G, and then the local adaptive threshold and binarization operation are performed on the gray image by using the adaptthresh function and the imbinarize function to obtain a complete binary image of the wheat spike, which is denoted as image BW.
[0077] Finally, in step 105, the wheat spike phenotype traits are determined according to the pixel data of the wheat spike and the wheat spike in the binary image of the wheat spike and the actual size represented by each pixel, and the wheat spike phenotype traits include the wheat spike area, the wheat spike number and the average length of the wheat spike.
[0078] In implementation, the image processing and algorithm design are performed on the basis of the binary image according to the phenotype characteristics of the wheat spike, and then the actual size represented by the pixel is used to determine the wheat spike phenotype traits.
[0079] For the measurement of the wheat spike area, in an embodiment, the wheat spike phenotype traits are determined according to the pixel data of the wheat spike and the wheat spike in the binary image of the wheat spike and the actual size represented by each pixel, which can include: performing an opening operation on the binary image of the wheat spike to obtain a binary image without wheat spike and with wheat spike; subtracting the binary image of the wheat spike from the binary image of the wheat spike to obtain a binary image with wheat spike and without wheat spike; and determining the actual area of the wheat spike according to the number of pixels with a gray value of 1 in the binary image with wheat spike and without wheat spike and the actual size represented by each pixel.
[0080] For the wheat spike number, in an embodiment, after the actual area of the wheat spike is determined, the wheat spike phenotype trait measurement method in the field environment further includes: performing skeleton extraction on the binary image with wheat spike and without wheat spike to obtain a binary image of the wheat spike skeleton; performing inflation processing and convex hull calculation on the binary image without wheat spike and with wheat spike to obtain a binary image of the wheat spike convex hull; calculating the number of intersection points of the wheat spike convex hull and the wheat spike skeleton; and determining the number of wheat spikes according to the number of intersection points.
[0081] In the inflation processing of the binary image with wheat spike and without wheat spike, the inflation threshold progressive method is used for inflation processing, a plurality of inflation thresholds are set to obtain a plurality of binary images of the wheat spike convex hull, and then the number of intersection points of the plurality of wheat spike convex hulls and the wheat spike skeleton is calculated, and the data close to the spike body is closer to the true value, so the third and fourth quartiles are calculated as the actual number of wheat spikes.
[0082] For the length of the awn, in an embodiment, after determining the number of awns according to the number of intersection points, the method for measuring the phenotype of the awn in the field environment further comprises:
[0083] calculating the number of pixels with a gray value of 1 in the binarized image of the awn skeleton;
[0084] determining the total length of the awn according to the number of pixels with a gray value of 1 in the binarized image of the awn skeleton and the actual size represented by each pixel;
[0085] determining the average length of the awn according to the total length of the awn and the number of awns.
[0086] Figure 6 For the schematic diagram of measuring the phenotype of the awn in the embodiment of the application, refer to Figure 6 For the specific description of measuring the phenotype of the awn.
[0087] 1) Awn area: the binarized image BW of the awn ear is subjected to an opening operation using the imopen function to obtain a binarized image BWN without awn and with ear, and the binarized image BW of the awn ear is subtracted from the binarized image BWN without awn and with ear (i.e. BW-BWN), and then subjected to denoising to obtain a binarized image BWA with only awn and without ear, and the number of values of 1 in the BWA image is counted, which is the awn image area SAWNim, and the calculation formula of the actual awn area AWNSgt is:
[0088] AWNS gt = SAWN im × SSOP 2
[0089] SSOP is the actual size represented by each pixel.
[0090] 2) Awn number: the binarized image BWA with awn and without ear is subjected to skeleton extraction using the bwskel function to obtain a binarized image BWSK of the awn skeleton, and the binarized image BWN without awn is subjected to dilation using the imdilate function, and then the convex hull BWC thereof is obtained using the convhull function, and the number of intersection points between the convex hull and the awn skeleton is calculated to determine the number of awns. Since the size of the dilation affects the number of intersection points, in the actual calculation process, the number of intersection points at different positions is calculated step by step in a progressive manner of dilation threshold, and the third and fourth quartiles are taken as the actual number of awns because the data close to the ear body is closer to the true value.
[0091] Figure 7 For the schematic diagram of the progressive processing of the dilation threshold in the embodiment of the application, refer to Figure 7The initial value of the expansion threshold is set to 11, the progressive step is set to 11, the length of the image is taken as the termination condition when the expansion threshold reaches the length of the image, the product (BWSK*BWC) of the wheat awn skeleton binary image and the convex hull is calculated, the number of intersection points IP (the value is 1) is counted, the number of wheat awns is obtained, a plurality of wheat awn number combinations are obtained, IPN={IPN1, IPN2, IPN3,..., IPNn}, the third quartile calculation method is IPNQ3=quantile(IPN,0.75), and the calculation formula of the actual number of wheat awns AWNN is:
[0092] AWNN=IPNQ3
[0093] 3) Wheat awn length: the number of values 1 in the wheat awn skeleton binary image BWSK is counted, that is, the total length of the wheat awn BWSKN, and the ratio of the total length to the number of wheat awns is the average length of the wheat awn. Therefore, the calculation formula of the actual length of the wheat awn AWNL is:
[0094]
[0095] In summary, the preset background plate is designed in the embodiment of the application, the image of the wheat ear is obtained in the field by combining the smart phone, the problem of destructive sampling is solved, the rapid and accurate measurement of the surface area, number and length of the wheat awn is realized by combining the deep learning algorithm and the image processing algorithm. The core algorithm is that the number of wheat awns is obtained by using the product of the convex hull of the wheat ear main body and the wheat awn skeleton, the number of wheat awns at different positions is obtained in the form of a progressive threshold, and finally the third quartile is taken as the actual number of wheat awns.
[0096] In the embodiment of the application, a wheat awn phenotype trait measurement device in a field environment is also provided, as described in the following embodiment. Since the principle of solving the problem of the device is similar to the wheat awn phenotype trait measurement method in the field environment, the implementation of the device can be referred to the implementation of the wheat awn phenotype trait measurement method in the field environment, and the repeated parts will not be described again.
[0097] Figure 8 The schematic diagram of the wheat awn phenotype trait measurement device in the field environment in the embodiment of the application is shown as Figure 8 The wheat awn phenotype trait measurement device 800 in the field environment includes:
[0098] An image acquisition module 801 is configured to acquire the image of the wheat ear in the field environment through a mobile terminal; the image of the wheat ear includes a specified size scale, and the specified size scale is used to determine the size and position of the wheat awn in the image.
[0099] An image extraction module 802 is configured to perform image segmentation and extraction of the wheat awn and the specified size scale in the image of the wheat ear, so as to obtain the image of the wheat awn and the specified size scale.
[0100] The pixel actual size determination module 803 is configured to determine the actual size represented by each pixel in the wheat ear image according to the image of the specified size ruler.
[0101] The wheat awn phenotype trait extraction module 804 is configured to perform image processing on the image of the wheat awn ear to obtain a binary image of the wheat awn ear, and determine the wheat awn phenotype trait according to the pixel data occupied by the wheat awn and the wheat ear in the binary image of the wheat awn ear and the actual size represented by each pixel. The wheat awn phenotype trait includes the wheat awn area, the wheat awn quantity, and the average length of the wheat awn.
[0102] In an embodiment, the image acquisition module 801 is specifically configured to:
[0103] acquire, by the mobile terminal, an imaging image of the wheat ear placed in front of a preset background plate in a field environment, and the preset background plate is marked with a wheat ear placement area to be photographed and a specified size ruler.
[0104] In an embodiment, the image extraction module 802 is specifically configured to:
[0105] extract, by using a deep learning model, the wheat awn ear and the specified size ruler from a plurality of wheat ear images to obtain a plurality of images of the wheat awn ear and the specified size ruler, and the deep learning model is obtained by training a YOLOv8n model in advance by using historical wheat ear images, wheat awn ears extracted from the historical wheat ear images, and specified size rulers extracted from the historical wheat ear images.
[0106] In an embodiment, the pixel actual size determination module 803 is specifically configured to:
[0107] perform local adaptive thresholding, binarization, closing operation, and filling operation on the image of the specified size ruler to obtain a binary image of the ruler;
[0108] determine the area of the ruler in the image according to the binary image of the ruler;
[0109] determine the actual size represented by each pixel according to the area of the ruler in the image and the actual area of the ruler.
[0110] In an embodiment, the pixel actual size determination module 703 is specifically configured to:
[0111] determine the actual size represented by each pixel according to the area of the ruler in the image and the actual area of the ruler according to the following formula:
[0112]
[0113] In the formula, SSOP is the actual size represented by each pixel, S 图像 is the area of the ruler in the image, and S 实际Actual area of spikelet.
[0114] In an embodiment, the spikelet phenotype trait extraction module 704 is specifically configured to:
[0115] perform an open operation on the binary image of the spikelet ear to obtain a binary image of the spikelet-free ear with spikelets;
[0116] subtract the binary image of the spikelet ear from the binary image of the spikelet-free ear with spikelets to obtain a binary image of the ear with spikelets free of spikelets;
[0117] determine the actual area of the spikelet according to the number of pixels with a gray value of 1 in the binary image of the ear with spikelets free of spikelets and the actual size of each pixel.
[0118] In an embodiment, the device further comprises a spikelet number determination module, which is configured to, after the spikelet phenotype trait extraction module 804 determines the actual area of the spikelet, perform skeleton extraction on the binary image of the ear with spikelets free of spikelets to obtain a binary image of the spikelet skeleton, perform inflation processing and convex hull calculation on the binary image of the spikelet-free ear with spikelets to obtain a binary image of the ear with spikelets convex hull, calculate the number of intersection points of the ear with spikelets convex hull and the spikelet skeleton, and determine the number of spikelets according to the number of intersection points.
[0119] In an embodiment, the device further comprises a spikelet length determination module, which is specifically configured to, after the spikelet number determination module determines the number of spikelets according to the number of intersection points, calculate the number of pixels with a gray value of 1 in the binary image of the spikelet skeleton, determine the total length of the spikelet according to the number of pixels with a gray value of 1 in the binary image of the spikelet skeleton and the actual size of each pixel, and determine the average length of the spikelet according to the total length of the spikelet and the number of spikelets.
[0120] Embodiments of the present application also provide a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the above-described method for measuring the phenotype traits of wheat spikelets in a field environment when executing the computer program.
[0121] Embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, and the computer program implements the above-described method for measuring the phenotype traits of wheat spikelets in a field environment when executed by a processor.
[0122] Embodiments of the present application also provide a computer program product, which comprises a computer program, and the computer program implements the above-described method for measuring the phenotype traits of wheat spikelets in a field environment when executed by a processor.
[0123] In the embodiment of the present application, the ear image of wheat under the field environment is acquired by the mobile terminal, the ear image of wheat is acquired without damaging the growth of wheat, the specified size scale is included in the ear image, then the actual size of each pixel in the ear image is determined by using the specified size scale, and the spike phenotype traits including the spike area, the spike quantity and the average length of the spike are determined by using the pixel data of the spike and the actual size of each pixel in the binary image of the spike, compared with the prior art, the specified size scale is shot when the ear image is acquired, and then the image processing is performed according to the specified size scale, the spike phenotype traits of the spike area, the spike quantity and the average length of the spike are obtained, and the rapid and accurate measurement of the spike area, the spike quantity and the length of the spike is realized.
[0124] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0125] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the flow Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The means for performing the functions specified in one or more blocks.
[0126] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction means, which implements the flow Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The means for performing the functions specified in one or more blocks.
[0127] These computer program instructions can also be loaded into a computer or other programmable data processing devices, so that a series of operational steps are performed on the computer or other programmable data processing devices to generate a computer implemented process, so that the instructions executed on the computer or other programmable data processing devices provide a process for implementing the flowchart Figure 1 one flow or multiple flows and / or the functions specified in the block Figure 1 one flow or multiple flows and / or the functions specified in the block
[0128] The above-described specific embodiments, the purpose, technical solutions and beneficial effects of the present application are further described in detail, it should be understood that the above-described is only a specific embodiment of the present application, and is not used to limit the protection scope of the present application, any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for measuring the phenotypic traits of wheat awns in a field environment, characterized in that, The method comprises the following steps: Obtaining an ear image of wheat under a field environment through a mobile terminal; the ear image comprises a specified size scale, which is used to determine the size and position of a wheat spikelet in the ear image; Image segmentation and extraction of the wheat spikelet and the specified size scale are performed on the ear image to obtain an image of the wheat spikelet and the specified size scale; According to the image of the specified size scale, the actual size of each pixel in the ear image is determined; Image processing is performed on the image of the wheat spikelet to obtain a binary image of the wheat spikelet; According to the pixel data of the wheat spikelet and the wheat ear in the binary image of the wheat spikelet and the actual size of each pixel, the wheat spikelet phenotype is determined; the wheat spikelet phenotype comprises the area, number and average length of the wheat spikelet; The binary image of the wheat spikelet is subjected to an opening operation to obtain a binary image of the wheat ear without the wheat spikelet; the binary image of the wheat spikelet is subtracted from the binary image of the wheat ear without the wheat spikelet to obtain a binary image of the wheat spikelet without the wheat ear; skeleton extraction is performed on the binary image of the wheat spikelet without the wheat ear to obtain a binary image of the wheat spikelet skeleton; the binary image of the wheat ear without the wheat spikelet is subjected to an inflation operation and a convex hull calculation to obtain a binary image of the wheat ear convex hull; the number of intersection points between the wheat ear convex hull and the wheat spikelet skeleton is calculated; the number of intersection points is determined according to the number of intersection points; the third and fourth quartiles are calculated as the actual number of wheat spikelets.
2. The method of claim 1, wherein, The method comprises the following steps: An imaging image of a wheat ear in a field environment is obtained through a mobile terminal; a specified size scale is placed in front of the imaging image; the specified size scale is used to determine the size and position of a wheat spikelet in the imaging image.
3. The method of claim 1, wherein, Image segmentation and extraction of the wheat spikelet and the specified size scale are performed on the ear image to obtain an image of the wheat spikelet and the specified size scale, comprising: A deep learning model is used to extract the wheat spikelet and the specified size scale from a plurality of ear images to obtain a plurality of images of the wheat spikelet and the specified size scale; the deep learning model is trained using historical ear images, wheat spikelets extracted from the historical ear images, and specified size scales extracted from the historical ear images.
4. The method of claim 1, wherein, According to the image of the specified size scale, the actual size of each pixel in the ear image is determined, comprising: Local adaptive thresholding, binarization, closing operation and filling operation are performed on the image of the specified size scale to obtain a binary image of the scale; The area of the scale in the image is determined according to the binary image of the scale; The actual size of each pixel is determined according to the area of the scale in the image and the actual area of the scale.
5. The method of claim 4, wherein, The actual size of each pixel is determined according to the area of the scale in the image and the actual area of the scale, comprising: The actual size of each pixel is determined according to the area of the scale in the image and the actual area of the scale according to the following formula: ; where SSOP is the actual size represented by each pixel, is the area of the scale in the image, is the actual area of the scale.
6. The method of claim 1, wherein, According to the pixel data of the wheat spikelet and the wheat ear in the binary image of the wheat spikelet and the actual size of each pixel, the wheat spikelet phenotype is determined, comprising: According to the number of pixels with a gray value of 1 in the binary image of the awn-free wheat ear and the actual size of each pixel, the actual area of the awn is determined.
7. The method of claim 1, wherein, After determining the number of awns according to the number of intersection points, further comprising: calculating the number of pixels with a gray value of 1 in the binary image of the awn skeleton; According to the number of pixels with a gray value of 1 in the binary image of the awn skeleton and the actual size of each pixel, the total length of the awn is determined. According to the total length of the awn and the number of awns, the average length of the awn is determined.
8. A device for measuring the phenotype of a wheat awn in a field environment, characterized by, Comprising: An image acquisition module for acquiring a wheat ear image in a field environment through a mobile terminal; the wheat ear image includes a specified size scale, which is used to determine the size and position of the awn and wheat ear in the image; An image extraction module for image segmentation and extraction of the awn and wheat ear and the specified size scale in the wheat ear image to obtain the images of the awn and wheat ear and the specified size scale; A pixel actual size determination module for determining the actual size of each pixel in the wheat ear image according to the image of the specified size scale; An awn phenotype trait extraction module for image processing of the image of the awn and wheat ear to obtain a binary image of the awn and wheat ear; and determining the awn phenotype traits according to the pixel data occupied by the awn and wheat ear in the binary image of the awn and wheat ear and the actual size of each pixel; the awn phenotype traits include the awn area, the number of awns and the average length of the awn; The awn phenotype trait extraction module is specifically configured to: perform an opening operation on the binary image of the awn and wheat ear to obtain a binary image of the awn-free wheat ear; and subtract the binary image of the awn-free wheat ear from the binary image of the awn and wheat ear to obtain a binary image of the awn-free wheat ear. Further comprising: an awn number determination module; the awn number determination module is configured to: perform skeleton extraction on the binary image of the awn-free wheat ear to obtain a binary image of the awn skeleton; perform inflation processing and convex hull calculation on the binary image of the awn-free wheat ear to obtain a binary image of the wheat ear convex hull; calculate the number of intersection points between the wheat ear convex hull and the awn skeleton; and determine the number of awns according to the number of intersection points; wherein the number of intersection points at different positions is calculated step by step in a progressive inflation threshold value manner, and the third quartile is taken as the actual number of awns.
9. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method of any one of claims 1 to 7.
11. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program is executed by the processor to realize the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Method for extracting wheatear morphological parameters
CN101944231A