A leaf area measurement method based on photographing
By constructing a standardized background and processing the HSV color space, and combining the maximum inter-class variance method, the leaf area is calculated pixel by pixel, which solves the problems of shooting angle error and leaf curling, and achieves high-precision leaf area measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NINGXIA UNIVERSITY
- Filing Date
- 2023-05-15
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies struggle to effectively avoid errors introduced by the shooting angle in blade area measurement, and automated correction methods are complex and cannot account for the effects of blade curling.
A standardized leaf image acquisition background is adopted. Combining the HSV color space and the maximum inter-class variance method, the leaf area is calculated pixel by pixel by extracting the red border and the marker circle. The super green index is used to distinguish the leaf and the marker circle. The center coordinates and actual area weight of each marker circle are calculated, and the actual area of the leaf is calculated pixel by pixel.
It achieves high-precision blade area measurement at different angles and heights, with root mean square error of 0.07-0.28 cm2 and relative root mean square error of 0.55%-1.01%, demonstrating high stability and accuracy.
Smart Images

Figure CN116592796B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of plant leaf measurement methods, and more particularly to a leaf area measurement method based on photography. Background Technology
[0002] Leaf area is an important characteristic of plant growth, and its size directly affects photosynthetic efficiency, making it a crucial observation indicator in crop variety breeding. Besides manual measurement, leaf area meters are currently the primary means of measuring leaf area; however, these devices are expensive and prone to significant errors when measuring smaller leaves. In recent years, measuring leaf area using cameras has gradually become a viable method. Previous leaf measurement methods based on camera photography typically did not consider image distortion caused by the shooting angle (Guo Libiao et al., 2020; Yang Yanjie et al., 2022; Tao Ye et al., 2022; Xin Changpeng et al., 2015). However, in actual photography, it is difficult to ensure centered and horizontal shooting; therefore, the leaf area measurement methods provided in the aforementioned patents or papers cannot effectively avoid measurement errors introduced by the shooting angle.
[0003] The article "Methods to Improve the Accuracy of Plant Leaf Area Measurement [J]. Journal of Henan Agricultural University, 2002, 36(1)" addresses the problem of imaging system distortion and proposes a method of placing standard reference objects during shooting for correction. However, this correction method has a low degree of automation and requires manual placement of reference objects in different positions according to different leaf types. Furthermore, the reference object information must be manually specified during calculation. In addition, this method does not consider the curling problem of leaves in their natural form. The article "Plant Leaf Geometric Parameter Measurement System Based on OpenCV for Android Phones [J]. Chinese Agricultural Science Bulletin, 2015, 31(35)" develops a plant leaf geometric parameter measurement system based on Android phones using the OpenCV algorithm. However, this system uses the four vertices of the black frame on the measurement background paper as standard reference objects. It requires complex image processing algorithms to identify the vertices, which consumes a lot of computing power and may fail to identify them. In addition, this system only uses the coordinates of the four vertices as the basis for correction and cannot effectively consider the influence of camera nonlinear distortion. Similarly, this system does not consider the influence of leaf curling on the measurement results. Summary of the Invention
[0004] Purpose of the invention: To achieve rapid, accurate, and low-cost plant leaf measurement, this invention proposes a leaf area measurement method based on photography.
[0005] Technical solution: The present invention proposes a method for measuring leaf area based on photography, comprising the following steps:
[0006] Step 1: Construct a standardized leaf image acquisition background board; the background board includes a base plate, a white leaf measurement background board placed on the base plate, and a transparent non-reflective glass cover plate; multiple black dots are printed on the edge of the white leaf measurement background board, the black dots are marker circles, and a red frame is set outside the black dots;
[0007] Step 2: Leaf image acquisition process; Place the leaf into the leaf image acquisition background plate constructed in Step 1, close the glass cover, and take a picture of the background plate to obtain the leaf image.
[0008] Step 3: Extract objects within the bounding box: After converting the leaf image obtained in Step 2 into the HSV color space, extract the red pixels. After binarizing the leaf, perform erosion and dilation processing, extract the red border from Step 1, and extract the connected components in the leaf image to obtain the objects within the bounding box.
[0009] Step 4: Extract the leaf and marker circles: Generate a binary image from the cropped leaf image in Step 3 using the Otsu's method, and perform erosion and dilation on the binary image. Find and count the connected components in the binary image. The obtained connected components are the leaf and several marker circles. Calculate the super-green index through the connected components to distinguish between the leaf and the marker circles. Calculate the average coordinates of all pixels in each marker circle to get the center coordinates of the marker circle.
[0010] Step 5: Pixel-by-pixel leaf area calculation: First, calculate the center coordinates of each marker circle based on the center of the marker circle obtained in Step 4. Second, calculate the actual area of each pixel at each marker circle. Next, calculate the distance between each pixel of the leaf and all marker circles. Then, calculate the area weight of each marker circle. Finally, calculate the actual area of the leaf pixel by pixel.
[0011] Preferably, during the photo-taking process in step 2, the red frame should be placed in the center of the photo as much as possible, and the red frame should occupy no more than 1 / 3 of the entire photo. In addition, no red objects other than the red frame should appear within the photo area.
[0012] Preferably, in step 3, the RGB information of the image is first converted to the HSV color space. Using the red tone threshold range, the image is binarized, and the binary image is subjected to erosion and dilation processing to make the extracted red box a continuous whole. Then, the connected components in the binary image are found, and two connected components, one inside the red box and one outside the red box, are obtained. The variance of the coordinates of all pixels in the two connected components is calculated. The object with the smaller variance value is the object inside the red box, and the connected component outside the red box is assigned white. The maximum and minimum values of the coordinates of all pixels in the connected component inside the red box are further calculated, and the image is cropped based on these values.
[0013] Preferably, in step 4, the connected components in the binary image are located and counted. The obtained connected components are the leaf and the reference marker point. For each connected component, the average super-green index value of all pixels in the connected component is calculated, and the specific formula is as follows:
[0014] ExG = 2G - RB (1)
[0015] Where ExG represents the super green index value, R represents the red channel value of the image, G represents the green channel value, and B represents the blue channel value;
[0016] The super green index values calculated for each connected component are sorted. The connected component with the largest super green index value is the leaf to be tested, and the remaining connected components are the marker circles. Next, for each marker circle, the average coordinates of all pixels of the marker circle are calculated. The average coordinates are the center coordinates of the marker circle.
[0017] Preferably, the calculation method in step 5 is based on the sum of pixels extracted from each marker circle in step 4, denoted as Pi. Then, the actual value corresponding to a single pixel at each marker circle is:
[0018]
[0019] In the formula, i = 1, 2, ..., n represent n marker points, and r is the actual radius of the marker circle. Then, based on the leaf extracted in the above steps, the distance to the center of each of the n marker circles is calculated pixel by pixel. The specific calculation formula is as follows:
[0020]
[0021] In the formula, x and y are the pixel coordinates of the leaf, and a i and b i These are the center coordinates of each marker circle; based on the calculated distance, the weight W of each marker circle in the calculation of the actual area of that pixel is calculated. i The formula is as follows:
[0022]
[0023] Then, the actual area of the pixel is calculated based on the calculated weights:
[0024]
[0025] The actual area of the measured blade is obtained by accumulating the areas calculated for each pixel.
[0026] Beneficial Effects: The leaf area measurement method based on photography proposed in this invention, using the aforementioned algorithm, captured four sets of 30 photos each of four leaves with significant differences in size and shape at different angles and heights. The actual leaf area was then measured using grid paper. Statistical results show that the root mean square error of the leaf area measured from the four sets of photos is only 0.07-0.28 cm². 2 The relative root mean square error (RRMSE) was between 0.55% and 1.01%. These results demonstrate that the blade area measurement method proposed in this invention achieves high accuracy and exhibits strong stability, making it suitable for practical blade measurement work. Attached Figure Description
[0027] Figure 1 Background for leaf area measurement;
[0028] Figure 2 Leaf area measurement procedure;
[0029] Figure 3 To import the original photo;
[0030] Figure 4 The image after cropping;
[0031] Figure 5 This is the binarized image;
[0032] Figure 6 The actual area and coordinates of the extracted leaf and each marker circle single pixel;
[0033] Figure 7 This is a graph showing the results of batch measurements of blade area;
[0034] Figure 8 These are the measurement results for four sets of blades. Detailed Implementation
[0035] The present invention will be further described below with reference to the accompanying drawings and embodiments;
[0036] The present invention first constructs a background board, the specific form of which is as follows: Figure 1 As shown, it includes a white, hard, smooth plate as a base, and is arranged according to... Figure 1 The arrangement consists of 10 black dots, each 2cm in diameter, printed on the substrate. A 2mm thick pure red border is printed around each dot. A transparent, non-reflective glass cover is hinged to the plastic substrate to ensure the plant leaves are flattened during photography and to prevent glare.
[0037] Place the leaf to be measured onto the background plate, close the glass cover, and take a photo of it from above the background plate using a mobile phone. After taking the photo, transfer it to the computer and place it in a designated folder. Use measurement software developed based on the M language to automatically crop, extract, and calculate the leaf area of the photo. The overall process is as follows: Figure 2 As shown, the specific steps are as follows: (1) Enter the complete path of the blade to be measured in the text box in the upper left corner, and click the "Single Measurement" button. The original photo will be displayed in the "Single Original Photo" column on the right side of the software. Figure 3 The software then uses the rgb2hsv function to convert the photo to the HSV color space. Combining this with the HSV red threshold range, it extracts the red border to generate a binary image. The bwareaopen and imfill functions are then used to erode and fill the image. The red-framed area is assigned a value of 0, while other areas are assigned a value of 1. The bwconncomp function is used to segment the image into two parts: inside and outside the red frame. The horizontal and vertical coordinate ranges of the part inside the red frame are further calculated, and based on this, the image outside the red frame is cropped. The cropped image is displayed in the "Extract Objects Inside the Frame" section. Figure 4 ).
[0038] (2) The extracted image is converted to grayscale using the rgb2gray function, binarized using the histeq function, and then noise is removed and missing leaf or marker dots are filled using the bwareaopen and imfill functions. The result is as follows: Figure 5 As shown.
[0039] (3) Use the bwconncomp function to segment the connected regions of the image, and calculate the average super-green index value of all pixels in each of the 11 obtained connected components:
[0040] ExG = 2G - RB (1)
[0041] The supergreen index values calculated for each connected component are sorted, and the connected component with the highest supergreen index value is the leaf to be tested. Figure 6 The remaining 10 connected components form marker circles. For each marker circle, the average coordinates of all its pixels are calculated; these average coordinates are the coordinates of the marker circle's center. Figure 6 ).
[0042] (4) For each of the 10 marker circles, count the number of pixels in each circle and calculate the actual area represented by a single pixel at each marker circle. The specific calculation formula is as follows:
[0043]
[0044] In the formula P i RA represents the number of pixels of the i-th marker circle.i The actual area of a single pixel at the i-th marker circle is calculated as follows: Figure 6 As shown on the right. Then, for the leaf extracted in the above steps, the distance to the center of the 10 marker circles is calculated pixel by pixel. The specific calculation formula is as follows:
[0045]
[0046] In the formula, x and y are the coordinates of the leaf pixel, and ai and bi are the center coordinates of each reference circle, respectively. Based on the calculated distance, the weight (W) of each marker circle in the calculation of the actual area of the pixel is calculated. i The formula is as follows:
[0047]
[0048] Then, the actual area of the pixel is calculated based on the calculated weights:
[0049]
[0050] Repeat formulas (3), (4), and (5) for each pixel in the leaf to calculate the actual area of each pixel and sum them up to obtain the actual area of the measured leaf.
[0051] This embodiment also provides a batch measurement function for blade area. Figure 7 In the "Batch Leaf Measurement" module in the lower left corner of the software, enter the folder where the leaves to be measured are stored, and click "Batch Measurement". The program will automatically read all the photos in the folder and perform batch cropping, leaf and marker circle extraction, and leaf area calculation. The image name and the measured leaf area will be displayed in the "Batch Results" column of the software.
[0052] like Figure 8 As shown, four sets of 30 photos were taken of four leaves with significantly different sizes and shapes from different angles and heights using a mobile phone. The actual leaf area was then measured using grid paper. Statistical results show that the root mean square error (RMSE) of the measured leaf area in the four sets of photos is only between 0.07 and 0.28 cm², and the relative root mean square error (RRMSE) is between 0.55% and 1.01%. These results demonstrate that the leaf area measurement method proposed in this invention achieves high accuracy and the photographic results exhibit strong stability, making it suitable for practical leaf measurement work.
Claims
1. A method for measuring leaf area based on photography, characterized in that, Includes the following steps: Step 1: Construct a standardized leaf image acquisition background board; the background board includes a base plate, a white leaf measurement background board placed on the base plate, and a transparent non-reflective glass cover plate; multiple black dots are printed on the edge of the white leaf measurement background board, the black dots are marker circles, and a red frame is set outside the black dots; Step 2: Leaf image acquisition process; Place the leaf into the leaf image acquisition background plate constructed in Step 1, close the glass cover, and take a picture of the background plate to obtain the leaf image. Step 3: Extract objects within the bounding box: After converting the leaf image obtained in Step 2 into the HSV color space, extract the red pixels. After binarizing the leaf, perform erosion and dilation processing, extract the red border from Step 1, and extract the connected components in the leaf image to obtain the objects within the bounding box. Step 4: Extract the leaf and marker circles: Generate a binary image from the cropped leaf image in Step 3 using the Otsu's method, and perform erosion and dilation on the binary image. Find and count the connected components in the binary image. The obtained connected components are the leaf and several marker circles. Calculate the super-green index through the connected components to distinguish between the leaf and the marker circles. Calculate the average coordinates of all pixels in each marker circle to get the center coordinates of the marker circle. Step 5: Pixel-by-pixel leaf area calculation: First, calculate the center coordinates of each marker circle based on the center of the marker circle obtained in Step 4. Second, calculate the actual area of each pixel at each marker circle. Next, calculate the distance between each pixel of the leaf and all marker circles. Then, calculate the area weight of each marker circle. Finally, calculate the actual area of the leaf pixel by pixel.
2. The leaf area measurement method based on photography as described in claim 1, characterized in that, During step 2, the red frame should be in the center of the photo, occupying no more than 1 / 3 of the entire photo. In addition, no red objects other than those in the red frame should appear within the photo.
3. The leaf area measurement method based on photography as described in claim 1, characterized in that, Step 3 first converts the image's RGB information to the HSV color space. Using the red tone threshold range, the image is binarized, and the binary image is subjected to erosion and dilation to make the extracted red box a continuous whole. Then, the connected components in the binary image are found, and two connected components, one inside and one outside the red box, are obtained. The variance of the coordinates of all pixels in the two connected components is calculated. The object with the smaller variance value is the one inside the red box, and the connected component outside the red box is assigned white. The maximum and minimum values of the coordinates of all pixels in the connected component inside the red box are further calculated, and the image is cropped based on these values.
4. The leaf area measurement method based on photography as described in claim 3, characterized in that, In step 4, the connected components in the binary image are located and counted. The obtained connected components are the leaf and the reference marker. For each connected component, the average super-green index value of all pixels in the connected component is calculated. The specific formula is as follows: (1) Where ExG represents the super green index value, R represents the red channel value of the image, G represents the green channel value, and B represents the blue channel value; The super green index values calculated for each connected component are sorted. The connected component with the largest super green index value is the leaf to be tested, and the remaining connected components are the marker circles. Next, for each marker circle, the average coordinates of all pixels of the marker circle are calculated. The average coordinates are the center coordinates of the marker circle.
5. The leaf area measurement method based on photography according to claim 4, characterized in that, The calculation method in step 5 is based on the sum of pixels extracted from each marker circle in step 4, denoted as Pi. The actual value corresponding to a single pixel at each marker circle is then: (2) In the formula, i = 1, 2, ..., n represent n marker points, and r is the actual radius of the marker circle. Then, based on the leaf extracted in step 4, the distance to the center of the n marker circles is calculated pixel by pixel. The specific calculation formula is as follows: (3) In the formula, x and y are the pixel coordinates of the leaf, and a i and b i These are the center coordinates of each marker circle; based on the calculated distance, the weight of each marker circle in the calculation of the actual area of that pixel is calculated. The formula is as follows: (4) Then, the actual area of the pixel is calculated based on the calculated weights: (5) The actual area of the measured blade is obtained by accumulating the areas calculated for each pixel.
6. A blade area measurement system based on photography, comprising the following modules: Module 1: Constructing a standardized leaf image acquisition background board; the background board includes a base plate, a white leaf measurement background board placed on the base plate, and a transparent non-reflective glass cover plate; multiple black dots are printed on the edge of the white leaf measurement background board, the black dots are marker circles, and a red frame is set outside the black dots; Module 2: Leaf image acquisition process; Place the leaf into the leaf image acquisition background plate constructed in Module 1, close the glass cover, and take a picture of the background plate to obtain the leaf image; Module 3: Extracting objects within the bounding box: After converting the leaf image obtained in Module 2 into the HSV color space, extract the red pixels, binarize the leaf and perform erosion and dilation processing, extract the red border in Module 1, and extract the connected components in the leaf image to obtain the objects within the bounding box. Module 4: Extracting Leaves and Marker Circles: The cropped leaf images from Module 3 are used to generate a binary image using the Otsu's method. The binary image is then subjected to erosion and dilation. Connected components in the binary image are found and counted. The obtained connected components are the leaves and several marker circles. The super-green index is calculated using the connected components to distinguish between leaves and marker circles. The average coordinates of all pixels in each marker circle are calculated to obtain the center coordinates of the marker circle. Module 5: Pixel-by-pixel leaf area calculation: First, calculate the center coordinates of each marker circle based on the center of the marker circle obtained in Module 4. Second, calculate the actual area of each pixel at each marker circle. Next, calculate the distance between each pixel of the leaf and all marker circles. Then, calculate the area weight of each marker circle. Finally, calculate the actual area of the leaf pixel by pixel.
7. The image-based blade area measurement system according to claim 6, characterized in that, During the photo-taking process in Module 2, try to ensure that the red frame is in the center of the photo, and that the red frame occupies no more than 1 / 3 of the entire photo. In addition, no red objects other than those in the red frame should appear within the photo area.
8. The image-based blade area measurement system according to claim 6, characterized in that, In Module 3, the image's RGB information is first converted to the HSV color space. Using the red tone threshold range, the image is binarized, and the binary image is subjected to erosion and dilation to make the extracted red box a continuous whole. Then, the connected components in the binary image are found, and two connected components, one inside and one outside the red box, are obtained. The variance of the coordinates of all pixels in the two connected components is calculated. The object with the smaller variance value is the one inside the red box, and the connected component outside the red box is assigned white. The maximum and minimum values of the coordinates of all pixels in the connected component inside the red box are further calculated, and the image is cropped based on these values.
9. The image-based blade area measurement system according to claim 6, characterized in that, In module 4, connected components in the binary image are located and counted. The obtained connected components are the leaf and the reference marker. For each connected component, the average super-green index value of all pixels in the connected component is calculated. The specific formula is as follows: (1) Where ExG represents the super green index value, R represents the red channel value of the image, G represents the green channel value, and B represents the blue channel value; The super green index values calculated for each connected component are sorted. The connected component with the largest super green index value is the leaf to be tested, and the remaining connected components are the marker circles. Next, for each marker circle, the average coordinates of all pixels of the marker circle are calculated. The average coordinates are the center coordinates of the marker circle.
10. The image-based blade area measurement system according to claim 6, characterized in that, The calculation method in Module 5 is based on the sum of pixels extracted from each marker circle in Module 4, denoted as Pi. The actual value corresponding to a single pixel at each marker circle is then: (2) In the formula, i = 1, 2, ..., n, representing n marker points, and r is the actual radius of the marker circle. Then, based on the leaf extracted from the above module, the distance to the center of each of the n marker circles is calculated pixel-by-pixel. The specific calculation formula is as follows: (3) In the formula, x and y are the pixel coordinates of the leaf, and a i and b i These are the center coordinates of each marker circle. Based on the calculated distance, the weight of each marker circle in the calculation of the actual area of that pixel is calculated. The formula is as follows: (4) Then, the actual area of the pixel is calculated based on the calculated weights: (5) The actual area of the measured blade is obtained by accumulating the areas calculated for each pixel.