Adaptive random sample consensus for cicle fitting.

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

J. Antonio Guzmán Q.

Examples


#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)

#>           X         Y     radius        RMSE
#> 1: 9.245804 -1.019894 0.09851767 0.002703773