Sphere
Sphere¶
class Sphere():
| Sphere()
Implementation for Sphere RANSAC. A Sphere is defined as points spaced from the center by a constant radius.
This class finds the center and radius of a sphere. Base on article "PGP2X: Principal Geometric Primitives Parameters Extraction"

fit¶
| fit(pts, thresh=0.2, maxIteration=1000)
Find the parameters (center and radius) to define a Sphere.
Arguments:
pts: 3D point cloud as a numpy array (N,3).thresh: Threshold distance from the Sphere hull which is considered inlier.maxIteration: Number of maximum iteration which RANSAC will loop over.
Returns:
center: Center of the cylinder np.array(1,3) which the cylinder axis is passing through.radius: Radius of cylinder.inliers: Inlier's index from the original point cloud.