Clear Filters
Clear Filters

How to extract tree DBH(Diameter at Breast Height) using helperExtractTreeMetrics function??

5 views (last 30 days)
Hello
i'm studying lidar toolbox using lidar toolbox guideline.
TreeId, TreeHeight, etc. were extracted using the helperExtractTreeMetrics function in the tree attribute extraction step. However, it does not provide for one of the most important properties of the tree to be extracted, the 1.2 height diameter extraction.
Is there any other way to extract DBH?
lidar data type => ply
this is helperExtractTreeMetrics function
function treeMetrics = helperExtractTreeMetrics(normalizedPoints,label3D)
% Copyright 2021 The MathWorks, Inc.
% Consider points belongs to valid labels
validLabels = label3D ~= 0;
filteredLabels = label3D(validLabels);
filteredPoints = normalizedPoints(validLabels,:);
[filteredLabels, sortedIds] = sort(filteredLabels);
filteredPoints = filteredPoints(sortedIds,:);
% Identify the number of points at each cell
uniqueLabels = unique(filteredLabels);
idCounts = histc(filteredLabels, uniqueLabels); %#ok<HISTC>
% Create treeMetrics table
treeMetrics = table('Size', [length(idCounts),7], ...
'VariableTypes', {'uint32', 'uint32', 'double', 'double', 'double', 'double', 'double'}, ...
'VariableNames',{'TreeId', 'NumPoints', 'TreeApexLocX', 'TreeApexLocY','TreeHeight', 'CrownDiameter','CrownArea'});
endIdx = 0;
% Loop over valid cells
for i = 1: length(idCounts)
gridIdx = endIdx + 1;
endIdx = endIdx + idCounts(i);
treeMetrics.TreeId(i) = i;
treeMetrics.NumPoints(i) = idCounts(i);
[~,id]= max(filteredPoints(gridIdx:endIdx,3));
treeMetrics.TreeApexLocX(i) = filteredPoints(gridIdx+id-1,1);
treeMetrics.TreeApexLocY(i) = filteredPoints(gridIdx+id-1,2);
treeMetrics.TreeHeight(i) = filteredPoints(gridIdx+id-1,3);
if(idCounts(i) >=3)
[~, treeMetrics.CrownArea(i)] = convhull(double(filteredPoints(gridIdx:endIdx,1:2)));
else
treeMetrics.CrownArea(i) = 0;
end
end
treeMetrics.CrownDiameter = 2 * sqrt(treeMetrics.CrownArea/ pi);

Answers (1)

Pratik
Pratik on 29 Dec 2023
Hi 동현 김,
As per my understanding, you want to extract Diameter of tree at Breast Height using “helperExtractTreeMetrics” function, in lidar toolbox.
Extracting DBH directly from LiDAR data can be challenging because LiDAR often captures the top and side profiles of trees. To estimate DBH from LiDAR data, you might need to use indirect methods or additional processing steps. Here are a few possible approaches:
  1. Allometric Equations are mathematical equations that relate tree height, crown dimensions, and other easily measured attributes to DBH.
  2. Segment the point cloud to isolate individual trees and analyze the point cloud to find the trunk and measure its width at the appropriate height.
  3. You can train a machine learning model using labeled data (where DBH is known) to predict DBH from the 3D point cloud data. This would require a substantial dataset for training and validation.
Please note that estimating DBH from LiDAR data is an area of ongoing research, and the accuracy of these methods can vary widely depending on the complexity of the forest structure, the quality of the LiDAR data, and the specific algorithms used.
Hope this helps!

Categories

Find more on Labeling, Segmentation, and Detection in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!