GEE多项式增强
2019-01-05 本文已影响0人
赤豆冰棍
多项式增强
主要功能
可以对多个选定波段,使用多个系数来完成多项式运算,减少了图层操作
代码
// Applies a non-linear contrast enhancement to a MODIS image using
// function -0.2 + 2.4x - 1.2x^2.
// Load a MODIS image and apply the scaling factor.
var img = ee.Image('MODIS/006/MOD09GA/2012_03_09')
.select(['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03'])
.multiply(0.0001);
// Apply the polynomial enhancement.
var adj = img.polynomial([-0.2, 2.4, -1.2]);
Map.setCenter(-107.24304, 35.78663, 8);
Map.addLayer(img, {min: 0, max: 1}, 'original');
Map.addLayer(adj, {min: 0, max: 1}, 'adjusted');
步骤分析
- 创建ee对象,获取MODIS数据
- 选择三个波段,都乘以一个系数0.0001
- 使用选择的三波段进行多项式计算,得到增强结果
- 设置地图中心,缩放等级
- 添加原始数据图层
- 显示多项式计算增强结果
主要方法
- ee.Image.polynomial()
Compute a polynomial at each pixel using the given coefficients.
Arguments:
this:image (Image):
The input image.
coefficients (List):
The polynomial coefficients in increasing order of degree starting with the constant term.
Returns: Image
计算输入影像对象的多项式计算结果
输入参数:输入影像对象,输入多项式系数(列表)