ee.Kernel.fixed

Membuat Kernel.

PenggunaanHasil
ee.Kernel.fixed(width, height, weights, x, y, normalize)Kernel
ArgumenJenisDetail
widthBilangan bulat, default: -1Lebar kernel dalam piksel.
heightBilangan bulat, default: -1Tinggi kernel dalam piksel.
weightsDaftarDaftar 2-D nilai [tinggi] x [lebar] untuk digunakan sebagai bobot kernel.
xBilangan bulat, default: -1Lokasi fokus, sebagai offset dari kiri.
yBilangan bulat, default: -1Lokasi fokus, sebagai offset dari atas.
normalizeBoolean, default: falseMenormalisasi nilai kernel agar berjumlah 1.

Contoh

Code Editor (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]
 */

Penyiapan Python

Lihat halaman Lingkungan Python untuk mengetahui informasi tentang Python API dan penggunaan geemap untuk pengembangan interaktif.

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]