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. 扩张,扩大;膨胀;详述

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

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值