Announcement: All noncommercial projects registered to use Earth Engine beforeApril 15, 2025 mustverify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.
ee.Kernel.sobel Stay organized with collections Save and categorize content based on your preferences.
Page Summary
ee.Kernel.sobelgenerates a 3x3 Sobel edge-detection kernel.The
magnitudeargument scales the kernel values.The
normalizeargument normalizes the kernel values to sum to 1.The default Sobel kernel has weights represented by the matrix
[[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]].
| Usage | Returns |
|---|---|
ee.Kernel.sobel(magnitude,normalize) | Kernel |
| Argument | Type | Details |
|---|---|---|
magnitude | Float, default: 1 | Scale each value by this amount. |
normalize | Boolean, default: false | Normalize the kernel values to sum to 1. |
Examples
Code Editor (JavaScript)
print('A Sobel kernel',ee.Kernel.sobel());/** * Output weights matrix * * [-1, 0, 1] * [-2, 0, 2] * [-1, 0, 1] */
Python setup
See the Python Environment page for information on the Python API and usinggeemap for interactive development.
importeeimportgeemap.coreasgeemap
Colab (Python)
display('A Sobel kernel:',ee.Kernel.sobel())# Output weights matrix# [-1, 0, 1]# [-2, 0, 2]# [-1, 0, 1]
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.