# The Active Segmentation Platform for Microscopic Image Classification and Segmentation
## 2 Theory
### Structure Tensor  
The structure tensor (ST) is an abstract extension of the gradient. The tensor encodes the predominant directions of the gradient in a specified neighborhood of a point, and the degree to which those directions are coherent as a function of scale. Suppose that we have a scale-space representation of the gradient \(\
abla_{G}\). Then the structure tensor is the smoothed tensor product of the smoothed gradient vector [22]:  
\[S_{r}(I):=G_{r}\star\{\
abla_{G}I\cdot\
abla_{G}I^{T}\} \tag{2}\]  
From this expression it is apparent that the operator introduces smoothing on two scales. However, because of the operator's quadratic character the scales do not compose. \(S_{r}(I)\) can be represented by a 2 \(\times\) 2 matrix. Besides the information on orientation and magnitude of structures, which is already present in the gradient, the structure tensor contains some additional information. This additional information is produced by the second smoothing step and measures the homogeneity of gradient field orientations within the neighborhood of a pixel. The information contained in the tensor is encoded by its eigenvalues and eigenvectors. Suppose that there is no second smoothing step. Then, the maximal eigenvalue encodes the eigenvector in the direction of the gradient, while by symmetry the second eigenvector is orthogonal and is in the direction of the isophote.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Curvature Invariant** & **Formula** \\ \hline Line curvature & \(\left(G_{xx}G_{y}^{2}-2G_{x}G_{y}G_{xy}+G_{x}^{2}G_{yy}\right)/\left(G_{x}^{2 }+G_{y}^{2}\right)^{3/2}\) \\ Mean curvature & \(1/2\left(\left(1+G_{x}^{2}\right)G_{yy}-2G_{x}G_{y}G_{xy}+\left(1+G_{y}^{2} \right)G_{xx}\right)/\left(1+G_{x}^{2}+G_{y}^{2}\right)^{3/2}\) \\ Gaussian curvature & \(\left(G_{xx}G_{yy}-G_{xy}^{2}\right)/\left(1+G_{x}^{2}+G_{y}^{2}\right)^{2}\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Curvature invariants.  
\begin{table}
\begin{tabular}{l l l} \hline \hline
**Filter** & **Functionality** & **Feature Order** \\ \hline Gauss2D & Gaussian smoothing, Equation (4) & 0 \\ Gradient & Gradient amplitude and orientation & 1 \\ Gaussian Structure & Structure tensor, Equation (2) & 1 \\ LoG & Laplacian of Gaussian (LoG) & 2 \\ ALoG & Anisotropic decomposition of LoG, Equations (A2) and (A3) & 2 \\  & Gradient amplitude and orientation & 1 \\ Hessian & Eigenvalues of the Hessian & 2 \\  & Determinant of the Hessian & 2 \\ Curvature 2D & Line curvature + Hessian determinant & 2 \\ Curvature 3D & Mean + Gauss curvature of surfaces & 2 \\ BoG & Bi-Laplacian of Gaussian, Equation (5) & 4 \\ Gaussian Jet & Gaussian Jet of order \(n\) & n \\ LoGN & \(n\)-th order PoL, Equation (5) & 2 n \\ \hline \hline \end{tabular}
\end{table}
Table 3: Filters computing geometric features.  
So that the encoded information is equivalent to the gradient. Moreover, if the second eigenvalue is 0 it means that the image has constant intensity along the direction of the second eigenvector. The second smoothing step induces a weighted averaging in a larger window. A useful measure of the homogeneity of the image is the coherence  
\[c=\left(\frac{\lambda_{1}-\lambda_{2}}{\lambda_{1}+\lambda_{2}}\right)^{2} \tag{3}\]  
This quantity is 1 when the gradient field is totally aligned, and 0 when it has no preferred direction. The structure tensor is implemented as the filter Gaussian Structure (see Table 3).