Corn plant type parameter measurement method, system, device and storage medium

The corn plants are pre-segmented and stem correction through image processing technology, combined with overall and skeleton analysis, and multiple parameters of corn plant type are calculated, solving the problem of insufficient efficiency and accuracy of corn plant type analysis in the existing technology, and achieving efficient and accurate plant type parameter measurement.

CN114170148BActive Publication Date: 2025-05-09ZHEJIANG TUOPUYUN AGRI SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111354251.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-12
Publication Date
2025-05-09
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

In the prior art, the efficiency and accuracy of corn plant type analysis are insufficient, and traditional manual measurement methods are difficult to meet the needs of modern agriculture for efficient acquisition of multi-parameter corn plant type information.

Method used

Through image processing technology, side view images of corn plants were obtained, presegmented and stem correction were performed to obtain a corrected binary map. Then, overall analysis and skeleton analysis were performed to determine the leaf path and stem path, and multiple parameters of the leaf and stem were calculated.

Benefits of technology

Systematized measurement of corn plant type parameters is realized, and multiple independent parameters for evaluating plant type from an overall and local perspective can be obtained at one time, improving the efficiency and accuracy of measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114170148B_ABST
    Figure CN114170148B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for measuring corn plant type parameters, the method comprising the following steps: obtaining a side view image of a corn plant, performing pre-segmentation processing on the image and correction processing on the corn plant stalk to obtain a corrected binary image; performing overall analysis and skeleton analysis on the corrected binary image respectively to obtain the overall parameters of the corn plant and the corn plant path; determining the point where each leaf in the corn plant is connected to the stalk and the angle between the leaf and the stalk based on the corrected binary image and the leaf path to obtain the leaf parameters and stalk parameters of the corn plant, wherein the stalk parameters include the internode distance and the thickness of the stalk. The present invention systematically measures corn plant type indicators based on image technology instead of the traditional manual measurement process, and can obtain multiple independent parameters for evaluating plant type from overall and local perspectives at one time, providing an efficient, portable and accurate means for evaluating corn plant type from different perspectives.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of plant phenotype measurement, and in particular to a method, system, device and storage medium for measuring corn plant type parameters. Background Art

[0002] In the existing technology, plant type analysis has become the basic basis for evaluating the quality of germplasm resources and selecting breeding directions in modern agricultural production. Even today when genetic breeding has become the mainstream, the screening and breeding of high-yield crop varieties still use crop plant type performance and corresponding yield performance as the final reference standard. As the world's highest-yielding food crop, corn has a huge demand for plant type analysis. Reasonable individual plant type can effectively improve the light energy interception ability of farmland corn populations, while improving the competition relationship within the population, providing the possibility of increasing group yield. The increasingly large domestic and foreign corn breeding and scientific research markets have created new requirements for the efficiency of plant type analysis. Traditional manual measurement methods can no longer meet the current needs of plant type analysis. Therefore, equipment for efficiently obtaining multi-parameter corn plant type information is urgently needed to be developed.

[0003] The existing phenotypic measurement types can be divided into large and medium-sized phenotypic platforms, laboratory phenotypic analyzers, mobile phenotypic measurement systems and portable phenotypic measurement instruments (or APPs). Some of these platforms have high costs that restrict large-scale use, some have redundant functions that make them less targeted, some are not convenient enough to affect outdoor field use, and some have different parameter measurement focuses. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides a method, system, device and storage medium for measuring corn plant type parameters.

[0005] In order to solve the above technical problems, the present invention is solved by the following technical solutions:

[0006] A method for measuring corn plant type parameters comprises the following steps:

[0007] Acquire a side view image of a corn plant, perform pre-segmentation processing on the image and perform correction processing on the stalk of the corn plant to obtain a corrected binary image;

[0008] The corrected binary image is subjected to overall analysis and skeleton analysis respectively to obtain the overall parameters of the corn plant and the corn plant path, wherein the corn plant path includes the leaf path and the stem path;

[0009] Based on the corrected binary image and the leaf path, the three points of the connection between each leaf and the stem and the angle between the leaf and the stem of the corn plant are determined to obtain the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the stem and the leaf, and the stem parameters include internode distance and the thickness of the stem.

[0010] As an implementable method, the image is pre-segmented and the corn plant stalks are corrected to obtain a corrected binary image, including the following steps:

[0011] Based on the side view image of the corn plant, the effective area containing the corn plant is obtained, and the effective area is segmented to obtain a preliminary result;

[0012] The initial segmentation result is processed by disconnecting leaves and optimizing the segmentation edges to obtain the original binary image;

[0013] Perform edge detection on the original binary image to obtain an edge map;

[0014] Perform probabilistic Hough transform on the edge graph to obtain a set of line segments;

[0015] Cluster the line segment set, and retain a number of candidate directions for each cluster based on the preset;

[0016] The best rotation direction is selected along the candidate directions through the horizontal projection histogram to obtain the corrected binary image.

[0017] As an implementable method, the overall analysis and skeleton analysis of the corrected binary image are performed respectively to obtain the overall parameters of the corn plant and the corn plant path, including the following steps:

[0018] Extracting the outermost contour of the corrected binary image to obtain convex bounding points and corresponding convex hull areas;

[0019] Based on the convex enclosing points, the circumscribed rectangle and the minimum circumscribed rectangle are obtained, and then the overall parameters of the corn plant are obtained, wherein the overall parameters include the projected area, the convex hull area, the circumscribed rectangle area, the minimum circumscribed rectangle area, the aspect ratio, the compactness, the greenness and the reference planting density.

[0020] As an implementation method, the aspect ratio is the ratio of the length to the width of the circumscribed rectangle; the compactness is the ratio of the convex hull area to the minimum circumscribed rectangle area;

[0021] The green degree represents the average value of the mask area of ​​the feature image, wherein the mask area of ​​the feature image is obtained by masking the feature image with 2*GRB and the original binary image, wherein G is the green channel image in the RBG space, R is the red channel image, and B is the green channel image;

[0022] The reference planting density is calculated by the following formula: 1 / (4*avg_w^2), wherein avg_w=(pw+cw) / 2, and pw and cw are respectively the widths of rectangles whose height is equal to the projection area and the convex hull area and whose height is the height of the circumscribed rectangle.

[0023] As an implementable method, the method of determining the connection point between each leaf and the stem of the corn plant and the angle between the leaf and the stem based on the corrected binary image and the leaf path to obtain the leaf parameters and stem parameters of the corn plant includes the following steps:

[0024] The skeleton of the rectified binary image is extracted by using a thinning algorithm to obtain a skeleton image, and then endpoints, joint points and line segments are obtained;

[0025] The characteristic value of each endpoint is calculated on the corrected binary image, including: calculating the proportion of white pixels on the four edges in a small window centered on the endpoint, and screening out leaf endpoints and non-leaf endpoints;

[0026] Construct an adjacency graph with endpoints and joint points as vertices and line segments as edges;

[0027] Obtain the preliminary leaf path from each endpoint to the joint point in the adjacency graph using the shortest path;

[0028] Based on the adjacency graph, the loop is judged and extracted to obtain the loop path. The preliminary blade path is corrected according to the preset blade interleaving model combined with the loop path to obtain the corrected blade path. The preset blade interleaving model divides the types of blade interleaving into three categories.

[0029] The stem path and path uniqueness of the corrected leaf path are determined and filtered to obtain the connection point between the leaf and the stem of the corrected leaf path, that is, the root position of the leaf.

[0030] As an implementable method, determining the connection point of each leaf with the stem and the angle between the leaf and the stem in the corn plant based on the corrected binary image and the leaf path includes the following steps:

[0031] Dividing all blade paths into a first blade path and a second blade path according to directions;

[0032] For each first blade path and second blade path, determine an upper node in the corrected binary graph;

[0033] In the corrected binary image, for each first leaf path and second leaf path, a foreground area and a valid contour surrounded by the skeleton and the contour edge are determined, and a point where the leaf and the stem are connected is determined in the valid contour;

[0034] For each leaf path, determine the three points of the angle between the leaf and the stem.

[0035] As an implementable method, the blade length is the sum of the Euclidean distances of adjacent points on the effective path portion of the blade path after smoothing and the sum of the Euclidean distances between the end of the effective path and the point where the blade connects to the stem;

[0036] The curvature of the blade is the ratio of the Euclidean distance from the tip of the blade to the point where the blade connects to the stem in the blade path to the length of the blade;

[0037] The stem-leaf angle is the supplementary angle of the angles corresponding to the three points of the leaf angle;

[0038] The internode distance is the height difference in the y direction of the points where adjacent leaves and stems are connected;

[0039] The thickness of the stem is a statistical value of the thickness of the portion between the points where adjacent leaves on the stem connect to the stem.

[0040] A corn plant type parameter measurement system, comprising an acquisition correction module, an overall analysis module and a result analysis module;

[0041] The acquisition and correction module is used to acquire a side-view image of a corn plant, perform pre-segmentation processing on the image and correction processing on the stalk of the corn plant to obtain a corrected binary image;

[0042] The overall analysis module is used to perform overall analysis and skeleton analysis on the corrected binary image to obtain overall parameters of the corn plant and a corn plant path, wherein the corn plant path includes a leaf path and a stalk path;

[0043] The result analysis module determines the three points of the connection between each leaf and the stem and the angle between the leaf and the stem of the corn plant based on the corrected binary image and the leaf path, and obtains the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the stem and the leaf, and the stem parameters include internode distance and stem thickness.

[0044] As an implementable embodiment, the image acquisition device further includes an imaging background device; the imaging background device includes a background device and a background frame, the background device is provided with a calibration object, and the background frame is a detachable and retractable background frame;

[0045] The background frame comprises a crossbar, a vertical bar and a base, and the crossbar is used for fixing the background cloth.

[0046] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented:

[0047] Acquire a side view image of a corn plant, perform pre-segmentation processing on the image and perform correction processing on the stalk of the corn plant to obtain a corrected binary image;

[0048] The corrected binary image is subjected to overall analysis and skeleton analysis respectively to obtain the overall parameters of the corn plant and the corn plant path, wherein the corn plant path includes the leaf path and the stem path;

[0049] Based on the corrected binary image and the leaf path, the three points of the connection between each leaf and the stem and the angle between the leaf and the stem of the corn plant are determined to obtain the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the stem and the leaf, and the stem parameters include internode distance and the thickness of the stem.

[0050] A corn plant type parameter measuring device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following method steps are implemented:

[0051] Acquire a side view image of a corn plant, perform pre-segmentation processing on the image and perform correction processing on the stalk of the corn plant to obtain a corrected binary image;

[0052] The corrected binary image is subjected to overall analysis and skeleton analysis respectively to obtain the overall parameters of the corn plant and the corn plant path, wherein the corn plant path includes the leaf path and the stem path;

[0053] Based on the corrected binary image and the leaf path, the three points of the connection between each leaf and the stem and the angle between the leaf and the stem of the corn plant are determined to obtain the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the stem and the leaf, and the stem parameters include internode distance and the thickness of the stem.

[0054] The present invention has significant technical effects due to the adoption of the above technical solution:

[0055] The present invention uses image technology to replace the traditional manual measurement process to systematically measure corn plant type indicators, and can obtain multiple independent parameters for evaluating plant type from overall and local perspectives at one time, providing an efficient, portable and accurate means for evaluating corn plant type from different angles. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] 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.

[0057] Figure 1 is an exemplary flow chart of a method for measuring corn plant type parameters in an embodiment of the present invention;

[0058] Figure 2 This is an exemplary structural diagram of a corn plant type parameter measurement system according to an embodiment of the present invention;

[0059] Figure 3 This is a schematic diagram of the segmentation effect of an embodiment of the present invention;

[0060] Figure 4 It is a schematic diagram of the point effect of the blade path and the connection with the stem in the present invention. DETAILED DESCRIPTION

[0061] 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.

[0062] Example 1: A method for measuring corn plant type parameters, such as Figure 1 As shown, the following steps are included:

[0063] S100, obtaining a side view image of a corn plant, performing pre-segmentation processing on the image and correction processing on the stalks of the corn plant to obtain a corrected binary image;

[0064] S200, performing overall analysis and skeleton analysis on the corrected binary image to obtain overall parameters of the corn plant and a corn plant path, wherein the corn plant path includes a leaf path and a stalk path;

[0065] S300. Based on the corrected binary image and the leaf path, determine the connection point of each leaf in the corn plant with the stem and the three points of the angle between the leaf and the stem to obtain the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the stem and the leaf, and the stem parameters include internode distance and stem thickness.

[0066] The corn plant type parameter measurement method provided by the embodiment of the present invention processes the collected image information of the corn plant to obtain the leaf path and the stalk path, fuses the skeleton information and the contour information, further determines the point where the leaf path connects with the stalk and the leaf angle, and finally obtains the overall and local phenotypic information of the corn plant. The image information of the corn plant is directly processed and analyzed, so as to realize the automation of the phenotypic measurement of the corn plant and improve the efficiency and accuracy of the phenotypic measurement of the corn plant.

[0067] Step 100 obtains a side-view image of a corn plant, performs pre-segmentation processing on the image and performs correction processing on the stalks of the corn plant to obtain a corrected binary image. After obtaining the side-view image of the corn plant, firstly design a calibration object detection algorithm to locate the calibration area, obtain a perspective transformation matrix, and correct the original image. The correction makes the calibration object area in the corrected image a regular rectangle, and saves the strip areas corresponding to the left and right sides of the calibration object in the corrected image as a new image, and scales it to a fixed width. Generally speaking, this new image is actually a cropped and corrected image. Here, the fixed width is selected as 2500 pixels. The specific value of the fixed width is not specifically limited in this embodiment of the invention.

[0068] The new image is in RGB color space. After color transformation, the Lab space image is obtained. Otsu segmentation is performed in a space and b space to obtain two binary images. The binary image determines whether color inversion is required based on the proportion of white pixels to ensure that the proportion of white is minimized, thereby ensuring that the plant part in the binary image is white. Then the two segmentation results are logically ORed to obtain the preliminary binary image Bin1. Taking the preliminary binary image Bin1 as the seed image, the new binary image Bin2 is obtained by the regional growing method. The growth condition is that 2**grb or 2*rgb meets the preset green threshold or red threshold. The former is a super green feature and the latter is a super red feature. Since the leaves of corn will have local reflection under light, in regional growth, the brightness that meets the preset brightness threshold is also considered to meet the growth conditions.

[0069] However, in actual applications, due to the shooting angle and light, the corn leaves are long and narrow. The super green and super red features of the area where the leaf width is less than five pixels in the original image will be lower than the preset threshold, and the brightness is also lower than the preset brightness threshold. Therefore, the leaves in the new binary image Bin2 may be disconnected. Then the adaptive threshold segmentation map adaptiveBin can be used to assist in solving this problem. The adaptive threshold segmentation map adaptiveBin uses the binary image obtained by the regional growing method to make the difference adaptiveBin-Bin2, which can be recorded as the difference binary image Bin3. In the difference binary image Bin3, a connected domain that meets the preset area threshold and the maximum distance threshold is found. At the same time, it is determined that the connected domain is connected to the new binary image Bin2, and all connected domains that meet the requirements are gradually added to the new binary image Bin2. In order to make the edge segmentation more accurate, the grayscale image and the distance transformation image are further combined, and each pixel of the edge part in the new binary image Bin2 is judged, and the grayscale image is smoothed by the mean value of the kernel*kernel size window to obtain a smoothed image. Only the points whose distance values ​​corresponding to the pixel points are less than the preset distance threshold are considered, and the difference between the corresponding grayscale value and the corresponding value in the smoothed image is calculated for these points. If it is greater than the set offset threshold, the corresponding pixel value in the new binary image Bin2 is set to 0. In this embodiment, the area threshold is used to describe the size of the disconnected area part, and the maximum distance threshold uses the maximum distance value in the connected domain to describe the shape of the connected domain. The setting of these two values ​​depends on the actual situation. In this embodiment, they are set to 750 and 10 respectively, and other values ​​in other embodiments are also possible. The kernel size represents the size of the selected pixel neighborhood block, and the offset threshold describes the degree of contrast between each pixel value and the surrounding pixel values. The setting of these two values ​​depends on the actual situation. In this embodiment, they are set to 15 and 10 respectively, and other values ​​in other embodiments are also possible.

[0070] Finally, the region of interest (corn plants) is extracted. Here, the connected domain with the largest overlap with the preset middle rectangular area is used, and this image is recorded as Bin4. Edge detection is performed on the binary image to obtain an edge map. Based on the edge map, a probabilistic Hough transform is performed to obtain a line segment set. The obtained line segment set is clustered according to the consistency of angle and distance, and the line segments with angles greater than the preset angle threshold are filtered to reduce the candidate line segment set. In order to narrow the search range, convex hull defect detection is performed on the contour of Bin4, and the set of concave and convex points that meet the set depth threshold is recorded. Further, the error between each cluster and the concave and convex point set is calculated, and the top three with the smallest error are selected as candidate clusters. For each cluster of the candidate clusters, the average value of the angles of all its line segments is calculated as a candidate direction. For each candidate direction, Bin4 is rotated in the opposite direction, and the best rotation direction is selected by the maximum projection value of the horizontal histogram. Bin4 is rotated in the opposite direction of this best rotation direction to obtain a corrected binary image rotatedBin. The edge detection used in this embodiment is Canny detection, and other edge detections are also possible, which will not be described in detail here. The depth threshold mentioned in this embodiment reflects the number of concave and convex points at the connection point between the leaf and the stem obtained by using the depth of the concave and convex points. The smaller the threshold, the more false concave and convex points will be introduced, and the subsequent calculation amount will increase.

[0071] In this embodiment, the best rotation direction is obtained by combining the contour information and the binary image information, so that the stalk is in an upright state, which provides a guarantee for the accuracy of the skeleton analysis of the corn plant type and the point positioning at the connection with the stalk in the later stage, thereby further preparing for improving the accuracy of the measurement of various parameters. In addition, through pre-segmentation and color-based region growth, leaf disconnection processing, edge optimization and other steps, the complete image area of ​​the corn plant type is obtained, which prepares for the later image processing of the corn plant type and the acquisition of the phenotypic information of the corn plant type.

[0072] In step S200, the corrected binary image is subjected to overall analysis and skeleton analysis respectively to obtain the overall parameters of the corn plant and the corn plant path. The overall parameters of the corn plant are obtained through overall analysis, wherein the overall parameters include projection area, convex hull area, circumscribed rectangle area, minimum circumscribed rectangle area, aspect ratio, compactness, greenness, and reference planting density.

[0073] In this step, the outermost contour is extracted on the corrected binary image through contour analysis, and the corresponding convex enclosing points are obtained by the convex hull construction algorithm; the circumscribed rectangle and the minimum circumscribed rectangle are calculated based on the convex enclosing points, and the overall parameters are further calculated, wherein the overall parameters include the projected area, convex hull area, circumscribed rectangle area, minimum circumscribed rectangle area, aspect ratio, compactness, greenness, and reference planting density.

[0074] The purpose of obtaining the corresponding convex bounding points by the convex hull construction algorithm is to reduce the subsequent parameter calculation time. The projection area is the number of foreground pixels in the rotated binary image; the convex hull area is the number of pixels in the area enclosed by the convex bounding points; the aspect ratio is the ratio of the length to the width of the calculated circumscribed rectangle; the compactness is the ratio of the convex hull area to the minimum circumscribed rectangle area; the green degree is calculated by masking the feature image 2*GRB with the original binary image, and calculating the average value of the mask area of ​​the feature image, which is a description measure of the green degree, where G is the green channel image of the RBG space, R is the red channel image, and B is the green channel image. The calculation formula for the reference planting density is 1 / (4*avg_w^2). Where avg_w=(pw+cw) / 2, pw and cw are the widths of rectangles with the height of the circumscribed rectangle as the height and the projection area and the convex hull area equal to each other.

[0075] In this embodiment, convex bounding points are obtained based on the contour information of the binary image, and a series of overall parameter calculations are obtained based on this. This solves the difficulty of manual measurement in obtaining overall parameters and improves the efficiency of phenotypic measurement of corn plant types and the extensibility of phenotypic information.

[0076] In one embodiment, skeleton analysis is performed on the corrected binary image to obtain the corn plant path of the corn plant, including the following steps: step a, using a thinning algorithm to extract the skeleton of the corrected binary image to obtain a skeleton image, and then obtain endpoints, joint points and line segments. The specific operation is: the skeleton of the corrected binary image is extracted using the thinning algorithm of Zhang-Suen to obtain a skeleton image skelImg, and the number of non-zero pixels in the eight-connected neighborhood around each pixel point is searched and counted. The pixel points with a count of 1 are endpoints, and the pixel points with a count of more than 1 are joint points. The path composed of non-zero pixels in skelImg connecting the endpoints or the joint points is a line segment, and the line segment does not pass through other endpoints or joint points. In the whole calculation process, the speed of the thinning algorithm is related to the size of the corn plant. The wider the leaf, the more time-consuming the calculation. In this embodiment, the thinning operation is performed after the binary image is reduced by 0.5 times, and then the obtained thinned image is enlarged by 2 times through nearest neighbor interpolation, and the thinning operation is performed again to obtain the skeleton image. In this step, the corn plant skeleton and end point joint point segments obtained by the thinning algorithm provide a strong basis for the subsequent leaf path acquisition and correction, thereby improving the efficiency of corn plant phenotypic measurement and the extensibility of phenotypic information.

[0077] Step b, perform eigenvalue calculation on the corrected binary graph for each endpoint, including: calculating the proportion of white pixels on the four sides in a small window centered on the endpoint, and screening out the blade endpoint and non-blade endpoint. Count the number of non-0 pixels on the four sides in the small window subWin*subWind centered on the endpoint to obtain the eigenvalue of each endpoint, which is used to screen the endpoint as a valid endpoint and an invalid endpoint. The eigenvalue is greater than the set threshold value for an invalid endpoint, otherwise it is a valid endpoint, and the corresponding blade path needs to be further judged as a true blade path according to other features. subWin is the size of the small window, and the value indicates the degree of encirclement of the small window to the tip of the leaf. The smaller the value, the tip of the leaf will fill the entire window. Therefore, the setting of the window size depends on the actual situation. In this embodiment, the window size is set to 30 pixels, and other values ​​in other embodiments are also possible, and the embodiment of the present invention is not specifically limited. The set threshold is used to filter invalid endpoints. Setting it too high will bring false leaves and increase the workload of subsequent judgment. It is set to 25 in this implementation, and other values ​​in other embodiments can also be achieved, which is not limited here.

[0078] Step c, construct an adjacency graph with endpoints and joint points as vertices and line segments as edges. In graph theory, graph G = (V, E) is a binary group, where V is a vertex, consisting of endpoints and joint points, and E is an edge connecting vertices. Here, the edge is composed of a line segment, the starting point of the line segment, the end point of the line segment, and the number of pixels on the line segment (the length of the edge). The graph is an undirected graph, that is, both endpoints of the line segment can be used as the starting point of the edge. The adjacency graph can also be constructed by using each pixel on skelImg as a vertex, and pixels with eight neighborhood connections form an edge, and the length of the edge is 1, but the method is not simple enough and the amount of calculation is relatively large. The embodiment of the present invention does not specifically limit the method for constructing the adjacency graph.

[0079] Step d, using the shortest path to obtain the preliminary leaf path from each endpoint to the joint point in the adjacency graph. In order to obtain each leaf path, the shortest path idea of ​​graph theory is used for analysis and processing. First, the root node of the corn plant is determined, and the point closest to the bottom of the stalk, that is, the point with the largest y coordinate value, is selected as the root node among the endpoints or joints. Each endpoint is used as the starting point and the root node is used as the end point. The shortest path is obtained by the shortest path algorithm, which is the preliminary leaf path from the endpoint to the root node. If the endpoint is judged to be an invalid endpoint, the corresponding leaf path is a false path. However, in actual situations, corn plants sometimes have leaf interlacing, and a leaf path error or leaf omission may occur according to the shortest path. This is because a loop path appears on the adjacency graph, and a leaf will deviate from the true trajectory according to the shortest path, or the tip of a leaf is a joint point rather than an endpoint, resulting in omission. At this time, it is necessary to adjust, correct or add a leaf path, that is, to correct or add new paths to some leaf paths according to the loop path combined with the leaf interlacing rule. Here we need to maintain an array keepB that records the validity of each joint point. When initialized, all are set to logical true, and the validity of the first joint point passed by the false path is updated to logical false.

[0080] Step e, judging and extracting the loop based on the adjacency graph, obtaining the loop path, and correcting the preliminary blade path according to the preset blade interleaving model combined with the loop path to obtain the corrected blade path, wherein the preset blade interleaving model divides the types of blade interleaving into three categories. The judgment and acquisition steps of the loop path are as follows: first set all the edges (line segments) of the adjacency graph to be logically true; set the first edge (line segment) passed by the false path to be logically false, and at the same time set all the edges (line segments) passed by the preliminary blade path to be logically false. At this time, the edges (line segments) set to be logically true are the edges (line segments) that the preliminary blade path has not passed, that is, the unused edges (line segments), and the loop exists in the path formed by these edges (line segments). Then, a new adjacency graph Gn=(Vn, En) is constructed according to step c by these unused edges (line segments) and the corresponding joint points. At the same time, the joint point set of the edges connected in Vn that are both marked as logically true and marked as logically false is recorded as Vn0, which is a subset of Vn, and these points are the starting point or end point of the loop path. On the new adjacency graph, select any two points in the set Vn0 as the starting point and the end point, and use the shortest path algorithm in Gn to obtain all possible loop paths.

[0081] In this embodiment, the blade interlacing rules include at least three types: when two leaves are interlaced, both of which have obvious leaf tips visible, and the two leaves are cross-interlaced, that is, the two parts of the same leaf are on both sides of the other leaf, this is the first leaf interlacing; when two leaves are interlaced, both of which have obvious leaf tips visible, and the two parts of the same leaf are on the same side of the other leaf, this is the second leaf interlacing; when two leaves are interlaced, one of which has no leaf tip visible, this is the third leaf interlacing. Of course, other interlacing relationships may also be included, and the embodiments of the present invention are not specifically limited thereto.

[0082] On the new adjacency graph Gn, the vertex set Vn0 is grouped according to connectivity to obtain a connected joint point set Ns0 and an independent joint point set Ns1. All joint points in each element of the set Ns0 are connected. A corn plant may have multiple rings, so the elements of the set Ns0 may be more than 1, and each element in the set Ns1 contains only one joint point.

[0083] Further judge each joint point Junc1 in the independent joint point set Ns1, and find the path that may be misjudged in the false leaf path judged in step d. First, find the other end point Junc2 of the line segment connected to the joint point Junc1 in En, and judge whether all the false leaf paths in step d pass through Junc2. If so, record the leaf path and the number of pixel points from the tip of the leaf path to the joint point Junc1. If it is greater than the preset first threshold, mark the leaf path as a valid path;

[0084] Next, for each group of joint points in the connected joint point set Ns0, a pair of valid points is determined, which are divided into the point nearestP close to the stem and the point farmostP farthest from the stem, and the corresponding path on Vn is recorded as Path; determine whether the length of Path is greater than the preset second threshold, and if so, determine the path and number of leaves passing through the point farmostP on the Path. If the number is 1, it means that this is the leaf interleaving 3, then a new path is added, and this Path and the shortest path in V with nearestP and the root node as the starting point and the end point respectively constitute a new leaf path, and at the same time the validity of the joint point farmostP is updated to logical false; if the number is 2, recorded as {PathI, PathJ}, and when the length of the overlapping part of the corresponding two leaf paths is less than or equal to the preset third threshold when they intersect, it is the leaf interleaving 1, then the path is adjusted, and the specific operation is that the path at the bottom of the leaf tip in PathI and PathJ needs to be adjusted, and the sub-path passed by nearestP and farmostP on the path needs to be replaced by Path; if the number is 2, and when the length of the overlapping part of the two leaf paths is greater than the third threshold when they intersect, it is the leaf interleaving 2, then the path is adjusted, and the specific operation is that the path at the top of the leaf tip in PathI and PathJ needs to be adjusted, and the sub-path passed by nearestP and farmostP on the path needs to be replaced by Path; if the number is greater than 3, it is a complex ring and will not be processed for the time being.

[0085] In this embodiment, the overlapping part refers to the sub-path part corresponding to the first overlapping joint point and farmostP of the two leaf paths passing through farmostP in V starting from the leaf tip, and the validity of the joint point farmostP and the first overlapping joint point are updated to logical false; wherein the second threshold and the third threshold are set according to the specific situation, and the embodiment of the present invention does not make specific limitations, and are set to 100 and 200 pixels respectively in the embodiment of the present invention.

[0086] Step f, determine the stem path and path uniqueness of the corrected blade path and judge and filter, and obtain the connection point of the blade and the stem of the corrected blade path, that is, the blade root position. Record the valid joint points that each blade path passes through, and determine that the blade path that passes through the most valid joint points is the stem path. After the effective joint points on the stem path and the stem are determined, the root node of all blades is updated to be the first connection point of the blade path and the stem path. However, there may be multiple stem paths in the process of recording, then it is necessary to further select the optimal stem path with the smallest standard deviation of the x-coordinate of the corresponding effective joint point, and determine the joint point at the top of the stem path according to the effective node frequency. Due to the fact that the adjacent blades on the same side are adhered together close to the stem part, or the shooting angle of view when the distance is close, or the situation where two blades appear due to blade damage, the multiple blade paths on the same side will have the same corresponding blade root node, so it is necessary to further perform path uniqueness judgment filtering.

[0087] Since the corrected binary image may have slight differences in different shooting conditions, in order to make the measurement results of each parameter more accurate and stable, the inclination correction fine-tuning is further performed based on the stem path. Specifically, a robust straight line fitting is performed on the path point set connected by several valid nodes near the lower end of the root of the stem path, and the rotated binary image rotatedBin is further rotated at a directed angle between the fitting straight line and the y-axis to make the stem direction consistent with the y-axis.

[0088] In this embodiment, the valid joint point refers to the joint point that is logically true in the array keepB that records the validity of the joint point.

[0089] Combining the binary image and the skeleton image and based on the shortest path idea, the initial leaf path is obtained, and the adjustment is made step by step to obtain the corrected leaf path and stalk path, which provides preparation for the next step of point positioning and angle determination at the connection between the leaf and the stalk, and provides a basis for the measurement of local parameters of corn plant type.

[0090] In one embodiment, based on the corrected binary image and the leaf path, the three points of the connection between each leaf and the stem and the angle between the leaf and the stem of the corn plant are determined to obtain the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the stem and the leaf, and the stem parameters include internode distance and thickness of the stem, including steps 1, 2, 3 and 4.

[0091] Step 1, all blade paths are divided into the first blade path and the second blade path according to the direction. For each leaf, the average value of the x-coordinates of the starting point and the ending point of the fragment of the continuous N0 pixel points close to the blade root node of its blade path is compared with the x-coordinate of the blade root node. If it is less than, it is judged as the first leaf, otherwise it is the second leaf; then the leaves on each side are sorted from large to small according to the y-coordinate of the blade root node. If the root nodes are the same, the y value of the coordinate of the highest point of the leaf is judged again, so that the blade path is divided into the left blade path and the right blade path according to the left and right directions, that is, the first blade path and the second blade path. At the same time, the first leaf is determined by the height of the root node of the first leaf on the left and right sides, and the subsequent leaf numbers are sorted in an alternating order of left and right (or right and left), so as to realize the numbering of the leaves.

[0092] Step 2. Determine the upper node for each first leaf path and second leaf path in the corrected binary image. Let the starting point and ending point of the stem path be upperPt and bottomPt respectively. The area enclosed by the stem path and the pixel point (0, upperPt.y) and the pixel point (0, bottomPt.y) is the large range on the left, and the area enclosed by the stem path and the points (w, upperPt.y) and (w, bottomPt.y) is the large range on the right, where w is the width of the new binary image. Get all the contours of rotatedBin, and record the point set after polygonal approximation of the contours that meet the preset area threshold, according to The positional relationship between each point in the point set of each contour and the large range of left and right edges is divided into a left contour point set and a right contour point set. For each left leaf path, the point whose y coordinate is smaller than the y coordinate of the root node of the leaf is closest in the left contour point set. This point is the leaf node corresponding to the leaf. Similarly, for each right leaf path, the point whose y coordinate is smaller than the y coordinate of the root node of the leaf is closest in the right contour point set. This point is the leaf node corresponding to the leaf. At this time, the determination of the upper node of each left leaf path and right leaf path on the new binary graph is completed.

[0093] Step 3: In the corrected binary image, for each first leaf path and second leaf path, the foreground area surrounded by the skeleton and the contour edge and the effective contour are determined, and the point where the leaf and the stem are connected in the effective contour. The subscript index of the leaf root node corresponding to the leaf path on the leaf path is leafrootNum1, and the total number of pixels in the leaf path is totalPixelNum1. The subscript index of the root node of the leaf closest to the current leaf number on the same side and below on its leaf path is leafrootNum0, and the total number of pixels in the corresponding leaf path is totalPixelNum0. The pixel coordinate leafPt at the subscript index leafrootNum1*0.8 of the current leaf path and the subpath corresponding to the pixel coordinate at the subscript index totalPixelNum1-(totalPixelNum0-leafrootNum0)-5 on the current leaf path, and the upper node mUpPt of the leaf below and the coordinate point (leafPt.x, (leafPt.y+mUpPt)*0.5) form a closed area closeRegion; extract the foreground area corresponding to closeRegion on rotatedBin, and find the maximum contour as the valid contour for the foreground area through contour detection. At this time, the foreground area surrounded by the skeleton and the contour edge on the binary image corresponding to the first leaf path and the second leaf path is determined. The effective contour of the foreground area records the point set of the leaf edge and the stem edge near the point where the leaf connects to the stem, which is ready for the next step of locating the point where the leaf connects to the stem.

[0094] Convex defect detection is performed on the valid contour. Each convex defect contains the subscript index of the start and end points on the contour, the subscript index of the defect point farthest from the contour convex hull, and the distance depth from the defect point to the farthest point of the contour convex hull. Among multiple convex defects, determine the most concave point with an opening facing left (right) and the corresponding start and end subscript indices. The most concave point is sometimes the point where the leaf and the stem are connected, and sometimes it deviates from the actual position of the point where the leaf and the stem are connected. Therefore, further judgment and adjustment are required, that is, it is necessary to find a candidate point set of the possible point where the leaf and the stem are connected near the most concave point. For this purpose, the points within the subscript index range of the beginning and the end of the most concave point on the effective contour are recorded as the effective point set. In the effective point set, each pixel point is further filtered and judged to remove the points that are convex points in the local area. The specific operation is: for each point, two farthest points within a preset distance are taken upward and downward respectively, and the cross product of the directed vectors from the two farthest points to the point is calculated. If it is a positive value, it is a convex point and is abandoned. Otherwise, it is recorded to obtain the candidate point set of the point where the leaf and the stem are connected. The candidate point set is sorted from large to small according to the y coordinate, and the point where the leaf and the stem are connected is determined according to the deviation constraint of the adjacent points. In this embodiment, the calculation method for the opening facing downward to the left (right) is: calculate the foot point of the perpendicular line connecting each defect point to the starting pixel point and the ending pixel point corresponding to the defect point, and judge based on the positional relationship between the defect point and the foot point of the perpendicular. For the first blade path, the contour with the foot point at the lower left of the defect point is defined as the opening facing downward to the left; for the second blade path, the contour with the foot point at the lower left of the defect point is defined as the opening facing downward to the right, so as to filter out false defect points.

[0095] The most concave point is: according to the predefined distance metric, the most concave point is found among the defect points with the opening facing left (right) and downward, and the distance describes the degree of encirclement of the point where the real leaf and stem are connected by the contour point set corresponding to the defect point or concave point. In this embodiment, the difference between the distance depth of the concave point to the contour convex hull and the x-coordinate distance between the defect point and the root node of the leaf is used. Of course, other values ​​are also feasible and are not limited here.

[0096] The deviation is defined as the difference between the vectors (Δx, Δy) of adjacent coordinate points in the sorted candidate point set. For the first blade path, the deviation is constrained to be Δx≤0 or For the second blade path, the deviation constraint is Δx ≥ 0 or Of course, other feasible calculation methods are also possible and are not limited here.

[0097] This embodiment combines the contour information of the leaf path and the binary image, locates the defect point according to the convex defect detection, determines the most concave point with the opening facing left (right) and downward, and further judges and filters the candidate point set of the point where the leaf and the stem are connected based on the most concave point and the corresponding valid point set. The candidate point set is sorted in descending order according to the y coordinate, and the point where the leaf and the stem are connected is determined according to the deviation constraint of the adjacent points. This provides a high-precision measurement basis for the calculation of local parameters of corn plants such as leaf length, curvature, internode distance, etc., and further guides the positioning calculation of the leaf angle.

[0098] Step 4, for each leaf path, determine the angle between the leaf and the stem, as well as the three points of the angle. For each point where the leaf path connects with the stem, find the contour containing the point where the leaf connects with the stem in all contours of the new rotated binary image, and then extract N continuous point sets centered on the point where the leaf connects with the stem from the matched contour; among the N point sets centered on the point where the leaf connects with the stem, find the upper fitting line and the lower fitting line of the leaf according to the straight line fitting and parallel principles, and then determine the three points of the angle between the leaf and the stem. Centered on the point where the leaf connects with the stem, take two continuous point sets upSet1 and upSet2 with different fixed lengths of offset pixels upward with different step sizes. Here, three different offset step sizes {-5, -15, -25} and two different fixed lengths L1 and L2 are selected. Robust straight line fitting is performed on each point set and the fitting error is calculated. The one with the smallest fitting error is selected from the three groups of lengths L1 and L2, and the fitting errors are recorded as mDistPtSumMini35 and mDistPtSumMini70, respectively. Then, the point set and the fitting line are selected according to whether the ratio of the former to the latter is greater than a given threshold Th1 or whether the latter is greater than a given threshold Th2, and the upper edge point of the leaf angle is determined. Similarly, the best point set and the corresponding fitting line are searched downward with the point where the leaf and the stem are connected as the center, and the lower edge point of the leaf angle is determined. The intersection of the two fitting lines is the vertex of the leaf angle, thereby determining the three points of the angle between the leaf and the stem.

[0099] Here, two different fixed lengths L1 and L2 are set according to specific circumstances, and are respectively set to 35 and 70 pixels in this embodiment; the threshold Th1 and the threshold Th2 respectively reflect the closeness of the fitting straight lines of the L1 length and L2 length point sets and the tolerance limit of the error of the L2 length fitting straight line, and are set according to specific circumstances. In this embodiment, they are respectively set to 0.4 and 18.0, and other values ​​are also feasible and are not limited here.

[0100] In this embodiment, N continuous point sets centered on the point where the leaf connects to the stem are extracted from the contour corresponding to the point where each leaf path connects to the stem, and the upper fitting straight line and the lower fitting straight line of the leaf are found according to the straight line fitting and parallel principles, thereby determining the three points of the angle between the leaf and the stem, thereby improving the accuracy and effectiveness of the local parameter measurement of the corn plant type.

[0101] Through the above embodiments, the leaf parameters and stem parameters of the corn plant are obtained. The leaf parameters include leaf length, leaf curvature, and stem-leaf angle. The stem parameters include internode spacing and stem thickness. The calculation of the leaf length is the sum of two parts, one of which is the sum of the Euclidean distances of the adjacent points on the effective path portion of the blade path after smoothing, and the other is the Euclidean distance between the end of the effective path and the point where the leaf and the stem are connected. The specific calculation method of the leaf length is designed according to the specific situation, and this embodiment does not make specific restrictions on this; the leaf curvature is the ratio of the Euclidean distance from the tip of the blade path to the point where the blade and the stem are connected to the leaf length; the stem-leaf angle is the supplementary angle of the angles corresponding to the three points of the leaf angle; the internode spacing of the stem is the absolute difference of the y coordinates of the adjacent points where the blade and the stem are connected; the stem thickness of the stem is the minimum value of the stem thickness of the adjacent points where the blade and the stem are connected.

[0102] The skeleton graph is combined with the shortest path idea to obtain the initial leaf path, and gradually judge and adjust to obtain the corrected leaf path and stem path; combined with the contour information of the binary graph, the point where the leaf and the stem are connected is located on the contour based on the leaf path, and the three angle points are determined by the contour information near the point where the leaf and the stem are connected, which ensures the accuracy and effectiveness of the local parameter measurement of the corn plant type.

[0103] Embodiment 2:

[0104] A corn plant type parameter measurement system, such as Figure 2 As shown, it includes an acquisition and correction module 100, an overall analysis module 200 and a result analysis module 300;

[0105] The acquisition and correction module 100 is used to acquire a side view image of a corn plant, perform pre-segmentation processing on the image and correction processing on the corn plant stalk to obtain a corrected binary image;

[0106] The overall analysis module 200 is used to perform overall analysis and skeleton analysis on the corrected binary image to obtain overall parameters of the corn plant and a corn plant path, wherein the corn plant path includes a leaf path and a stalk path;

[0107] The result analysis module 300 determines the point where each leaf in the corn plant is connected to the stem and the three points of the angle between the leaf and the stem based on the corrected binary image and the leaf path, and obtains the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the stem and the leaf, and the stem parameters include internode distance and stem thickness.

[0108] In one embodiment, the image acquisition device also includes an imaging background device; the imaging background device includes a background device and a background frame, the background device is provided with a calibration object, and the background frame is a detachable and retractable background frame; the background frame includes a crossbar, a vertical bar and a base, and the crossbar is used to fix the background cloth. Specifically, the imaging background device includes a background device with a calibration object and a detachable and retractable background frame. Here, the background device can be a background cloth, and the background frame includes a crossbar, a vertical bar and a base. The background cloth is fixed to the upper crossbar and the lower crossbar of the background frame so that it is flat and perpendicular to the ground; the material of the background cloth is selected to be suede, non-reflective and non-elastic; the left and right vertical bars of the background frame are chiseled with fixing holes at different heights from the ground to accommodate flower pots of different heights. The flower pots are used to hold corn plants, and the background cloth is surrounded by inlaid calibration objects. Here, the form of the calibration object is not limited, and it can be round or strip-shaped. The present embodiment uses a strip-shaped calibration object.

[0109] First, build the imaging background device. The background cloth is fixed on the upper and lower crossbars of the background frame. Keep the background cloth flat and perpendicular to the ground, and the lower crossbar has been adjusted to an appropriate height, higher than the edge of the flowerpot where the measured corn plant is located. In order to ensure that the entire corn plant is in the background during shooting, the lower crossbar also retains a certain height of background cloth. The background cloth is equipped with calibration objects for correction and scale determination of the photographed image. The measured corn plant planted in the flowerpot is placed in front of the background cloth with the largest expansion surface close to the background cloth to ensure the accuracy of the measurement. At the same time, the flowerpot is covered with black cloth to ensure the segmentation validity and integrity of the subsequent segmentation algorithm. The acquisition and correction module acquires a side view image of a corn plant, performs pre-segmentation processing on the image and correction processing on the corn plant stem to obtain a corrected binary image. The image may be acquired by a camera or a video camera, or may be other devices including a camera or a video camera for collecting image information, which is not specifically limited in the embodiment of the present invention; then the overall analysis module 200 is used to perform overall analysis and skeleton analysis on the corrected binary image respectively to obtain overall parameters of the corn plant and a corn plant path, wherein the corn plant path includes a leaf path and a stem path; the result analysis module 300 determines the point where each leaf in the corn plant is connected to the stem and the angle between the leaf and the stem based on the corrected binary image and the leaf path to obtain leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and stem-leaf angle, and the stem parameters include internode distance and stem thickness.

[0110] The system of this embodiment uses a simple imaging background device to collect images of potted corn plants placed in front of a background cloth, processes the image information, obtains the detection area, perspective transformation matrix and scale by detecting the calibration object, and obtains the corrected image; the corrected image is segmented to extract the foreground image of the corn plant, that is, the corrected binary image; further skeleton analysis is performed on the skeleton image of the corrected binary image, and on the skeleton image, based on the shortest path idea, the initial leaf path is obtained, and the correction is gradually judged and adjusted to obtain the corrected leaf path and stalk path; combined with the contour information of the corrected binary image, the point where each leaf is connected to the stalk is determined on the contour based on the leaf path, and then the three angles between each leaf and the stalk are determined; the overall parameters and local parameters are calculated, and converted to the actual size through the scale. Through the imaging background device and the image processing device, the systematic measurement of corn plant type parameters is realized, and multiple independent parameters for evaluating the plant type from the overall and local perspectives can be obtained at one time, providing an efficient, portable and accurate means for evaluating the corn plant type from different angles.

[0111] Embodiment 3:

[0112] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented:

[0113] Acquire a side view image of a corn plant, perform pre-segmentation processing on the image and perform correction processing on the stalk of the corn plant to obtain a corrected binary image;

[0114] The corrected binary image is subjected to overall analysis and skeleton analysis respectively to obtain the overall parameters of the corn plant and the corn plant path, wherein the corn plant path includes the leaf path and the stem path;

[0115] Based on the corrected binary image and the leaf path, the three points of the connection between each leaf and the stem and the angle between the leaf and the stem of the corn plant are determined to obtain the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the stem and the leaf, and the stem parameters include internode distance and the thickness of the stem.

[0116] 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.

[0117] 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.

[0118] 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.

[0119] 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.

[0120] 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 executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0121] It should be noted that:

[0122] 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.

[0123] 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 measuring corn plant type parameters, characterized in that: The following steps are involved: Acquire a side view image of a corn plant, perform pre-segmentation processing on the image and perform correction processing on the stalk of the corn plant to obtain a corrected binary image; The corrected binary image is subjected to overall analysis and skeleton analysis respectively to obtain the overall parameters of the corn plant and the path of the corn plant, and the growth parameters of the corn plant are obtained through the overall parameters, wherein the path of the corn plant includes the leaf path and the stem path; Based on the corrected binary image and the leaf path, three points including the connection point between each leaf and the stem and the angle between the leaf and the stem are determined to obtain leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include leaf length, leaf curvature and the angle between the leaf and the stem, and the stem parameters include internode distance and the thickness of the stem; The method of determining the connection point between each leaf and the stem and the angle between the leaf and the stem of the corn plant based on the corrected binary image and the leaf path to obtain the leaf parameters and stem parameters of the corn plant includes the following steps: The skeleton of the rectified binary image is extracted by using a thinning algorithm to obtain a skeleton image, and then endpoints, joint points and line segments are obtained; The characteristic value of each endpoint is calculated on the corrected binary image, including: calculating the proportion of white pixels on the four edges in a small window centered on the endpoint, and screening out leaf endpoints and non-leaf endpoints; Construct an adjacency graph with endpoints and joint points as vertices and line segments as edges; Obtain the preliminary leaf path from each endpoint to the joint point in the adjacency graph using the shortest path; Based on the adjacency graph, the loop is judged and extracted to obtain the loop path. The preliminary leaf path is corrected according to the preset leaf interleaving model combined with the loop path to obtain the corrected leaf path. The preset leaf interleaving model divides the types of leaf interleaving into three categories, namely: the first leaf interleaving, that is, the two leaves are interleaved, and the leaf tips can be clearly seen. At the same time, the two leaves are cross-interleaved, that is, the two parts of the same leaf are on both sides of the other leaf; the second leaf interleaving, that is, the two leaves are interleaved, and the leaf tips can be clearly seen, and the two parts of the same leaf are on the same side of the other leaf; the third leaf interleaving, that is, the leaf tip of one leaf cannot be seen; The stem path and path uniqueness of the corrected leaf path are determined and filtered to obtain the connection point between the leaf and the stem of the corrected leaf path, that is, the root position of the leaf.

2. The method for measuring corn plant type parameters according to claim 1, characterized in that: The image is pre-segmented and corrected to obtain a corrected binary image, comprising the following steps: Based on the side view image of the corn plant, the effective area containing the corn plant is obtained, and the effective area is segmented to obtain a preliminary result; The initial segmentation result is processed by disconnecting leaves and optimizing the segmentation edges to obtain the original binary image; Perform edge detection on the original binary image to obtain an edge map; Perform probabilistic Hough transform on the edge graph to obtain a set of line segments; Cluster the line segment set, and retain a number of candidate directions for each cluster based on the preset; The best rotation direction is selected along the candidate directions through the horizontal projection histogram to obtain the corrected binary image.

3. The method for measuring corn plant type parameters according to claim 1, characterized in that: The step of performing overall analysis and skeleton analysis on the corrected binary image to obtain overall parameters of the corn plant and the corn plant path comprises the following steps: Extracting the outermost contour of the corrected binary image to obtain convex bounding points and corresponding convex hull areas; Based on the convex bounding points, the circumscribed rectangle and the minimum circumscribed rectangle are obtained, and then the overall parameters of the corn plant are obtained, and the growth parameters are obtained through the overall parameters, wherein the overall parameters include the projection area, the convex hull area, the circumscribed rectangle area and the minimum circumscribed rectangle area, and the growth parameters are the aspect ratio, compactness, greenness and reference planting density, the aspect ratio is the ratio of the length to the width of the circumscribed rectangle; the compactness is the ratio of the convex hull area to the minimum circumscribed rectangle area.

4. The method for measuring corn plant type parameters according to claim 3, characterized in that: The green degree represents the average value of the mask area of ​​the feature image, wherein the mask area of ​​the feature image is obtained by masking the feature image with 2*GRB and the original binary image, wherein G is the green channel image in the RBG space, R is the red channel image, and B is the green channel image; The reference planting density is calculated by the following formula: 1 / (4*avg_w^2), wherein avg_w=(pw+cw) / 2, and pw and cw are respectively the widths of rectangles whose height is equal to the projection area and the convex hull area and whose circumscribed rectangle has a height equal to the projection area and the convex hull area.

5. The method for measuring corn plant type parameters according to claim 1, characterized in that: The method of determining the connection point between each leaf and the stem and the angle between the leaf and the stem in the corn plant based on the corrected binary image and the leaf path comprises the following steps: Dividing all blade paths into a first blade path and a second blade path according to directions; For each first blade path and second blade path, determine an upper node in the corrected binary graph; In the corrected binary image, based on each first leaf path and second leaf path, a foreground area and a valid contour surrounded by a skeleton and a contour edge are determined, and a point where a leaf and a stem are connected is determined in the valid contour; For each leaf path, determine the three points of the angle between the current leaf and the stem; Among them, the subscript index of the leaf root node corresponding to the leaf path on the leaf path is recorded as leafrootNum1, and the total number of pixels of the corresponding leaf path is recorded as totalPixelNum1. The subscript index of the root node of the leaf closest to the current leaf number on the same side and below is recorded as leafrootNum0, and the total number of pixels of the corresponding leaf path is recorded as totalPixelNum0; the pixel point coordinate leafPt at the subscript index leafrootNum1*0.8 of the current leaf path and the subpath corresponding to the pixel point coordinate at the subscript index totalPixelNum1-(totalPixelNum0- leafrootNum0)-5 on the current leaf path, and the upper node and coordinate point (leafPt.x, (leafPt.y+mUpPt)*0.5) of the leaf below form a closed area; the foreground area corresponding to the closed area on the rotated binary image is extracted, and the maximum contour of the foreground area is found as the valid contour through contour detection, and the foreground area is determined in the corrected binary image, and the foreground area is surrounded by the skeleton and the contour edge.

6. The method for measuring corn plant type parameters according to claim 1 or 5, characterized in that: The blade length is the sum of the Euclidean distances of adjacent points on the effective path portion of the blade path after smoothing and the sum of the Euclidean distances between the end of the effective path and the point where the blade and the stem are connected; The curvature of the blade is the ratio of the Euclidean distance from the tip of the blade to the point where the blade connects to the stem in the blade path to the length of the blade; The stem-leaf angle is the supplementary angle of the angles corresponding to the three points of the leaf angle; The internode distance is the height difference in the y direction of the points where adjacent leaves and stems are connected; The thickness of the stem is a statistical value of the thickness of the portion between the points where adjacent leaves on the stem connect to the stem.

7. A corn plant type parameter measurement system, characterized in that: It includes acquisition and correction module, overall analysis module and result analysis module; The acquisition and correction module is used to acquire a side-view image of a corn plant, perform pre-segmentation processing on the image and correction processing on the stalk of the corn plant to obtain a corrected binary image; The overall analysis module is used to perform overall analysis and skeleton analysis on the corrected binary image to obtain overall parameters of the corn plant and a corn plant path, wherein the corn plant path includes a leaf path and a stalk path; The result analysis module determines the connection point between each leaf and the stem and the angle between the leaf and the stem of each corn plant based on the corrected binary image and the leaf path, and obtains the leaf parameters and stem parameters of the corn plant, wherein the leaf parameters include the leaf length, the leaf curvature and the stem-leaf angle, and the stem parameters include the internode distance and the thickness of the stem; The method of determining the connection point between each leaf and the stem and the angle between the leaf and the stem of the corn plant based on the corrected binary image and the leaf path to obtain the leaf parameters and stem parameters of the corn plant includes the following steps: The skeleton of the rectified binary image is extracted by using a thinning algorithm to obtain a skeleton image, and then endpoints, joint points and line segments are obtained; The characteristic value of each endpoint is calculated on the corrected binary image, including: calculating the proportion of white pixels on the four edges in a small window centered on the endpoint, and screening out leaf endpoints and non-leaf endpoints; Construct an adjacency graph with endpoints and joint points as vertices and line segments as edges; Obtain the preliminary leaf path from each endpoint to the joint point in the adjacency graph using the shortest path; Based on the adjacency graph, the loop is judged and extracted to obtain the loop path. The preliminary leaf path is corrected according to the preset leaf interleaving model combined with the loop path to obtain the corrected leaf path. The preset leaf interleaving model divides the types of leaf interleaving into three categories, namely: the first leaf interleaving, that is, the two leaves are interleaved, and the leaf tips can be clearly seen. At the same time, the two leaves are cross-interleaved, that is, the two parts of the same leaf are on both sides of the other leaf; the second leaf interleaving, that is, the two leaves are interleaved, and the leaf tips can be clearly seen, and the two parts of the same leaf are on the same side of the other leaf; the third leaf interleaving, that is, the leaf tip of one leaf cannot be seen; The stem path and path uniqueness of the corrected leaf path are determined and filtered to obtain the connection point between the leaf and the stem of the corrected leaf path, that is, the root position of the leaf.

8. The corn plant type parameter measurement system according to claim 7, characterized in that: The image acquisition device also includes an imaging background device; the imaging background device includes a background device and a background frame, the background device is provided with a calibration object, and the background frame is a detachable and retractable background frame; The background frame comprises a crossbar, a vertical bar and a base, and the crossbar is used for fixing the background cloth.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method steps according to any one of claims 1 to 6 are implemented.

10. A device for measuring corn plant type parameters, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method steps according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Vegetation phenotypic structure parameter measuring method, device and system

    CN110849262A

  • Text image tilt correction method, system and device and storage medium

    CN111553344A