filled_voxel_cloud: Produces a filled voxel cloud.

Description Usage Arguments Value References Examples

View source: R/fill_voxel_cloud.R

Description

This function produces a filled voxel cloud of a tree, i.e. a voxels cloud within which empty objects (e.g. trunk and large branches) are filled. The algorithm was inspired from the one described by Vonderach et al. (2012) with some modifications. First, the point cloud is is voxelized with a given (res) voxel resolution. The voxel cloud is then sliced into one voxel tick layers. Within a single layer different objects are then clustered based on their distance to each other (see the distance_clustering function for more details). Each cluster is then filled by addind voxels along the range of Y for each X value of the cluster and reversly along the range of X for each Y of the cluster. All unique voxels are then returned.

Usage

1
filled_voxel_cloud(data, res, d_clust, estimate_volume, message)

Arguments

data

a data.frame or data.table containing the x, y, z, ... coordinates of a point cloud.

res

numeric. Resolution of a voxel.

d_clust

numeric. The distance to use for clustering, see the distance_clustering for more details.

estimate_volume

logical. If TRUE the tree volume is computed as done in Vonderach et al. (2012).

message

logical. If FALSE, messages are disabled. Default = TRUE.

Value

If estimate_volume = FLASE a data.frame or data.table containing the voxels coordinates is returned. If estimate_volume = TRUE a list containing the voxels coordinates and the estimated tree volume is returned.

References

Vonderach, C., Voegtle, T., & Adler, P. (2012). Voxel-based approach for estimating urban tree volume from terrestrial laser scanning data. International Archives of Photogrammetry, Remote Sensing and Spatial Information Sciences, 39, 451-456.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#- import tls data
tls=data.table::fread(system.file("extdata", "Tree_t1.asc", package="VoxR"))

#- keep the tree trunk
tls=tls[z<=0]

#- run filled voxel voxelisation
filled = VoxR::filled_voxel_cloud(tls,0.02)

#- run usual voxelisation
voxels = VoxR::vox(tls,0.02)

#- compare filled voxel cloud to empty voxel cloud
VoxR::plot_voxels(filled,res = 0.02)
VoxR::plot_voxels(voxels,res = 0.02)

#- compare the volume estimate from Vonderach et al. 2012 to estimate based on voxel volume
#- run filled voxel voxelisation with volume estimation
filled = VoxR::filled_voxel_cloud(tls,0.01,estimate_volume = TRUE)

#- compare volumes
filled$estimated_volume # Vonderach
nrow(filled$filled_voxels)*0.01^3 # voxel based

VoxR documentation built on Nov. 16, 2020, 9:14 a.m.