サマリー
Groups connected regions with the same pixel value and calculates the number of pixels in each region.
説明
For more information on how this function works, see the Region Pixel Count 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.
構文
RegionPixelCount (raster, {maximum_region_size}, {pixel_neighborhood})
パラメーター | 説明 | データ タイプ |
raster | The input raster. | Raster |
maximum_region_size | The maximum number of pixels a region can contain. (デフォルト値は次のとおりです 100) | Integer |
pixel_neighborhood | The number of neighborhoods used to assess pixel connectivity. Valid values are 4 and 8. (デフォルト値は次のとおりです 4) | Integer |
データ タイプ | 説明 |
Raster |
The output raster. |
コードのサンプル
This example calculates the number of pixels in each region.
from arcpy.ia import *
pixel_count_raster = RegionPixelCount('C:/arcpyExamples/ndvi_threshold.tif', 1000, 4)
pixel_count_raster.save('C:/temp/ndvi_mask.tif')