R/RcppExports.R

Defines functions MeanShift_Voxels MeanShift_Classical

Documented in MeanShift_Classical MeanShift_Voxels

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Mean shift clustering
#'
#' @title Mean shift clustering
#' @description
#' Adaptive mean shift clustering to delineate tree crowns from lidar point clouds
#' @param pc Point cloud has to be in matrix format with 3-columns representing X, Y and Z and each row representing one point
#' @param H2CW_fac Factor for the ratio of height to crown width. Determines kernel diameter based on its height above ground.
#' @param H2CL_fac Factor for the ratio of height to crown length. Determines kernel height based on its height above ground.
#' @param UniformKernel Boolean to enable the application of a simple uniform kernel without distance weighting (Default False)
#' @param MaxIter Maximum number of iterations, i.e. steps that the kernel can move for each point. If centroid is not found after all iteration, the last position is assigned as centroid and the processing jumps to the next point
#' @return data.frame with X, Y and Z coordinates of each point in the point cloud and  X, Y and Z coordinates of the centroid to which the point belongs
#' @export
MeanShift_Classical <- function(pc, H2CW_fac, H2CL_fac, UniformKernel = FALSE, MaxIter = 20L) {
    .Call('_MeanShiftR_MeanShift_Classical', PACKAGE = 'MeanShiftR', pc, H2CW_fac, H2CL_fac, UniformKernel, MaxIter)
}

#' Mean shift clustering using a discrete voxel space
#'
#' @title Mean shift clustering using a discrete voxel space
#' @description
#' Adaptive mean shift clustering to delineate tree crowns from lidar point clouds. This is a version using 1-m³ voxels instead of exact point coordinates, to speed up processing.
#' @param pc Point cloud has to be in matrix format with 3-columns representing X, Y and Z and each row representing one point
#' @param H2CW_fac Factor for the ratio of height to crown width. Determines kernel diameter based on its height above ground.
#' @param H2CL_fac Factor for the ratio of height to crown length. Determines kernel height based on its height above ground.
#' @param UniformKernel Boolean to enable the application of a simple uniform kernel without distance weighting (Default False)
#' @param MaxIter Maximum number of iterations, i.e. steps that the kernel can move for each point. If centroid is not found after all iteration, the last position is assigned as centroid and the processing jumps to the next point
#' @param maxx Maximum X-coordinate
#' @param maxy Maximum Y-coordinate
#' @param maxz Maximum Z-coordinate
#' @return data.frame with X, Y and Z coordinates of each point in the point cloud and  X, Y and Z coordinates of the centroid to which the point belongs
#' @export
MeanShift_Voxels <- function(pc, H2CW_fac, H2CL_fac, UniformKernel = FALSE, MaxIter = 20L, maxx = 100L, maxy = 100L, maxz = 60L) {
    .Call('_MeanShiftR_MeanShift_Voxels', PACKAGE = 'MeanShiftR', pc, H2CW_fac, H2CL_fac, UniformKernel, MaxIter, maxx, maxy, maxz)
}
niknap/MeanShiftR documentation built on Dec. 20, 2020, 12:32 p.m.