Skip to main content

Segment Mean Shift (Spatial Analyst Tools)

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.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Parameters

Label Explanation Data type

Input Raster

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

Mosaic Layer; Raster Layer

Spectral Detail

(Optional)

The level of importance given to the spectral differences of features in the imagery.

Valid values range from 1.0 to 20.0. A higher value is appropriate when there are features to classify separately that have similar spectral characteristics. Smaller values create spectrally smoother outputs. For example, with higher spectral detail in a forested scene, there will be greater discrimination between the tree species.

Double

Spatial Detail

(Optional)

The level of importance given to the proximity between features in the imagery.

Valid values range from 1.0 to 20. A higher value is appropriate for a scene in which the features of interest are small and clustered together. Smaller values create spatially smoother outputs. For example, in an urban scene, impervious surfaces can be classified using a smaller spatial detail, or buildings and roads can be classified as separate classes using a higher spatial detail.

Long

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

Label Explanation Data 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

Environments

Compression, Current Workspace, Extent, Geographic Transformations, NoData, Output CONFIG Keyword, Output Coordinate System, Parallel Processing Factor, Pyramid, Resampling Method, Scratch Workspace, Snap Raster, Raster Statistics, Tile Size

Licensing information

  • Basic: Requires Spatial Analyst or Image Analyst
  • Standard: Requires Spatial Analyst or Image Analyst
  • Advanced: Requires Spatial Analyst or Image Analyst