【发布时间】:2019-08-23 22:55:33
【问题描述】:
我希望使用灰度共现矩阵 (GLCM) 在 Google 地球引擎 (GEE) 中提取一组 RGB 卫星图像纹理的摘要统计信息。 GEE 有一个内置的 image.glcm() 函数来执行此操作,但是此页面 (https://developers.google.com/earth-engine/image_texture) 中的示例代码表明它需要单个波段作为输入:
// Load a high-resolution NAIP image.
var image = ee.Image('USDA/NAIP/DOQQ/m_3712213_sw_10_1_20140613');
// Get the NIR band.
var nir = image.select('N');
// Compute the gray-level co-occurrence matrix (GLCM), get contrast.
var glcm = nir.glcmTexture({size: 4});
var contrast = glcm.select('N_contrast');
Map.addLayer(contrast,
{min: 0, max: 1500, palette: ['0000CC', 'CC0000']},
'contrast');
有没有办法在 GEE 中将 RGB 图像转换为单波段灰度图像?
我正在使用 Python API,因此 Python 中的答案将是理想的,但任何建议都将不胜感激!
【问题讨论】:
-
var image = ee.Image(...).convert('LA');工作吗? -
您好 Elias,我无法在 Google 地球引擎代码编辑器中找到
.convert('LA');作为函数,而且它似乎不是ee.Image()的属性。你成功使用了吗?
标签: python rgb google-earth-engine glcm