Google Earth Engine学习笔记(一)

Google Earth Engine学习笔记(一)

    • 原文
    • 翻译
    • 代码
    • 说明
    • 结果
    • 其他

Morphological Operations(形态学操作)

原文

Earth Engine implements morphological operations as focal operations, specifically focal_max(), focal_min(), focal_median(), and focal_mode() instance methods in the Image class. (These are shortcuts for the more general reduceNeighborhood(), which can input the pixels in a kernel to any reducer with a numeric output. See this page for more information on reducing neighborhoods). The morphological operators are useful for performing operations such as erosion, dilation, opening and closing. For example, to perform an opening operation, use focal_min() followed by focal_max():

翻译

Earth Engine通过聚焦的方式实现形态学操作,特别是Image类中的 focal_max(),focal_min(),focal_median(),和 focal_mode()实例方法。(这些是reduceNeighborhood()方法的更通用的快捷方式,它可以将输入到内核中的像素以数字的形式输出到任何reducer。有关reducing neighborhoods的更多信息,请参阅此页面)。形态学算子可以用于执行诸如侵蚀,膨胀,开运算和闭运算。例如,要执行开运算,请使用focal_min()后跟focal_max():

代码

// Load a Landsat 8 image, select the NIR band, threshold, display.
var image = ee.Image('LANDSAT/LC08/C01/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
             .focal_min({kernel: kernel, iterations: 2})
             .focal_max({kernel: kernel, iterations: 2});
Map.addLayer(opened, {}, 'opened');

说明

Note that in the previous example, a kernel argument is provided to the morphological operator. The pixels covered by non-zero elements of the kernel are used in the computation. The iterations argument indicates how many times to apply the operator.

请注意,在前面的示例中,提供了kernel参数用作形态学操作。在计算中使用由kernel的非零元素覆盖的像素。iterations参数指示应用操作的次数。

结果

其他

Morphological adj.形态学的。同义词:morphologic adj. 形态学(上),形态学的
implement n. 工具,器具;手段 vt. 实施,执行;实现,使生效
focal adj.焦点的,在焦点上的;灶的,病灶的 [of or relating to the center or main point of interest]
erosion n. 侵蚀,腐蚀
dilation n. 扩张,扩大;膨胀;详述

关于形态学操作的概念,可参考下面链接的介绍:
形态学理解

你可能感兴趣的:(GEE)