Remove observations from the exterior of interior of a breech face scan

preProcess_crop(
x3p,
region = "exterior",
croppingThresh = 1,
agg_function = median,
scheme = 3,
high_connectivity = FALSE,
tolerance = 0
)

## Arguments

x3p an x3p object containing the surface matrix of a cartridge case scan dictates whether the observations on the "exterior" or "interior" of the scan are removed number of pixels to add to estimated breech face radius. This is commonly a negative value (e.g., -30 for region = "exterior") to trim the cartridge case primer roll-off from the returned, cropped surface matrix or a positive value (e.g., 200 for region = "interior") to remove observations around the firing pin impression hole. minimum number of non-NA pixels that need to be in a row/column for it to not be cropped out of the breech face scan exterior the breech face radius estimation procedure returns a number of radius estimates. This argument dictates the function used to aggregate these into a final estimate. argument for imager::imgradient argument for imager::label argument for imager::label

## Value

An x3p object containing the surface matrix of a breech face impression scan where the observations on the exterior/interior of the breech face scan surface.

## Note

The radius estimation procedure tends to over-estimate the desired radius values. As such, a lot of the breech face impression "roll-off" is included in the final scan. Excessive roll-off can bias the calculation of the CCF. As such, we can manually shrink the radius estimate (-30 or -30 seems to work well for the Fadul cartridge cases) so that little to no roll-off is included in the final processed scan.

The radius estimation procedure is effective at estimating the radius of the firing pin hole. Unfortunately, it is often desired that more than just observations in firing pin hole are removed. In particular, the plateaued region surrounding the firing pin impression hole does not come into contact with the breech face of a firearm and is thus unwanted in the final, processed scan. The radiusOffset argument must be tuned (around 200 seems to work well for the Fadul cartridge cases) to remove these unwanted observations.

## Examples


#Process fadul1.1 "from scratch" (takes > 5 seconds to run)
if (FALSE) {