GEE(Google Earth Engine)如何获取影像像素均值和栅格计算?

简介: GEE(Google Earth Engine)如何获取影像像素均值和栅格计算?

ee.Image.constant(value)

Generates an image containing a constant value everywhere.

生成一个在任何地方都包含一个常量值的图像


Arguments:

value (Object):

The value of the pixels in the constant image. Must be a number or an Array or a list of numbers or Arrays.

恒定图像中像素的值。必须是数字或数组或数字列表或数组


Returns: Image

方法2:

ee.Dictionary.values(keys)

Returns the values of a dictionary as a list. If no keys are specified, all values are returned in the natural ordering of the dictionary's keys.

以列表形式返回字典的值。如果未指定键,则所有值都以字典键的自然顺序返回。主要是你影像当中的波段你是否乱序,如果没有乱序的化就按照默认就欧克,在下面的例子中我是将所有的影像波段都以列表的形式传送个一个变量。


Arguments:

this:dictionary (Dictionary)

keys (List, default: null)


Returns: List

方法3:

subtract(image2)栅格减法

Subtracts the second value from the first for each matched pair of bands in image1 and image2. If either image1 or image2 has only 1 band, then it is used against all the bands in the other image. If the images have the same number of bands, but not the same names, they're used pairwise in the natural order. The output bands are named for the longer of the two inputs, or if they're equal in length, in image1's order. The type of the output pixels is the union of the input types.

对于 image1 和 image2 中的每对匹配的波段,从第一个值中减去第二个值。如果 image1 或 image2 只有 1 个波段,则将其用于另一个图像中的所有波段。如果图像具有相同数量的波段,但名称不同,则它们按自然顺序成对使用。输出波段以两个输入中较长的命名,或者如果它们的长度相等,则按 image1 的顺序命名。输出像素的类型是输入类型的并集。


Arguments:

this:image1 (Image):

The image from which the left operand bands are taken.

image2 (Image):

The image from which the right operand bands are taken.


Returns: Image

最后看代码:

var image = ee.Image('LANDSAT/LC8_L1T/LC80440342014077LGN00')
  .select(['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10', 'B11']);
// Mean center the data to enable a faster covariance reducer 平均中心数据以启用更快的协方差减少器
// and an SD stretch of the principal components.和主成分的 SD 拉伸。
//计算均值,这是为了利用一会计算军之后的影像和没有计算的影像进行相减操作。
var meanDict = image.reduceRegion({
    reducer: ee.Reducer.mean(),
    geometry: region, 
    scale: scale,//如果知道影像分辨率这里可以直接写 例如 :30
    maxPixels: 1e9//最大像素值
});
//统计影像中的定值.constant(获取meanDict中各个波段计算出来的均值)
var means = ee.Image.constant(meanDict.values(bandNames));
var centered = image.subtract(means);
print("means",means)
print("centered",centered)


计算结果图:


相关文章
|
5天前
|
数据可视化 定位技术 Sentinel
如何用Google Earth Engine快速、大量下载遥感影像数据?
【2月更文挑战第9天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,批量下载指定时间范围、空间范围的遥感影像数据(包括Landsat、Sentinel等)的方法~
708 0
如何用Google Earth Engine快速、大量下载遥感影像数据?
|
5天前
|
编解码 人工智能 算法
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
33 0
|
5天前
|
机器学习/深度学习 算法 数据可视化
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
114 0
|
5天前
GEE——Google dynamic world中在影像导出过程中无法完全导出较大面积影像的解决方案(投影的转换)EPSG:32630和EPSG:4326的区别
GEE——Google dynamic world中在影像导出过程中无法完全导出较大面积影像的解决方案(投影的转换)EPSG:32630和EPSG:4326的区别
49 0
|
5天前
|
存储 编解码 数据可视化
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
【2月更文挑战第14天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,按照给定的地表分类数据,对每一种不同的地物类型,分别加以全球范围内随机抽样点自动批量选取的方法~
278 0
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
|
5天前
|
API Go 网络架构
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
105 4
|
5天前
|
机器学习/深度学习 存储 人工智能
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
86 3
|
5天前
|
数据处理
Google Earth Engine(GEE)——sentinel-1数据处理过程中出现错误Dictionary does not contain key: bucketMeans
Google Earth Engine(GEE)——sentinel-1数据处理过程中出现错误Dictionary does not contain key: bucketMeans
33 0
|
5天前
|
数据采集 编解码 人工智能
Google Earth Engine(GEE)——全球每日近地表空气温度(2003-2020年)
Google Earth Engine(GEE)——全球每日近地表空气温度(2003-2020年)
79 0
|
5天前
|
编解码 人工智能 数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
48 0

热门文章

最新文章