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.reduceNeighborhood
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Applica il riduttore specificato al vicinato intorno a ogni pixel, come determinato dal kernel specificato. Se il riduttore ha un solo input, viene applicato separatamente a ogni banda della raccolta; in caso contrario, deve avere lo stesso numero di input delle bande dell'immagine di input.
I nomi degli output del riduttore determinano i nomi delle bande di output: i riduttori con più input utilizzeranno direttamente i nomi degli output, mentre i riduttori con un singolo input anteporranno al nome dell'output il nome della banda di input (ad es. '10_mean', '20_mean').
I riduttori con input ponderati possono avere il peso dell'input basato sulla maschera di input, sul valore del kernel o sul valore più piccolo tra i due.
Utilizzo | Resi |
---|
Image.reduceNeighborhood(reducer, kernel, inputWeight, skipMasked, optimization) | Immagine |
Argomento | Tipo | Dettagli |
---|
questo: image | Immagine | L'immagine di input. |
reducer | Riduttore | Il riduttore da applicare ai pixel all'interno del quartiere. |
kernel | Kernel | Il kernel che definisce il vicinato. |
inputWeight | Stringa, valore predefinito: "kernel" | Può assumere uno di tre valori: "mask", "kernel" o "min". |
skipMasked | Booleano, valore predefinito: true | Maschera i pixel di output se il pixel di input corrispondente è mascherato. |
optimization | Stringa, valore predefinito: null | Strategia di ottimizzazione. Le opzioni sono "vagone" e "finestra". Il metodo "boxcar" è un metodo rapido per calcolare conteggio, somma o media. Richiede un kernel omogeneo, un riduttore a singolo input e MASK, KERNEL o nessuna ponderazione. Il metodo "finestra" utilizza una finestra mobile e ha gli stessi requisiti di "boxcar", ma può utilizzare qualsiasi singolo riduttore di input. Entrambi i metodi richiedono una notevole quantità di memoria aggiuntiva. |
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\u003eApplies a given reducer function to the neighborhood of each pixel, defined by a kernel.\u003c/p\u003e\n"],["\u003cp\u003eOutput band names are determined by the reducer's output names, prefixed with the input band name for single-input reducers.\u003c/p\u003e\n"],["\u003cp\u003eInput weight for reducers can be based on the mask, kernel value, or the minimum of the two.\u003c/p\u003e\n"],["\u003cp\u003eOffers optimization strategies like 'boxcar' and 'window' for specific reducer and kernel types to improve performance.\u003c/p\u003e\n"],["\u003cp\u003eAllows skipping computation on masked pixels for efficiency.\u003c/p\u003e\n"]]],["This operation applies a reducer to pixel neighborhoods defined by a kernel. The reducer can have single or multiple inputs, with output band names determined accordingly. Weighted inputs are supported based on the input mask, kernel value, or their minimum. Options are available to skip masked pixels and optimize the process. The `Image.reduceNeighborhood` function takes a reducer, kernel, input weight, skip masked option, and an optimization method, returning a new image.\n"],null,["# ee.Image.reduceNeighborhood\n\nApplies the given reducer to the neighborhood around each pixel, as determined by the given kernel. If the reducer has a single input, it will be applied separately to each band of the collection; otherwise it must have the same number of inputs as the input image has bands.\n\n\u003cbr /\u003e\n\nThe reducer output names determine the names of the output bands: reducers with multiple inputs will use the output names directly, while reducers with a single input will prefix the output name with the input band name (e.g., '10_mean', '20_mean').\n\nReducers with weighted inputs can have the input weight based on the input mask, the kernel value, or the smaller of those two.\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------------------------|---------|\n| Image.reduceNeighborhood`(reducer, kernel, `*inputWeight* `, `*skipMasked* `, `*optimization*`)` | 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 neighborhood. |\n| `kernel` | Kernel | The kernel defining the neighborhood. |\n| `inputWeight` | String, default: \"kernel\" | One of 'mask', 'kernel', or 'min'. |\n| `skipMasked` | Boolean, default: true | Mask output pixels if the corresponding input pixel is masked. |\n| `optimization` | String, default: null | Optimization strategy. Options are 'boxcar' and 'window'. The 'boxcar' method is a fast method for computing count, sum or mean. It requires a homogeneous kernel, a single-input reducer and either MASK, KERNEL or no weighting. The 'window' method uses a running window, and has the same requirements as 'boxcar', but can use any single input reducer. Both methods require considerable additional memory. |"]]