ee.Kernel.sobel

生成 3x3 Sobel 边缘检测内核。

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

示例

代码编辑器 (JavaScript)

print('A Sobel kernel', ee.Kernel.sobel());

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

Python 设置

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

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

print('A Sobel kernel:')
pprint(ee.Kernel.sobel().getInfo())

#  Output weights matrix

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