需要 Spatial Analyst 许可。
摘要
通过高斯分布或基于用户指定中点的正态分布(分配的隶属度为 1)及经过定义减至零的散度,定义针对特定值的模糊隶属度函数。
讨论
使用 FuzzyGaussian 对象的工具:模糊隶属度。
模糊高斯函数的方程为:
方程的输入为 f1(散度 (spread))和 f2(中点 (midpoint))。增大散度会导致模糊隶属度曲线变得陡峭。
高斯函数在特定值的附近进行分类时十分有用。
输入值可以为整型值或浮点型正值。
高斯函数与近邻 (Near) 函数类似,但高斯函数的阶差 (spread) 更小。
语法
FuzzyGaussian (midpoint, spread)
参数 | 说明 | 数据类型 |
midpoint | The user-defined value with a fuzzy membership of 1. The default is the midpoint of the range of values of the input raster. | Double |
spread | Defines the spread of the Gaussian function. The spread generally ranges from 0.01 to 1, with the larger the value results in a steeper distribution around the midpoint. (默认值为 0.1) | Double |
属性
属性 | 说明 | 数据类型 |
midpoint (读写) | 定义隶属度函数中点的用户定义值。 | Double |
spread (读写) | Defines the spread of the membership function. The larger the value results in a steeper distribution from the midpoint. | Double |
代码实例
FuzzyGaussian 示例 1(Python 窗口)
演示如何在 Python 窗口下创建 FuzzyGaussian 类,并通过 FuzzyMembership 工具使用该类。
import arcpy
from arcpy.sa import *
from arcpy import env
env.workspace = "c:/sapyexamples/data"
outFzyMember = FuzzyMembership("as_std", FuzzyGaussian(12, 0.1))
outFzyMember.save("c:/sapyexamples/fzymemb")
FuzzyGaussian 示例 2(独立脚本)
使用 FuzzyGaussian 类执行 FuzzyMembership。
# Name: FuzzyGaussian_Ex_02.py
# Description: Scales input raster data into values ranging from zero to one
# indicating the strength of a membership in a set.
# Requirements: Spatial Analyst Extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "C:/sapyexamples/data"
# Set local variables
inRaster = "as_std"
# Create the FuzzyGaussian algorithm object
midpoint = 10
spread = 0.2
myFuzzyAlgorithm = FuzzyGaussian(midpoint, spread)
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute FuzzyMembership
outFuzzyMember = FuzzyMembership(inRaster, myFuzzyAlgorithm)
# Save the output
outFuzzyMember.save("c:/sapyexamples/fzygauss")