Vision-based plant leaf phenotypic data analysis method, system and device
By analyzing plant leaf phenotypic data using visual methods, the problems of high difficulty and low accuracy in manual measurement have been solved, realizing automated and intelligent leaf data measurement and improving detection accuracy and efficiency.
Patent Information
- Application Number
- CN202411147759.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-08-21
AI Technical Summary
In existing technologies, the analysis of plant leaf phenotypic data relies on manual measurement, which has problems such as high measurement difficulty, low efficiency and poor accuracy, especially when plant leaves are cross-occluded.
A vision-based approach is adopted to acquire plant images, perform binarization processing, extract leaf vertex and concave point data, detect the intersection of leaves and stems, determine whether leaves cross and occlude, obtain complete leaf data through a fitting algorithm, and finally calculate the leaf length.
It enables automated and intelligent analysis of plant leaf phenotypic data, improves measurement efficiency and accuracy, reduces the difficulty and cost of manual measurement, and provides data support for plant research.
Smart Images

Figure CN118674745B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, system and device for analyzing plant leaf phenotype data based on vision. Background Art
[0002] During the plant growth process, plant leaf phenotypic data is an important parameter in plant phenotypic data and an important reflection of the plant's growth and health. Therefore, accurately obtaining plant leaf phenotypic data has important guiding significance for the scientific research and cultivation of plants.
[0003] At present, the analysis of plant leaf phenotypic data mainly relies on manual and visual methods for measurement. The manual measurement method has problems such as great measurement difficulty, low efficiency and poor accuracy. The visual method of plant leaf phenotypic data analysis is difficult to solve the problem of overlapping plant leaves, and the detection accuracy is poor when the plant leaves are complex.
[0004] With the rapid development of machine vision, the present invention realizes fast and accurate measurement of plant leaf phenotypic data by applying machine vision to the plant leaf phenotypic data analysis method. At the same time, the present invention solves the problem of low detection accuracy caused by cross-occlusion of plant leaves by analyzing and processing the data, realizes automatic and intelligent data measurement, reduces the difficulty of manual measurement, and saves a lot of manpower and material resources. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides a method, system and device for analyzing plant leaf phenotype data based on vision.
[0006] In order to solve the above technical problems, the present invention is solved by the following technical solutions:
[0007] A method for analyzing plant leaf phenotype data based on vision, comprising the following steps:
[0008] Acquire a plant image and perform binarization processing to obtain a plant binary image;
[0009] Preprocess the plant binary image to obtain a plant fitting data set, extract the plant fitting data set to obtain a plant leaf vertex data set and a plant concave point data set, and then obtain the number of plant leaves by obtaining the number of data in the plant leaf vertex data set;
[0010] Extract the contour of the plant binary image to obtain the plant contour image, detect and analyze the plant contour image to obtain the plant stem area, and then obtain the intersection data set of the plant leaves and stems;
[0011] Based on the plant leaf vertex dataset, plant contour image and intersection dataset, determine whether there is cross occlusion between plant leaves, and then obtain complete plant leaf data based on the plant concave point dataset;
[0012] The leaf skeleton data is obtained based on the complete plant leaf data, and the plant leaf length data is obtained through the leaf skeleton data.
[0013] As an implementable method, preprocessing the plant binary image to obtain the plant fitting data set includes the following steps:
[0014] Extract contour points from the plant binary image to obtain a plant contour point set;
[0015] Polygon fitting is performed based on the plant contour point set to obtain a plant fitting data set.
[0016] As an implementable method, obtaining a plant leaf vertex dataset and a plant concave point dataset comprises the following steps:
[0017] Based on the three adjacent plant fitting data in the plant fitting data set, a triangle is formed and analyzed. If the plant fitting data located in the middle is the vertex of the triangle, the vertex angle of the triangle is obtained;
[0018] If the vertex angle of the triangle is an acute angle, calculate the midpoint data of the base of the triangle, and obtain the pixel value of the corresponding point of the midpoint data of the base of the triangle in the plant binary image;
[0019] If the corresponding point pixel value meets the preset threshold, it is plant leaf data, otherwise it is plant concave point data. By traversing the plant fitting data set, the plant leaf data set and the plant concave point data set are obtained;
[0020] The abnormal root data in the plant leaf dataset is removed to obtain the plant leaf vertex dataset.
[0021] As an implementable method, obtaining the plant stem region comprises the following steps:
[0022] Extracting the contour of the plant binary image to obtain contour data, and generating a plant contour image based on the contour data;
[0023] Perform straight line detection on the plant contour image to obtain a plant straight line set, obtain the slope of the plant straight line, and obtain a plant slope set;
[0024] Analyzing the plant slope set based on a preset slope threshold, extracting plant straight lines corresponding to plant slopes that meet the preset slope threshold, and obtaining a screened plant straight line set;
[0025] The longest screening plant straight line in the screening plant straight line set is used as the plant baseline, and the distance between the screening plant straight line and the plant baseline is obtained to obtain a baseline distance set;
[0026] If the baseline distance meets the plant stem change trend and the preset plant stem thickness threshold, the initial stem area is obtained based on the area between the screening plant straight line and the plant baseline, and then the initial stem area is extended in combination with the plant binary image to obtain the plant stem area.
[0027] As an implementable method, obtaining the intersection data set of plant leaves and stems includes the following steps:
[0028] Based on the plant stem area, data on both sides of the stem area are obtained, and the central axis of the plant stem is obtained through the data on both sides of the stem area;
[0029] Based on the plant binary image and the plant stem area, the outline width of the pixel point in the plant binary image in the preset sliding window perpendicular to the central axis of the plant stem is obtained;
[0030] The mean value of the contour width within the preset sliding window is obtained. If the change value of the mean value of the contour width meets the preset change threshold, the intersection data set of the plant leaves and stems is obtained based on the pixel points of the corresponding plant binary image.
[0031] As an implementable method, the method of determining whether there is cross occlusion between plant leaves and obtaining complete plant leaf data based on the plant concave point data set includes the following steps:
[0032] Based on the leaf vertex dataset, the plant contour image and the intersection dataset of the plant leaf and stem, both sides of the plant leaf contour are traversed. If the intersection data of the plant leaf and stem is passed during the traversal process, there is no cross occlusion of the corresponding plant leaf, and then the complete plant leaf data is obtained based on the plant leaf contour;
[0033] During the traversal process, if plant concave point data is encountered before the intersection data of plant leaves and stems, there is cross occlusion of the corresponding plant leaves, and then the plant concave point data set is analyzed and fitted to obtain complete plant leaf data.
[0034] As an implementable method, the analysis and fitting of the plant pit data set to obtain complete plant leaf data includes the following steps:
[0035] Based on the plant leaf vertex dataset and the plant binary image, the two sides of the plant leaf contour are traversed, and the plant concave point data encountered during the traversal process are extracted to obtain the contour concave point dataset;
[0036] Combining the contour concave point data set and the rice leaf vertex coordinate set, the pixel points of the plant leaf contour are extracted to obtain the plant leaf data point set. The plant leaf data point set is fitted with a quadratic curve to obtain the matrix fitting equation, which is expressed as follows:
[0037]
[0038] The loss function is established based on the matrix fitting equation, which is expressed as follows:
[0039]
[0040] The loss function is derived to obtain the fitting parameter matrix in the matrix fitting equation, which is expressed as follows:
[0041]
[0042] Based on the fitting parameter matrix, the intersection of the matrix fitting equation and the central axis of the plant stem is obtained to obtain the plant stem intersection point, and based on the distance between the plant stem intersection point and the intersection point data of the plant leaf and the stem, the plant stem intersection point data of the current leaf is obtained;
[0043] Combine the intersection data between the current leaf and the plant stem and the plant binary image, traverse along both sides of the plant leaf to obtain the first intersection data and the second intersection data;
[0044] Based on the first cross data and the second cross data, a quadratic fitting is performed on the matrix fitting equation to obtain a quadratic fitting equation, and based on the quadratic fitting equation, the cross parts of the plant leaves are connected to obtain complete plant leaf data;
[0045] in, , , , represents the fitting parameters, represents the fitting parameter matrix, Represents the abscissa matrix of the plant leaf data point set, Represents the ordinate matrix of the plant leaf data point set, The horizontal axis represents the plant leaf data. The vertical coordinate representing the plant leaf data, Indicates the number of plant leaf data. Represents the loss function.
[0046] As an implementable method, the binarization process is expressed as follows:
[0047]
[0048] in, Represents the plant binary image at point The pixel value of , , Represents the pixel value of the plant image in the red channel, green channel, and blue channel. represents the horizontal axis, Indicates the vertical coordinate.
[0049] A plant leaf phenotype data analysis system based on vision, comprising an image binary module, an image preprocessing module, an intersection data calculation module, a plant leaf analysis module and a leaf length calculation module;
[0050] The image binary module acquires the plant image and performs a binary process to obtain a plant binary image;
[0051] The image preprocessing module preprocesses the plant binary image to obtain a plant fitting data set, extracts the plant fitting data set to obtain a plant leaf vertex data set and a plant concave point data set, and then obtains the number of plant leaves by obtaining the number of data in the plant leaf vertex data set;
[0052] The intersection data calculation module extracts the contour of the plant binary image to obtain the plant contour image, performs detection and analysis on the plant contour image to obtain the plant stem area, and then obtains the intersection data set of the plant leaves and stems;
[0053] The plant leaf analysis module determines whether there is cross occlusion between plant leaves based on the plant leaf vertex data set, the plant contour image and the intersection data set, and then obtains complete plant leaf data based on the plant concave point data set;
[0054] The leaf length calculation module obtains leaf skeleton line data based on the complete plant leaf data, and obtains plant leaf length data through the leaf skeleton line data.
[0055] As an implementable embodiment, the plant leaf analysis module is configured as follows:
[0056] Based on the leaf vertex dataset, the plant contour image and the intersection dataset of the plant leaf and stem, both sides of the plant leaf contour are traversed. If the intersection data of the plant leaf and stem is passed during the traversal process, there is no cross occlusion of the corresponding plant leaf, and then the complete plant leaf data is obtained based on the plant leaf contour;
[0057] During the traversal process, if the plant concave point data is encountered before the intersection data of the plant leaf and the stem is encountered, there is cross occlusion of the corresponding plant leaf, and then the plant concave point data set is analyzed and fitted to obtain the complete plant leaf data;
[0058] The analysis and fitting of the plant concave point data set to obtain complete plant leaf data includes the following steps:
[0059] Based on the plant leaf vertex dataset and the plant binary image, the two sides of the plant leaf contour are traversed, and the plant concave point data encountered during the traversal process are extracted to obtain the contour concave point dataset;
[0060] Combining the contour concave point data set and the rice leaf vertex coordinate set, the pixel points of the plant leaf contour are extracted to obtain the plant leaf data point set. The plant leaf data point set is fitted with a quadratic curve to obtain the matrix fitting equation, which is expressed as follows:
[0061]
[0062] The loss function is established based on the matrix fitting equation, which is expressed as follows:
[0063]
[0064] The loss function is derived to obtain the fitting parameter matrix in the matrix fitting equation, which is expressed as follows:
[0065]
[0066] Based on the fitting parameter matrix, the intersection of the matrix fitting equation and the central axis of the plant stem is obtained to obtain the plant stem intersection point, and based on the distance between the plant stem intersection point and the intersection point data of the plant leaf and the stem, the plant stem intersection point data of the current leaf is obtained;
[0067] Combine the intersection data between the current leaf and the plant stem and the plant binary image, traverse along both sides of the plant leaf to obtain the first intersection data and the second intersection data;
[0068] Based on the first cross data and the second cross data, a quadratic fitting is performed on the matrix fitting equation to obtain a quadratic fitting equation, and based on the quadratic fitting equation, the cross parts of the plant leaves are connected to obtain complete plant leaf data;
[0069] in, , , , represents the fitting parameters, represents the fitting parameter matrix, Represents the abscissa matrix of the plant leaf data point set, Represents the ordinate matrix of the plant leaf data point set, The horizontal axis represents the plant leaf data. The vertical coordinate representing the plant leaf data, Indicates the number of plant leaf data. Represents the loss function.
[0070] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method is implemented:
[0071] Acquire a plant image and perform binarization processing to obtain a plant binary image;
[0072] Preprocess the plant binary image to obtain a plant fitting data set, extract the plant fitting data set to obtain a plant leaf vertex data set and a plant concave point data set, and then obtain the number of plant leaves by obtaining the number of data in the plant leaf vertex data set;
[0073] Extract the contour of the plant binary image to obtain the plant contour image, detect and analyze the plant contour image to obtain the plant stem area, and then obtain the intersection data set of the plant leaves and stems;
[0074] Based on the plant leaf vertex dataset, plant contour image and intersection dataset, determine whether there is cross occlusion between plant leaves, and then obtain complete plant leaf data based on the plant concave point dataset;
[0075] The leaf skeleton data is obtained based on the complete plant leaf data, and the plant leaf length data is obtained through the leaf skeleton data.
[0076] A device for analyzing plant leaf phenotype data based on vision includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the following method is implemented:
[0077] Acquire a plant image and perform binarization processing to obtain a plant binary image;
[0078] Preprocess the plant binary image to obtain a plant fitting data set, extract the plant fitting data set to obtain a plant leaf vertex data set and a plant concave point data set, and then obtain the number of plant leaves by obtaining the number of data in the plant leaf vertex data set;
[0079] Extract the contour of the plant binary image to obtain the plant contour image, detect and analyze the plant contour image to obtain the plant stem area, and then obtain the intersection data set of the plant leaves and stems;
[0080] Based on the plant leaf vertex dataset, plant contour image and intersection dataset, determine whether there is cross occlusion between plant leaves, and then obtain complete plant leaf data based on the plant concave point dataset;
[0081] The leaf skeleton data is obtained based on the complete plant leaf data, and the plant leaf length data is obtained through the leaf skeleton data.
[0082] The present invention adopts the above technical solution and has significant technical effects:
[0083] The method of the present invention collects and processes plant images, and by judging whether there is cross-occlusion of plant leaves, the plant leaves with cross-occlusion are processed to obtain complete plant leaf data, and the skeleton lines of complete plant leaves are extracted to obtain plant leaf length data. The present invention analyzes and processes plant images based on vision, and finally obtains the number of plant leaves and the length of plant leaves, realizes automated and intelligent plant leaf phenotypic data analysis, and solves the problem of large workload and low accuracy of existing manual measurement, reduces labor costs, and provides data support for further research on plants. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0085] Figure 1 It is a schematic flow diagram of the method of the present invention;
[0086] Figure 2 It is an overall schematic diagram of the system of the present invention;
[0087] Figure 3 is a schematic diagram of a plant image of the method of the present invention;
[0088] Figure 4 It is a schematic diagram of the blade skeleton line of the method of the present invention. DETAILED DESCRIPTION
[0089] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.
[0090] Embodiment 1:
[0091] A vision-based method for analyzing plant leaf phenotypic data, such as Figure 1 As shown, the following steps are included:
[0092] S100, acquiring a plant image and performing binarization processing to obtain a plant binary image;
[0093] S200, preprocessing the plant binary image to obtain a plant fitting data set, extracting the plant fitting data set to obtain a plant leaf vertex data set and a plant concave point data set, and then obtaining the number of plant leaves by obtaining the number of data in the plant leaf vertex data set;
[0094] S300, extracting the contour of the plant binary image to obtain a plant contour image, detecting and analyzing the plant contour image to obtain a plant stem region, and then obtaining a data set of intersection points between plant leaves and stems;
[0095] S400, judging whether there is cross occlusion between plant leaves based on the plant leaf vertex data set, the plant contour image and the intersection data set, and then obtaining complete plant leaf data based on the plant concave point data set;
[0096] S500: Obtain leaf skeleton line data based on the complete plant leaf data, and obtain plant leaf length data through the leaf skeleton line data.
[0097] In the present invention, a plant image is obtained through image acquisition, the plant image is binarized to obtain a plant binary image, preprocessing and fitting extraction are performed based on the plant binary image to obtain a plant leaf vertex data set and a plant concave point data set, the number of plant leaves is obtained by the number of plant leaf vertex data in the plant leaf vertex data set, contour extraction and detection analysis are performed on the plant binary image to obtain a data set of intersections of plant leaves and stems, and then complete plant leaf data is obtained by analyzing whether there is cross occlusion between plant leaves, and plant leaf length data is obtained based on the skeleton line data of the complete plant leaf data.
[0098] The method of the present invention solves the drawback of existing plant leaf phenotypic data analysis methods that rely on manual measurement, and realizes an automated and intelligent phenotypic data measurement method. The method of the present invention can accurately obtain the number and length of plant leaves, providing data support for further research on plants, while saving a lot of manpower and material resources and improving the accuracy of measurement results.
[0099] In step S100, a plant image is acquired and binarized to obtain a plant binary image, which includes the following steps:
[0100] S110: Capturing plant images through an image acquisition device to obtain plant images , plant images like Figure 3 As shown, Figure 3 A black background is used as the background color, and the segmented plant image is obtained through image segmentation. ;
[0101] S120: Segmenting plant images Perform binarization to obtain a plant binary image , which is expressed by pixel relationship as follows:
[0102]
[0103] in, Represents a plant binary image At the point The pixel value of , , Represents the pixel value of the plant image in the red channel, green channel, and blue channel. represents the horizontal axis, Indicates the vertical coordinate.
[0104] In step S200, the plant binary image is preprocessed to obtain a plant fitting data set, the plant fitting data set is extracted to obtain a plant leaf vertex data set and a plant concave point data set, and then the number of plant leaves is obtained by obtaining the number of data in the plant leaf vertex data set, including the following steps:
[0105] S210: Based on plant binary image Extract contour points to obtain plant contour point set , set the polygon fitting accuracy according to the resolution of the plant image, and calculate the plant contour point set based on the fitting accuracy. Perform polygon fitting to obtain the plant fitting data set ;
[0106] S220: Fitting datasets by plants , using the triangle base midpoint method, we get the plant leaf vertex data set and plant concave point dataset , wherein the triangle base midpoint method comprises the following steps:
[0107] Step 1: Get the plant fitting data set The three consecutive points in the triangle constitute a triangle. If the coordinates of the second point in the triangle are the vertices of the triangle and the angle formed is an acute angle, the midpoint data of the base of the triangle formed at this time is calculated, and the midpoint data of the base of the triangle is obtained in the plant binary image. The pixel value in ;
[0108] Step 2: If the pixel value is not 0, then the vertex coordinates of the triangle formed at this time are the vertex data of the plant leaf. If the pixel value If it is 0, the vertex coordinates of the triangle formed at this time are the plant concave point data;
[0109] Step 3: Traverse the plant fitting data set All the plant fitting data in the dataset are obtained to obtain the plant leaf dataset and plant concave point dataset. ;
[0110] Step 4: Eliminate abnormal root data in the plant leaf dataset to obtain the plant leaf vertex dataset , the number of plant leaf vertex data in the plant leaf vertex data set is the number of plant leaves.
[0111] In step S300, contour extraction is performed on the plant binary image to obtain a plant contour image, and detection and analysis are performed on the plant contour image to obtain a plant stem region, and then a data set of intersection points between plant leaves and stems is obtained, including the following steps:
[0112] S310: Binarize the plant image Perform contour extraction to obtain contour data, draw the contour data to the blank image, and obtain the plant contour image ;
[0113] S320: Plant outline image Perform straight line detection to obtain a plant straight line set, analyze the positional relationship between the plant straight lines in combination with plant growth characteristics, and obtain a positional relationship in which the straight lines on both sides of the plant are slightly parallel but not completely parallel. Based on this positional relationship and in combination with the plant straight line set, obtain the plant stem area, including the following steps:
[0114] Step 1: Obtain the slopes of all plant lines in the plant line set to obtain the plant slope set;
[0115] Step 2: In this embodiment, the preset slope threshold is 5%. Based on the preset slope threshold, the straight lines with similar slopes in the plant straight line set are screened to obtain a screened plant straight line set;
[0116] Step 3: The longest screening plant straight line in the screening plant straight line set is taken as the plant baseline, and the distances between other screening plant straight lines and each point on the plant baseline are calculated to obtain the baseline distance set;
[0117] Step 4: If the distances between the points in the baseline distance set gradually decrease from bottom to top, and the baseline distance meets the preset plant stem thickness threshold, the area between the plant straight line and the plant baseline is selected as the initial stem area;
[0118] Step 5: Based on the straight line trends on both sides of the initial stem area, extend upward to obtain the plant stem area.
[0119] S330: Based on the plant stem region, a sliding window method is used to obtain a data set of intersection points between plant leaves and stems, including the following steps:
[0120] Step 1: Based on the plant stem area, obtain the data on both sides of the stem area, and then obtain the central axis of the plant stem;
[0121] Step 2: Combine the plant binary image and the plant stem area, set a preset sliding window, slide the plant stem root area upward in the direction of the plant stem, and obtain the outline width of the plant binary image pixel point in the preset sliding window along the direction perpendicular to the central axis of the plant stem;
[0122] Step 3: Get the mean width of the contour in the preset sliding window. If the mean width changes suddenly, the mutation point is the intersection of the plant leaf and the stem, and then get the intersection data set of the plant leaf and stem. .
[0123] Since plant leaves may cross or be blocked during their growth, which will affect the calculation of plant leaf length, it is necessary to determine whether plant leaves are crossed or blocked, and to segment plant leaves that are crossed or blocked to improve the accuracy of plant leaf length calculation.
[0124] In step S400, based on the plant leaf vertex data set, the plant contour image and the intersection data set, it is determined whether there is cross occlusion between the plant leaves, and then the complete plant leaf data is obtained based on the plant concave point data set, including the following steps:
[0125] S410: Based on the plant leaf vertex dataset , starting from the vertex data of the plant leaf, traverse along the contour of the plant leaf;
[0126] S420: If, during the traversal process along the contours on both sides of the plant leaf, the intersection data of the plant leaf and the stem are encountered on both sides, the current plant leaf is an independent leaf, and there is no cross-occlusion; if, during the traversal process along the contours on both sides of the plant leaf, before encountering the intersection data of the plant leaf and the stem, the plant concave point data is encountered, the current plant leaf is a cross-occluded leaf;
[0127] S430: For an independent leaf, since there is no cross-occlusion, a skeleton line of the plant leaf from the vertex of the plant leaf to the intersection of the plant leaf and the stem is calculated, and the length of the skeleton line is the length of the plant leaf;
[0128] S440: For the cross-blocking leaves, segment the cross-blocking leaves by using a quadratic curve fitting method, wherein the quadratic curve fitting method includes the following steps:
[0129] Step 1: Obtain the plant leaf data point set between the plant leaf vertex data and the plant concave point data encountered during the contour traversal process , perform quadratic curve fitting on the plant leaf data point set, assuming that the quadratic curve fitting equation is ;
[0130] Step 2: Based on the plant leaf data point set , we get the matrix equation, which is expressed as follows:
[0131]
[0132] Assumptions , , , then the matrix fitting equation is obtained, which is expressed as follows:
[0133]
[0134] The loss function is established based on the matrix fitting equation, which is expressed as follows:
[0135]
[0136] The loss function is derived to obtain the fitting parameter matrix in the matrix fitting equation, which is expressed as follows:
[0137]
[0138]
[0139] in, represents the fitting parameters, represents the fitting parameter matrix, Represents the abscissa matrix of the plant leaf data point set, Represents the ordinate matrix of the plant leaf data point set, The horizontal axis represents the plant leaf data. The vertical coordinate representing the plant leaf data, Indicates the number of plant leaf data. represents the loss function;
[0140] Step 3: Obtain the fitting parameters and matrix fitting equation by calculation, obtain the intersection of the matrix fitting equation and the central axis of the plant stem, and obtain the intersection of the plant stem;
[0141] Step 4: Obtain the data set of the intersection points of plant stems and the intersection points of plant leaves and stems The nearest point in the middle is used to obtain the intersection data of the current leaf and plant stem;
[0142] Step 5: Based on the current leaf-stem intersection data, traverse along the contours of both sides of the plant leaf, and obtain the first intersection data in the process of traversing toward the vertex of the leaf , in the process of traversing from the plant leaf vertex to the current leaf plant stem intersection data direction, the second intersection data is obtained ;
[0143] Step 6: Based on the first cross data And the second cross data , combined with the quadratic curve fitting equation , retain the parameters in the quadratic curve fitting equation , re-perform quadratic fitting on the quadratic curve fitting equation to obtain a quadratic fitting equation, and connect the cross parts of the plant leaves based on the quadratic fitting equation to obtain complete plant leaf data.
[0144] In step S500, the leaf skeleton data is obtained based on the complete plant leaf data, and the plant leaf length data is obtained through the leaf skeleton data. Figure 4 This is a schematic diagram of the blade skeleton line data.
[0145] Embodiment 2:
[0146] A vision-based plant leaf phenotypic data analysis system, such as Figure 2 As shown, it includes an image binary module 100, an image preprocessing module 200, an intersection data calculation module 300, a plant leaf analysis module 400 and a leaf length calculation module 500;
[0147] The image binary module 100 acquires a plant image and performs a binary process to obtain a plant binary image;
[0148] The image preprocessing module 200 preprocesses the plant binary image to obtain a plant fitting data set, extracts the plant fitting data set to obtain a plant leaf vertex data set and a plant concave point data set, and then obtains the number of plant leaves by obtaining the number of data in the plant leaf vertex data set;
[0149] The intersection data calculation module 300 extracts the contour of the plant binary image to obtain a plant contour image, performs detection and analysis on the plant contour image to obtain a plant stem area, and then obtains a data set of intersections between plant leaves and stems;
[0150] The plant leaf analysis module 400 determines whether there is cross occlusion between plant leaves based on the plant leaf vertex data set, the plant contour image and the intersection data set, and then obtains complete plant leaf data based on the plant concave point data set;
[0151] The leaf length calculation module 500 obtains leaf skeleton line data based on the complete plant leaf data, and obtains plant leaf length data through the leaf skeleton line data.
[0152] Various changes and modifications can be made without departing from the spirit and scope of the present invention, and all equivalent technical solutions also belong to the scope of the present invention.
[0153] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0154] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may 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-ROM, optical storage, etc.) containing computer-usable program code.
[0155] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, 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 terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0156] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0157] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0158] It should be noted that:
[0159] The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.
[0160] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. A method for analyzing plant leaf phenotype data based on vision, characterized in that: The following steps are involved: Acquire a plant image and perform binarization processing to obtain a plant binary image; Preprocess the plant binary image to obtain a plant fitting data set, extract the plant fitting data set to obtain a plant leaf vertex data set and a plant concave point data set, and then obtain the number of plant leaves by obtaining the number of data in the plant leaf vertex data set; Extract the contour of the plant binary image to obtain the plant contour image, detect and analyze the plant contour image to obtain the plant stem area, and then obtain the intersection data set of the plant leaves and stems; Based on the plant leaf vertex dataset, plant contour image and intersection dataset, determine whether there is cross occlusion between plant leaves, and then obtain complete plant leaf data based on the plant concave point dataset; Obtain leaf skeleton data based on complete plant leaf data, and obtain plant leaf length data through the leaf skeleton data; The step of obtaining a data set of intersection points between plant leaves and stems comprises the following steps: Based on the plant stem area, data on both sides of the stem area are obtained, and the central axis of the plant stem is obtained through the data on both sides of the stem area; Based on the plant binary image and the plant stem area, the outline width of the pixel point in the plant binary image in the preset sliding window perpendicular to the central axis of the plant stem is obtained; Obtain the mean value of the contour width within the preset sliding window. If the change value of the mean value of the contour width meets the preset change threshold, obtain the intersection data set of the plant leaves and stems based on the pixel points of the corresponding plant binary image. The method of determining whether there is cross occlusion between plant leaves and obtaining complete plant leaf data based on the plant concave point data set includes the following steps: Based on the plant leaf vertex dataset, plant contour image and the intersection dataset of plant leaves and stems, both sides of the plant leaf contour are traversed. If the intersection data of plant leaves and stems is passed during the traversal process, there is no cross occlusion of the corresponding plant leaves, and then the complete plant leaf data is obtained based on the plant leaf contour; During the traversal process, if the plant concave point data is encountered before the intersection data of the plant leaf and the stem is encountered, there is cross occlusion of the corresponding plant leaf, and then the plant concave point data set is analyzed and fitted to obtain the complete plant leaf data; The step of analyzing and fitting the plant concave point data set to obtain complete plant leaf data includes the following steps: Based on the plant leaf vertex dataset and the plant binary image, the two sides of the plant leaf contour are traversed, and the plant concave point data encountered during the traversal process are extracted to obtain the contour concave point dataset; Combining the contour concave point data set and the plant leaf vertex data set, the pixel points of the plant leaf contour are extracted to obtain the plant leaf data point set. The plant leaf data point set is fitted with a quadratic curve to obtain the matrix fitting equation, which is expressed as follows: The loss function is established based on the matrix fitting equation, which is expressed as follows: The loss function is derived to obtain the fitting parameter matrix in the matrix fitting equation, which is expressed as follows: Based on the fitting parameter matrix, the intersection of the matrix fitting equation and the central axis of the plant stem is obtained to obtain the plant stem intersection point, and based on the distance between the plant stem intersection point and the intersection point data of the plant leaf and the stem, the plant stem intersection point data of the current leaf is obtained; Combining the current leaf plant stem intersection data and the plant binary image, traverse along both sides of the plant leaf to obtain first intersection data and second intersection data; Based on the first cross data and the second cross data, a quadratic fitting is performed on the matrix fitting equation to obtain a quadratic fitting equation, and based on the quadratic fitting equation, the cross parts of the plant leaves are connected to obtain complete plant leaf data; in, , , , represents the fitting parameters, represents the fitting parameter matrix, represents the abscissa matrix of the plant leaf data point set, Represents the ordinate matrix of the plant leaf data point set, The horizontal axis represents the plant leaf data. The vertical coordinate representing the plant leaf data, Indicates the number of plant leaf data. Represents the loss function.
2. The method for analyzing plant leaf phenotype data based on vision according to claim 1, characterized in that: The process of preprocessing the plant binary image to obtain a plant fitting data set includes the following steps: Extract contour points from the plant binary image to obtain a plant contour point set; Polygon fitting is performed based on the plant contour point set to obtain a plant fitting data set.
3. The method for analyzing plant leaf phenotype data based on vision according to claim 1, characterized in that: The method of obtaining a plant leaf vertex dataset and a plant concave point dataset comprises the following steps: Based on the three adjacent plant fitting data in the plant fitting data set, a triangle is formed and analyzed. If the plant fitting data located in the middle is the vertex of the triangle, the vertex angle of the triangle is obtained; If the vertex angle of the triangle is an acute angle, calculate the midpoint data of the base of the triangle, and obtain the pixel value of the corresponding point of the midpoint data of the base of the triangle in the plant binary image; If the corresponding point pixel value meets the preset threshold, it is plant leaf data, otherwise it is plant concave point data. By traversing the plant fitting data set, the plant leaf data set and the plant concave point data set are obtained; The abnormal root data in the plant leaf dataset is removed to obtain the plant leaf vertex dataset.
4. The method for analyzing plant leaf phenotype data based on vision according to claim 1, characterized in that: The method of obtaining the plant stem region comprises the following steps: Extracting the contour of the plant binary image to obtain contour data, and generating a plant contour image based on the contour data; Perform straight line detection on the plant contour image to obtain a plant straight line set, obtain the slope of the plant straight line, and obtain a plant slope set; Analyzing the plant slope set based on a preset slope threshold, extracting plant straight lines corresponding to plant slopes that meet the preset slope threshold, and obtaining a screened plant straight line set; The longest screening plant straight line in the screening plant straight line set is used as the plant baseline, and the distance between the screening plant straight line and the plant baseline is obtained to obtain a baseline distance set; If the baseline distance meets the plant stem change trend and the preset plant stem thickness threshold, the initial stem area is obtained based on the area between the screening plant straight line and the plant baseline, and then the initial stem area is extended in combination with the plant binary image to obtain the plant stem area.
5. The method for analyzing plant leaf phenotype data based on vision according to claim 1, characterized in that: The binarization process is expressed as follows: in, Represents the plant binary image at point The pixel value of , , Represents the pixel value of the plant image in the red channel, green channel, and blue channel. represents the horizontal axis, Indicates the vertical coordinate.
6. A vision-based plant leaf phenotype data analysis system, characterized in that: It includes an image binary module, an image preprocessing module, an intersection data calculation module, a plant leaf analysis module and a leaf length calculation module; The image binary module acquires the plant image and performs a binary process to obtain a plant binary image; The image preprocessing module preprocesses the plant binary image to obtain a plant fitting data set, extracts the plant fitting data set to obtain a plant leaf vertex data set and a plant concave point data set, and then obtains the number of plant leaves by obtaining the number of data in the plant leaf vertex data set; The intersection data calculation module extracts the contour of the plant binary image to obtain the plant contour image, performs detection and analysis on the plant contour image to obtain the plant stem area, and then obtains the intersection data set of the plant leaves and stems; The plant leaf analysis module determines whether there is cross occlusion between plant leaves based on the plant leaf vertex data set, the plant contour image and the intersection data set, and then obtains complete plant leaf data based on the plant concave point data set; The leaf length calculation module obtains leaf skeleton line data based on the complete plant leaf data, and obtains plant leaf length data through the leaf skeleton line data; The step of obtaining a data set of intersection points between plant leaves and stems comprises the following steps: Based on the plant stem area, data on both sides of the stem area are obtained, and the central axis of the plant stem is obtained through the data on both sides of the stem area; Based on the plant binary image and the plant stem area, the outline width of the pixel point in the plant binary image in the preset sliding window perpendicular to the central axis of the plant stem is obtained; Obtain the mean value of the contour width within the preset sliding window. If the change value of the mean value of the contour width meets the preset change threshold, obtain the intersection data set of the plant leaves and stems based on the pixel points of the corresponding plant binary image. Wherein, the plant leaf analysis module is configured as follows: Based on the leaf vertex dataset, the plant contour image and the intersection dataset of the plant leaf and stem, both sides of the plant leaf contour are traversed. If the intersection data of the plant leaf and stem is passed during the traversal process, there is no cross occlusion of the corresponding plant leaf, and then the complete plant leaf data is obtained based on the plant leaf contour; During the traversal process, if the plant concave point data is encountered before the intersection data of the plant leaf and the stem is encountered, there is cross occlusion of the corresponding plant leaf, and then the plant concave point data set is analyzed and fitted to obtain the complete plant leaf data; The analysis and fitting of the plant concave point data set to obtain complete plant leaf data includes the following steps: Based on the plant leaf vertex dataset and the plant binary image, the two sides of the plant leaf contour are traversed, and the plant concave point data encountered during the traversal process are extracted to obtain the contour concave point dataset; Combining the contour concave point data set and the plant leaf vertex data set, the pixel points of the plant leaf contour are extracted to obtain the plant leaf data point set. The plant leaf data point set is fitted with a quadratic curve to obtain the matrix fitting equation, which is expressed as follows: The loss function is established based on the matrix fitting equation, which is expressed as follows: The loss function is derived to obtain the fitting parameter matrix in the matrix fitting equation, which is expressed as follows: Based on the fitting parameter matrix, the intersection of the matrix fitting equation and the central axis of the plant stem is obtained to obtain the plant stem intersection point, and based on the distance between the plant stem intersection point and the intersection point data of the plant leaf and the stem, the plant stem intersection point data of the current leaf is obtained; Combining the current leaf plant stem intersection data and the plant binary image, traverse along both sides of the plant leaf to obtain first intersection data and second intersection data; Based on the first cross data and the second cross data, a quadratic fitting is performed on the matrix fitting equation to obtain a quadratic fitting equation, and based on the quadratic fitting equation, the cross parts of the plant leaves are connected to obtain complete plant leaf data; in, , , , represents the fitting parameters, represents the fitting parameter matrix, represents the abscissa matrix of the plant leaf data point set, Represents the ordinate matrix of the plant leaf data point set, The horizontal axis represents the plant leaf data. The vertical coordinate representing the plant leaf data, Indicates the number of plant leaf data. Represents the loss function.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
8. A device for analyzing plant leaf phenotype data based on vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
