お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.Kernel.add
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
中心を揃えた後、2 つのカーネル(ポイント単位)を追加します。
用途 | 戻り値 |
---|
Kernel.add(kernel2, normalize) | カーネル |
引数 | タイプ | 詳細 |
---|
これ: kernel1 | カーネル | 最初のカーネル。 |
kernel2 | カーネル | 2 番目のカーネル。 |
normalize | ブール値。デフォルト値は false です。 | カーネルを正規化します。 |
例
コードエディタ(JavaScript)
// Two kernels, they do not need to have the same dimensions.
var kernelA = ee.Kernel.chebyshev({radius: 3});
var kernelB = ee.Kernel.square({radius: 1, normalize: false, magnitude: 100});
print(kernelA, kernelB);
/**
* Two kernel weights matrices
*
* [3, 3, 3, 3, 3, 3, 3]
* [3, 2, 2, 2, 2, 2, 3]
* [3, 2, 1, 1, 1, 2, 3] [100, 100, 100]
* A [3, 2, 1, 0, 1, 2, 3] B [100, 100, 100]
* [3, 2, 1, 1, 1, 2, 3] [100, 100, 100]
* [3, 2, 2, 2, 2, 2, 3]
* [3, 3, 3, 3, 3, 3, 3]
*/
print('Pointwise addition of two kernels', kernelA.add(kernelB));
/**
* [3, 3, 3, 3, 3, 3, 3]
* [3, 2, 2, 2, 2, 2, 3]
* [3, 2, 101, 101, 101, 2, 3]
* [3, 2, 101, 100, 101, 2, 3]
* [3, 2, 101, 101, 101, 2, 3]
* [3, 2, 2, 2, 2, 2, 3]
* [3, 3, 3, 3, 3, 3, 3]
*/
Python の設定
Python API とインタラクティブな開発での geemap
の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
from pprint import pprint
# Two kernels, they do not need to have the same dimensions.
kernel_a = ee.Kernel.chebyshev(**{'radius': ee.Number(3)})
kernel_b = ee.Kernel.square(**{
'radius': 1,
'normalize': False,
'magnitude': 100
})
pprint(kernel_a.getInfo())
pprint(kernel_b.getInfo())
# Two kernel weights matrices
# [3, 3, 3, 3, 3, 3, 3]
# [3, 2, 2, 2, 2, 2, 3]
# [3, 2, 1, 1, 1, 2, 3] [100, 100, 100]
# A [3, 2, 1, 0, 1, 2, 3] B [100, 100, 100]
# [3, 2, 1, 1, 1, 2, 3] [100, 100, 100]
# [3, 2, 2, 2, 2, 2, 3]
# [3, 3, 3, 3, 3, 3, 3]
print('Pointwise addition of two kernels:')
pprint(kernel_a.add(kernel_b).getInfo())
# [3, 3, 3, 3, 3, 3, 3]
# [3, 2, 2, 2, 2, 2, 3]
# [3, 2, 101, 101, 101, 2, 3]
# [3, 2, 101, 100, 101, 2, 3]
# [3, 2, 101, 101, 101, 2, 3]
# [3, 2, 2, 2, 2, 2, 3]
# [3, 3, 3, 3, 3, 3, 3]
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[[["\u003cp\u003e\u003ccode\u003eKernel.add\u003c/code\u003e combines two kernels by adding their weights pointwise after aligning their centers.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting kernel has the same dimensions as the larger of the two input kernels.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003enormalize\u003c/code\u003e parameter can be used to normalize the resulting kernel.\u003c/p\u003e\n"],["\u003cp\u003eKernels do not need to have the same dimensions to be added.\u003c/p\u003e\n"]]],[],null,["# ee.Kernel.add\n\nAdds two kernels (pointwise) after aligning their centers.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------|---------|\n| Kernel.add`(kernel2, `*normalize*`)` | Kernel |\n\n| Argument | Type | Details |\n|-----------------|-------------------------|-----------------------|\n| this: `kernel1` | Kernel | The first kernel. |\n| `kernel2` | Kernel | The second kernel. |\n| `normalize` | Boolean, default: false | Normalize the kernel. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Two kernels, they do not need to have the same dimensions.\nvar kernelA = ee.Kernel.chebyshev({radius: 3});\nvar kernelB = ee.Kernel.square({radius: 1, normalize: false, magnitude: 100});\nprint(kernelA, kernelB);\n\n/**\n * Two kernel weights matrices\n *\n * [3, 3, 3, 3, 3, 3, 3]\n * [3, 2, 2, 2, 2, 2, 3]\n * [3, 2, 1, 1, 1, 2, 3] [100, 100, 100]\n * A [3, 2, 1, 0, 1, 2, 3] B [100, 100, 100]\n * [3, 2, 1, 1, 1, 2, 3] [100, 100, 100]\n * [3, 2, 2, 2, 2, 2, 3]\n * [3, 3, 3, 3, 3, 3, 3]\n */\n\nprint('Pointwise addition of two kernels', kernelA.add(kernelB));\n\n/**\n * [3, 3, 3, 3, 3, 3, 3]\n * [3, 2, 2, 2, 2, 2, 3]\n * [3, 2, 101, 101, 101, 2, 3]\n * [3, 2, 101, 100, 101, 2, 3]\n * [3, 2, 101, 101, 101, 2, 3]\n * [3, 2, 2, 2, 2, 2, 3]\n * [3, 3, 3, 3, 3, 3, 3]\n */\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\nfrom pprint import pprint\n\n# Two kernels, they do not need to have the same dimensions.\nkernel_a = ee.Kernel.chebyshev(**{'radius': ee.Number(3)})\nkernel_b = ee.Kernel.square(**{\n 'radius': 1,\n 'normalize': False,\n 'magnitude': 100\n})\npprint(kernel_a.getInfo())\npprint(kernel_b.getInfo())\n\n# Two kernel weights matrices\n\n# [3, 3, 3, 3, 3, 3, 3]\n# [3, 2, 2, 2, 2, 2, 3]\n# [3, 2, 1, 1, 1, 2, 3] [100, 100, 100]\n# A [3, 2, 1, 0, 1, 2, 3] B [100, 100, 100]\n# [3, 2, 1, 1, 1, 2, 3] [100, 100, 100]\n# [3, 2, 2, 2, 2, 2, 3]\n# [3, 3, 3, 3, 3, 3, 3]\n\nprint('Pointwise addition of two kernels:')\npprint(kernel_a.add(kernel_b).getInfo())\n\n# [3, 3, 3, 3, 3, 3, 3]\n# [3, 2, 2, 2, 2, 2, 3]\n# [3, 2, 101, 101, 101, 2, 3]\n# [3, 2, 101, 100, 101, 2, 3]\n# [3, 2, 101, 101, 101, 2, 3]\n# [3, 2, 2, 2, 2, 2, 3]\n# [3, 3, 3, 3, 3, 3, 3]\n```"]]