Plant Leaf Detection and Counting in a Greenhouse during Day and Nighttime Using a Raspberry Pi NoIR Camera
<p>(<b>a</b>) Greenhouse; (<b>b</b>) <span class="html-italic">Ramie</span> plant and camera installation.</p> "> Figure 2
<p>Raspberry Pi NoIR camera module.</p> "> Figure 3
<p>Images of <span class="html-italic">Ramie</span> plants taken at different times: (<b>a</b>) 03:00; (<b>b</b>) 07:00; (<b>c</b>) 10:00; (<b>d</b>) 14:30; (<b>e</b>) 16:50; (<b>f</b>) 21:00.</p> "> Figure 4
<p>Flowchart of proposed systems: (<b>a</b>) static image approach; (<b>b</b>) image sequence approach.</p> "> Figure 5
<p>(<b>a</b>) Histogram of image in <a href="#sensors-21-06659-f003" class="html-fig">Figure 3</a>c. (<b>b</b>) Histogram of image in <a href="#sensors-21-06659-f003" class="html-fig">Figure 3</a>f.</p> "> Figure 6
<p>Flowchart of the proposed leaf detection and counting method.</p> "> Figure 7
<p>Sample of image data in (<b>a</b>) Scene-1; (<b>b</b>) Scene-2; (<b>c</b>) Scene-3; (<b>d</b>) Scene-4.</p> "> Figure 8
<p>Leaf detection results: (<b>a</b>) daytime image with TP = 1, FP = 0, FN = 0; (<b>b</b>) daytime image with TP = 0.67, FP = 0.17, FN = 0.33; (<b>c</b>) nighttime image with TP = 1, FP = 0, FN = 0; (<b>d</b>) nighttime image with TP = 0.83, FP = 0, FN = 0.17.</p> "> Figure 9
<p>Recall of static image methods from four scenes.</p> "> Figure 10
<p>Precision of static image methods from four scenes.</p> "> Figure 11
<p>F1 score evaluation of static image methods from four scenes.</p> "> Figure 12
<p>Average recall, precision, and F1 scores of static image methods.</p> "> Figure 13
<p>Average recall, precision, and F1 scores of the static image and image sequence methods.</p> "> Figure 14
<p>Image datasets of <span class="html-italic">Arabidopsis thaliana</span> plants [<a href="#B12-sensors-21-06659" class="html-bibr">12</a>,<a href="#B39-sensors-21-06659" class="html-bibr">39</a>,<a href="#B40-sensors-21-06659" class="html-bibr">40</a>]: (<b>a</b>) Ara2012; (<b>b</b>) Ara2013.</p> "> Figure 15
<p>Typical leaf detection results of <span class="html-italic">Arabidopsis thaliana</span> plants: (<b>a</b>) Ara2012; (<b>b</b>) Ara2013.</p> "> Figure 16
<p>Average recall, precision, and F1 scores of Ara2012.</p> "> Figure 17
<p>Average recall, precision, and F1 scores of Ara2013.</p> "> Figure 18
<p>Position of Plant-A to Plant-G in the leaf counting experiments.</p> "> Figure 19
<p>Leaf counting results using NoIR camera: (<b>a</b>,<b>d</b>) without miscounting errors; (<b>b</b>,<b>c</b>,<b>e</b>,<b>f</b>) with miscounting errors.</p> "> Figure 19 Cont.
<p>Leaf counting results using NoIR camera: (<b>a</b>,<b>d</b>) without miscounting errors; (<b>b</b>,<b>c</b>,<b>e</b>,<b>f</b>) with miscounting errors.</p> "> Figure 20
<p>Results of DiC measurements using the NoIR camera.</p> "> Figure 21
<p>Results of ABS_DiC measurements using the NoIR camera.</p> "> Figure 22
<p>Results of DiC measurements using Ara2012.</p> "> Figure 23
<p>Results of ABS_DiC measurements using Ara2012.</p> "> Figure 24
<p>Results of DiC measurements using Ara2013.</p> "> Figure 25
<p>Results of ABS_DiC measurements using Ara2013.</p> ">
Abstract
:1. Introduction
2. Proposed Algorithm
2.1. Image Acquisition
- A low-cost Raspberry Pi NoIR camera can capture leaves in natural outdoor environments during the day and nighttime;
- The image intensity frequently changes according to the time of day;
- The colors of backgrounds (non-leaf) vary according to the lighting;
- The shadow problem occurs during the daytime (Figure 3c,d);
- Strong sunlight causes the color of the soil to become a white color, similar to the leaf color.
2.2. Overview of Proposed Algorithm
2.3. Leaf Detection and Counting
- A.
- Initialization phase:
- Create an ordered queue, where the number of simple queues equals the number of gray levels in an image f;
- Select all boundary points of the markers and put them into the ordered queue, where the gray value of the point determines its priority in the ordered queue. For instance, the marker with the gray level value of 0 is entered into the highest priority of the ordered queue, while the one with the value of 255 is entered into the lowest priority of the ordered queue.
- B.
- Working phase:
- Create an image g by labeling the markers M;
- Scan the ordered queue from the highest priority queue;
- Remove an element x from the first non-empty ordered queue;
- Find each neighbor y of x in the image g that has no label;
- Label the point y obtained in Step B.4 with the same label of x;
- Store the point y obtained in Step B.4 in the ordered list, where the gray value of point y determines its priority in the ordered queue;
- If all queues in the ordered queue are empty, stop the algorithm; otherwise, proceed to Step B.2
2.4. Performance Evaluation
3. Experimental Results
3.1. Leaf Detection Results
3.1.1. Leaf Detection Results Using the NoIR Camera
3.1.2. Leaf Detection Results Using the NoIR Camera with Static Image Method
3.1.3. Leaf Detection Results Using NoIR Camera with Image Sequence Method
3.1.4. Results of Execution Time
3.1.5. Leaf Detection Results Using Benchmark Image Datasets
3.2. Leaf Counting Results
3.2.1. Leaf Counting Results Using the NoIR Camera
3.2.2. Leaf Counting Results Using Benchmark Image Datasets
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Zhang, L.; Xu, Z.; Xu, D.; Ma, J.; Chen, Y.; Fu, Z. Growth monitoring of greenhouse lettuce based on a convolutional neural network. Hortic. Res. 2020, 7, 124. [Google Scholar] [CrossRef]
- Dash, J.; Verma, S.; Dasmunshi, S.; Nigam, S. Plant Health Monitoring System Using Raspberry Pi. Int. J. Pure Appl. Math. 2018, 119, 955–959. [Google Scholar]
- II, R.S.C.; Lauguico, S.C.; Alejandrino, J.D.; Dadios, E.P.; Sybingco, E. Lettuce Canopy Area Measurement Using Static Supervised Neural Networks Based on Numerical Image Textural Feature Analysis of Haralick and Gray Level Co-Occurrence Matrixs. J. Agric. Sci. 2020, 42, 472–486. [Google Scholar] [CrossRef]
- Hu, Y.; Wang, L.; Xiang, L.; Wu, Q.; Jiang, H. Automatic Non-Destructive Growth Measurement of Leafy Vegetables Based on Kinect. Sensors 2018, 18, 806. [Google Scholar] [CrossRef] [Green Version]
- Yeh, Y.H.F.; Lai, T.C.; Liu, T.Y.; Liu, C.C.; Chung, W.C.; Lin, T.T. An Automated Growth Measurement System for Leafy Vegetables. Biosyst. Eng. 2014, 117, 43–50. [Google Scholar] [CrossRef]
- Valle, B.; Simonneau, T.; Boulord, R.; Sourd, F.; Frisson, T.; Ryckewaert, M.; Hamard, P.; Brichet, N.; Dauzat, M.; Christophe, A. PYM: A New, Affordable, Image-Based Method Using a Raspberry Pi to Phenotype Plant Leaf Area in a Wide Diversity of Environments. Plant Methods 2017, 13, 98. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Minervini, M.; Giuffrida, M.V.; Tsaftaris, S. An Interactive Tool for Semi-Automated Leaf Annotation. In Proceedings of the Computer Vision Problems in Plant Phenotyping (CVPPP), Swansea, UK, 10 September 2015; pp. 6.1–6.13. [Google Scholar] [CrossRef] [Green Version]
- Chen, Y.; Baireddy, S.; Cai, E.; Yang, C.; Delp, E.J. Leaf Segmentation by Functional Modeling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Long Beach, CA, USA, 16–20 June 2019; pp. 2685–2694. [Google Scholar] [CrossRef]
- Khan, R.; Debnath, R. Segmentation of Single and Overlapping Leaves by Extracting Appropriate Contours. In Proceedings of the 6th International Conference on Computer Science, Engineering and Information Technology (CSEIT-2019), Zurich, Switzerland, 23–24 November 2019; pp. 287–300. [Google Scholar] [CrossRef]
- Shantkumari, M.; Uma, S.V. Grape Leaf Segmentation for Disease Identification through Adaptive Snake Algorithm Model. Multimed. Tools Appl. 2021, 80, 8861–8879. [Google Scholar] [CrossRef]
- Praveen Kumar, J.; Domnic, S. Image Based Leaf Segmentation and Counting in Rosette Plants. Inf. Process. Agric. 2019, 6, 233–246. [Google Scholar] [CrossRef]
- Scharr, H.; Minervini, M.; French, A.P.; Klukas, C.; Kramer, D.M.; Liu, X.; Luengo, I.; Pape, J.M.; Polder, G.; Vukadinovic, D.; et al. Leaf Segmentation in Plant Phenotyping: A Collation Study. Mach. Vis. Appl. 2016, 27, 585–606. [Google Scholar] [CrossRef] [Green Version]
- Hu, J.; Chen, Z.; Zhang, R.; Yang, M.; Zhang, S. Robust Random Walk for Leaf Segmentation. IET Image Process. 2020, 14, 1180–1186. [Google Scholar] [CrossRef]
- Chen, Y.; Ribera, J.; Boomsma, C.; Delp, E.J. Plant Leaf Segmentation for Estimating Phenotypic Traits. In Proceedings of the 2017 IEEE International Conference on Image Processing (ICIP), Beijing, China, 17–20 September 2017; pp. 3884–3888. [Google Scholar] [CrossRef]
- Pereira, C.S.; Morais, R.; Reis, M.J.C.S. Pixel-Based Leaf Segmentation from Natural Vineyard Images Using Color Model and Threshold Techniques. In Image Analysis and Recognition; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2018; Volume 10882 LNCS, pp. 96–106. [Google Scholar] [CrossRef]
- Anantrasirichai, N.; Hannuna, S.; Canagarajah, N. Automatic Leaf Extraction from Outdoor Images. arXiv 2017, arXiv:1709.06437. [Google Scholar]
- Niu, C.; Li, H.; Niu, Y.; Zhou, Z.; Bu, Y.; Niu, C.; Li, H.; Niu, Y.; Zhou, Z.; Bu, Y.; et al. Segmentation of Cotton Leaves Based on Improved Watershed Algorithm. In Proceedings of the Computer and Computing Technologies in Agriculture IX; Li, D., Li, Z., Eds.; Springer International Publishing: Cham, Switzerland, 2016; pp. 425–436. [Google Scholar] [CrossRef] [Green Version]
- Ci, D.; Cui, S.; Liang, F. Research of Statistical Method for the Number of Leaves in Plant Growth Cabinet. MATEC Web Conf. 2015, 31, 5–8. [Google Scholar] [CrossRef]
- Buoncompagni, S.; Maio, D.; Lepetit, V. Leaf Segmentation under Loosely Controlled Conditions. In Proceedings of the British Machine Vision Conference (BMVC), Swansea, UK, 7–10 September 2015; pp. 133.1–133.12. [Google Scholar] [CrossRef] [Green Version]
- Yang, K.; Zhong, W.; Li, F. Leaf Segmentation and Classification with a Complicated Background Using Deep Learning. Agronomy 2020, 10, 1721. [Google Scholar] [CrossRef]
- Xia, C.; Lee, J.M.; Li, Y.; Song, Y.H.; Chung, B.K.; Chon, T.S. Plant Leaf Detection Using Modified Active Shape Models. Biosyst. Eng. 2013, 116, 23–35. [Google Scholar] [CrossRef]
- Kumar, J.P.; Dominic, S. Rosette plant segmentation with leaf count using orthogonal transform and deep convolutional neural network. Mach. Vis. Appl. 2020, 31, 6. [Google Scholar] [CrossRef]
- Giuffrida, M.V.; Doerner, P.; Tsaftaris, S.A. Pheno-Deep Counter: A unified and versatile deep learning architecture for leaf counting. Plant J. 2018, 96, 880–890. [Google Scholar] [CrossRef] [Green Version]
- Buzzy, M.; Thesma, V.; Davoodi, M.; Velni, J.M. Real-Time Plant Leaf Counting Using Deep Object Detection Networks. Sensors 2020, 20, 6896. [Google Scholar] [CrossRef]
- Vukadinovic, D.; Polder, G. Watershed and Supervised Classification Based Fully Automated Method for Separate Leaf Segmentation. In Proceedings of the The Netherlands conference on computer vision (NCCV), Lunteren, The Netherland, 14–15 September 2015; pp. 1–2. [Google Scholar]
- Valente, J.; Giuffrida, M.V. Leaf Counting from Uncontrolled Acquired Images from Greenhouse Workers. In Proceedings of the Computer Vision Problems in Plant Phenotyping (CVPPP 2019), Long Beach, CA, USA, 17 June 2019. [Google Scholar]
- Rother, C.; Kolmogorov, V.; Blake, A. GrabCut—Interactive Foreground Extraction Using Iterated Graph Cuts. In ACM SIGGRAPH 2004 Papers; SIGGRAPH 2004; ACM: New York, NY, USA, 2004; Volume 23, pp. 309–314. [Google Scholar] [CrossRef]
- Grady, L. Random Walks for Image Segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2006, 28, 1768–1783. [Google Scholar] [CrossRef] [Green Version]
- What is motionEyeOS? Available online: https://github.com/ccrisan/motioneyeos/wiki (accessed on 20 April 2021).
- Bt, R.I.; Broadcasting, B.T.S. Studio Encoding Parameters of Digital Television for Standard 4:3 and Wide-Screen 16:9 Aspect Ratios BT Series Broadcasting Service; ITU: Geneva, Switzerland, 2017; Volume 7. [Google Scholar]
- Otsu, N. A Threshold Selection Method from Gray-Level Histograms. IEEE Trans. Syst. Man. Cybern. 1979, 9, 62–66. [Google Scholar] [CrossRef] [Green Version]
- Liao, P.S.; Chen, T.S.; Chung, P.C. A Fast Algorithm for Multilevel Thresholding. J. Inf. Sci. Eng. 2001, 17, 713–727. [Google Scholar] [CrossRef]
- Huang, D.-Y.; Lin, T.-W.; Hu, W.-C. Automatic Multilevel Thresholding Based on Two-Stage Otsu’s Method with Cluster Determination by Valley Estimation. Int. J. Innov. Comput. Inf. Control 2011, 7, 5631–5644. [Google Scholar]
- Ruesch, A. Visual Pattern Recognition by Moment Invariants. IRE Trans. Inf. Theory 1962, 8, 179–187. [Google Scholar] [CrossRef] [Green Version]
- Beucher, S. The Watershed Transformation Applied to Image Segmentation. Scanning Microsc. 1992, 1992, 299–314. [Google Scholar]
- Beucher, S.; Meyer, F. The Morphological Approach to Segmentation: The Watershed Transformation. Math. Morphol. Image Process. 2019, 433–481. [Google Scholar] [CrossRef]
- Kornilov, A.S.; Safonov, I.V. An Overview of Watershed Algorithm Implementations in Open Source Libraries. J. Imaging 2018, 4, 123. [Google Scholar] [CrossRef] [Green Version]
- Bailey, D.G. An Efficient Euclidean Distance Transform. In International Workshop on Combinatorial Image Analysis; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2004; Volume 3322, pp. 394–408. [Google Scholar] [CrossRef] [Green Version]
- Minervini, M.; Fischbach, A.; Scharr, H.; Tsaftaris, S.A. Finely-Grained Annotated Datasets for Image-Based Plant Phenotyping. Pattern Recognit. Lett. 2016, 81, 80–89. [Google Scholar] [CrossRef] [Green Version]
- Minervini, M.; Fischbach, A.; Scharr, H.; Tsaftaris, S.A. Plant Phenotyping Datasets. Available online: http://www.plant-phenotyping.org/datasets (accessed on 23 September 2021).
Ref. | Algorithm | Implementation | Type of Images | Lighting Condition of Images | Purpose |
---|---|---|---|---|---|
[3] | CIELAB color thresholding | PC—MATLAB | Visible images | Indoor | LD |
[4] | HSI color segmentation | PC—C++ | Visible images | Indoor | LD |
[5] | GrabCut | PC—OpenCV | Visible images | Indoor | LD |
[6] | New channel color segmentation | Raspberry Pi—OpenCV | Visible and NoIR images | Outdoor | LD |
[7] | Random walker | PC—MATLAB | Visible images | Outdoor | LC |
[8] | Shape-based segmentation | PC—NA | Visible images | Outdoor | LD |
[9] | Contour edges detection | PC—OpenCV | Visible images | Outdoor | LD |
[10] | Active snake model | PC—MATLAB | Visible images | Outdoor | LD |
[11] | Graph, CHT | PC—MATLAB | Visible image | Outdoor | LD, LC |
[12] | 3D histogram, SLIC, watershed | PC—MATLAB | Visible images | Indoor | LD, LC |
[13] | Random walker | PC—NA | Visible images | Outdoor | LD |
[14] | HSV color thresholding | PC—NA | Visible images | Outdoor | LD |
[15] | CIELAB color thresholding | PC—MATLAB | Visible images | Outdoor | LD |
[16] | Watershed, GrabCut | PC—NA | Visible images | Outdoor | LD |
[17] | Watershed | PC—MATLAB | Visible images | Indoor (with window) | LC |
[18] | Watershed | PC—MATLAB | Visible images | Indoor | LC |
[19] | Expectation-maximization | PC—MATLAB | Visible image | Outdoor | LD |
[20] | Mask R-CNN | PC—NA | Visible images | Outdoor | LD |
[21] | MLP-ASM | PC—MATLAB | Visible images | Outdoor | LD |
[22] | Orthogonal transform, DCNN | PC—MATLAB | Visible images | Outdoor | LD, LC |
[23] | DNN | PC—Keras | Visible, NIR, fluorescent images | Outdoor | LC |
[24] | DNN | PC, Android device—OpenCV | Visible images | Indoor | LC |
[25] | NN, watershed | PC—NA | Visible images | Outdoor | LD, LC |
[26] | DNN | PC—NA | Visible images | Outdoor | LC |
Method | Description |
---|---|
M1 | Bi-level Otsu thresholding (Single threshold) |
M2 | Three-level Otsu thresholding (Two thresholds) |
M3 | Four-level Otsu thresholding (Three thresholds) |
M4 | Bi-level + three-level Otsu thresholding (M1 + M2) |
M5 | Bi-level + four-level Otsu thresholding (M1 + M3) |
M6 | Three-level + four-level Otsu thresholding (M2 + M3) |
M4_SQ | M4 with the sequence of images |
M5_SQ | M5 with the sequence of images |
SLIC | SLIC method proposed by [12] |
Method | Execution Time (ms) |
---|---|
M1 | 275.76 |
M2 | 302.79 |
M3 | 1247.63 |
M4 | 551.00 |
M5 | 1500.15 |
M6 | 1498.92 |
M4_SQ | 516.30 |
M5_SQ | 1408.07 |
SLIC | 16,116.11 |
Method (Ref.) | FBD * (%) | |
---|---|---|
Ara2012 | Ara2013 | |
[11] | 96.2 (1.9) | 96.2 (2.4) |
[12]-IPK | 97.0 (0.8) | 96.3 (1.7) |
[12]-Nottingham | 95.3 (1.1) | 93.0 (4.2) |
[12]-MSU | 94.0 (1.9) | 87.7 (3.6) |
[12]-Wageningen | 94.7 (1.5) | 95.1 (2.0) |
[22] | 95.5 (2.3) | 96.3 (2.4) |
Proposed | 93.7 (2.0) | 96.2 (1.7) |
Number of Leaves | |||||||
---|---|---|---|---|---|---|---|
Scene | Plant-A | Plant-B | Plant-C | Plant-D | Plant-E | Plant-F | Plant-G |
Scene-1 | 5 | 8 | 6 | NA * | NA * | NA * | NA * |
Scene-2 | 6 | 8 | 7 | 6 | 6 | NA * | NA * |
Scene-3 | 6 | 8 | 8 | NA * | 6 | 6 | NA * |
Scene-4 | 8 | 8 | 8 | 7 | 6 | NA * | 7 |
Method (Ref.) | Ara2012 | Ara2013 | NoIR | |||
---|---|---|---|---|---|---|
DiC * | ABS_DiC * | DiC * | ABS_DiC * | DiC * | ABS_DiC * | |
[11] | −0.9 (2.5) | 2.0 (1.8) | 1.2 (5.9) | 3.8 (4.7) | NA | NA |
[12]-IPK | −1.8 (1.8) | 2.2 (1.3) | −1.0 (1.5) | 1.2 (1.3) | NA | NA |
[12]-Nottingham | −3.5 (2.4) | 3.8 (1.9) | −1.9 (1.7) | 1.9 (1.7) | NA | NA |
[12]-MSU | −2.5 (1.5) | 2.5 (1.5) | −2.0 (1.5) | 2.0 (1.5) | NA | NA |
[12]-Wageningen | 1.3 (2.4) | 2.2 (1.6) | −0.2 (0.7) | 0.4 (0.5) | NA | NA |
[22] | 0.12 (0.78) | 0.55 (0.56) | −0.22 (1.56) | 1.11 (1.05) | NA | NA |
[23] | −0.39 (1.17) | 0.88 (0.86) | −0.78 (1.64) | 1.44 (1.01) | NA | NA |
Proposed | 1.67 (2.46) | 3.11 (1.33) | 1.52 (2.29) | 2.68 (1.49) | 2.02 (1.27) | 2.23 (0.93) |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Soetedjo, A.; Hendriarianti, E. Plant Leaf Detection and Counting in a Greenhouse during Day and Nighttime Using a Raspberry Pi NoIR Camera. Sensors 2021, 21, 6659. https://doi.org/10.3390/s21196659
Soetedjo A, Hendriarianti E. Plant Leaf Detection and Counting in a Greenhouse during Day and Nighttime Using a Raspberry Pi NoIR Camera. Sensors. 2021; 21(19):6659. https://doi.org/10.3390/s21196659
Chicago/Turabian StyleSoetedjo, Aryuanto, and Evy Hendriarianti. 2021. "Plant Leaf Detection and Counting in a Greenhouse during Day and Nighttime Using a Raspberry Pi NoIR Camera" Sensors 21, no. 19: 6659. https://doi.org/10.3390/s21196659
APA StyleSoetedjo, A., & Hendriarianti, E. (2021). Plant Leaf Detection and Counting in a Greenhouse during Day and Nighttime Using a Raspberry Pi NoIR Camera. Sensors, 21(19), 6659. https://doi.org/10.3390/s21196659