Anuncio: Todos los proyectos no comerciales registrados para usar Earth Engine antes del
15 de abril de 2025 deben
verificar su elegibilidad no comercial para mantener el acceso a Earth Engine.
ee.Kernel.fixed
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Crea un kernel.
Uso | Muestra |
---|
ee.Kernel.fixed(width, height, weights, x, y, normalize) | Kernel |
Argumento | Tipo | Detalles |
---|
width | Número entero, valor predeterminado: -1 | Es el ancho del kernel en píxeles. |
height | Número entero, valor predeterminado: -1 | Es la altura del kernel en píxeles. |
weights | Lista | Es una lista bidimensional de valores [altura] x [ancho] que se usa como los pesos del kernel. |
x | Número entero, valor predeterminado: -1 | Ubicación del enfoque, como una compensación desde la izquierda. |
y | Número entero, valor predeterminado: -1 | Ubicación del enfoque, como una compensación desde la parte superior. |
normalize | Booleano, valor predeterminado: falso | Normaliza los valores del kernel para que sumen 1. |
Ejemplos
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]
*/
Configuración de Python
Consulta la página
Entorno de Python para obtener información sobre la API de Python y el uso de geemap
para el desarrollo interactivo.
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]
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-26 (UTC)
[null,null,["Última actualización: 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```"]]