ImageMeasurements

ImageMeasurements[image,"prop"]

returns the value of property "prop" for the entire image.

ImageMeasurements[image,"prop",format]

returns the values in the specified output format.

ImageMeasurements[{image1, image2, },]

returns measurements for all imagei.

Details and Options

  • ImageMeasurements works with arbitrary 2D and 3D images.
  • ImageMeasurements[image,{"prop1","prop2",}] computes multiple properties.
  • ImageMeasurements[image,"Properties"] gives names of all available properties as a list of strings.
  • Position, area, and length measurements are computed in the standard image coordinate system.
  • For images of type "Byte" and "Bit16", ImageMeasurements always normalizes values to lie between 0 and 1.
  • The following properties can be computed on images:
  • Global image properties:
  • "AspectRatio"ratio of height to width
    "Channels"number of image channels
    "ColorSpace"image color space
    "DataRange"range of the underlying data
    "DataType"underlying data type
    "Dimensions"dimensions of the image
    "Interleaving"amount of interleaving of the image
    "SampleDepth"number of bits used to represent each pixel
    "Transparency"whether or not the image has an alpha channel
  • Basic histogram properties, measured for each channel individually:
  • "Min"minimum value
    "Max"maximum value
    "Mean"average value
    "Median"median value
    "StandardDeviation"standard deviation
    "Total"total of all values
  • Basic image intensity properties:
  • "MinIntensity"minimum intensity
    "MaxIntensity"maximum intensity
    "MeanIntensity"average intensity
    "MedianIntensity"median intensity
    "StandardDeviationIntensity"standard deviation of the intensity distribution
    "TotalIntensity"total intensity
  • Contour properties:
  • "Contours"lines describing the component boundary
    "ContourHierarchy"topological nesting of the contours
    "PerimeterPositions"sorted positions of the perimeter elements
  • Spatial intensity measurements:
  • "Skew"asymmetry in intensity distribution
    "IntensityCentroid"coordinates of the intensity-weighted centroid
  • Statistical measurements:
  • "Entropy"data entropy (base E)
    "Energy"data energy
  • The following format specifications can be used:
  • Automaticdetermine the output automatically
    "Association"format the result as an Association
    "Dataset"format the result as a Dataset
    "List"format the result as a List
    "RuleList"format the result as a list of Rule expressions
  • ImageMeasurements takes a Masking option. The default setting is Masking->All. The Masking option is ignored when returning global image properties.

Examples

open allclose all

Basic Examples  (2)

Extract mean color value:

Mean pixel intensity:

Global image entropy:

Standard deviation of pixel intensity in a 3D image:

Scope  (8)

Basic Uses  (5)

Test an image to see if it has an alpha channel:

Compute multiple properties of an image:

Compute a property of multiple images:

Compute multiple properties of multiple images:

Extract pixel value ranges for each channel:

Output Format  (3)

Format the properties as an Association:

Return a list of rules:

Return a Dataset:

Options  (2)

Masking  (1)

Compute the mean pixel value for a specified region of interest:

CornerNeighbors  (1)

By default, ImageMeasurements assumes 8-connectivity:

Use CornerNeighborsFalse to assume 4-connectivity:

Applications  (5)

Multiply the gradient magnitude of an image by its maximum value, so that the pixels with the largest values are white:

Detect whether an image has constant pixel values:

Ordinal measurement descriptor of an image:

Compute the centroid distance function for the shapes present in an image:

Extract the list of shapes from the image:

Define a function that parametrizes the distance from the contour centroid:

Plot the centroid distance function for some of the shapes:

Define a feature vector sampling the centroid distance:

Use the feature vectors to cluster the shapes:

Compute the Fourier descriptors of a shape:

Extract the contour coordinates and compute the Fourier transform of their complex representation:

The original shape can be reconstructed using only a portion of the descriptors:

Control the contour smoothness by interactively setting the number of descriptors:

Introduced in 2012
 (9.0)
 |
Updated in 2014
 (10.0)
2015
 (10.3)
2016
 (11.0)
2017
 (11.2)