ImageDev

Image Analysis

The purpose of quantitative analysis is to extract new representations in the form of measurements from images.
Whereas processing algorithms produce another image, analysis algorithms extract data values from an image. These data can then be compared to a priori information, classified, or used to identify objects in the image.

Local and Global Measurements

Measurements can be divided into two types: local and global.

Local measurements

Local measurements are computed by segmenting each original object into a union of disjointed, or unique, elements, on each of which elementary measurements are performed. The local measurement is then defined as the sum of elementary measurements on the disjointed sets. For example, the surface area of an object can be defined as the sum of the areas of the pixels in the object. Local measurements are mostly computed with neighborhood operators.

Global measurements

Global measurements require the computation of information on an entire object. They cannot be deduced from the values of the subsets. For example, the Feret diameter cannot be computed from the Feret diameters of subsets of the object. Ideally, global measurements should be computed for objects that are fully visible, or equivalently, that fall into the image field and do not intersect the field boundary.

Continuous and Discrete Cases

In some of the explanations of the analysis algorithms, different formulae are presented for both continuous and discrete cases. The continuous case refers to the analysis of "real" objects, which can be theoretically assumed to have a continuous range of values.

The discrete case refers to analysis in an actual digital image, where there is a finite number of pixels and values.

Intensity image

Some of the analysis algorithms, like LabelAnalysis or BinaryAnalysis, take an intensity image as input.

Providing an intensity image is necessary for computing some grayscale or color based measurements, such as histogram or texture features. For instance, selecting the IntensityIntegral measurement in a label analysis sums the gray levels of the intensity image for each object of the label image input.
When selecting only measurements that do not take gray levels into account, like geometric features, the intensity image input can be set to the same image as the label input. In this case, the IntensityIntegral measurement amounts to multiply the index of each label by its number of pixels.

How to select a measurement list

The LabelAnalysis, LabelFilteringAnalysis or BinaryAnalysis algorithms compute a set of measurements on an image.

These measurements can be selected by using the add method of the AnalysisMsr object. This method can add each measurement individually, or directly set a MeasurementGroup.
Details about each native measurement can be found in the NativeMeasurements object.
For example, to select and compute the equivalent diameter measurement of a binary image in C#:
    // Connected component labeling and particle counting
    Processing.ObjectCountOutput result = Processing.ObjectCount(imageBin);
    // Define and compute an analysis with a single measurement
    AnalysisMsr anlMsr = new AnalysisMsr();
    Measurements.EqDiameter diameterMsr = anlMsr.Add(NativeMeasurements.EqDiameter);
    Processing.LabelAnalysis(imageLab, imageLab, anlMsr);
    // Print results in the standard output
    Console.WriteLine("Index\tDiameter");
    for (int i = 0; i < (int) result.outputMeasurement.count(0); i++)
        Console.WriteLine((i+1).ToString() + "\t" + diameterMsr.Value(i).ToString("0.00"));