# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Mean shift clustering using a discrete voxel space
#'
#' 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`, pc, H2CW_fac, H2CL_fac, UniformKernel, MaxIter, maxx, maxy, maxz)
}
#' Mean shift clustering
#'
#' Adaptive mean shift clustering to delineate tree crowns from lidar point
#' clouds.
#'
#' @param pointCloud Point cloud data in a three-column matrix where the
#' columns represent X, Y and Z coordinates and each row represents one
#' point.
#' @param crownDiameter2TreeHeight Numeric scalar. Ratio of crown diameter
#' to tree height. Determines kernel diameter based on the height of its
#' center.
#' @param crownHeight2TreeHeight Numeric scalar. Ratio of crown height to tree
#' height. Determines kernel height based on the height of its center.
#' @param maxNumCentroidsPerMode Integer scalar. Maximum number of
#' iterations, i.e. steps that the kernel can move for each point. If no mode
#' is found after \code{maxNumCentroidsPerMode} iterations, the centroid
#' that was calculated last is treated as the mode.
#'
#' @return A data.frame with the coordinates in \code{pointCloud} and three
#' additional columns with the coordinates of the calculated modes.
#'
#' @export
meanShiftClassic <- function(pointCloud, crownDiameter2TreeHeight, crownHeight2TreeHeight, maxNumCentroidsPerMode = 200L) {
.Call(`_meanshiftr_meanShiftClassic`, pointCloud, crownDiameter2TreeHeight, crownHeight2TreeHeight, maxNumCentroidsPerMode)
}
#' Mean shift clustering
#'
#' Adaptive mean shift clustering to delineate tree crowns from lidar point
#' clouds.
#'
#' @param pointCloud Point cloud data in a three-column matrix where the
#' columns represent X, Y and Z coordinates and each row represents one
#' point.
#' @param crownDiameter2TreeHeight Numeric scalar. Ratio of crown diameter
#' to tree height. Determines kernel diameter based on the height of its
#' center.
#' @param crownHeight2TreeHeight Numeric scalar. Ratio of crown height to tree
#' height. Determines kernel height based on the height of its center.
#' @param maxNumCentroidsPerMode Integer scalar. Maximum number of
#' iterations, i.e. steps that the kernel can move for each point. If no mode
#' is found after \code{maxNumCentroidsPerMode} iterations, the centroid
#' that was calculated last is treated as the mode.
#'
#' @return A data.frame with the coordinates in \code{pointCloud} and three
#' additional columns with the coordinates of the calculated modes.
#'
#' @export
meanShiftClassicImproved <- function(pointCloud, crownDiameter2TreeHeight, crownHeight2TreeHeight, maxNumCentroidsPerMode = 200L) {
.Call(`_meanshiftr_meanShiftClassicImproved`, pointCloud, crownDiameter2TreeHeight, crownHeight2TreeHeight, maxNumCentroidsPerMode)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.