ee.Kernel.sobel
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Generuje jądro wykrywania krawędzi Sobela o rozmiarze 3x3.
Wykorzystanie | Zwroty |
---|
ee.Kernel.sobel(magnitude, normalize) | Jądro |
Argument | Typ | Szczegóły |
---|
magnitude | Liczba zmiennoprzecinkowa, domyślnie: 1 | Skaluj każdą wartość o tę kwotę. |
normalize | Wartość logiczna, domyślnie: false | Znormalizuj wartości jądra tak, aby ich suma wynosiła 1. |
Przykłady
Edytor kodu (JavaScript)
print('A Sobel kernel', ee.Kernel.sobel());
/**
* Output weights matrix
*
* [-1, 0, 1]
* [-2, 0, 2]
* [-1, 0, 1]
*/
Konfiguracja Pythona
Informacje o interfejsie Python API i używaniu geemap
do interaktywnego programowania znajdziesz na stronie
Środowisko Python.
import ee
import geemap.core as geemap
Colab (Python)
from pprint import pprint
print('A Sobel kernel:')
pprint(ee.Kernel.sobel().getInfo())
# Output weights matrix
# [-1, 0, 1]
# [-2, 0, 2]
# [-1, 0, 1]
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[],["The `ee.Kernel.sobel()` function creates a 3x3 Sobel edge-detection kernel. It accepts two arguments: `magnitude`, which scales the kernel values (default is 1), and `normalize`, which normalizes the kernel to sum to 1 (default is false). The function returns a Kernel object with the weights matrix: `[-1, 0, 1]`, `[-2, 0, 2]`, `[-1, 0, 1]`. The kernel can be used in both Javascript and Python coding environments.\n"],null,[]]