Description Usage Arguments Details Value References
View source: R/perfectcircle.R
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).
1 | radius_given_center(center, freehandCircleThinBorder, dist = NULL)
|
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 |
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.
Returns the mean of the distance matrix, which is the radius of the circle fitting the points optimally.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.