SegMeanShift

Mit der Image Analyst-Lizenz verfügbar.

Mit der Spatial Analyst-Lizenz verfügbar.

Zusammenfassung

Groups adjacent pixels together that have similar spectral and spatial characteristics.

Auswertung

The input raster must be a 3-band, unsigned 8-bit image.

To use this function, specify the spectral_detail and spatial_detail arguments or the spectral_radius and spatial_radius arguments. These pairs of arguments have an inverse relationship.

For more information about how this function works, see the Segment Mean Shift raster function.

The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.

Syntax

SegMeanShift (raster, spectral_detail, spatial_detail, {spectral_radius}, {spatial_radius}, min_num_pixels_per_segment, {astype})
ParameterErklärungDatentyp
raster

The input raster.

Raster
spectral_detail

The relative importance of separating objects based on color characteristics.

Valid values range from 0 to 21. Smaller values result in broad classes and more smoothing. A higher value is appropriate when you want to discriminate between features having somewhat similar spectral characteristics.

(Der Standardwert ist None)

Double
spatial_detail

The relative importance of separating objects based on spatial characteristics.

Valid integer values range from 0 to 21. Smaller values result in broad classes and more smoothing. A higher value is appropriate for discriminating between features that are spatially small and clustered together.

(Der Standardwert ist None)

Integer
spectral_radius

The relative importance of separating objects based on color characteristics.

Valid values range from 0 to 21. Larger values result in broad classes and more smoothing. A lower value is appropriate when you want to discriminate between features having somewhat similar spectral characteristics.

(Der Standardwert ist None)

Double
spatial_radius

The relative importance of separating objects based on spatial characteristics.

Valid integer values range from 0 to 21. Larger values result in broad classes and more smoothing. A lower value is appropriate for discriminating between features that are spatially small and clustered together.

(Der Standardwert ist None)

Integer
min_num_pixels_per_segment

The minimum segment size, measured in pixels. This value is related to your minimum mapping unit, and will filter out smaller blocks of pixels.

(Der Standardwert ist None)

Integer
astype

The output pixel type.

(Der Standardwert ist None)

Double

Codebeispiel

SegMeanShift example

Groups adjacent pixels that have similar spectral and spatial characteristics in a multispectral image.

from arcpy.sa import *
out_segmented_raster = SegMeanShift("Multispectral_Landsat.tif")
out_segmented_raster.save("C:/arcpyExamples/outputs/segmeanshift_out.crf")
SegMeanShift example

Groups adjacent pixels that have similar spectral and spatial characteristics in a multispectral image.

# Import system modules
import arcpy
from arcpy.sa import *

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"

# Set the local variables
raster = "Multispectral_Landsat.tif"
spectral_detail = 15.5
spatial_detail = 15
spectral_radius = None
spatial_radius = None
min_num_pixels_per_segment = 20

# Apply SegMeanShift function
out_segmented_raster = SegMeanShift(raster, spectral_detail, spatial_detail,
                                    spectral_radius, spatial_radius,
                                    min_num_pixels_per_segment)

# Save the output
out_segmented_raster.save(
    "C:/arcpyExamples/outputs/Multispectral_Landsat_seg.crf")

Verwandte Themen