Operasi Morfologis
Earth Engine menerapkan operasi morfologi sebagai operasi fokus, khususnya metode instance focalMax()
, focalMin()
, focalMedian()
, dan focalMode()
di class Image
. (Ini adalah
pintasan untuk reduceNeighborhood()
yang lebih umum, yang dapat memasukkan
piksel dalam kernel ke pengurangan apa pun dengan output numerik. Lihat
halaman ini untuk mengetahui informasi selengkapnya tentang cara mengurangi
jumlah lingkungan). Operator morfologi berguna untuk melakukan operasi seperti erosi, dilatasi, pembukaan, dan penutupan. Misalnya, untuk melakukan
operasi pembukaan,
gunakan focalMin()
diikuti dengan focalMax()
:
// Load a Landsat 8 image, select the NIR band, threshold, display.
var image = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318')
.select(4).gt(0.2);
Map.setCenter(-122.1899, 37.5010, 13);
Map.addLayer(image, {}, 'NIR threshold');
// Define a kernel.
var kernel = ee.Kernel.circle({radius: 1});
// Perform an erosion followed by a dilation, display.
var opened = image
.focalMin({kernel: kernel, iterations: 2})
.focalMax({kernel: kernel, iterations: 2});
Map.addLayer(opened, {}, 'opened');
Perhatikan bahwa dalam contoh sebelumnya, argumen kernel diberikan ke operator
morfologis. Piksel yang tercakup oleh elemen kernel yang bukan nol digunakan dalam
komputasi. Argumen iterasi menunjukkan frekuensi penerapan operator.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-02-18 UTC.
[null,null,["Terakhir diperbarui pada 2025-02-18 UTC."],[[["Earth Engine uses focal operations like `focalMax()`, `focalMin()`, `focalMedian()`, and `focalMode()` to implement morphological operations for image processing."],["Morphological operations, such as erosion, dilation, opening, and closing, can be performed using these focal operations to modify image structures."],["Users can define kernels to specify the shape and size of the neighborhood used in the operations and control the number of times the operation is applied with the iterations argument."],["An opening operation, for example, can be achieved by applying `focalMin()` followed by `focalMax()` with a defined kernel."]]],["Earth Engine's `Image` class provides `focalMax()`, `focalMin()`, `focalMedian()`, and `focalMode()` for morphological operations like erosion, dilation, opening, and closing. These operations use a kernel to define the neighborhood of pixels. For example, the opening operation is achieved by applying `focalMin()` then `focalMax()`. A kernel argument defines the area for computation, and the iterations argument specifies the number of operator applications. The provided code demonstrates the opening operation on a Landsat 8 image using a circular kernel.\n"]]