DIPlib Documentation - ©1995-2013 Quantitative Imaging Group, Delft University of Technology.

# StructureTensor2D

Two dimensional Structure Tensor

## SYNOPSIS

`#include "dip_structure.h"`

dip_Error dip_StructureTensor2D( in, mask, orientation, energy, l1, l2, anisotropy1, anisotropy2, boundary, gradSpec, gradSigmas, tensorSpec, tensorSigmas )

## DATA TYPES

integer,float

## FUNCTION

This function computes the Structure Tensor (ST) at each point in the image. For a description of this technique see the references. There are two stages in the computation. The first stage computes the gradient vector at each point, using `Derivative` with parameters `gradSpec` and `gradSigmas`. The second stage, the tensor smoothing, is also performed using `Derivative` (with order = 0). The parameters used are `tensorSpec` and `tensorSigmas`.

If a mask image is given, a technique called normalised convolution (see references) is used to "fill in" the missing data.

The routine has a number of output images. Each of these can be set to zero. If set to zero, the corresponding result will not be computed. The following quantities are computed by this routine:

`orientation` | Orientation. Lies in the interval (-pi/2,pi/2).
`energy` | Sum of the two eigenvalues `l1` and `l2`.
`l1` | The largest eigenvalue.
`l2` | The smallest eigenvalue.
`anisotropy1` | Measure for local anisotropy: `( l1 - l2 ) / ( l1 + l2 )`.
`anisotropy2` | Measure for local anisotropy: `1 - l2 / l1`.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in` | Input
`dip_Image` | `mask` | Mask image (0=missing data)
`dip_Image` | `orientation` | Orientation
`dip_Image` | `energy` | Energy `(l1+l2)`
`dip_Image` | `l1` | Largest eigenvalue
`dip_Image` | `l2` | Smallest eigenvalue
`dip_Image` | `anisotropy1` | Local anisotropy: `(l1-l2)/(l1+l2)`
`dip_Image` | `anisotropy2` | Local anisotropy: `1-l2/l1`
`dip_BoundaryArray` | `boundary` | Boundary conditions
`dip_DerivativeSpec` | `gradSpec` | Parameters for derivative to compute gradient (see DerivativeSpec data structure)
`dip_FloatArray` | `gradSigmas` | Sigmas of derivative to compute gradient
`` | `` | Sigma of derivative to compute gradient
`dip_DerivativeSpec` | `tensorSpec` | Parameters for Gaussian for tensor smoothing (see DerivativeSpec data structure)
`dip_FloatArray` | `tensorSigmas` | Sigmas of Gaussian for tensor smoothing
`` | `` | Sigma of Gaussian for tensor smoothing

## LITERATURE

Bernd Jahne, Practical Handbook on Image Processing for Scientific Applications, chapter 13, CRC Press, 1997

L.J. van Vliet and P.W. Verbeek, Estimators for Orientation and Anisotropy in Digitized Images, in: J. van Katwijk, J.J. Gerbrands, M.R. van Steen, J.F.M. Tonino (eds.), ASCI'95, Proc. First Annual Conference of the Advanced School for Computing and Imaging (Heijen, NL, May 16-18), ASCI, Delft, 1995, pp. 442-450.

C.F. Westin, A Tensor Framework for Multidimensional Signal Processing, PhD thesis, Linkoping University, Sweden, 1994

## SEE ALSO

`Derivative`