Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 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,["Creates 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\nCode 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\nColab (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```"]]