3.1. Spherical Harmonics

In order to be able to represent a function on a sphere in a rotation invariant manner, we utilize the mathematical notion of spherical harmonics to describe the way that rotations act on a spherical function. The theory of spherical harmonics says that any spherical function ${\displaystyle {\mathfrak {f}}}$(?,f) can be decomposed as the sum of its harmonics:

${\displaystyle {\mathfrak {f}}(\theta ,\phi )={\sum \limits _{l=0}^{\infty }}{\sum \limits _{m=-l}^{m=+l}}f_{l}^{m}Y_{l}^{m}(\theta ,\phi )}$

(1)

where degree ${\displaystyle l}$ and order ${\displaystyle m}$ and

${\displaystyle \mathrm {Y} _{l}^{m}(\theta ,\phi )=\mathrm {N} e^{im\phi }\mathrm {P} _{l}^{m}(cos\theta )}$

(2)

Normalization factor ${\displaystyle \mathrm {N} }$ is defined below and

${\displaystyle e^{im\phi }=cos(m\phi )+isin(m\phi )}$

(3)

and

${\displaystyle f_{l}^{m}=\int _{0}^{2\pi }\int _{0}^{\pi }f(\theta ,\phi )\mathrm {Y} _{l}^{m}(\theta ,\phi )sin\theta ~d\theta ~d\phi }$

(4)

Fourier transform component:

${\displaystyle f_{m}(\theta )=\int _{0}^{2\pi }f(\theta ,\phi )e^{im\phi }~d\phi }$

(5)

Legendre transform:

${\displaystyle f_{l}^{m}=\int _{0}^{\pi }f_{m}(\theta )P_{l}^{m}(cos\theta )sin\theta ~d\theta ~~~~\Rightarrow ~~~f_{l}^{m}=-\int _{1}^{-1}f_{m}(arccos(cos\theta ))P_{l}^{m}(cos\theta )~d\cos \theta }$

(6)

and discrete form of Gauss-Legendre transform:

${\displaystyle f_{l}^{m}=\sum _{j=1}^{N_{0}}{f_{m}(\theta _{j})\mathrm {P} _{l}^{m}(cos\theta _{j})w_{j}}}$

(7)

${\displaystyle \bullet }$ ALTERNATIVE EXPRESSION OF COEFFICIENTS:

${\displaystyle f_{l}^{m}=\int \limits _{0}^{2\pi }d\phi cos(m\phi )\int \limits _{0}^{\pi }d\theta sin(\theta )F(\theta ,\phi )P_{l}^{m}(cos\theta )}$ ${\displaystyle ~~~~~+i\int \limits _{0}^{2\pi }d\phi sin(m\phi )\int \limits _{0}^{\pi }d\theta sin(\theta )F(\theta ,\phi )P_{l}^{m}(cos\theta )}$

(8)

Assuming

${\displaystyle Q_{l}^{m}(\phi )=\int \limits _{0}^{\pi }d\theta sin(\theta )F(\theta ,\phi )P_{l}^{m}(cos\theta )}$

(9)

we can rewrite the expression (8) as

${\displaystyle f_{l}^{m}=\int \limits _{0}^{2\pi }d\phi cos(m\phi )Q_{l}^{m}(\phi )+i\int \limits _{0}^{2\pi }d\phi \sin(m\phi )Q_{l}^{m}(\phi )}$

(10)

${\displaystyle \bullet }$ DISCRETE FOURIER TRANSFORM

Forward Transform:

${\displaystyle X(n)={\frac {1}{N}}\sum _{k=0}^{N-1}x(k)\exp ^{-jk2\pi n/N}~~~for~~~n=0,....N-1}$

(11)

Inverse Transform:

${\displaystyle x(n)=\sum _{k=0}^{N-1}X(k)\exp ^{+jk2\pi n/N}~~~for~~~n=0,...N-1}$

(12)

${\displaystyle \bullet }$ INTERVAL CHANGE

An integral over [a, b] must be changed into an integral over [-1, 1] before applying the Gaussian quadrature rule. This change of interval can be done in the following way:

${\displaystyle \int \limits _{a}^{b}{\mathfrak {f}}(x)~dx={\frac {b-a}{2}}\int \limits _{-1}^{1}{\mathfrak {f}}\left({\frac {b-a}{2}}x+{\frac {b+a}{2}}\right)~dx}$

(13)

Applying the Gaussian quadrature rule then results in the following approximation:

${\displaystyle \int _{a}^{b}f(x)\,dx={\frac {b-a}{2}}\sum _{i=1}^{n}w_{i}f\left({\frac {b-a}{2}}x_{i}+{\frac {a+b}{2}}\right)}$

(14)

${\displaystyle \bullet }$ SUBSPACES AND ROTATIONS

The key property of this decomposition is that if we restrict to some frequency ${\displaystyle {\mathfrak {l}}}$, and define the subspace of functions:

${\displaystyle V_{l}={\text{Span}}\{Y_{l}^{-l},Y_{l}^{-l+1},....,Y_{l}^{l-1},Y_{l}^{l}\}}$

(15)

then:

• ${\displaystyle V_{l}}$ is a Representation For the Rotation Group: For any function ${\displaystyle {\mathfrak {f}}}$ ${\displaystyle {\in }V_{l}}$ and any rotation R, we have R(${\displaystyle {\mathfrak {f}}}$) ${\displaystyle {\in }V_{l}}$

This can also be expressed in the following manner: if ${\displaystyle \pi _{l}}$ is the projection onto the subspace ${\displaystyle V_{l}}$ then ${\displaystyle \pi _{l}}$ commutes with rotations:

${\displaystyle \pi _{l}(R({\mathfrak {f}}))=R(\pi _{l}({\mathfrak {f}}))}$

(16)

• ${\displaystyle V_{l}}$ is Irreducible ${\displaystyle V_{l}}$ cannot be further decomposed as a direct sum ${\displaystyle V_{l}}$ = ${\displaystyle V{_{l}^{i}}}$?${\displaystyle V{_{l}^{j}}}$ where ${\displaystyle V{_{l}^{i}}}$ and ${\displaystyle V{_{l}^{j}}}$ are also (nontrivial) representation of rotation group.

The first property presents a way for decomposing spherical functions into rotation in variant components, while the second property guarantees that, in a linear sense, this decomposition is optimal

3. Spherical Rotation Invariance

In this paper, we present a tool for transforming rotation dependent spherical and voxel shape descriptors into rotation invariant ones. The key idea of our approach is to describe a spherical function in terms of the amount of energy it contains at different frequencies. Since these values do not change when the function is rotated, the resulting descriptor is rotation invariant. This approach can be viewed as a generalization of the Fourier Descriptor method 11 to the case of spherical functions.

3.2 Rotation Invariant Descriptors

Using the properties of spherical harmonics and the observation that rotation of the spherical harmonics does not change its ${\displaystyle L_{2}}$-norm we represents the energies of the spherical function f(?,f) as:

${\displaystyle \mathrm {SH} ({\mathfrak {f}})=\{{\parallel f_{0}(\theta ,\phi )\parallel ,\parallel f_{1}(\theta ,\phi )\parallel ,....\parallel f_{l}(\theta ,\phi )\parallel }\}}$

(17)

where ${\displaystyle {\mathfrak {f}}_{l}}$ are frequency components of ${\displaystyle {\mathfrak {f}}}$:

${\displaystyle {\mathfrak {f}}_{l}(\theta ,\phi )=\pi _{l}({\mathfrak {f}})=\sum _{m=-l}^{m=+l}a_{lm}Y_{l}^{m}(\theta ,\phi )}$

(18)

This representation has the property that it is independent of the orientation of the spherical function. To see this we let R be any rotation and we have:

${\displaystyle \mathrm {SH} (\mathrm {R} ({\mathfrak {f}}))=\{{\parallel \pi _{0}(\mathrm {R} (f))\parallel ,\parallel \pi _{1}(\mathrm {R} (f))\parallel ,....}\}}$

(19)

= ${\displaystyle \{{\parallel \mathrm {R} \pi _{0}(f)\parallel ,\parallel \mathrm {R} \pi _{1}(f)\parallel ,....}\}}$
= ${\displaystyle \{{\parallel \pi _{0}(f)\parallel ,\parallel \pi _{1}(f)\parallel ,....}\}}$
= ${\displaystyle SH({\mathfrak {f}})}$

The following is from the Wikipedia article on Spherical Harmonics (with my comments as well):

While computing invariants it may be necessary take into account the contribution of expansion coefficients with negative m index). This contribution is not linear and cannot simply be discounted. On the other hand you may consider dropping some subset of indices m across the whole range of ${\displaystyle -l, for instance you can drop even or odd m's or to drop two or three in a row and then use the next one. The only rule must apply: it has to be uniform for negative and positive m's.

${\displaystyle P{_{l}^{-m}}=(-1)^{m}{\frac {(l-m)!}{(l+m)!}}P{_{l}^{m}}}$

(20)

You can use Stirling approximation to compute large factorials or you can reduce the fraction by noticing that the fraction with factorials will be equal to

${\displaystyle {\frac {(l-m)!}{(l+m)!}}={\frac {1}{(l-m+1)(l-m+2)...(l+m)}}}$

(21)

• Power spectrum in signal processing

The total power of a function ${\displaystyle {\mathfrak {f}}}$ is defined in the signal processing literature as the integral of the function squared, divided by the area of its domain. Using the orthonormality properties of the real unit-power spherical harmonic functions, it is straightforward to verify that the total power of a function defined on the unit sphere is related to its spectral coefficients by a generalization of Parseval's theorem:

${\displaystyle {\frac {1}{4\pi }}\int _{\Omega }\parallel {\mathfrak {f}}(\Omega )\parallel ^{2}{\mathit {d}}\Omega =\sum \limits _{l=0}^{\infty }S_{ff}}$

(22)

where

${\displaystyle S_{ff}(l)={\frac {1}{2l+1}}\sum \limits _{m=-l}^{l}\parallel f_{lm}\parallel ^{2}}$

(23)

is defined as the angular power spectrum. In a similar manner, one can define the cross-power of two functions as

${\displaystyle {\frac {1}{4\pi }}\int _{\Omega }{\mathfrak {f}}(\Omega ){\mathfrak {g^{\ast }}}(\Omega ){\mathit {d}}\Omega =\sum \limits _{l=0}^{\infty }S_{fg}(l)}$

(24)

where

${\displaystyle S_{fg}(l)={\frac {1}{2l+1}}\sum \limits _{m=-l}^{l}{\mathfrak {f}}_{lm}{\mathfrak {g}}_{lm}^{\ast }}$

(25)

As one can see the previous paragraph is directly related to our two perspectives. Those "total powers of a function" split in ribbons in the vector space with the same degree ${\displaystyle l}$ are in fact the invariants we must use.

CONVENIENT FORMULAS:

${\displaystyle P_{l}^{l}(x)=(-1)^{l}(2l-1)!!(1-x^{2})^{l/2}}$

(26)

${\displaystyle P_{m+1}^{m}(x)=x(2m+1)P_{m}^{m}(x)}$

(27)

${\displaystyle P_{l+1}^{l+1}(x)=-(2l+1){\sqrt {1-x^{2}}}P_{l}^{l}(x)}$

(28)

${\displaystyle P_{l}^{l}(x)=-(2l-1){\sqrt {1-x^{2}}}P_{l-1}^{l-1}(x)}$

(29)

${\displaystyle P_{l}^{m}(x)=(-1)^{m}P_{l-m}(x)}$

(30)

${\displaystyle P_{n}(x)=\sum _{m=0}^{M}(-1)^{m}{\Biggl (}{\frac {n!}{(2n)!}}{\Biggl )}{\frac {(2n-2m)!}{m!(n-m)!(n-2m)!}}x^{n-2m}}$

(31)

where

${\displaystyle M={\frac {n}{2}}}$ or ${\displaystyle M={\frac {(n-1)}{2}}}$

(32)

depending on n being even or odd

RECURRENCES:

${\displaystyle P_{l}(x)={\frac {(2l-1)xP_{l-1}(x)-(l-1)P_{l-2}(x)}{l}}}$

(33)

${\displaystyle (l-m)P_{l}^{m}(x)=(2l-1)xP_{l-1}^{m}(x)-(l+m-1)P_{l-2}^{m}(x)}$

(34)

Moving along indices M to the right (in the direction of increasing index M):

${\displaystyle P_{l}^{m}(x)=-[{\dfrac {2(m-1)xP_{l}^{m-1}(x)}{\sqrt {1-x^{2}}}}+(l+m-1)(l-m+2)P_{l}^{m-2}(x)]}$

(35)

Moving along indices M to the left (in the direction of decreasing index M):

${\displaystyle P_{l}^{m}(x)=-{\frac {2(m+1)xP_{l}^{m+1}(x)}{{\sqrt {1-x^{2}}}(l+m+1)(l-m)}}-{\frac {P_{l}^{m+2}(x)}{(l+m+1)(l-m)}}}$

(36)

NORMALIZATION (LEGENDRE POLYNOMIALS FIRST):

${\displaystyle {\sqrt {\frac {2l+1}{2}}}P_{l}(x)}$

(37)

NORMALIZATION (ASSOCIATED LEGENDRE POLYNOMIALS):

I have a few questions concerning orthonormality of Associated Legendre Polynomials (ALP). I want to stress the word orthonormality as opposed to simply orthogonality. The reason for that is computational. It is a well known fact that when ALP with large indices ${\displaystyle l}$ & ${\displaystyle m}$ are computed the functional values grow in magnitude to the point that the exponents overflow. Double precision is required and in some cases even quadruple precision is needed. The normalization diminishes the absolute values of the functions considerably but not universally. I want to make sure that I understand normalization correctly. Wikipedia article on ALP gives two formulas.

${\displaystyle \int _{-1}^{1}P_{k}^{m}(x)P_{l}^{m}(x)dx={\frac {2(l+m)!}{(2l+1)(l-m)!}}\delta _{k,l}}$

(38)

Thus the normalization factor here will be:

${\displaystyle N_{l}^{m}={\sqrt {\frac {(2l+1)(l-m)!}{2(l+m)!}}}}$

(39)

I call it normalization in respect to ${\displaystyle l}$

For my task it is more important to normalize in respect to ${\displaystyle m}$. It is given by this formula:

${\displaystyle \int _{-1}^{1}{\frac {P_{l}^{m}(x)P_{l}^{n}(x)}{(1-x^{2})}}dx={\frac {(l+m)!}{m(l-m)!}}\,\,\,(m=n\neq 0)}$

(40)

The normalization factor for each subspace with a given ${\displaystyle l}$ but differing ${\displaystyle m}$ should be this:

${\displaystyle N_{l}^{m}={\sqrt {\frac {m(l-m)!}{(l+m)!}}}}$

(41)

I call it normalization in respect to index ${\displaystyle m}$. I am uncertain about what to do with the factor ${\displaystyle (1-x^{2})^{-1}}$ under the integral, however. Does it have to be included in the normalization formula, perhaps as ${\displaystyle {\sqrt {(1-x^{2})^{-1}}}}$ ?

NORMALIZATION IN QUANTUM MECHANICS:

${\displaystyle \mathrm {Y} _{l}^{m}(\theta ,\phi )=(-1)^{m}{\sqrt {\frac {(2l+1)(l-m)!}{4\pi (l+m)!}}}\mathrm {P} _{l}^{m}(cos\theta )e^{im\phi }}$

(42)

which are orthonormal:

${\displaystyle \int _{\theta =0}^{\pi }\int _{\phi =0}^{2\pi }\mathrm {Y} _{l}^{m}\mathrm {Y} _{l^{\prime }}^{m^{\prime \ast }}d\Omega =\delta _{ll^{\prime }}\delta _{mm^{\prime }}}$

(43)

${\displaystyle \bullet }$ NORMALIZATION PER keisan.casio CALCULATOR [1]

${\displaystyle \int \limits _{-1}^{1}P_{n}^{m}(x)P_{n^{\prime }}^{m}(x)dx={\frac {2}{2n+1}}{\frac {(n+m)!}{(n-m)!}}\delta _{nn^{\prime }}}$

(44)

${\displaystyle \int \limits _{-1}^{1}P_{n}^{m}(x)P_{n}^{m^{\prime }}(x){\frac {dx}{1-x^{2}}}={\frac {(n+m)!}{m(n-m)!}}\delta _{mm^{\prime }}}$

(45)

INEQUALITY:

${\displaystyle \max {\left\vert P_{n}^{m}(x)\right\vert }\leq {1 \over {\sqrt {2}}}{\sqrt {\frac {(n+m)!}{(n-m)!}}}}$

(46)

Contribution by Quondum in response to my post in Math Section under the heading "DETERMINANT:"

If you want to describe an arc from ${\displaystyle \mathbf {X_{1}} }$ and ${\displaystyle \mathbf {X_{2}} }$ can't you just say that:

${\displaystyle \mathbf {A_{3}} =s\,\mathbf {X_{1}} +(1-s)\,\mathbf {X_{2}} }$ and ${\displaystyle \mathbf {X_{3}} ={\mathbf {A_{3}} \over \lVert \mathbf {A_{3}} \rVert }R}$

(47)

where s is an arbitrary new parameter that runs from 0 to 1 and R is the radius of the sphere. Then in a cartesian representation ${\displaystyle \mathbf {A_{3}} (s)}$ describes a secant In through the sphere, and the rescaling projects that path to the surface, hence defining an arc. It will break down if the starting points are exact antipodes, but that case if pretty ill-defined anyway.

This can be extended to the case of a rectangle defined by ${\displaystyle \mathbf {X_{1}} ,\mathbf {X_{2}} ,\mathbf {X_{3}} ,\mathbf {X_{4}} }$ by introducing a second parameter t:

${\displaystyle \mathbf {A_{5}} =t(s\,\mathbf {X_{1}} +(1-s)\,\mathbf {X_{2}} )+(1-t)(s\,\mathbf {X_{3}} +(1-s)\,\mathbf {X_{4}} )}$ and ${\displaystyle \mathbf {X_{5}} ={\mathbf {A_{5}} \over \lVert \mathbf {A_{5}} \rVert }R}$

(48)

Assuming that the natural edges of the rectangle are ${\displaystyle \mathbf {X_{1}} }$ to ${\displaystyle \mathbf {X_{2}} }$, ${\displaystyle \mathbf {X_{2}} }$ to ${\displaystyle \mathbf {X_{4}} }$, ${\displaystyle \mathbf {X_{4}} }$ to ${\displaystyle \mathbf {X_{3}} }$, and ${\displaystyle \mathbf {X_{3}} }$ to ${\displaystyle \mathbf {X_{1}} }$.

It is worth noting that a uniform sampling of s and t, will not uniformly sample the surface of the sphere (especially if the points are far apart), but it is a good starting point. Dragons flight (talk) 19:29, 3 December 2014 (UTC)

Camera matrix:

Comment: x,y & z in fact mean ${\displaystyle -\theta _{x},-\theta _{y},-\theta _{z}}$

${\displaystyle {\begin{bmatrix}cos(y)&0&sin(y)\\cos(x)&cos(x)&-sin(x)cos(y)\\-cos(x)sin(y)&sin(x)&cos(x)cos(y)\end{bmatrix}}{\begin{bmatrix}cos(z)&-sin(z)&0\\sin(z)&cos(z)&0\\0&0&1\end{bmatrix}}=}$ ${\displaystyle {\begin{bmatrix}cos(y)cos(z)&-cos(y)sin(z)&sin(y)\\cos(x)cos(z)+cos(x)sin(z)&-cos(x)sin(z)+cos(x)cos(z)&-sin(x)cos(y)\\-cos(x)sin(y)cos(z)+sin(x)sin(z)&cos(x)sin(y)sin(z)+sin(x)cos(z)&cos(x)cos(y)\end{bmatrix}}}$