ee.Kernel.laplacian4

生成 3x3 Laplacian-4 边缘检测内核。

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

示例

代码编辑器 (JavaScript)

print('A Laplacian-4 kernel', ee.Kernel.laplacian4());

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

Python 设置

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

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

print('A Laplacian-4 kernel:')
pprint(ee.Kernel.laplacian4().getInfo())

#  Output weights matrix

#  [0,  1, 0]
#  [1, -4, 1]
#  [0,  1, 0]