Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.Image.focalMedian
Stay organized with collections
Save and categorize content based on your preferences.
Applies a morphological reducer() filter to each band of an image using a named or custom kernel.
Usage | Returns | Image.focalMedian(radius, kernelType, units, iterations, kernel) | Image |
Argument | Type | Details | this: image | Image | The image to which to apply the operations. |
radius | Float, default: 1.5 | The radius of the kernel to use. |
kernelType | String, default: "circle" | The type of kernel to use. Options include: 'circle', 'square', 'cross', 'plus', 'octagon', and 'diamond'. |
units | String, default: "pixels" | If a kernel is not specified, this determines whether the kernel is in meters or pixels. |
iterations | Integer, default: 1 | The number of times to apply the given kernel. |
kernel | Kernel, default: null | A custom kernel. If used, kernelType and radius are ignored. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-13 UTC.
[null,null,["Last updated 2024-07-13 UTC."],[[["\u003cp\u003eApplies a morphological reducer filter to each band of an image using a kernel.\u003c/p\u003e\n"],["\u003cp\u003eOffers options for kernel type including circle, square, cross, plus, octagon, and diamond, or allows for a custom kernel.\u003c/p\u003e\n"],["\u003cp\u003eThe radius of the kernel, units (pixels or meters), and number of iterations can be specified.\u003c/p\u003e\n"],["\u003cp\u003eThe filter is applied using the \u003ccode\u003efocalMedian()\u003c/code\u003e function, accepting arguments for radius, kernel type, units, iterations, and a custom kernel if desired.\u003c/p\u003e\n"]]],[],null,["# ee.Image.focalMedian\n\nApplies a morphological reducer() filter to each band of an image using a named or custom kernel.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------------------|---------|\n| Image.focalMedian`(`*radius* `, `*kernelType* `, `*units* `, `*iterations* `, `*kernel*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|---------------------------|------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image to which to apply the operations. |\n| `radius` | Float, default: 1.5 | The radius of the kernel to use. |\n| `kernelType` | String, default: \"circle\" | The type of kernel to use. Options include: 'circle', 'square', 'cross', 'plus', 'octagon', and 'diamond'. |\n| `units` | String, default: \"pixels\" | If a kernel is not specified, this determines whether the kernel is in meters or pixels. |\n| `iterations` | Integer, default: 1 | The number of times to apply the given kernel. |\n| `kernel` | Kernel, default: null | A custom kernel. If used, kernelType and radius are ignored. |"]]