Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
ee.Image.reduceConnectedComponents
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Applica un riduttore a tutti i pixel all'interno di ogni "oggetto". I pixel sono considerati appartenenti a un oggetto se sono collegati (in 8 direzioni) e hanno lo stesso valore nella banda "etichetta". La banda dell'etichetta viene utilizzata solo per identificare la connettività; il resto viene fornito come input al riduttore.
Utilizzo | Resi |
---|
Image.reduceConnectedComponents(reducer, labelBand, maxSize) | Immagine |
Argomento | Tipo | Dettagli |
---|
questo: image | Immagine | L'immagine di input. |
reducer | Riduttore | Il riduttore da applicare ai pixel all'interno del componente connesso. |
labelBand | Stringa, valore predefinito: null | Il nome della banda da utilizzare per rilevare la connettività. Se non specificato, viene utilizzata la prima banda. |
maxSize | Numero intero, valore predefinito: 256 | Dimensione del vicinato da considerare durante l'aggregazione dei valori. Gli oggetti più grandi di maxSize nella dimensione orizzontale o verticale verranno mascherati, poiché alcune parti dell'oggetto potrebbero trovarsi al di fuori del quartiere. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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. |"]]