ee.Kernel.fixed

建立核心。

用量傳回
ee.Kernel.fixed(width, height, weights, x, y, normalize)核心
引數類型詳細資料
width整數,預設值為 -1核心的寬度 (以像素為單位)。
height整數,預設值為 -1核心的高度 (以像素為單位)。
weights清單做為核心權重的 [高度] x [寬度] 值 2D 清單。
x整數,預設值為 -1對焦位置,以左側的偏移量表示。
y整數,預設值為 -1對焦點位置,以與頂端的偏移量表示。
normalize布林值,預設值為 false將核心值正規化為總和為 1。

範例

程式碼編輯器 (JavaScript)

// Kernel weights.
var weights = [[4, 3, 2, 1, 2, 3, 4],
               [4, 3, 2, 1, 2, 3, 4],
               [4, 3, 2, 1, 2, 3, 4]];

print('A fixed kernel', ee.Kernel.fixed({weights: weights}));

/**
 * Output weights matrix
 *
 * [4, 3, 2, 1, 2, 3, 4]
 * [4, 3, 2, 1, 2, 3, 4]
 * [4, 3, 2, 1, 2, 3, 4]
 */

Python 設定

請參閱 Python 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

weights = [[4, 3, 2, 1, 2, 3, 4],
           [4, 3, 2, 1, 2, 3, 4],
           [4, 3, 2, 1, 2, 3, 4]]

print('A fixed kernel:')
pprint(ee.Kernel.fixed(**{'weights': weights}).getInfo())

#  Output weights matrix

#  [4, 3, 2, 1, 2, 3, 4]
#  [4, 3, 2, 1, 2, 3, 4]
#  [4, 3, 2, 1, 2, 3, 4]