Image Analyst ライセンスで利用できます。
Spatial Analyst のライセンスで利用可能。
概要
Groups adjacent pixels together that have similar spectral and spatial characteristics.
ディスカッション
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.
構文
SegMeanShift (raster, spectral_detail, spatial_detail, {spectral_radius}, {spatial_radius}, min_num_pixels_per_segment, {astype})
パラメーター | 説明 | データ タイプ |
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. (デフォルト値は次のとおりです 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. (デフォルト値は次のとおりです 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. (デフォルト値は次のとおりです 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. (デフォルト値は次のとおりです 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. (デフォルト値は次のとおりです None) | Integer |
astype | The output pixel type. (デフォルト値は次のとおりです None) | Double |
コードのサンプル
Groups adjacent pixels that have similar spectral and spatial characteristics in a multispectral image.
from arcpy.ia import *
out_segmented_raster = SegMeanShift("Multispectral_Landsat.tif")
out_segmented_raster.save("C:/arcpyExamples/outputs/segmeanshift_out.crf")
Groups adjacent pixels that have similar spectral and spatial characteristics in a multispectral image.
# Import system modules
import arcpy
from arcpy.ia import *
# Check out the ArcGIS Image Analyst extension license
arcpy.CheckOutExtension("ImageAnalyst")
# Set the local variables
raster = "C:/data/Multispectral_Landsat.tif"
spectral_detail= 15.5
spatial_detail= 15
spectral_radius=None
spatial_radius=None
min_num_pixels_per_segment= 20
# Apply RegionGrow function
arcpy.ia.SegMeanShift(raster, spectral_detail, spatial_detail, spectral_radius, spatial_radius, min_num_pixels_per_segment)
# Save the output
segmented_raster.save("C:/arcpyExamples/outputs/Multispectral_Landsat_seg.crf")