Segment Mean Shift (Spatial Analyst)

Available with Spatial Analyst license.

Summary

Groups adjacent pixels that have similar spectral characteristics into segments.

Usage

  • The input can be any Esri-supported raster, with any valid bit depth.

  • The Band Index parameter is a list of three bands, separated by a space delimiter.

  • To achieve optimal results, use the Symbology tab in the dataset properties to interactively stretch your Input Raster so the features you want to classify are apparent. Then use these optimal settings in the Stretch raster function to enhance your imagery for optimum results, and specify the Output Pixel Type as 8 bit unsigned from the General tab.

    The output layer from the previously executed Stretch raster function can be the Input Raster for the Segment Mean Shift tool.

Parameters

LabelExplanationData Type
Input Raster

The raster dataset to segment. This can be a multispectral or grayscale image.

Mosaic Layer; Raster Layer
Minimum Segment Size In Pixels
(Optional)

The minimum size of a segment. Merge segments smaller than this size with their best fitting neighbor segment. This is related to the minimum mapping unit for your project.

Units are in pixels.

Long
Band Indexes
(Optional)

The bands that will be used to segment the imagery, separated by a space. If no band indexes are specified, they are determined by the following criteria:

  • If the raster has only 3 bands, those 3 bands are used
  • If the raster has more than 3 bands, the tool assigns the red, green, and blue bands according to the raster's properties.
  • If the red, green, and blue bands are not identified in the raster dataset's properties, bands 1, 2, and 3 are used.

The band order will not change the result.

Select bands that offer the most differentiation between the features of interest.

String
Maximum Segment Size In Pixels
(Optional)

The maximum size of a segment. Segments that are larger than the specified size will be divided. Use this parameter to prevent artifacts in the output raster resulting from large segments.

Units are in pixels.

The default value is -1, meaning there is no limit on the segment size.

Long

Return Value

LabelExplanationData Type
Output Raster Dataset

Specify a name and extension for the output dataset.

If the input was a multispectral image, the output will be an 8-bit RGB image. If the input was a grayscale image, the output will be an 8-bit grayscale image.

Raster

SegmentMeanShift(in_raster, {min_segment_size}, {band_indexes}, {max_segment_size})
NameExplanationData Type
in_raster

The raster dataset to segment. This can be a multispectral or grayscale image.

Mosaic Layer; Raster Layer
min_segment_size
(Optional)

The minimum size of a segment. Merge segments smaller than this size with their best fitting neighbor segment. This is related to the minimum mapping unit for your project.

Units are in pixels.

Long
band_indexes
(Optional)

The bands that will be used to segment the imagery, separated by a space. If no band indexes are specified, they are determined by the following criteria:

  • If the raster has only 3 bands, those 3 bands are used
  • If the raster has more than 3 bands, the tool assigns the red, green, and blue bands according to the raster's properties.
  • If the red, green, and blue bands are not identified in the raster dataset's properties, bands 1, 2, and 3 are used.

The band order will not change the result.

Select bands that offer the most differentiation between the features of interest.

String
max_segment_size
(Optional)

The maximum size of a segment. Segments that are larger than the specified size will be divided. Use this parameter to prevent artifacts in the output raster resulting from large segments.

Units are in pixels.

The default value is -1, meaning there is no limit on the segment size.

Long

Return Value

NameExplanationData Type
out_raster_dataset

Specify a name and extension for the output dataset.

If the input was a multispectral image, the output will be an 8-bit RGB image. If the input was a grayscale image, the output will be an 8-bit grayscale image.

Raster

Related topics