# Superellipsoid

In mathematics, a superellipsoid (or super-ellipsoid) is a solid whose horizontal sections are superellipses (Lamé curves) with the same squareness parameter ${\displaystyle \epsilon _{2}}$, and whose vertical sections through the center are superellipses with the squareness parameter ${\displaystyle \epsilon _{1}}$. It is a generalization of an ellipsoid, which is a special case when ${\displaystyle \epsilon _{1}=\epsilon _{2}=1}$.[2]

Superellipsoids as computer graphics primitives were popularized by Alan H. Barr (who used the name "superquadrics" to refer to both superellipsoids and supertoroids).[2][3] In modern computer vision and robotics literatures, superquadrics and superellipsoids are used interchangeably, since superellipsoids are the most representative and widely utilized shape among all the superquadrics.[4][5]

Superellipsoids have an rich shape vocabulary, including cuboids, cylinders, ellipsoids, octahedra and their intermediates.[6] It becomes an important geometric primitive widely used in computer vision,[6][5][7] robotics,[4] and physical simulation.[8] The main advantage of describing objects and envirionment with superellipsoids is its conciseness and expressiveness in shape.[6] Furthermore, a closed-form expression of the Minkowski sum between two superellipsoids is available.[9] This makes it a desirable geometric primitive for robot grasping, collision detection, and motion planning.[4]

## Special cases

A handful of notable mathematical figures can arise as special cases of superellipsoids given the correct set of values, which are depicted in the above graphic:

Piet Hein's supereggs are also special cases of superellipsoids.

## Formulas

### Basic (normalized) superellipsoid

The basic superellipsoid is defined by the implicit function

${\displaystyle f(x,y,z)=\left(x^{\frac {2}{\epsilon _{2}}}+y^{\frac {2}{\epsilon _{2}}}\right)^{\epsilon _{2}/\epsilon _{1}}+z^{\frac {2}{\epsilon _{1}}}}$

The parameters ${\displaystyle \epsilon _{1}}$ and ${\displaystyle \epsilon _{2}}$ are positive real numbers that control the squareness of the shape.

The surface of the superellipsoid is defined by the equation:

${\displaystyle f(x,y,z)=1}$

For any given point ${\displaystyle (x,y,z)\in \mathbb {R} ^{3}}$, the point lies inside the superellipsoid if ${\displaystyle f(x,y,z)<1}$, and outside if ${\displaystyle f(x,y,z)>1}$.

Any "parallel of latitude" of the superellipsoid (a horizontal section at any constant z between -1 and +1) is a Lamé curve with exponent ${\displaystyle 2/\epsilon _{2}}$, scaled by ${\displaystyle a=(1-z^{\frac {2}{\epsilon _{1}}})^{\frac {\epsilon _{1}}{2}}}$, which is

${\displaystyle \left({\frac {x}{a}}\right)^{\frac {2}{\epsilon _{2}}}+\left({\frac {y}{a}}\right)^{\frac {2}{\epsilon _{2}}}=1.}$

Any "meridian of longitude" (a section by any vertical plane through the origin) is a Lamé curve with exponent ${\displaystyle 2/\epsilon _{1}}$, stretched horizontally by a factor w that depends on the sectioning plane. Namely, if ${\displaystyle x=u\cos \theta }$ and ${\displaystyle y=u\sin \theta }$, for a given ${\displaystyle \theta }$, then the section is

${\displaystyle \left({\frac {u}{w}}\right)^{\frac {2}{\epsilon _{1}}}+z^{\frac {2}{\epsilon _{1}}}=1,}$

where

${\displaystyle w=(\cos ^{\frac {2}{\epsilon _{2}}}\theta +\sin ^{\frac {2}{\epsilon _{2}}}\theta )^{-{\frac {\epsilon _{2}}{2}}}.}$

In particular, if ${\displaystyle \epsilon _{2}}$ is 1, the horizontal cross-sections are circles, and the horizontal stretching ${\displaystyle w}$ of the vertical sections is 1 for all planes. In that case, the superellipsoid is a solid of revolution, obtained by rotating the Lamé curve with exponent ${\displaystyle 2/\epsilon _{1}}$ around the vertical axis.

### Superellipsoid

The basic shape above extends from −1 to +1 along each coordinate axis. The general superellipsoid is obtained by scaling the basic shape along each axis by factors ${\displaystyle a_{x}}$, ${\displaystyle a_{y}}$, ${\displaystyle a_{z}}$, the semi-diameters of the resulting solid. The implicit function is [2]

${\displaystyle F(x,y,z)=\left(\left({\frac {x}{a_{x}}}\right)^{\frac {2}{\epsilon _{2}}}+\left({\frac {y}{a_{y}}}\right)^{\frac {2}{\epsilon _{2}}}\right)^{\frac {\epsilon _{2}}{\epsilon _{1}}}+\left({\frac {z}{a_{z}}}\right)^{\frac {2}{\epsilon _{1}}}}$.

Similarly, the surface of the superellipsoid is defined by the equation

${\displaystyle F(x,y,z)=1}$

For any given point ${\displaystyle (x,y,z)\in \mathbb {R} ^{3}}$, the point lies inside the superellipsoid if ${\displaystyle f(x,y,z)<1}$, and outside if ${\displaystyle f(x,y,z)>1}$.

Therefore, the implicit function is also called the inside-outside function of the superellipsoid.[2]

The superellipsoid has a parametric representation in terms of surface parameters ${\displaystyle \eta \in [-\pi /2,\pi /2)}$, ${\displaystyle \omega \in [-\pi ,\pi )}$.[3]

${\displaystyle x(\eta ,\omega )=a_{x}\cos ^{\epsilon _{1}}\eta \cos ^{\epsilon _{2}}\omega }$
${\displaystyle y(\eta ,\omega )=a_{y}\cos ^{\epsilon _{1}}\eta \sin ^{\epsilon _{2}}\omega }$
${\displaystyle z(\eta ,\omega )=a_{z}\sin ^{\epsilon _{1}}\eta }$

### General posed superellipsoid

In computer vision and robotic applications, a superellipsoid with a general pose in the 3D Euclidean space is usually of more interest.[6][5]

For a given Euclidean transformation of the superellipsoid frame ${\displaystyle g=[\mathbf {R} \in SO(3),\mathbf {t} \in \mathbb {R} ^{3}]\in SE(3)}$ relative to the world frame, the implicit function of a general posed superellipsoid surface defined the world frame is[6]

${\displaystyle F\left(g^{-1}\circ (x,y,z)\right)=1}$

where ${\displaystyle \circ }$ is the transformation operation that maps the point ${\displaystyle (x,y,z)\in \mathbb {R} ^{3}}$ in the world frame into the canonical superellipsoid frame.

### Volume of superellipsoid

The volume encompassed by the superelllipsoid surface can be expressed in terms of the beta functions ${\displaystyle \beta (\cdot ,\cdot )}$,[10]

${\displaystyle V(\epsilon _{1},\epsilon _{2},a_{x},a_{y},a_{z})=2a_{x}a_{y}a_{z}\epsilon _{1}\epsilon _{2}\beta ({\frac {\epsilon _{1}}{2}},\epsilon _{1}+1)\beta ({\frac {\epsilon _{2}}{2}},{\frac {\epsilon _{2}+2}{2}})}$

or equivalently with the Gamma function ${\displaystyle \Gamma (\cdot )}$, since

${\displaystyle \beta (m,n)={\frac {\Gamma (m)\Gamma (n)}{\Gamma (m+n)}}}$

## Recovery from data

Recoverying the superellipsoid (or superquadrics) representation from raw data (e.g., point cloud, mesh, images, and voxels) is an important task in computer vision,[11][7][6][5] robotics,[4] and physical simulation.[8]

Traditional computational methods model the problem as a least-square problem.[11] The goal is to find out the optimal set of superellipsoid parameters ${\displaystyle \theta \doteq [\epsilon _{1},\epsilon _{2},a_{x},a_{y},a_{z},g]}$ that minimize an objective function. Other than the shape parameters, ${\displaystyle g\in }$ SE(3) is the pose of the superellipsoid frame with respect to the world coordinate.

There are two commonly used objective functions.[12] The first one is constructed directly based on the implicit function[11]

${\displaystyle G_{1}(\theta )=a_{x}a_{y}a_{z}\sum _{i=1}^{N}\left(F^{\epsilon _{1}}\left(g^{-1}\circ (x_{i},y_{i},z_{i})\right)-1\right)^{2}}$

The minimization of the objective function provides a recovered superellipsoid as close as possible to all the input points ${\displaystyle \{(x_{i},y_{i},z_{i})\in \mathbb {R} ^{3},i=1,2,...,N\}}$. At the mean time, the scalar value ${\displaystyle a_{x},a_{y},a_{z}}$ is positively proportional to the volume of the superellipsoid, and thus have the effect of minimizing the volume as well.

The other objective function tries to minimized the radial distance between the points and the superellipsoid. That is[13][12]

${\displaystyle G_{2}(\theta )=\sum _{i=1}^{N}\left(\left|r_{i}\right|\left|1-F^{-{\frac {\epsilon _{1}}{2}}}\left(g^{-1}\circ (x_{i},y_{i},z_{i})\right)\right|\right)^{2}}$, where ${\displaystyle r_{i}=\|(x_{i},y_{i},z_{i})\|_{2}}$

A probabilistic method called EMS is designed to deal with noise and outliers.[6] In this method, the superellipsoid recovery is reformulated as a maximum likelihood estimation problem, and an optimization method is proposed to avoid local minima utilizing geometric similarities of the superellipsoids.

The method is further extended by modeling with nonparametric bayesian techniques to recovery multiple superellipsoids simultaneously.[14]

## References

1. ^ "POV-Ray: Documentation: 2.4.1.11 Superquadric Ellipsoid".
2. ^ a b c d Barr (1981). "Superquadrics and Angle-Preserving Transformations". IEEE Computer Graphics and Applications. 1 (1): 11–23. doi:10.1109/MCG.1981.1673799. ISSN 1558-1756. S2CID 9389947.
3. ^ a b Barr, A.H. (1992), Rigid Physically Based Superquadrics. Chapter III.8 of Graphics Gems III, edited by D. Kirk, pp. 137–159
4. ^ a b c d Ruan, Sipu; Wang, Xiaoli; Chirikjian, Gregory S. (2022). "Collision Detection for Unions of Convex Bodies With Smooth Boundaries Using Closed-Form Contact Space Parameterization". IEEE Robotics and Automation Letters. 7 (4): 9485–9492. doi:10.1109/LRA.2022.3190629. ISSN 2377-3766. S2CID 250543506.
5. ^ a b c d Paschalidou, Despoina; Van Gool, Luc; Geiger, Andreas (2020). "Learning Unsupervised Hierarchical Part Decomposition of 3D Objects from a Single RGB Image". 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 1057–1067. doi:10.1109/CVPR42600.2020.00114. ISBN 978-1-7281-7168-5. S2CID 214634317.
6. Liu, Weixiao; Wu, Yuwei; Ruan, Sipu; Chirikjian, Gregory S. (2022). "Robust and Accurate Superquadric Recovery: A Probabilistic Approach". 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 2666–2675. arXiv:2111.14517. doi:10.1109/CVPR52688.2022.00270. ISBN 978-1-6654-6946-3. S2CID 244715106.
7. ^ a b Paschalidou, Despoina; Ulusoy, Ali Osman; Geiger, Andreas (2019). "Superquadrics Revisited: Learning 3D Shape Parsing Beyond Cuboids". 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). pp. 10336–10345. arXiv:1904.09970. doi:10.1109/CVPR.2019.01059. ISBN 978-1-7281-3293-8. S2CID 128265641.
8. ^ a b Lu, G.; Third, J. R.; Müller, C. R. (2012-08-20). "Critical assessment of two approaches for evaluating contacts between super-quadric shaped particles in DEM simulations". Chemical Engineering Science. 78: 226–235. Bibcode:2012ChEnS..78..226L. doi:10.1016/j.ces.2012.05.041. ISSN 0009-2509.
9. ^ Ruan, Sipu; Chirikjian, Gregory S. (2022-02-01). "Closed-form Minkowski sums of convex bodies with smooth positively curved boundaries". Computer-Aided Design. 143: 103133. arXiv:2012.15461. doi:10.1016/j.cad.2021.103133. ISSN 0010-4485. S2CID 229923980.
10. ^
11. ^ a b c Bajcsy, R.; Solina, F. (1987). "Three dimensional object representation revisited". Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV): 231–240.
12. ^ a b Zhang, Yan (2003-10-01). "Experimental comparison of superquadric fitting objective functions". Pattern Recognition Letters. 24 (14): 2185–2193. Bibcode:2003PaReL..24.2185Z. doi:10.1016/S0167-8655(02)00400-2. ISSN 0167-8655.
13. ^ Gross, A.D.; Boult, T.E. (1988). "Error of Fit Measures for Recovering Parametric Solids". [1988 Proceedings] Second International Conference on Computer Vision. pp. 690–694. doi:10.1109/CCV.1988.590052. ISBN 0-8186-0883-8. S2CID 43541446.
14. ^ Wu, Yuwei; Liu, Weixiao; Ruan, Sipu; Chirikjian, Gregory S. (2022). "Primitive-Based Shape Abstraction via Nonparametric Bayesian Inference". In Avidan, Shai; Brostow, Gabriel; Cissé, Moustapha; Farinella, Giovanni Maria; Hassner, Tal (eds.). Computer Vision – ECCV 2022. Lecture Notes in Computer Science. Vol. 13687. Cham: Springer Nature Switzerland. pp. 479–495. arXiv:2203.14714. doi:10.1007/978-3-031-19812-0_28. ISBN 978-3-031-19812-0.

## Bibliography

• Barr, "Superquadrics and Angle-Preserving Transformations," in IEEE Computer Graphics and Applications, vol. 1, no. 1, pp. 11–23, Jan. 1981, doi: 10.1109/MCG.1981.1673799.
• Aleš Jaklič, Aleš Leonardis, Franc Solina, Segmentation and Recovery of Superquadrics. Kluwer Academic Publishers, Dordrecht, 2000.
• Aleš Jaklič, Franc Solina (2003) Moments of Superellipsoids and their Application to Range Image Registration. IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS, 33 (4). pp. 648–657
• W. Liu, Y. Wu, S. Ruan and G. S. Chirikjian, "Robust and Accurate Superquadric Recovery: a Probabilistic Approach," 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), New Orleans, LA, USA, 2022, pp. 2666–2675, doi: 10.1109/CVPR52688.2022.00270.