הודעה: כל הפרויקטים הלא מסחריים שנרשמו לשימוש ב-Earth Engine לפני
15 באפריל 2025 חייבים
לאמת את הזכאות לשימוש לא מסחרי כדי לשמור על הגישה. אם לא תאמתו את החשבון עד 26 בספטמבר 2025, יכול להיות שהגישה שלכם תושעה.
פעולות מורפולוגיות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
פעולות מורפולוגיות מיושמות ב-Earth Engine כפעולות מוקד, במיוחד שיטות המכונה focalMax(), focalMin(), focalMedian() ו-focalMode() בכיתה Image. (אלה קיצורי דרך ל-reduceNeighborhood() הכללי יותר, שיכול להזין את הפיקסלים בליבה לכל פונקציית צמצום עם פלט מספרי. מידע נוסף על צמצום השכונות זמין בדף הזה. אופרטורים מורפולוגיים שימושיים לביצוע פעולות כמו שחיקה, הרחבה, פתיחה וסגירה. לדוגמה, כדי לבצע פעולת פתיחה, משתמשים ב-focalMin() ואז ב-focalMax():
Code Editor (JavaScript)
// Load a Landsat 8 image, select the NIR band, threshold, display.
var image = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318')
.select(4).gt(0.2);
Map.setCenter(-122.1899, 37.5010, 13);
Map.addLayer(image, {}, 'NIR threshold');
// Define a kernel.
var kernel = ee.Kernel.circle({radius: 1});
// Perform an erosion followed by a dilation, display.
var opened = image
.focalMin({kernel: kernel, iterations: 2})
.focalMax({kernel: kernel, iterations: 2});
Map.addLayer(opened, {}, 'opened');
שימו לב שבדוגמה הקודמת, ניתנת ל-operator מורפולוגי טענת ליבה. הפיקסלים שמכוסים באלמנטים שאינם אפס בליבה משמשים לחישוב. הארגומנט iterations מציין כמה פעמים להחיל את האופרטור.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],["Earth Engine's `Image` class provides `focalMax()`, `focalMin()`, `focalMedian()`, and `focalMode()` for morphological operations like erosion, dilation, opening, and closing. These operations use a kernel to define the neighborhood of pixels. For example, the opening operation is achieved by applying `focalMin()` then `focalMax()`. A kernel argument defines the area for computation, and the iterations argument specifies the number of operator applications. The provided code demonstrates the opening operation on a Landsat 8 image using a circular kernel.\n"]]