A Novel Wood Log Measurement Combined Mask R-CNN and Stereo Vision Camera
Abstract
:1. Introduction
- 1.
- We proposed a log diameter detection method conforming to Chinese wood measurement standards that takes the circumcircle center of the wood contour as the contour center and uses a rotational search to obtain the long and short diameters of the wood contour. The method can quickly obtain the long and short diameters from irregular wood cross-sections with improved accuracy.
- 2.
- We proposed a novel log diameter measurement method that uses a Mask R-CNN instance segmentation model and binocular camera to automatically extract wood log contours and calculate the real wood log size, improving the measurement efficiency.
2. Materials
3. Methods
3.1. Mask R-CNN Algorithm
3.2. Diameter Search Algorithm
- 1.
- Obtain the binary mask images of wood by feeding the wood image into the trained Mask R-CNN model;
- 2.
- Fit the circumcircle of the wood contour to get the rotation center;
- 3.
- Calculate the next rotation point every five degrees in circumcircle successively by using a point on the wood’s contour as the beginning point;
- 4.
- Connect each point to the center point to generate a straight line, and extend the line to the intersect of the wood contour other side as another point. There is a line segment between the point pair.
- 5.
- Compare the pixel length of each line segment and select the shortest one as the short diameter of the wood contour.
- 6.
- Calculate the length of the line segment perpendicular to the short diameter which passes through the wood contour center. If the pixel length is not an integer, the neighbor points are used to calculate the length and the maximum length line segment is treated as the long diameter.
- 7.
- Output the pixel coordinates of the long diamter and short diamter.
3.3. Distance Measurement Algorithm
Algorithm 1 Short diameter finding. |
Require: Ensure: short diameter
|
3.4. Evaluate
3.4.1. Mask R-CNN Model Evaluation
3.4.2. Long and Short Diameter Measurement Comparison in Actual
4. Results and Discussions
4.1. YOLO vs. Mask R-CNN
4.2. Segmentation and Detection Results for Wood
4.3. Analyse of Diameter Search
4.4. Analyse of Actual Measurement of Wood
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Food and Agriculture Organization of the United Nations. Forest Product Statistics. Available online: https://www.fao.org/forestry/statistics/80938/en/ (accessed on 20 May 2022).
- Yu, H.; Tian, M.; Shi, Y.; Cheng, J.; Zhang, Z. The Measuring Methods of Dependence on Foreign Trade of China’s Wooden Forest Products and the Estimating after Measuring. Sci. Silvae Sin. 2018, 54, 16. [Google Scholar] [CrossRef]
- Pásztory, Z.; Heinzmann, B.; Barbu, M. Manual and Automatic Volume Measuring Methods for Industrial Timber. In Proceedings of the IOP Conference Series: Earth and Environmental Science, Da Nang, Vietnam, 25–27 February 2018; IOP Publishing: Bristol, UK, 2018; Volume 159, p. 012019. [Google Scholar] [CrossRef]
- Borz, S.A.; Proto, A.R. Application and accuracy of smart technologies for measurements of roundwood: Evaluation of time consumption and efficiency. Comput. Electron. Agric. 2022, 197, 106990. [Google Scholar] [CrossRef]
- Cai, Q.; Cheng, S.; Zhao, R. Interaction Relationship between Central Forestry Investment and Forestry Economic Growth in China. Sci. Silvae Sin. 2015, 51, 126–133. [Google Scholar]
- de Miguel-Díez, F.; Reder, S.; Wallor, E.; Bahr, H.; Blasko, L.; Mund, J.P.; Cremer, T. Further application of using a personal laser scanner and simultaneous localization and mapping technology to estimate the log’s volume and its comparison with traditional methods. Int. J. Appl. Earth Obs. Geoinf. 2022, 109, 102779. [Google Scholar] [CrossRef]
- McGee, A.L.; Browning, R.A.; Yock, L.M. Log Centering Apparatus and Method Using Transmitted Light and Reference Edge Log Scanner. US Patent 4,197,888, 15 April 1980. [Google Scholar]
- Dai, L.; Gu, J.G. The method of minimal square circularity and its application in log centering. Wood Process. Mach. 2002, 13, 16–18. [Google Scholar] [CrossRef]
- Ramoser, H.; Cambrini, L.; Rötzer, H. Real-time 3D wood panel surface measurement using laser triangulation and low-cost hardware. In Proceedings of the Machine Vision Applications in Industrial Inspection XIV, International Society for Optics and Photonics, San Jose, CA, USA, 9 February 2006; Volume 6070, p. 60700C. [Google Scholar] [CrossRef]
- Brüchert, F.; Baumgartner, R.; Sauter, U. Ring width detection for industrial purposes-use of CT and discrete scanning technology on fresh roundwood. In Proceedings of the Conference COST E, Delft, The Netherlands, 29–30 October 2008; Volume 53, pp. 29–30. [Google Scholar]
- Chun-feng, W. Research of Measuring Standing Volume Based on Laser Scanning System. Master’s Thesis, Northeast Forestry University, Harbin, China, 2009. [Google Scholar]
- Zi-yan, H. A study on Wood 3d Profile Measurement System Based on Fringe Projection. Ph.D. Thesis, Beijing Forestry University, Beijing, China, 2011. [Google Scholar]
- Longo, B.L.; Brüchert, F.; Becker, G.; Sauter, U.H. Validation of a CT knot detection algorithm on fresh Douglas-fir (Pseudotsuga menziesii (Mirb.) Franco) logs. Ann. For. Sci. 2019, 76, 1–16. [Google Scholar] [CrossRef]
- Gergel’, T.; Bucha, T.; Gracovskỳ, R.; Chamula, M.; Gejdoš, M.; Veverka, P. Computed Tomography as a Tool for Quantification and Classification of Roundwood—Case Study. Forests 2022, 13, 1042. [Google Scholar] [CrossRef]
- Feifan, Y.; Zhongke, F.; Tao, L.; Mingming, W. Research on the Method of Log Scaling by Mobile Phone Combined With Rangefinder. For. Resour. Manag. 2016, 6, 120. [Google Scholar] [CrossRef]
- Kruglov, A.V. The algorithm of the roundwood volume measurement via photogrammetry. In Proceedings of the 2016 International Conference on Digital Image Computing: Techniques and Applications (DICTA), Gold Coast, QLD, Australia, 30 November–2 December 2016; pp. 1–5. [Google Scholar] [CrossRef]
- Chiryshev, Y.V.; Kruglov, A.V.; Atamanova, A.S.; Zavada, S.G. Detection and dimension of moving objects using single camera applied to the round timber measurement. In Proceedings of the 2017 Federated Conference on Computer Science and Information Systems (FedCSIS), Prague, Czech Republic, 3–6 September 2017; pp. 49–56. [Google Scholar] [CrossRef]
- He, T.; Liu, Y.; Yu, Y.; Zhao, Q.; Hu, Z. Application of deep convolutional neural network on feature extraction and detection of wood defects. Measurement 2020, 152, 107357. [Google Scholar] [CrossRef]
- Gao, M.; Qi, D.; Mu, H.; Chen, J. A Transfer Residual Neural Network Based on ResNet-34 for Detection of Wood Knot Defects. Forests 2021, 12, 212. [Google Scholar] [CrossRef]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. Ssd: Single shot multibox detector. In Lecture Notes in Computer Science, Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 11–14 October 2016; Springer: Cham, Switzerland, 2016; pp. 21–37. [Google Scholar] [CrossRef]
- Tang, H.; Wang, K.; Gu, J.; Li, X.; Jian, W. Application of SSD framework model in detection of logs end. J. Phys. Conf. Ser. 2020, 1486, 072051. [Google Scholar] [CrossRef]
- Long, J.; Shelhamer, E.; Darrell, T. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 3431–3440. [Google Scholar]
- Samdangdech, N.; Phiphobmongkol, S. Log-End Cut-Area Detection in Images Taken from Rear End of Eucalyptus Timber Trucks. In Proceedings of the 2018 15th International Joint Conference on Computer Science and Software Engineering (JCSSE), Nakhonpathom, Thailand, 11–13 July 2018; pp. 1–6. [Google Scholar] [CrossRef]
- Adarsh, P.; Rathi, P.; Kumar, M. YOLO v3-Tiny: Object Detection and Recognition using one stage improved model. In Proceedings of the 2020 6th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, 6–7 March 2020; pp. 687–694. [Google Scholar] [CrossRef]
- Ballard, D.H. Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognit. 1981, 13, 111–122. [Google Scholar] [CrossRef]
- Haiyao, L.; Honglu, Z.; Zecan, Y.; Mengting, L. An equal length log volume inspection system using deep-learing and Hough transformation. J. For. Eng. 2021, 006, 136–142. [Google Scholar] [CrossRef]
- Wang, J.; Chen, X.; Cao, L.; An, F.; Chen, B.; Xue, L.; Yun, T. Individual rubber tree segmentation based on ground-based LiDAR data and faster R-CNN of deep learning. Forests 2019, 10, 793. [Google Scholar] [CrossRef] [Green Version]
- Luo, M.; Tian, Y.; Zhang, S.; Huang, L.; Wang, H.; Liu, Z.; Yang, L. Individual Tree Detection in Coal Mine Afforestation Area Based on Improved Faster RCNN in UAV RGB Images. Remote Sens. 2022, 14, 5545. [Google Scholar] [CrossRef]
- Lin, Y.; Cai, R.; Lin, P.; Cheng, S. A detection approach for bundled log ends using K-median clustering and improved YOLOv4-Tiny network. Comput. Electron. Agric. 2022, 194, 106700. [Google Scholar] [CrossRef]
- Fang, Y.; Guo, X.; Chen, K.; Zhou, Z.; Ye, Q. Accurate and Automated Detection of Surface Knots on Sawn Timbers Using YOLO-V5 Model. BioResources 2021, 16, 5390–5406. [Google Scholar] [CrossRef]
- Zou, Z.; Shi, Z.; Guo, Y.; Ye, J. Object detection in 20 years: A survey. arXiv 2019, arXiv:1905.05055. [Google Scholar] [CrossRef]
- He, K.; Gkioxari, G.; Dollár, P.; Girshick, R. Mask r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2961–2969. [Google Scholar]
- Jian, L.; Pu, Z.; Zhu, L.; Yao, T.; Liang, X. SS R-CNN: Self-Supervised Learning Improving Mask R-CNN for Ship Detection in Remote Sensing Images. Remote Sens. 2022, 14, 4383. [Google Scholar] [CrossRef]
- Zhang, L.; Wu, J.; Fan, Y.; Gao, H.; Shao, Y. An Efficient Building Extraction Method from High Spatial Resolution Remote Sensing Images Based on Improved Mask R-CNN. Sensors 2020, 20, 1465. [Google Scholar] [CrossRef]
- Liu, Z.; Yeoh, J.K.; Gu, X.; Dong, Q.; Chen, Y.; Wu, W.; Wang, L.; Wang, D. Automatic pixel-level detection of vertical cracks in asphalt pavement based on GPR investigation and improved mask R-CNN. Autom. Constr. 2023, 146, 104689. [Google Scholar] [CrossRef]
- Zhou, M.; Wang, J.; Li, B. ARG-Mask RCNN: An Infrared Insulator Fault-Detection Network Based on Improved Mask RCNN. Sensors 2022, 22, 4720. [Google Scholar] [CrossRef] [PubMed]
- Zhang, C.; Zhou, J.; Wang, H.; Tan, T.; Cui, M.; Huang, Z.; Wang, P.; Zhang, L. Multi-Species Individual Tree Segmentation and Identification Based on Improved Mask R-CNN and UAV Imagery in Mixed Forests. Remote Sens. 2022, 14, 874. [Google Scholar] [CrossRef]
- Hao, Z.; Lin, L.; Post, C.J.; Mikhailova, E.A.; Li, M.; Chen, Y.; Yu, K.; Liu, J. Automated tree-crown and height detection in a young forest plantation using mask region-based convolutional neural network (Mask R-CNN). ISPRS J. Photogramm. Remote Sens. 2021, 178, 112–123. [Google Scholar] [CrossRef]
- Hu, G.; Wang, T.; Wan, M.; Bao, W.; Zeng, W. UAV remote sensing monitoring of pine forest diseases based on improved Mask R-CNN. Int. J. Remote Sens. 2022, 43, 1274–1305. [Google Scholar] [CrossRef]
- Zhu, J.Y.; Park, T.; Isola, P.; Efros, A.A. Unpaired Image-To-Image Translation Using Cycle-Consistent Adversarial Networks. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017; pp. 2223–2232. [Google Scholar] [CrossRef]
- Li, D.; Xie, W.; Wang, B.; Zhong, W.; Wang, H. Data Augmentation and Layered Deformable Mask R-CNN-Based Detection of Wood Defects. IEEE Access 2021, 9, 108162–108174. [Google Scholar] [CrossRef]
- Shi, J.; Li, Z.; Zhu, T.; Wang, D.; Ni, C. Defect Detection of Industry Wood Veneer Based on NAS and Multi-Channel Mask R-CNN. Sensors 2020, 20, 4398. [Google Scholar] [CrossRef] [PubMed]
- Rublee, E.; Rabaud, V.; Konolige, K.; Bradski, G. ORB: An efficient alternative to SIFT or SURF. In Proceedings of the 2011 International Conference on Computer Vision, Barcelona, Spain, 6–13 November 2011; pp. 2564–2571. [Google Scholar] [CrossRef]
- Guanghua, C.; Qiang, Z.; Meiqian, C.; Jianwei, L.; Yonghuai, Y. Rapid detection algorithms for log diameter classes based on binocular vision. J. Beijing Jiaotong Univ. 2018, 42, 9. [Google Scholar] [CrossRef]
- Zheng, B.; Sun, G.; Meng, Z.; Nan, R. Vegetable Size Measurement Based on Stereo Camera and Keypoints Detection. Sensors 2022, 22, 1617. [Google Scholar] [CrossRef]
- Suo, F.; Huang, K.; Ling, G.; Li, Y.; Xiang, J. Fish keypoints detection for ecology monitoring based on underwater visual intelligence. In Proceedings of the 2020 16th International Conference on Control, Automation, Robotics and Vision (ICARCV), Shenzhen, China, 13–15 December 2020; pp. 542–547. [Google Scholar] [CrossRef]
- Solak, S.; Bolat, E.D. A new hybrid stereovision-based distance-estimation approach for mobile robot platforms. Comput. Electr. Eng. 2018, 67, 672–689. [Google Scholar] [CrossRef]
- Huang, L.; Wu, G.; Liu, J.; Yang, S.; Cao, Q.; Ding, W.; Tang, W. Obstacle distance measurement based on binocular vision for high-voltage transmission lines using a cable inspection robot. Sci. Prog. 2020, 103, 0036850420936910. [Google Scholar] [CrossRef] [PubMed]
- Adil, E.; Mikou, M.; Mouhsen, A. A novel algorithm for distance measurement using stereo camera. CAAI Trans. Intell. Technol. 2022, 7, 177–186. [Google Scholar] [CrossRef]
- Schraml, R.; Uhl, A. Similarity Based Cross-Section Segmentation in Rough Log End Images. In Artificial Intelligence Applications and Innovations, Proceedings of the 10th IFIP WG 12.5 International Conference, AIAI 2014, Rhodes, Greece, 19–21 September 2014; Iliadis, L., Maglogiannis, I., Papadopoulos, H., Eds.; Springer: Berlin/Heidelberg, Germany, 2014; pp. 614–623. [Google Scholar]
- Jung, A.B.; Wada, K.; Crall, J.; Tanaka, S.; Graving, J.; Reinders, C.; Yadav, S.; Banerjee, J.; Vecsei, G.; Kraft, A.; et al. Imgaug. 2020. Available online: https://github.com/aleju/imgaug (accessed on 1 February 2020).
- Log Inspection: GB/T 144—2013[S]; General Administration of Quality Supervision, Inspection and Quarantine of the People’s Republic of China. Standards Press of China: Beijing, China, 2013.
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016; pp. 770–778. [Google Scholar]
- Lin, T.Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature pyramid networks for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 2117–2125. [Google Scholar]
- Zhang, Z. Flexible camera calibration by viewing a plane from unknown orientations. In Proceedings of the Seventh IEEE International Conference on Computer Vision, Kerkyra, Greece, 20–27 September 1999; Volume 1, pp. 666–673. [Google Scholar] [CrossRef]
- Liu, Z.; Gu, X.; Chen, J.; Wang, D.; Chen, Y.; Wang, L. Automatic recognition of pavement cracks from combined GPR B-scan and C-scan images using multiscale feature fusion deep neural networks. Autom. Constr. 2023, 146, 104698. [Google Scholar] [CrossRef]
- Li, C.; Li, L.; Jiang, H.; Weng, K.; Geng, Y.; Li, L.; Ke, Z.; Li, Q.; Cheng, M.; Nie, W.; et al. YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications. arXiv 2022, arXiv:2209.02976. [Google Scholar] [CrossRef]
- Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. arXiv 2022, arXiv:2207.02696. [Google Scholar] [CrossRef]
Model | AP | AP50 |
---|---|---|
YOLOv5 | 0.903 | 0.990 |
YOLOv6 | 0.683 | 0.760 |
YOLOv7 | 0.867 | 0.993 |
Methods | AP | APs | APm | APl | |
---|---|---|---|---|---|
Resnet50 Ori | 0.790 | 0.705 | 0.699 | 0.822 | 0.938 |
Resnet101 Ori | 0.788 | 0.711 | 0.675 | 0.827 | 0.937 |
Resnet50 Aug | 0.793 | 0.701 | 0.702 | 0.823 | 0.943 |
Resnet101 Aug | 0.796 | 0.723 | 0.652 | 0.847 | 0.943 |
Images | Total | ResNet50 | ResNet101 | YOLOv5 |
---|---|---|---|---|
Image a | 147 | 135 | 142 | 112 |
Image e | 140 | 137 | 139 | 138 |
Image i | 202 | 197 | 199 | 201 |
Image m | 183 | 177 | 180 | 155 |
Total | 672 | 646 | 660 | 606 |
Detection rate | 96.1% | 98.2% | 90.1% |
Distance | Samples | Error1 | Error2 | Standard Deviation1 | Standard Deviation2 | RMSE1 | RMSE2 |
---|---|---|---|---|---|---|---|
1.5 m | 59 | 12.32 | 15.11 | 12.87 | 14.92 | 17.3 | 20.5 |
2 m | 59 | 12.01 | 14.79 | 12.86 | 15.92 | 16.77 | 19.9 |
2.5 m | 59 | 5.70 | 7.19 | 7.30 | 8.47 | 7.67 | 9.1 |
Distance | Samples | Error | Standard Deviation | RMSE |
---|---|---|---|---|
1.5 m | 59 | 13.18 | 11.89 | 17.75 |
2 m | 59 | 12.85 | 11.30 | 17.11 |
2.5 m | 59 | 5.32 | 4.68 | 7.08 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 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
Yu, C.; Sun, Y.; Cao, Y.; He, J.; Fu, Y.; Zhou, X. A Novel Wood Log Measurement Combined Mask R-CNN and Stereo Vision Camera. Forests 2023, 14, 285. https://doi.org/10.3390/f14020285
Yu C, Sun Y, Cao Y, He J, Fu Y, Zhou X. A Novel Wood Log Measurement Combined Mask R-CNN and Stereo Vision Camera. Forests. 2023; 14(2):285. https://doi.org/10.3390/f14020285
Chicago/Turabian StyleYu, Chunjiang, Yongke Sun, Yong Cao, Jie He, Yixing Fu, and Xiaotao Zhou. 2023. "A Novel Wood Log Measurement Combined Mask R-CNN and Stereo Vision Camera" Forests 14, no. 2: 285. https://doi.org/10.3390/f14020285
APA StyleYu, C., Sun, Y., Cao, Y., He, J., Fu, Y., & Zhou, X. (2023). A Novel Wood Log Measurement Combined Mask R-CNN and Stereo Vision Camera. Forests, 14(2), 285. https://doi.org/10.3390/f14020285