Tina provides an implementation of the colour segmentation algorithm described in more detail in Tina Memo no. 2001-015, as
presented at the British Machine Vision Conference in 2001. The algorithm works by non-parametric density estimation in the JK
colour space. The red, green and blue fields are converted to the IJK colour space, and the I field discarded to remove
illumination effects to first order. The JK colour space is then mapped with points, where the distance between the points is
specified by the "resolution" field. All measurements in the colour space are scaled by the local noise, in order to convert to
first order into a variance-normalised space and so take proper account of the noise. Hill climbing is then performed on this map
of nodes, moving from each pixel to the nearest node, and then across the nodes in the direction of steepest gradient, until a
local peak is found. A list of peaks is generated, and each is assigned a label, in order of the number of pixels assigned to
that peak. Then the labels are propagated to all pixels assigned to each peak, and an image of labels generated.

The novel aspect of the Tina colour segmentation algorithm is the way in which the peak climbing is performed. The points used
to map the colour space can be envisaged as tesselating the space with a set of polygonal regions known as Voronoid cells: each
point is at the centre of a cell, and the boundaries of the cell are defined by lines normal to the vector between each point and
its immediate neighbours. During the hill climbing stage of the algorithm, each step from point to point is tested to ensure that
it only steps to a Voronoid neighbour i.e. does not jump completely across a cell. This ensures that the hill climbing will not
jump across local minima, without requiring any implicit assumption of scale (see the discussion in section 3.4). Combined with
scaling all distance measurements in the colour space be the local noise, this ensures that proper statistical account is taken of
the data accuracy.

The noise scaling in the colour segmentation operates by maintaining a matrix of errors on each pixel. This matrix is regenerated
whenever an image is loaded, a colour field is popped from the stack, or a normalisation is performed. This error matrix is then
used to perform error propagation through the colour segmentation algorithm. The noise estimation process operates on the assumption
that the noise on each colour field is uniform when it is loaded into the tool. This should be a reasonably good approximation for
most colour images. However, if you load a colour image and then manipulate a field within Imcalc, before popping it back into the
colour tool, you could in theory transform the colour field such that the noise is no longer uniform. This will interfere with the
operation of the colour segmentation function.