A method and device for quantitatively measuring morphological characteristics of plant leaves
By preprocessing and rotating the two-dimensional digital images of plant leaves to establish a rectangular coordinate system, the problem of insufficient accuracy and reliability in the measurement of leaf morphological features in existing technologies is solved, and high-precision quantitative measurement is achieved.
Patent Information
- Application Number
- CN202211314075.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-10-25
AI Technical Summary
Existing quantitative measurement schemes for plant leaf morphology features suffer from poor accuracy and reliability. In particular, when dealing with leaves with deep and numerous leaf lobes or serrated edges, direct measurement methods are inaccurate and cumbersome to operate, while indirect measurement methods suffer from large errors during image acquisition, are severely affected by light and shadow and background environment, and lack quantitative description schemes.
Two-dimensional digital images of plant leaves are obtained, preprocessed to obtain binarized images, and the leaf positions are rotated and corrected to establish a target rectangular coordinate system. Quantitative measurements are then performed based on the corrected images, including the calculation of parameters for perimeter, area, leaf base, and leaf tip.
It achieves high-precision and high-reliability quantitative measurement of plant leaf morphological characteristics, simplifies the operation process, enhances applicability, and reduces the impact of the external environment on the measurement results.
Smart Images

Figure CN115719371B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer application, and relates to a plant leaf shape feature quantitative measurement method and device. In addition, the present application also relates to an electronic device and a processor readable storage medium. BACKGROUND
[0002] Plant leaf shape is an important morphological feature in the process of plant growth, and its size affects photosynthetic performance. It is an important observation index in the process of crop variety improvement and breeding. Meanwhile, plant leaf shape is also one of the important trait features for identifying plants. Specific plant species can be identified according to shape parameters such as length, width, circumference and area. In recent years, the determination technology of plant leaf area has developed rapidly, and the determination methods are more and more. The determination methods mainly include direct measurement method and indirect measurement method. The direct measurement method includes grid method, paper sample weighing method, punching weighing method, fresh weight method, leaf area meter method and the like. The indirect measurement method needs to use reference objects and various markers, and the shape description parameters can be obtained after conversion. At present, the original image of the leaf is obtained by using a smart phone, a digital camera and the like, and then the image is processed by using Photoshop, AutoCAD, Matlab and the like, so that the shape parameter data is finally obtained.
[0003] However, the direct measurement method cannot completely imitate the size of the real leaf, especially for the leaves with deep and many leaf splits or jagged edges. The contour of the leaves cannot be completely and carefully outlined, and the precision is low, for example, the grid method and the paper sample weighing method. The punching weighing method and the fresh weight method have high precision, but the operation is complicated, the leaf shape is damaged, and the efficiency is low. The leaf area meter method has acceptable precision and convenient operation, but the cost is high, and the size of the leaf is limited. In the image acquisition process of the indirect measurement method, there is a large error. The lens can only capture a two-dimensional picture. The leaves growing in the nature are affected by the growth habit, growth environment and pests and diseases, and often do not present a planar state. If the three-dimensional state is ignored, much information of the morphological features will be lost. Moreover, the distance between the lens and the leaf cannot be determined to a reasonable value, which will cause the plant leaf shape to be unable to be accurately reproduced in 1:1. In addition, the outdoor variable light and background environment will also affect the shooting. These factors will affect the measurement of the shape parameters such as the circumference, area, leaf base and leaf tip of the plant leaf in the subsequent processing process. At present, there is a lack of a quantitative description scheme, and the specific quantitative effect cannot be achieved, resulting in poor measurement precision of the leaf shape feature. Therefore, how to design a more accurate plant leaf shape feature quantitative measurement scheme becomes a technical problem to be solved. SUMMARY
[0004] To this end, the present application provides a plant leaf shape feature quantitative measurement method and device to solve the problem of high limitation of the plant leaf shape feature quantitative measurement scheme in the prior art, resulting in poor measurement accuracy and reliability.
[0005] The present application provides a plant leaf shape feature quantitative measurement method, comprising:
[0006] Obtaining a two-dimensional digital image of a plant leaf;
[0007] Pretreating the two-dimensional digital image to obtain a corresponding binary image;
[0008] Rotating and correcting the plant leaf position in the binary image to obtain a corrected binary image, and constructing a target rectangular coordinate system based on the corrected binary image; based on the corrected binary image and the rectangular coordinate system, quantitatively measuring the shape of the plant leaf to obtain corresponding shape parameters.
[0009] Further, rotating and correcting the plant leaf position in the binary image to obtain a corrected binary image, specifically comprising:
[0010] Framing the plant leaf in the binary image to determine a target rectangular frame covering the plant leaf; determining an initial rectangular coordinate system based on the coordinates of the four vertices of the target rectangular frame; determining the angle of the plant leaf deviating from the scanning frame based on the positional relationship between the initial rectangular coordinate system and the target rectangular frame; and rotating and correcting the plant leaf position in the binary image based on the angle to obtain a corrected binary image.
[0011] Further, based on the corrected binary image and the rectangular coordinate system, quantitatively measuring the shape of the plant leaf to obtain corresponding shape parameters, specifically comprising: obtaining the connected domain of the corrected binary image, and obtaining the coordinate data of the connected domain contour edge points based on the rectangular coordinate system; determining the circumference of the plant leaf according to the coordinate data of the connected domain contour edge points; and,
[0012] Counting the number of black and white pixel points in the corrected binary image, and determining the area of the plant leaf based on the ratio of the number of black and white pixel points and the relationship between the area ratio; and,
[0013] Based on the rectangular coordinate system, determining each leaf base area corresponding to the corrected binary image, and fitting the edge pixel points of the leaf base area respectively to obtain a corresponding first fitting curve; determining the leaf base extension number of each leaf base area of the plant leaf according to the first fitting curve; and,
[0014] determine each leaf tip part area corresponding to the corrected binary image based on the rectangular coordinate system, and respectively fit edge pixel points of the leaf tip part area to obtain a corresponding second fitting curve; determine a leaf base extension degree number of each leaf tip part area of the plant leaf based on the second fitting curve; and
[0015] determine a leaf base part asymmetry degree of the plant leaf based on the leaf base extension degree number of each leaf base part area.
[0016] obtain a leaf tip part asymmetry degree of the plant leaf based on the leaf base extension degree number of each leaf tip part area.
[0017] Further, the two-dimensional digital image is preprocessed to obtain a corresponding binary image, specifically including:
[0018] The two-dimensional digital image is subjected to grayscale processing to obtain a corresponding grayscale image.
[0019] The grayscale image is subjected to binary processing to obtain an initial binary image.
[0020] The initial binary image is subjected to morphological filtering image processing to obtain the binary image.
[0021] Further, the grayscale image is subjected to binary processing to obtain an initial binary image, specifically including: the grayscale image is subjected to binary processing based on a preset adaptive threshold law to obtain an initial binary image.
[0022] Further, the initial binary image is subjected to morphological filtering image processing to obtain the binary image, specifically including:
[0023] The initial binary image is divided into a foreground part and a background part according to a preset grayscale value threshold, and the edge pixel points of the divided initial binary image are subjected to expansion and corrosion processing to obtain the binary image; wherein the foreground part is a region in the initial binary image with a grayscale value greater than or equal to the grayscale value threshold; and the background part is a region in the initial binary image with a grayscale value less than the grayscale value threshold.
[0024] The application further provides a plant leaf morphological feature quantitative measurement device, including:
[0025] An image acquisition unit is configured to obtain a two-dimensional digital image of a plant leaf.
[0026] A data preprocessing unit is configured to preprocess the two-dimensional digital image to obtain a corresponding binary image.
[0027] The parameter measurement unit is configured to: perform rotation correction on the plant leaf position in the binary image to obtain a corrected binary image; and construct a target rectangular coordinate system based on the corrected binary image.
[0028] Further, the parameter measurement unit is specifically configured to:
[0029] obtain a connected domain of the corrected binary image, and obtain coordinate data of a connected domain contour edge point based on the rectangular coordinate system; determine the perimeter of the plant leaf according to the coordinate data of the connected domain contour edge point; and
[0030] count the number of black and white pixel points in the corrected binary image, and determine the area of the plant leaf based on the ratio of the number of black and white pixel points and the relationship between the ratio and the area ratio; and
[0031] determine each leaf base area corresponding to the corrected binary image based on the rectangular coordinate system, and respectively fit the edge pixel points of the leaf base area to obtain a corresponding first fitting curve; and determine the leaf base extension degree of each leaf base area of the plant leaf according to the first fitting curve; and
[0032] determine each leaf tip area corresponding to the corrected binary image based on the rectangular coordinate system, and respectively fit the edge pixel points of the leaf tip area to obtain a corresponding second fitting curve; and determine the leaf base extension degree of each leaf tip area of the plant leaf according to the second fitting curve; and
[0033] determine the leaf base asymmetry of the plant leaf based on the leaf base extension degrees of the each leaf base area; and
[0034] obtain the leaf tip asymmetry of the plant leaf based on the leaf base extension degrees of the each leaf tip area.
[0035] Further, the parameter measurement unit is specifically configured to:
[0036] frame the plant leaf in the binary image to determine a target rectangular frame covering the plant leaf; determine an initial rectangular coordinate system based on the coordinates of the four vertices of the target rectangular frame; determine the angle at which the plant leaf deviates from the scanning frame based on the positional relationship between the initial rectangular coordinate system and the target rectangular frame; and perform rotation correction on the plant leaf position in the binary image based on the angle to obtain a corrected binary image.
[0037] Further, the data preprocessing unit is specifically configured to:
[0038] graying the two-dimensional digital image to obtain a corresponding gray image;
[0039] binaryzation processing the gray image to obtain an initial binaryzation image;
[0040] morphological filter image processing the initial binaryzation image to obtain the binaryzation image.
[0041] Further, the gray image is binaryzation processed to obtain an initial binaryzation image, specifically including: based on a preset adaptive threshold law, the gray image is binaryzation processed to obtain an initial binaryzation image.
[0042] Further, the initial binaryzation image is morphological filter image processed to obtain the binaryzation image, specifically including: according to a preset gray value threshold, the initial binaryzation image is divided into a foreground part and a background part, and the edge pixel points of the divided initial binaryzation image are missing or hole expansion and corrosion processing is performed to obtain the binaryzation image; wherein the foreground part is a region in the initial binaryzation image with a gray value greater than or equal to the gray value threshold; the background part is a region in the initial binaryzation image with a gray value less than the gray value threshold.
[0043] The application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the plant leaf shape feature quantitative measurement method according to any one of the above.
[0044] The application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement the steps of the plant leaf shape feature quantitative measurement method according to any one of the above.
[0045] The plant leaf shape feature quantitative measurement method provided by the application obtains a two-dimensional digital image of a plant leaf, pre-processes the two-dimensional digital image to obtain a corresponding binaryzation image, and rotates and corrects the position of the plant leaf in the binaryzation image to obtain a corrected binaryzation image, then constructs a target rectangular coordinate system based on the corrected binaryzation image, and based on the corrected binaryzation image and the rectangular coordinate system, quantitatively measures the shape of the plant leaf to obtain corresponding shape parameters. The method is simpler and more convenient, has a wider application scenario, is more suitable, and can effectively improve the accuracy and reliability of plant leaf shape feature quantitative measurement. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0047] Figure 1 is a flowchart of the plant leaf morphological feature quantitative measurement method provided by the present application;
[0048] Figure 2 is a two-dimensional digital image of a plant leaf collected by a scanner provided by the present application;
[0049] Figure 3 is a schematic diagram of the preprocessing process for the two-dimensional digital image in the plant leaf morphological feature quantitative measurement method provided by the present application;
[0050] Figure 4 is a schematic diagram of the rotation correction of the plant leaf position in the binary image provided by the present application;
[0051] Figure 5 is a schematic diagram of the leaf base extension degree number acquisition process provided by the present application;
[0052] Figure 6 is a schematic diagram of the leaf tip extension degree number acquisition process provided by the present application;
[0053] Figure 7 is a complete flowchart of the plant leaf morphological feature quantitative measurement method provided by the present application;
[0054] Figure 8 is a structural schematic diagram of the plant leaf morphological feature quantitative measurement device provided by the present application;
[0055] Figure 9 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0057] The embodiments of the plant leaf morphological feature quantitative measurement method provided by the present application will be described in detail below. As Figure 1As shown, it is the flowchart of the plant leaf shape feature quantitative measurement method provided by the embodiment of the application, and the specific implementation process includes the following steps:
[0058] Step 101: Obtain a two-dimensional digital image of a plant leaf.
[0059] The plant leaf can be a bamboo leaf, which is not limited here. The following describes the acquisition of a two-dimensional digital image of a bamboo leaf. Specifically, a scanner can be used to collect the image of the bamboo leaf. The environment can be an indoor environment, and the background can be a black light-absorbing flocking cloth, which is wrapped on a metal sheet (such as an iron sheet) with a length of 50 cm, a width of 50 cm, and a mass of 3 kg. The iron sheet is used to press the single bamboo leaf by its own weight. On the one hand, this can avoid the influence of external light and the background environment. The selected black light-absorbing background cloth can form a sharp contrast with the color of the leaf, and the light of the scanner is not easy to reflect during the scanning process, which is beneficial to the subsequent binary processing of the bamboo leaf. On the other hand, it avoids the situation that the leaf cannot be flattened. The iron sheet is pressed to make the leaf flat and adhere to the scanning table, and the leaf plane can be completely scanned by the scanner to obtain a two-dimensional digital image. During the scanning process, the front of the leaf is placed on the scanning table, the iron sheet with black flocking cloth is placed above the leaf surface, and the scanner is started. The relevant parameters are set in the scanning parameter setting page, such as the output image type (grayscale or color), the resolution (the number of sampling or display points per inch), the scanning size (which can also be manually framed), the image format, the file saving path, and the file name. After scanning is completed, the leaf image is automatically saved to the specified folder. Figure 2 As shown, the two-dimensional digital image is obtained. The present application uses a scanner to collect the image of the bamboo leaf, and uses a black flocking cloth as a background image to avoid the influence of the external environment and the light of the scanner on the imaging of the bamboo leaf during the scanning process. The leaf does not present a two-dimensional plane state during natural growth, and the leaf will quickly lose water, deform, and shrink when it is separated from the growth environment. The iron block with a certain weight can press the leaf to make the leaf completely adhere to the scanning table, and the leaf plane can be completely scanned by the scanner to obtain a two-dimensional digital image with a proportional size, which is beneficial to the subsequent measurement and calculation of the shape parameters of the bamboo leaf and has good accuracy and reliability. The use of a mobile phone or a digital camera to collect images is affected by lens distortion, imaging focal length, shooting angle, external light, and photography technology. The image is easy to deform and distort, which has a great influence on the measurement results. At the same time, field operation also has safety hazards.
[0060] Step 102: Preprocess the two-dimensional digital image to obtain a corresponding binary image.
[0061] As shown in Figure 7As shown, in the implementation process of the present step, first, the two-dimensional digital image is subjected to grayscale processing to obtain a corresponding grayscale image; then, the grayscale image is subjected to binarization processing to obtain an initial binarization image; finally, the initial binarization image is subjected to morphological filter image processing to obtain the binarization image. The binarization processing of the grayscale image to obtain the initial binarization image corresponds to an implementation process including: binarization processing of the grayscale image based on a preset adaptive threshold law to obtain the initial binarization image. The morphological filter image processing of the initial binarization image to obtain the binarization image corresponds to an implementation process including: dividing the initial binarization image into a foreground part and a background part according to a preset grayscale value threshold, and performing dilation and corrosion processing on missing edge pixel points or holes of the divided initial binarization image to obtain the binarization image; wherein the foreground part is a region in the initial binarization image with a grayscale value greater than or equal to the grayscale value threshold; and the background part is a region in the initial binarization image with a grayscale value less than the grayscale value threshold.
[0062] The following describes the obtaining of a two-dimensional digital image of a bamboo leaf. Specifically, a scanned bamboo leaf image is taken as an object, and a preset Python programming program is used to perform grayscale processing on the object; then, binarization processing is performed on the object, and an Otsu adaptive threshold method is selected for the binarization processing. According to the value of the inter-class variance, a most suitable grayscale value threshold is found to divide the bamboo leaf image into a foreground part (with a grayscale value greater than or equal to the grayscale value threshold) and a background part (with a grayscale value less than the grayscale value threshold). In the image processing process, there may be missing edge pixel points or hole phenomena, and therefore, morphological filter image processing is further performed on the object for multiple times of dilation and corrosion processing. The morphological filter image processing method mainly aims at the missing pixel points or hole phenomena after image segmentation, has the effect of smoothing the boundary and contour, and can obtain a relatively complete and clean bamboo leaf binarization image. The bamboo leaf binarization image is specifically as shown in Figure 3 The present application adopts the Otsu adaptive threshold algorithm to perform binarization processing on the two-dimensional digital image of the bamboo leaf. Some bamboo leaf blades have patterns or uneven edges, and the adaptive threshold can ensure that the foreground and the background are completely separated, with a small misclassification probability. Meanwhile, the dilation and corrosion processing can smooth the boundary and contour, and obtain a relatively complete and clean bamboo leaf binarization image.
[0063] Step 103: performing rotation correction on the plant leaf position in the binarization image to obtain a corrected binarization image, and constructing a target rectangular coordinate system based on the corrected binarization image; performing quantitative measurement on the morphology of the plant leaf based on the corrected binarization image and the rectangular coordinate system to obtain a corresponding morphological parameter.
[0064] AsFigure 7 In the embodiment, the position of the plant leaf in the binary image is corrected in rotation, to obtain a corrected binary image, and the corresponding implementation includes: the plant leaf in the binary image is framed to determine a target rectangular frame covering the plant leaf; based on the coordinates of the four vertices of the target rectangular frame, an initial rectangular coordinate system is determined; based on the positional relationship between the initial rectangular coordinate system and the target rectangular frame, an angle at which the plant leaf deviates from the scanning frame is determined; and based on the angle, the position of the plant leaf in the binary image is corrected in rotation to obtain the corrected binary image.
[0065] Based on the corrected binary image and the rectangular coordinate system, the morphology of the plant leaf is quantitatively measured to obtain corresponding morphological parameters, and the corresponding implementation includes: the connected domain of the corrected binary image is obtained, and the coordinate data of the connected domain contour edge points are obtained based on the rectangular coordinate system; the perimeter of the plant leaf is determined according to the coordinate data of the connected domain contour edge points; the number of black and white pixel points in the corrected binary image is counted, and the area of the plant leaf is determined based on the ratio of the number of black and white pixel points and the relationship between the ratio and the area ratio; based on the rectangular coordinate system, each leaf base area corresponding to the corrected binary image is determined, and the edge pixel points of the leaf base area are fitted respectively to obtain a corresponding first fitting curve; the leaf base extension degree of each leaf base area of the plant leaf is determined according to the first fitting curve; based on the rectangular coordinate system, each leaf tip area corresponding to the corrected binary image is determined, and the edge pixel points of the leaf tip area are fitted respectively to obtain a corresponding second fitting curve; the leaf base extension degree of each leaf tip area of the plant leaf is determined according to the second fitting curve; the leaf base asymmetry of the plant leaf is determined based on the leaf base extension degrees of each leaf base area; and the leaf tip asymmetry of the plant leaf is obtained based on the leaf base extension degrees of each leaf tip area.
[0066] The plant leaf can refer to bamboo leaves and the like, which are not specifically limited herein. The following describes the obtaining of a binary image of a bamboo leaf, and the measurement and obtaining process of various parameters of the binary image of the bamboo leaf specifically include: the position of the plant leaf in the binary image is corrected in rotation, the acquisition of the perimeter of the bamboo leaf, the acquisition of the area of the bamboo leaf, the acquisition of the leaf base extension degree, the acquisition of the leaf tip contraction degree, the acquisition of the leaf base asymmetry, the acquisition of the leaf tip asymmetry, and the acquisition of the lanceolate degree of the bamboo leaf.
[0067] In the process of rotating and correcting the position of plant leaves in the binarized image: since the bamboo leaves are manually placed for scanning, the deviation angle of the bamboo leaves relative to the scanning frame cannot be precisely controlled, so it is necessary to first rotate and correct the position of the bamboo leaves. This invention utilizes a preset Python programming program to select the bamboo leaf region after binarization, obtaining the smallest rectangle that exactly covers the bamboo leaf region, i.e., the target rectangle covering the plant leaves (e.g., ...). Figure 4 As shown in the image on the left, the coordinates of the four vertices of the rectangle are a(x) and a(x). a ,y a b(x) b ,y b ), c(x) c ,y c ), d(x d ,y d ), further calculate the coordinates (x) of point O. d -x c ,y c -y d Using points c, d, and o, establish a rectangular coordinate system with o as the origin, od as the x-axis, and oc as the y-axis. and The included angle α is the angle by which the bamboo leaf deviates from the scanning frame. This angle is used to rotate and correct the position of the bamboo leaf. The four vertices a, b, c, and d of the rectangle are rotated to obtain the corresponding a'(x) angles. a' ,y a' b'(x) b' ,y b' ), c'(x c' ,y c' ), d'(x d' ,y d' Next, using the coordinates of points a', b', c', and d', determine the center point o' of the rectangle a'b'c'd'. Then, horizontally move the origin o of the original coordinate system to o' to obtain a new coordinate system, i.e., the target rectangular coordinate system (specifically as follows). Figure 4 (As shown in the image on the right).
[0068] In the process of obtaining the circumference of bamboo leaves: the connected components of the corrected binary image can be obtained using a preset Python programming program, and the coordinate data of the contour edge points can be obtained. The circumference P of the leaf can be obtained based on the point set composed of the contour edge points of the connected components and their coordinate data.
[0069] In obtaining the area of bamboo leaves: the area of bamboo leaves is calculated based on the principle that the pixel ratio equals the area ratio. Specifically, after binarization, the binarized image contains only black and white pigment points, and the number of black and white pixels (B) is counted separately. p W pCalculate the area S of the rectangle a'b'c'd'. r =(x d' -x c' ,y a' -y c' ), then the leaf area
[0070] In obtaining the lanceolate degree of bamboo leaves: Bamboo leaves with a main lanceolate shape are fitted with a minimum bounding box, and then the length L and width W of the bounding box are calculated, along with the lanceolate degree.
[0071] In obtaining the leaf base extension degree: Based on the established rectangular coordinate system, the bamboo leaf can be divided into four parts, located in the first, second, third, and fourth quadrants of the coordinate system, thus determining the corresponding leaf base regions. Regions I and II are located in the third and fourth quadrants, respectively. For example, by fitting the edge pixels of leaf base regions I and II using quadratic functions, a standardized quadratic function expression is obtained, i.e., the first fitting curve: y3=a3x 2 +b3x+c3(a3≠0),y4=a4x 2 +b4x+c4(a4≠0). Here, we use the first fitted curve of region I at the leaf base as an example. Let A(x) be the intersection of the x-axis and the left side of the rectangle. A ,y A The intersection of the y-axis and the bottom of the rectangle is B(x). B ,y B Points A and B can determine a straight line, let's call it y. AB =k AB x+b AB The quadratic function y³ = a³x 2 The slope of the curve at each point is y'3 = 2a3x + b3. There exist x-coordinates at certain points on this curve such that y'3 is perpendicular to k. AB Find a line whose values are equal to k. AB Distance between Let the point be C(x) where the x value is at its maximum. C ,y C Then use point B(x) B ,y B ) and point C(x) C ,y C Determine the straight line y BC =k BC x+b' BC ,straight line With coordinate system The angle between the directions is the leaf base extension measure θ of region I at the leaf base. I (like Figure 5(As shown), the leaf base extension number θ in region II of the leaf base. II Similarly.
[0072] In obtaining the contraction degree of the leaf tip: Based on the established rectangular coordinate system, the bamboo leaf can be divided into four parts, located in the first, second, third, and fourth quadrants of the coordinate system, thus determining the corresponding leaf tip regions. Regions I and II of the leaf tip are located in the first and second quadrants, respectively. The edge pixels of leaf tip regions I and II are then fitted using quadratic functions to obtain the standardized quadratic function analytical expression, i.e., the second fitting curve: y1=a1x 2 +b1x+c1(a1≠0), y2=a2x 2 +b²x+c² (a²≠0). For example, the second fitted curve of region I at the leaf tip is used here for illustration. Let the intersection of the x-axis and the right side of the rectangle be D(x D ,y D The intersection of the y-axis and the top of the rectangle is E(x). E ,y E Points D and E can determine a straight line, let's call it y. DE =k DE x+b DE The quadratic function y1 = a1x 2 The slope of each point +b1x+c1 is y'1=2a1x+b1, and there exist some points whose x-coordinates are such that y'1 is parallel to k. DE Find a line y'1 with k whose values are equal. DE Distance between Let the point be F(x) corresponding to the maximum value of x. F ,y F ), and then use point E(x) E ,y E ) and point F(x) F ,y F Determine the straight line y FE =k FE x+b' FE ,straight line With coordinate system The angle between the directions is the leaf tip extension degree β of zone I at the leaf tip. I (like Figure 6 As shown), the leaf tip extension β in zone II of the leaf tip. II Similarly.
[0073] In obtaining the asymmetry of the leaf base: Since some bamboo leaves growing in nature exhibit asymmetry at their bases, the leaf base extension θ obtained above is used as a reference. I θ II The leaf base asymmetry was calculated.
[0074] In the process of obtaining the asymmetry of the leaf tip: since the part of the growing bamboo leaves in nature has the asymmetry phenomenon, the asymmetry of the leaf tip is calculated by using the obtained leaf tip extension degree number β I 、β II .
[0075] The present application summarizes the morphological characteristics of bamboo leaves as circumference, area, lanceolate degree, leaf base extension degree number, leaf tip contraction degree number, leaf base asymmetry and leaf tip asymmetry from the perspective of geometry, which are quantitatively described, thereby facilitating the consultation and identification of bamboo species. That is, by establishing on the basis of computer digital image processing technology and geometry, the measurement of the circumference, area, lanceolate degree, leaf base extension degree number, leaf tip contraction degree number, leaf base asymmetry and leaf tip asymmetry of bamboo leaves can be realized, the process does not need manual data recording and calculation of measurement results, the program automatically measures according to the set function, and the measurement data is recorded in an electronic spreadsheet file which can be batch exported for analysis. The method is simple and fast, has large amount of information, is not affected by the shape, size, color, thickness of the leaf and the external environment, and has accurate measurement results and rigorous scientificity.
[0076] The plant leaf morphological characteristic quantitative measurement method provided in the embodiments of the present application obtains a two-dimensional digital image of a plant leaf, pre-processes the two-dimensional digital image to obtain a corresponding binary image, and rotates and corrects the position of the plant leaf in the binary image to obtain a corrected binary image. Then, a target rectangular coordinate system is constructed based on the corrected binary image, and the morphology of the plant leaf is quantitatively measured based on the corrected binary image and the rectangular coordinate system to obtain corresponding morphological parameters. The method is simpler and more convenient, has a wider application scenario and stronger applicability, and can effectively improve the accuracy and reliability of plant leaf morphological characteristic quantitative measurement.
[0077] Corresponding to the plant leaf morphological characteristic quantitative measurement method provided above, the present application also provides a plant leaf morphological characteristic quantitative measurement device. Since the embodiments of the device are similar to the embodiments of the above method, they are described relatively simply, and the relevant parts can be referred to the description of the method embodiments. The embodiments of the plant leaf morphological characteristic quantitative measurement device described below are only illustrative. Please refer to Figure 8 , which is a structure diagram of a plant leaf morphological characteristic quantitative measurement device provided in the embodiments of the present application.
[0078] The plant leaf morphological characteristic quantitative measurement device provided in the present application specifically comprises:
[0079] The image acquisition unit 801 is configured to obtain a two-dimensional digital image of a plant leaf.
[0080] The data preprocessing unit 802 is configured to preprocess the two-dimensional digital image to obtain a corresponding binary image.
[0081] The parameter measurement unit 803 is configured to perform rotation correction on the plant leaf position in the binary image to obtain a corrected binary image, and construct a target rectangular coordinate system based on the corrected binary image; perform quantitative measurement on the morphology of the plant leaf based on the corrected binary image and the rectangular coordinate system to obtain corresponding morphological parameters.
[0082] Further, the parameter measurement unit is specifically configured to:
[0083] obtain a connected domain of the corrected binary image, and obtain coordinate data of connected domain contour edge points based on the rectangular coordinate system, determine the circumference of the plant leaf according to the coordinate data of the connected domain contour edge points; and
[0084] count the number of black and white pixel points in the corrected binary image, determine the area of the plant leaf based on the ratio of the number of black and white pixel points and the relationship between the area ratio; and
[0085] determine each leaf base area corresponding to the corrected binary image based on the rectangular coordinate system, and respectively fit the edge pixel points of the leaf base area to obtain a corresponding first fitting curve; determine the leaf base extension degree of each leaf base area of the plant leaf according to the first fitting curve; and
[0086] determine each leaf tip area corresponding to the corrected binary image based on the rectangular coordinate system, and respectively fit the edge pixel points of the leaf tip area to obtain a corresponding second fitting curve; determine the leaf base extension degree of each leaf tip area of the plant leaf according to the second fitting curve; and
[0087] determine the leaf base asymmetry of the plant leaf based on the leaf base extension degree of each leaf base area; and
[0088] obtain the leaf tip asymmetry of the plant leaf based on the leaf base extension degree of each leaf tip area.
[0089] Further, the parameter measurement unit is specifically configured to:
[0090] Frame the plant leaves in the binary image to determine a target rectangular frame covering the plant leaves; determine an initial rectangular coordinate system based on coordinates of four vertices of the target rectangular frame; determine an angle of the plant leaves deviating from the scanning frame based on a positional relationship between the initial rectangular coordinate system and the target rectangular frame; and perform rotation correction on the plant leaves in the binary image based on the angle to obtain a corrected binary image.
[0091] Further, the data preprocessing unit is specifically configured to:
[0092] Gray-scale the two-dimensional digital image to obtain a corresponding gray-scale image.
[0093] Binaryzation process the gray-scale image to obtain an initial binary image.
[0094] Morphological filter image process the initial binary image to obtain the binary image.
[0095] Further, binaryzation process the gray-scale image to obtain an initial binary image, specifically including: binaryzation process the gray-scale image based on a preset adaptive threshold algorithm to obtain an initial binary image.
[0096] Further, morphological filter image process the initial binary image to obtain the binary image, specifically including: according to a preset gray-scale value threshold, divide the initial binary image into a foreground part and a background part, and perform dilation and corrosion processing on missing or hole edge pixel points of the divided initial binary image to obtain the binary image; wherein the foreground part is a region in the initial binary image with a gray-scale value greater than or equal to the gray-scale value threshold; and the background part is a region in the initial binary image with a gray-scale value less than the gray-scale value threshold.
[0097] The plant leaf morphological feature quantitative measurement device provided in the embodiments of the present application obtains a two-dimensional digital image of a plant leaf, pre-processes the two-dimensional digital image to obtain a corresponding binary image, performs rotation correction on the plant leaf position in the binary image, obtains a corrected binary image, then constructs a target rectangular coordinate system based on the corrected binary image, and performs quantitative measurement on the morphology of the plant leaf based on the corrected binary image and the rectangular coordinate system to obtain corresponding morphological parameters. This method is simpler and more convenient, has a wider application scenario, has stronger applicability, and can effectively improve the accuracy and reliability of quantitative measurement of plant leaf morphological features.
[0098] Corresponding to the plant leaf morphological feature quantitative measurement method provided above, the present application also provides an electronic device. Since the embodiments of the electronic device are similar to the embodiments of the above method, they are described more simply, and the relevant parts are described in the above method embodiment part. The electronic device described below is only illustrative. As shown in Figure 9 The electronic device can include a processor 901, a memory 902 and a communication bus 903. The processor 901, the memory 902 and the communication bus 903 can communicate with each other, and communicate with the outside through a communication interface 904. The processor 901 can call the logic instructions in the memory 902 to execute the plant leaf morphological feature quantitative measurement method, which includes: obtaining a two-dimensional digital image of a plant leaf; pre-processing the two-dimensional digital image to obtain a corresponding binary image; rotating and correcting the position of the plant leaf in the binary image to obtain a corrected binary image, and constructing a target rectangular coordinate system based on the corrected binary image; based on the corrected binary image and the rectangular coordinate system, quantitatively measuring the morphology of the plant leaf to obtain corresponding morphological parameters.
[0099] In addition, the logic instructions in the memory 902 described above can be implemented in the form of a software function unit and sold or used as an independent product. When used, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the technical solutions that make essential contributions to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0100] In another aspect, the present application also provides a computer program product, which comprises a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method of quantitatively measuring morphological features of a plant leaf, the method comprising: obtaining a two-dimensional digital image of a plant leaf; pre-processing the two-dimensional digital image to obtain a corresponding binary image; performing rotation correction on a position of the plant leaf in the binary image to obtain a corrected binary image, and constructing a target rectangular coordinate system based on the corrected binary image; and based on the corrected binary image and the rectangular coordinate system, quantitatively measuring a morphology of the plant leaf to obtain a morphological parameter.
[0101] In another aspect, the present application also provides a non-transitory computer-readable storage medium, which stores a computer program, the computer program being executed by a processor to implement the method of quantitatively measuring morphological features of a plant leaf, the method comprising: obtaining a two-dimensional digital image of a plant leaf; pre-processing the two-dimensional digital image to obtain a corresponding binary image; performing rotation correction on a position of the plant leaf in the binary image to obtain a corrected binary image, and constructing a target rectangular coordinate system based on the corrected binary image; and based on the corrected binary image and the rectangular coordinate system, quantitatively measuring a morphology of the plant leaf to obtain a corresponding morphological parameter.
[0102] The system embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0103] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus necessary universal hardware platforms, and of course can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0104] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for quantitatively measuring a morphological feature of a plant leaf, characterized by, The method comprises the following steps: obtaining a two-dimensional digital image of a plant leaf; preprocessing the two-dimensional digital image to obtain a corresponding binary image; rotating and correcting the position of the plant leaf in the binary image to obtain a corrected binary image, and constructing a target rectangular coordinate system based on the corrected binary image; quantitatively measuring the shape of the plant leaf based on the corrected binary image and the rectangular coordinate system to obtain corresponding shape parameters, including: obtaining the connected domain of the corrected binary image, and obtaining the coordinate data of the connected domain contour edge points based on the rectangular coordinate system, and determining the perimeter of the plant leaf according to the coordinate data of the connected domain contour edge points; and, counting the number of black and white pixel points in the corrected binary image, and determining the area of the plant leaf based on the ratio of the number of black and white pixel points and the relationship between the area ratio; and based on the rectangular coordinate system, determining each leaf base area corresponding to the corrected binary image, and fitting the edge pixel points of the leaf base area respectively to obtain a corresponding first fitting curve; according to the first fitting curve, determining the leaf base extension degree of each leaf base area of the plant leaf; and based on the rectangular coordinate system, determining each leaf tip area corresponding to the corrected binary image, and fitting the edge pixel points of the leaf tip area respectively to obtain a corresponding second fitting curve; according to the second fitting curve, determining the leaf base extension degree of each leaf tip area of the plant leaf; and based on the leaf base extension degree of each leaf base area, determining the leaf base asymmetry of the plant leaf; and based on the leaf base extension degree of each leaf tip area, obtaining the leaf tip asymmetry of the plant leaf.
2. The method of quantitatively measuring a morphological feature of a plant leaf according to claim 1, wherein The method comprises the following steps: rotating and correcting the position of the plant leaf in the binary image to obtain a corrected binary image, and constructing a target rectangular coordinate system based on the corrected binary image; 3. The method of quantitatively measuring a morphological feature of a plant leaf according to claim 1, wherein preprocessing the two-dimensional digital image to obtain a corresponding binary image, specifically including: performing grayscale processing on the two-dimensional digital image to obtain a corresponding grayscale image; performing binaryzation processing on the grayscale image to obtain an initial binary image; performing morphological filter image processing on the initial binary image to obtain the binary image.
4. The method of quantitatively measuring a morphological feature of a plant leaf according to claim 3, wherein performing binaryzation processing on the grayscale image to obtain an initial binary image, specifically including: performing binaryzation processing on the grayscale image based on a preset adaptive threshold algorithm to obtain an initial binary image.
5. The method of quantitatively measuring a morphological feature of a plant leaf according to claim 3, wherein performing morphological filter image processing on the initial binary image to obtain the binary image, specifically including: According to a preset gray value threshold, the initial binary image is divided into a foreground part and a background part, and edge pixel points of the divided initial binary image are subjected to expansion and corrosion processing to obtain the binary image; wherein the foreground part is a region in the initial binary image with a gray value greater than or equal to the gray value threshold; and the background part is a region in the initial binary image with a gray value less than the gray value threshold.
6. A device for quantitatively measuring the morphological characteristics of plant leaves, characterized in that, Comprise: An image acquisition unit configured to obtain a two-dimensional digital image of a plant leaf; A data preprocessing unit configured to preprocess the two-dimensional digital image to obtain a corresponding binary image; A parameter measurement unit configured to perform rotation correction on a plant leaf position in the binary image to obtain a corrected binary image, and construct a target rectangular coordinate system based on the corrected binary image; Based on the corrected binary image and the rectangular coordinate system, the morphology of the plant leaf is quantitatively measured to obtain corresponding morphological parameters; The parameter measurement unit is specifically configured to: Obtain a connected domain of the corrected binary image, and obtain coordinate data of connected domain contour edge points based on the rectangular coordinate system, and determine the circumference of the plant leaf according to the coordinate data of the connected domain contour edge points; In addition, Count the number of black and white pixel points in the corrected binary image, and determine the area of the plant leaf based on the ratio of the number of black and white pixel points and the relationship between the ratio and the area ratio; and Based on the rectangular coordinate system, determine each leaf base area corresponding to the corrected binary image, and respectively fit the edge pixel points of the leaf base area to obtain a corresponding first fitting curve; and determine the leaf base extension degree of each leaf base area of the plant leaf according to the first fitting curve; and Based on the rectangular coordinate system, determine each leaf tip area corresponding to the corrected binary image, and respectively fit the edge pixel points of the leaf tip area to obtain a corresponding second fitting curve; and determine the leaf base extension degree of each leaf tip area of the plant leaf according to the second fitting curve; and Based on the leaf base extension degree of each leaf base area, determine the leaf base asymmetry degree of the plant leaf; and Based on the leaf base extension degree of each leaf tip area, obtain the leaf tip asymmetry degree of the plant leaf.
7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps of the plant leaf morphology quantitative measurement method according to any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the plant leaf morphology quantitative measurement method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Plant leaf information obtaining method and plant leaf information acquisition system
CN108871235A
Blade area measurement method and system, storage medium and mobile terminal
CN109059808A