circleRANSAC: Adaptive RANSAC Circle Fitting

Description Usage Arguments Value Author(s) See Also Examples

View source: R/circleRANSAC.R

Description

Adaptive random sample consensus for cicle fitting.

Usage

1
2
3
4
5
6
7
8
9
circleRANSAC(
  cloud,
  fpoints,
  pconf,
  poutlier,
  max_iterations,
  threads = 1L,
  plot = TRUE
)

Arguments

cloud

A data.table with *XY* coordinates in the first two columns.

fpoints

A numeric vector between 0 and 1 representing the fraction of point samples that will be used during each iteration.

pconf

A numeric vector between 0 and 1 describing the confidence threshold to consider a point in a given fitted circle outlier or inlier.

poutlier

A numeric vector of length two describing the proportion of outliers to consider inside or outsite of the pconf threshold.

max_iterations

An integer specifying the number of iterations. If NULL, the number of iterations are automaticaly estimated using pconf, 1 - poutlier, and 1 - fpoints; see details.

threads

An integer specifying the number of threads to use for parallel processing. Experiment to see what works best for your data on your hardware.

plot

Logical. If TRUE, it provides visual representation of the fitted circle.

Value

A data.table with the *XY* coordinate information of the circle center, the radius, the error based on the least squares fit, and the proportion of inliers.

Author(s)

J. Antonio Guzmán Q.

See Also

tree_metrics, trunk_volume

Examples

1
2
3
4
5
6
7
8
#Point cloud
data("pc_tree")

#Subset region at at breast height
sub <- pc_tree[between(Z, 1.25, 1.35),]

#Fit circle
circleRANSAC(sub, fpoints = 0.2, pconf = 0.95, poutlier = c(0.5, 0.5), max_iterations = 100)

Antguz/rTLS documentation built on Dec. 14, 2021, 9:49 a.m.