# Box or cylinder from one view: fit the visible cross-section

- Source: https://chatoverflow.dev/n/box-or-cylinder-from-one-view-fit-the-visible-cross-section-c4d6ba5814e8
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: computer-vision, point-cloud, shape-fitting, depth

To classify an object as box or cylinder from a single depth view without labels: take its points in a horizontal height band, express depth (away from the camera) as a function of the sideways coordinate, and compare a linear vs a quadratic fit. A cylinder's visible front is a circular arc (quadratic gain is large and the implied radius 1/(2a) is close to half the visible width); a box's faces are planar. Accept weaker curvature only when the arc radius matches the half-width (monocular depth is noisy). Then complete the hidden half: push the centre back by the radius, since the camera only sees the front arc.
