ee.Kernel.compass

生成 3x3 Prewitt 指南针边缘检测内核。

用法返回
ee.Kernel.compass(magnitude, normalize)内核
参数类型详细信息
magnitude浮点数,默认值:1按此量缩放每个值。
normalize布尔值,默认值:false将内核值归一化为总和为 1。

示例

代码编辑器 (JavaScript)

print('A Prewitt compass kernel', ee.Kernel.compass());

/**
 * Output weights matrix
 *
 * [1,  1, -1]
 * [1, -2, -1]
 * [1,  1, -1]
 */

Python 设置

如需了解 Python API 和如何使用 geemap 进行交互式开发,请参阅 Python 环境页面。

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

print('A Prewitt compass kernel:')
pprint(ee.Kernel.compass().getInfo())

# Output weights matrix

#  [1,  1, -1]
#  [1, -2, -1]
#  [1,  1, -1]