Learn R Programming

CspStandSegmentation (version 0.1.2)

comparative_shortest_path: helper function for csp_cost_segemntation

Description

The function performs a Dijkstra algorithm on a 3D voxel file to assign every voxel to the closest seed point using the igraph package.

Usage

comparative_shortest_path(
  vox = vox,
  adjacency_df = adjacency_df,
  seeds,
  v_w = 0,
  l_w = 0,
  s_w = 0,
  N_cores = parallel::detectCores() - 1,
  Voxel_size
)

Value

voxels with the TreeID in the data slot

Arguments

vox

a LAS S4 element with XYZ voxel coordinates in the @data slot.

adjacency_df

a data.frame with voxel ids (row numbers) in the first column and a neighboring voxel ID in the second column and the weight (distance) in the third column. Might be generated using the dbscan::frNN function (which requires reshaping the data).

seeds

seed points for tree positions.

v_w, l_w, s_w

weights for verticality, linearity spericity see csp_cost_segmentation

N_cores

Number of CPU cores for multi-threading

Voxel_size

Edge length used to create the voxels. This is only important to gain comparable distance weights on different voxel sizes. Should be greater than 0.

Author

Julian Frey <julian.frey@wwd.uni-freiburg.de>

See Also

csp_cost_segmentation