Anúncio: todos os projetos não comerciais registrados para usar o Earth Engine antes de
15 de abril de 2025 precisam
verificar a qualificação não comercial para manter o acesso ao Earth Engine.
ee.Kernel.fixed
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Cria um kernel.
Uso | Retorna |
---|
ee.Kernel.fixed(width, height, weights, x, y, normalize) | Kernel |
Argumento | Tipo | Detalhes |
---|
width | Número inteiro, padrão: -1 | A largura do kernel em pixels. |
height | Número inteiro, padrão: -1 | A altura do kernel em pixels. |
weights | Lista | Uma lista 2D de valores [altura] x [largura] a serem usados como pesos do kernel. |
x | Número inteiro, padrão: -1 | A localização do foco, como um deslocamento da esquerda. |
y | Número inteiro, padrão: -1 | A localização do foco, como um deslocamento da parte de cima. |
normalize | Booleano, padrão: falso | Normalizar os valores do kernel para somar 1. |
Exemplos
Editor de código (JavaScript)
// Kernel weights.
var weights = [[4, 3, 2, 1, 2, 3, 4],
[4, 3, 2, 1, 2, 3, 4],
[4, 3, 2, 1, 2, 3, 4]];
print('A fixed kernel', ee.Kernel.fixed({weights: weights}));
/**
* Output weights matrix
*
* [4, 3, 2, 1, 2, 3, 4]
* [4, 3, 2, 1, 2, 3, 4]
* [4, 3, 2, 1, 2, 3, 4]
*/
Configuração do Python
Consulte a página
Ambiente Python para informações sobre a API Python e como usar
geemap
para desenvolvimento interativo.
import ee
import geemap.core as geemap
Colab (Python)
from pprint import pprint
weights = [[4, 3, 2, 1, 2, 3, 4],
[4, 3, 2, 1, 2, 3, 4],
[4, 3, 2, 1, 2, 3, 4]]
print('A fixed kernel:')
pprint(ee.Kernel.fixed(**{'weights': weights}).getInfo())
# Output weights matrix
# [4, 3, 2, 1, 2, 3, 4]
# [4, 3, 2, 1, 2, 3, 4]
# [4, 3, 2, 1, 2, 3, 4]
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-26 UTC.
[null,null,["Última atualização 2025-07-26 UTC."],[[["\u003cp\u003eCreates a kernel to be applied to an image, using a fixed set of weights provided in a 2-D list.\u003c/p\u003e\n"],["\u003cp\u003eThe kernel can be customized with dimensions (width, height), weight values, and a central focus point (x, y).\u003c/p\u003e\n"],["\u003cp\u003eOptionally, the kernel weights can be normalized to sum to 1.\u003c/p\u003e\n"],["\u003cp\u003eExamples in JavaScript, Python, and Colab are included to demonstrate how to create and use a fixed kernel.\u003c/p\u003e\n"]]],["The function `ee.Kernel.fixed` creates a kernel using specified parameters. Key actions involve defining the kernel's `width` and `height` in pixels and providing a 2-D list of `weights`. Users can specify the focus point using `x` and `y` offsets. An option to `normalize` the weights, ensuring they sum to 1, is available. The function then returns a `Kernel` object for use. Example `weights` data are shown.\n"],null,["# ee.Kernel.fixed\n\nCreates a Kernel.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------|---------|\n| `ee.Kernel.fixed(`*width* `, `*height* `, weights, `*x* `, `*y* `, `*normalize*`)` | Kernel |\n\n| Argument | Type | Details |\n|-------------|-------------------------|----------------------------------------------------------------------------------|\n| `width` | Integer, default: -1 | The width of the kernel in pixels. |\n| `height` | Integer, default: -1 | The height of the kernel in pixels. |\n| `weights` | List | A 2-D list of \\[height\\] x \\[width\\] values to use as the weights of the kernel. |\n| `x` | Integer, default: -1 | The location of the focus, as an offset from the left. |\n| `y` | Integer, default: -1 | The location of the focus, as an offset from the top. |\n| `normalize` | Boolean, default: false | Normalize the kernel values to sum to 1. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Kernel weights.\nvar weights = [[4, 3, 2, 1, 2, 3, 4],\n [4, 3, 2, 1, 2, 3, 4],\n [4, 3, 2, 1, 2, 3, 4]];\n\nprint('A fixed kernel', ee.Kernel.fixed({weights: weights}));\n\n/**\n * Output weights matrix\n *\n * [4, 3, 2, 1, 2, 3, 4]\n * [4, 3, 2, 1, 2, 3, 4]\n * [4, 3, 2, 1, 2, 3, 4]\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\nweights = [[4, 3, 2, 1, 2, 3, 4],\n [4, 3, 2, 1, 2, 3, 4],\n [4, 3, 2, 1, 2, 3, 4]]\n\nprint('A fixed kernel:')\npprint(ee.Kernel.fixed(**{'weights': weights}).getInfo())\n\n# Output weights matrix\n\n# [4, 3, 2, 1, 2, 3, 4]\n# [4, 3, 2, 1, 2, 3, 4]\n# [4, 3, 2, 1, 2, 3, 4]\n```"]]