Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Za pomocą funkcji image.gradient() możesz obliczyć gradient każdego pasma obrazu.
Na przykład ten kod oblicza wielkość i kierunek gradientu w paśmie panchromatycznym Landsat 8:
Pamiętaj, że gradient() generuje 2 pasma: gradient w kierunku osi X i gradient w kierunku osi Y. Jak widać na przykładzie, te 2 kierunki można połączyć, aby uzyskać kierunek i natężenie gradientu. Wielkość powinna wyglądać jak na rysunku 1.
Rysunek 1. Wielkość gradientu panchromatycznego dla zdjęć satelitarnych Landsat 8 nad zatoką San Francisco w Kalifornii w USA.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[],["The `image.gradient()` function computes the gradient of each image band, outputting X and Y-direction gradients. The example loads a Landsat 8 panchromatic band image, calculates the X and Y gradients, then determines the gradient's magnitude by combining the squared X and Y values and the gradient's direction using `atan2` function. Finally, it displays the gradient and its direction, centered on San Francisco. The image gradient magnitude is then illustrated.\n"],null,[]]