ee.Kernel.laplacian4
Generates a 3x3 Laplacian-4 edge-detection kernel.
Usage | Returns |
---|
ee.Kernel.laplacian4(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
print('A Laplacian-4 kernel', ee.Kernel.laplacian4());
/**
* Output weights matrix
*
* [0, 1, 0]
* [1, -4, 1]
* [0, 1, 0]
*/
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
from pprint import pprint
print('A Laplacian-4 kernel:')
pprint(ee.Kernel.laplacian4().getInfo())
# Output weights matrix
# [0, 1, 0]
# [1, -4, 1]
# [0, 1, 0]
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 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["Creates a 3x3 kernel for edge detection using the Laplacian-4 operator."],["The kernel can be scaled using the `magnitude` argument and normalized using the `normalize` argument."],["The default kernel values are: `[[0, 1, 0], [1, -4, 1], [0, 1, 0]]`."]]],["The `ee.Kernel.laplacian4()` function generates a 3x3 Laplacian-4 edge-detection kernel. It accepts `magnitude` (float, default 1) to scale kernel values and `normalize` (boolean, default false) to normalize values to sum to 1. The function returns a kernel represented by the weights matrix: `[[0, 1, 0], [1, -4, 1], [0, 1, 0]]`. `magnitude` allows for customization of the kernel's sensitivity.\n"]]