お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.Image.normalizedDifference
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
2 つのバンド間の正規化された差を計算します。使用するバンドが指定されていない場合は、最初の 2 つのバンドを使用します。正規化された差は、(最初 - 2 番目)/(最初 + 2 番目)として計算されます。返される画像バンド名は「nd」です。入力画像のプロパティは出力画像に保持されません。入力バンドのいずれかのピクセル値が負の値の場合、出力ピクセルはマスクされます。負の入力値がマスクされないようにするには、
ee.Image.expression()
を使用して正規化された差分を計算します。
用途 | 戻り値 |
---|
Image.normalizedDifference(bandNames) | 画像 |
引数 | タイプ | 詳細 |
---|
これ: input | 画像 | 入力画像。 |
bandNames | リスト、デフォルト: null | 使用するバンドを指定する名前のリスト。指定しない場合、最初のバンドと 2 番目のバンドが使用されます。 |
例
コードエディタ(JavaScript)
// A Landsat 8 surface reflectance image.
var img = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508');
// Calculate normalized difference vegetation index: (NIR - Red) / (NIR + Red).
var nirBand = 'SR_B5';
var redBand = 'SR_B4';
var ndvi = img.normalizedDifference([nirBand, redBand]);
// Display NDVI result on the map.
Map.setCenter(-122.148, 37.377, 11);
Map.addLayer(ndvi, {min: 0, max: 0.5}, 'NDVI');
Python の設定
Python API とインタラクティブな開発での geemap
の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# A Landsat 8 surface reflectance image.
img = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508')
# Calculate normalized difference vegetation index: (NIR - Red) / (NIR + Red).
nir_band = 'SR_B5'
red_band = 'SR_B4'
ndvi = img.normalizedDifference([nir_band, red_band])
# Display NDVI result on the map.
m = geemap.Map()
m.set_center(-122.148, 37.377, 11)
m.add_layer(ndvi, {'min': 0, 'max': 0.5}, 'NDVI')
m
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eComputes the normalized difference between two specified or default image bands using the formula (first - second) / (first + second).\u003c/p\u003e\n"],["\u003cp\u003eReturns a single-band image named 'nd' representing the normalized difference.\u003c/p\u003e\n"],["\u003cp\u003eInput image properties are not preserved in the output, and negative input values in either band result in masked output pixels.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eee.Image.expression()\u003c/code\u003e is recommended for handling negative input values and avoiding masking.\u003c/p\u003e\n"]]],[],null,["# ee.Image.normalizedDifference\n\nComputes the normalized difference between two bands. If the bands to use are not specified, uses the first two bands. The normalized difference is computed as (first − second) / (first + second). Note that the returned image band name is 'nd', the input image properties are not retained in the output image, and a negative pixel value in either input band will cause the output pixel to be masked. To avoid masking negative input values, use `ee.Image.expression()` to compute normalized difference.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------|---------|\n| Image.normalizedDifference`(`*bandNames*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|---------------------|-----------------------------------------------------------------------------------------------------|\n| this: `input` | Image | The input image. |\n| `bandNames` | List, default: null | A list of names specifying the bands to use. If not specified, the first and second bands are used. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A Landsat 8 surface reflectance image.\nvar img = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508');\n\n// Calculate normalized difference vegetation index: (NIR - Red) / (NIR + Red).\nvar nirBand = 'SR_B5';\nvar redBand = 'SR_B4';\nvar ndvi = img.normalizedDifference([nirBand, redBand]);\n\n// Display NDVI result on the map.\nMap.setCenter(-122.148, 37.377, 11);\nMap.addLayer(ndvi, {min: 0, max: 0.5}, 'NDVI');\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# A Landsat 8 surface reflectance image.\nimg = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508')\n\n# Calculate normalized difference vegetation index: (NIR - Red) / (NIR + Red).\nnir_band = 'SR_B5'\nred_band = 'SR_B4'\nndvi = img.normalizedDifference([nir_band, red_band])\n\n# Display NDVI result on the map.\nm = geemap.Map()\nm.set_center(-122.148, 37.377, 11)\nm.add_layer(ndvi, {'min': 0, 'max': 0.5}, 'NDVI')\nm\n```"]]