お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.Image.reduceNeighborhood
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
指定されたカーネルによって決定された各ピクセルの近傍に、指定されたリデューサーを適用します。リデューサーの入力が 1 つの場合、コレクションの各バンドに個別に適用されます。それ以外の場合は、入力画像と同じ数のバンドが必要です。
リデューサーの出力名によって、出力バンドの名前が決まります。複数の入力があるリデューサーは出力名を直接使用しますが、入力が 1 つしかないリデューサーは、出力名の前に入力バンド名を付けます(例: '10_mean', '20_mean')。
重み付き入力を使用する削減指定子は、入力マスク、カーネル値、またはその 2 つのうち小さい値に基づいて入力の重みを設定できます。
用途 | 戻り値 |
---|
Image.reduceNeighborhood(reducer, kernel, inputWeight, skipMasked, optimization) | 画像 |
引数 | タイプ | 詳細 |
---|
これ: image | 画像 | 入力画像。 |
reducer | レデューサ | 近傍内のピクセルに適用するリデューサー。 |
kernel | カーネル | 近傍を定義するカーネル。 |
inputWeight | 文字列、デフォルト: "kernel" | 「mask」、「kernel」、「min」のいずれか。 |
skipMasked | ブール値。デフォルト値は true です。 | 対応する入力ピクセルがマスクされている場合は、出力ピクセルをマスクします。 |
optimization | 文字列、デフォルト: null | 最適化戦略。オプションは「boxcar」と「window」です。「boxcar」メソッドは、カウント、合計、平均を高速で計算する方法です。均一なカーネル、単一入力リデューサー、MASK、KERNEL、重み付けなしのいずれかが必要です。「window」メソッドは実行中のウィンドウを使用し、「boxcar」と同じ要件がありますが、単一の入力リデューサーを使用できます。どちらの方法でも、かなりの追加メモリが必要になります。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eApplies a given reducer function to the neighborhood of each pixel, defined by a kernel.\u003c/p\u003e\n"],["\u003cp\u003eOutput band names are determined by the reducer's output names, prefixed with the input band name for single-input reducers.\u003c/p\u003e\n"],["\u003cp\u003eInput weight for reducers can be based on the mask, kernel value, or the minimum of the two.\u003c/p\u003e\n"],["\u003cp\u003eOffers optimization strategies like 'boxcar' and 'window' for specific reducer and kernel types to improve performance.\u003c/p\u003e\n"],["\u003cp\u003eAllows skipping computation on masked pixels for efficiency.\u003c/p\u003e\n"]]],["This operation applies a reducer to pixel neighborhoods defined by a kernel. The reducer can have single or multiple inputs, with output band names determined accordingly. Weighted inputs are supported based on the input mask, kernel value, or their minimum. Options are available to skip masked pixels and optimize the process. The `Image.reduceNeighborhood` function takes a reducer, kernel, input weight, skip masked option, and an optimization method, returning a new image.\n"],null,["# ee.Image.reduceNeighborhood\n\nApplies the given reducer to the neighborhood around each pixel, as determined by the given kernel. If the reducer has a single input, it will be applied separately to each band of the collection; otherwise it must have the same number of inputs as the input image has bands.\n\n\u003cbr /\u003e\n\nThe reducer output names determine the names of the output bands: reducers with multiple inputs will use the output names directly, while reducers with a single input will prefix the output name with the input band name (e.g., '10_mean', '20_mean').\n\nReducers with weighted inputs can have the input weight based on the input mask, the kernel value, or the smaller of those two.\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------------------------|---------|\n| Image.reduceNeighborhood`(reducer, kernel, `*inputWeight* `, `*skipMasked* `, `*optimization*`)` | Image |\n\n| Argument | Type | Details |\n|----------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The input image. |\n| `reducer` | Reducer | The reducer to apply to pixels within the neighborhood. |\n| `kernel` | Kernel | The kernel defining the neighborhood. |\n| `inputWeight` | String, default: \"kernel\" | One of 'mask', 'kernel', or 'min'. |\n| `skipMasked` | Boolean, default: true | Mask output pixels if the corresponding input pixel is masked. |\n| `optimization` | String, default: null | Optimization strategy. Options are 'boxcar' and 'window'. The 'boxcar' method is a fast method for computing count, sum or mean. It requires a homogeneous kernel, a single-input reducer and either MASK, KERNEL or no weighting. The 'window' method uses a running window, and has the same requirements as 'boxcar', but can use any single input reducer. Both methods require considerable additional memory. |"]]