hough_sphere_3d — 3D detect op

• Data kinds: voxel → primitive

• Call: import fullseye as fs; fs.ledger.hough_sphere_3d(vol, device='cpu', radii=None, mc=0.0, iso=0.5, subvoxel=True) (to call the implementation directly, import match3d; match3d.hough_sphere_3d(vol, device='cpu', radii=None, mc=0.0, iso=0.5, subvoxel=True); from the registry, ops3d.get("hough_sphere_3d"))

• GPU: this op has a GPU path (device="cuda")

Usage

Sphere detection (the 3-D lift of the 2-D Hough circle). Votes the centre = p + sgn·r·n for each radius r.

Each voxel of the thin boundary surface votes towards the centre along its normal n (both signs are tried so that both bright and dark spheres are caught). The maximum of the centre-peak votes per radius = the detected sphere. votes-vs-radius is parabola-interpolated for a sub-voxel radius. Industrial use: balls, spherical parts, spherical surfaces in point clouds. Returns (votes, radius, center(3,)).

Procedure: from the 1-voxel-thick boundary surface voxels p of (vol > iso) and their unit normals n (sobel3d; mc is a threshold on the raw output), vote for c = round(p ± r·n) per radius r (± tries both bright and dark spheres and takes the larger), and the maximum of the votes falling inside the volume is the score for that r. The best over all r is the detected sphere.

• radii: sequence of radii to try (voxel units). None means range(4, 16) (4 to 15). subvoxel=True

refines the radius within ±1 by parabolic interpolation of the votes only when both neighbours r±1 of the best r are in radii (at the end r or with sparse radii it stays an integer).

• Returns (votes, radius, center): votes is the vote count (bounded by the number of boundary voxels), radius is a float,

center is an integer (z,y,x) tuple (the centre is not refined).

• With fewer than 10 boundary voxels, None. An empty radii crashes with TypeError.

• Returns only 1 sphere. For multiple spheres, erase the voxels of the detected sphere and run again, or for point clouds use

ransac_sphere / fit_sphere_3d.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

Runnable examples (verified samples that actually call this op)

• detect_primitives_3d — py -3.11 examples_3d/detect_primitives_3d.py

Ops the type connects to (they accept primitive as input)

fuse_to_voxel · angle_between_lines · angle_between_planes · angle_line_plane · distance_point_plane · distance_point_line · distance_line_line · distance_segment_segment

Same category (detect)

hough_plane_3d


*Provenance: match3d.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.