radius_given_center: Estimate best radius given center of the circle in an image.

Description Usage Arguments Details Value References

View source: R/perfectcircle.R

Description

Given a mask image containing the borderline of the circle and the center coordinates one can compute for this configuration using the formula by Coope (1993).

Usage

1
radius_given_center(center, freehandCircleThinBorder, dist = NULL)

Arguments

center

A vector of length two containing the (x,y) coordinates of the center

freehandCircleThinBorder

An imager image mask with the extracted borderline of the freehand circle having a pixel value > 0

dist

A distance matrix for each pixel with freehandCircleThinBorder > 0

Details

The function implements Formula 3 in Coope (1993) while using a mask image to hold the points. Given the center c we can determine the radius as r(c)=1/m ∑_{j=1}^m (c-a_j)^2.

Value

Returns the mean of the distance matrix, which is the radius of the circle fitting the points optimally.

References

Coope, I.D. 1993. “Circle Fitting by Linear and Nonlinear Least Squares.” Journal of Optimization Theory and Applications 76 (2): 381–88. doi:10.1007/BF00939613.


hoehleatsu/perfectcircle documentation built on Feb. 6, 2020, 10:13 p.m.