Superellipsoid



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

Superellipsoids as computer graphics primitives were popularized by Alan H. Barr (who used the name "superquadrics" to refer to both superellipsoids and supertoroids). 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.

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

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:


 * Cylinder
 * Sphere
 * Steinmetz solid
 * Bicone
 * Regular octahedron
 * Cube, as a limiting case where the exponents tend to infinity

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

Basic (normalized) superellipsoid
The basic superellipsoid is defined by the implicit function
 * $$ 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 $$ \epsilon_1$$ and $$ \epsilon_2$$ are positive real numbers that control the squareness of the shape.

The surface of the superellipsoid is defined by the equation:

$$ f(x,y,z)=1$$

For any given point $$ (x,y,z)\in\mathbb{R}^3$$, the point lies inside the superellipsoid if $$ f(x,y,z)<1$$, and outside if $$ 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 $$ 2/\epsilon_2$$, scaled by $$ a = (1 - z^{\frac{2}{\epsilon_1}})^{\frac{\epsilon_1}{2}}$$, which is


 * $$ \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 $$ 2/\epsilon_1$$, stretched horizontally by a factor w that depends on the sectioning plane. Namely, if $$ x=u\cos\theta$$ and $$ y=u\sin\theta$$, for a given $$ \theta$$, then the section is


 * $$ \left(\frac{u}{w}\right)^{\frac{2}{\epsilon_1}} + z^{\frac{2}{\epsilon_1}} = 1,$$

where


 * $$w = (\cos^{\frac{2}{\epsilon_2}}\theta + \sin^{\frac{2}{\epsilon_2}}\theta)^{-\frac{\epsilon_2}{2}}.$$

In particular, if $$ \epsilon_2$$ is 1, the horizontal cross-sections are circles, and the horizontal stretching $$ 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 $$ 2/\epsilon_1$$ around the vertical axis.

Superellipsoid
The basic shape above extends from &minus;1 to +1 along each coordinate axis. The general superellipsoid is obtained by scaling the basic shape along each axis by factors $$ a_x$$, $$ a_y$$, $$ a_z$$, the semi-diameters of the resulting solid. The implicit function is


 * $$ 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

$$ F(x,y,z)=1$$

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

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

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


 * $$x(\eta,\omega) = a_x \cos^{\epsilon_1}\eta\cos^{\epsilon_2}\omega$$
 * $$y(\eta,\omega) = a_y \cos^{\epsilon_1}\eta\sin^{\epsilon_2}\omega$$
 * $$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.

For a given Euclidean transformation of the superellipsoid frame $$ 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

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

where $$ \circ$$ is the transformation operation that maps the point $$ (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 $$ \beta(\cdot,\cdot)$$,

$$ V(\epsilon_1,\epsilon_2,a_x,a_y,a_z)=2a_xa_ya_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 $$ \Gamma(\cdot)$$, since

$$ \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,  robotics, and physical simulation.

Traditional computational methods model the problem as a least-square problem. The goal is to find out the optimal set of superellipsoid parameters $$ \theta\doteq[\epsilon_1, \epsilon_2, a_x, a_y, a_z, g]$$ that minimize an objective function. Other than the shape parameters, $$ g\in $$ SE(3) is the pose of the superellipsoid frame with respect to the world coordinate.

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

$$ G_1(\theta)=a_xa_ya_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 $$ \{(x_i,y_i,z_i)\in \mathbb{R}^3, i=1,2,...,N\}$$. At the mean time, the scalar value $$ 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

$$ 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 $$ r_i=\|(x_i,y_i,z_i)\|_2$$

A probabilistic method called EMS is designed to deal with noise and outliers. 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.