Learn R Programming

cmcR (version 0.1.11)

preProcess_ransacLevel: Finds plane of breechface marks using the RANSAC method

Description

Finds plane of breechface marks using the RANSAC method

Usage

preProcess_ransacLevel(
  x3p,
  ransacInlierThresh = 1e-06,
  ransacFinalSelectThresh = 2e-05,
  iters = 300,
  returnResiduals = TRUE
)

Value

an x3p object containing the leveled surface matrix.

Arguments

x3p

an x3p object containing a surface matrix

ransacInlierThresh

threshold to declare an observed value close to the fitted plane an "inlier". A smaller value will yield a more stable estimate.

ransacFinalSelectThresh

once the RANSAC plane is fitted based on the ransacInlierThresh, this argument dictates which observations are selected as the final breech face estimate.

iters

number of candidate planes to fit (higher value yields more stable breech face estimate)

returnResiduals

dictates whether the difference between the estimated breech face and fitted plane are returned (residuals) or if the estimates breech face is simply shifted down by its mean value

See Also

https://github.com/xhtai/cartridges3D

Examples

Run this code
if (FALSE) {
nbtrd_link <- "https://tsapps.nist.gov/NRBTD/Studies/CartridgeMeasurement/"
fadul1.1_link <- "DownloadMeasurement/2d9cc51f-6f66-40a0-973a-a9292dbee36d"

fadul1.1 <- x3ptools::read_x3p(paste0(nbtrd_link,fadul1.1_link))

fadul1.1_ransacLeveled <- fadul1.1 %>%
                     preProcess_crop(region = "exterior",
                                     radiusOffset = -30) %>%
                     preProcess_crop(region = "interior",
                                     radiusOffset = 200) %>%
                     preProcess_removeTrend(statistic = "quantile",
                                            tau = .5,
                                            method = "fn")

x3pListPlot(list("Original" = fadul1.1,
                 "RANSAC Leveled" = fadul1.1_ransacLeveled),type = "list")
}

Run the code above in your browser using DataLab