ee.Image.reduceConnectedComponents
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wendet einen Reducer auf alle Pixel innerhalb jedes „Objekts“ an. Pixel gehören zu einem Objekt, wenn sie verbunden sind (8-way) und im Band „label“ denselben Wert haben. Das Labelband wird nur verwendet, um die Verbundenheit zu identifizieren. Die anderen werden als Eingaben für den Reducer bereitgestellt.
Nutzung | Ausgabe |
---|
Image.reduceConnectedComponents(reducer, labelBand, maxSize) | Bild |
Argument | Typ | Details |
---|
So gehts: image | Bild | Das Eingabebild. |
reducer | Reducer | Der Reducer, der auf Pixel innerhalb der verbundenen Komponente angewendet werden soll. |
labelBand | String, Standard: null | Der Name des Bands, das zum Erkennen der Verbindung verwendet werden soll. Wenn nichts angegeben ist, wird das erste Band verwendet. |
maxSize | Ganzzahl, Standard: 256 | Größe der Nachbarschaft, die beim Aggregieren von Werten berücksichtigt werden soll. Alle Objekte, die in horizontaler oder vertikaler Richtung größer als „maxSize“ sind, werden maskiert, da sich Teile des Objekts möglicherweise außerhalb der Umgebung befinden. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003eReduces pixel values within connected regions (objects) of an image based on a user-provided reducer function.\u003c/p\u003e\n"],["\u003cp\u003eObjects are identified by contiguous pixels sharing the same value in a specified label band (defaults to the first band if not provided).\u003c/p\u003e\n"],["\u003cp\u003eThe reducer function receives all image bands except the label band as input and aggregates pixel values within each object.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003emaxSize\u003c/code\u003e parameter limits the size of objects considered for reduction, masking larger objects to avoid edge effects.\u003c/p\u003e\n"]]],[],null,["# ee.Image.reduceConnectedComponents\n\nApplies a reducer to all of the pixels inside of each 'object'. Pixels are considered to belong to an object if they are connected (8-way) and have the same value in the 'label' band. The label band is only used to identify the connectedness; the rest are provided as inputs to the reducer.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------------------------------------------------|---------|\n| Image.reduceConnectedComponents`(reducer, `*labelBand* `, `*maxSize*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The input image. |\n| `reducer` | Reducer | The reducer to apply to pixels within the connected component. |\n| `labelBand` | String, default: null | The name of the band to use to detect connectedness. If unspecified, the first band is used. |\n| `maxSize` | Integer, default: 256 | Size of the neighborhood to consider when aggregating values. Any objects larger than maxSize in either the horizontal or vertical dimension will be masked, since portions of the object might be outside of the neighborhood. |"]]