implementation of a computer vision algorithm for
TRANSCRIPT
![Page 1: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/1.jpg)
Implementation of a computer vision algorithm for automated detection and diameter estimation of logs on trucks
Mauricio AcunaAFORA, USC, Australia
Amanda SosaSchool of Biosystems and Food Eng., UCD, Ireland
![Page 2: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/2.jpg)
Outline
1. Problem – Manual and automated measurement of logs
2. Objectives of the study3. Methodology – samples, computer vision
algorithm, and tool (LogVision)4. Results from research trial (Forestal Mininco,
Chile)5. Future research 6. Summary
![Page 3: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/3.jpg)
Problem
• It is time consuming and labour expensive• Manually measuring logs is inaccurate and
prone to high errors• Not consistent among people (scalers)• Often not transparent to buyers
Manual measurement of timber
![Page 4: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/4.jpg)
ProblemAutomated measurement of timber: Commercial apps
Source: Sarzynski et al. 2016 “Using the app is easy: a person takes a photo of the pile and instantly obtains the number of logs, their volumes and the exact diameters of each log”
![Page 5: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/5.jpg)
Problem
• Few scientific references presenting errors and limitations of commercial vision systems in different conditions (e.g. species, log size, luminosity, pulp vs sawlogs, etc.)
• Volume calculations based on log diameter, but which diameter (SED or LED)?
• Logs of variable length• Volume of sawlogs are measured
using the SED (e.g. JAS rule)
Automated measurement of timber
![Page 6: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/6.jpg)
Objectives• Apply and implement a computer vision algorithm
to detect logs and estimate their diameters• Quantify errors between actual and estimated
diameters• Investigate patterns in the errors• Develop regression model between actual and
estimated diameters• Test the algorithm/tool in operational conditions
![Page 7: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/7.jpg)
Methodology
Radiata pine sawlogs in Chile
1301117Diam. range Frequency 1 2
28 5 28.6 28.6 28 28.6 28.030 6 30.3 30.8 30.1 30.2 30.1 30.132 3 32.1 32.6 32.334 11 34.7 34.7 34.5 34.2 34 34.2 34.8 34.6 34.2 34.2 34.236 1 36.838 1 38.640 1 40.442 1 4244
TOTAL LOGS 29 13 16
20 truckloads
![Page 8: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/8.jpg)
Methodology• End faces from 220 logs carried on trucks.• Each diameter was measured manually with a
measuring tape.• The background of the images was cropped to
remove noise from the end face of the logs.• A convolved algorithm was used for contrast
enhancement of the image. • Automated detection and diameter estimation.• Algorithm implemented with OpenCV, and
programmed with C++ and Qt
![Page 9: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/9.jpg)
MethodologyOpenCV: Open Source Computer Vision
Opencv.org
![Page 10: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/10.jpg)
Methodology
a b
c
Images from the back of trucks carrying logs a) original b) with cropped background and c) convolved
![Page 11: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/11.jpg)
MethodologyLog diameter measurement tool called LogVision developed by Acuna.
Functions/algorithms:P1. 2D filtering with a 5x5 kernel.P2. Changing of colour channels. P3. A Gaussian Blur algorithm.P4. A Hough Circles algorithm.P5. A function to draw circles around the faces of the logs.
![Page 12: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/12.jpg)
Methodology
![Page 13: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/13.jpg)
LogVision – Log detection & diameter estimates
![Page 14: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/14.jpg)
Results
Description Manual Algorithm
Count
Mean
Std. error
Median
Std.deviation
Range
Min
Max
CI (95%)
220
34.4
0.28
34.1
4.15
21.3
27.5
48.8
0.56
220
34.6
0.30
34.0
4.44
27.8
23.7
51.5
0.60
Statistics - Manual and automated measurements
![Page 15: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/15.jpg)
Results
-8
-6
-4
-2
0
2
4
6
8
28 29 30 30 30 31 32 32 32 33 34 34 34 35 35 36 37 38 38 40 41 45
Diff
eren
ce M
anua
l-Alg
orith
m (c
m)
Manual diameter (cm)
Variation (cm) between the manual and digital measurements of the diameters
Difference avg. - 0.13 cm, with a maximum of 6.73 cm and minimum of – 5.87 cm
Std. error = 0.175CI (95%) = [-0.50, 0.21]
Class Difference
38-3030-3232-3434-3636-3838-40>40
-0.68-1.10-0.050.120.470.400.32
![Page 16: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/16.jpg)
Results
0%
2%
4%
6%
8%
10%
12%
14%
16%
18%
-7 -6 -4 -3 -2 -1 0 1 2 3 4 5 6 7
Obs
erva
tions
(%)
Difference diameter Manual- Algorithm (cm)
67% variation within ±2 cm
Variation (cm) between the manual and digital measurements of the diameters
![Page 17: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/17.jpg)
Results
![Page 18: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/18.jpg)
R² = 0,6437
25
30
35
40
45
50
55
25 30 35 40 45 50
Alg
orith
m d
iam
eter
(cm
)
Manual diameter (cm)
Regression model between manual and automated measurements of the diameters
![Page 19: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/19.jpg)
Future research• Use the algorithms/app to measure stacked piles• Apply and test improved algorithms in different
conditions (species, log size, luminosity, etc.)• Test the accuracy of commercial applications• Quantify the errors and their economic impact• Provide volumetric estimates based on a
combination of photogrammetric (3D reconstruction) and computing vision algorithms
![Page 20: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/20.jpg)
Future researchMeasuring stacked piles and logs on forwarders
![Page 21: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/21.jpg)
Summary• A computer vision approach for detection and
estimation of diameters of logs on trucks (LogVision) has been presented.
• Based on OpenCV algorithms and developed with the Qt/C++ framework.
• Preliminary results show the potential in real life operations. Mean differences were -0.13 cm.
• Further studies will compare different image capturing and pre-processing techniques, and also different measurement algorithms.
![Page 22: Implementation of a computer vision algorithm for](https://reader035.vdocument.in/reader035/viewer/2022073108/62e512dd6d38c670f62f5e1f/html5/thumbnails/22.jpg)
Implementation of a computer vision algorithm for automated detection and diameter estimation of logs on trucks
Mauricio AcunaAFORA, USC, Australia
Amanda SosaSchool of Biosystems and Food Eng., UCD, Ireland