Anúncio: todos os projetos não comerciais registrados para usar o Earth Engine antes de
15 de abril de 2025 precisam
verificar a qualificação não comercial para manter o acesso ao Earth Engine.
ee.Image.reduceNeighborhood
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Aplica o redutor especificado à vizinhança de cada pixel, conforme determinado pelo kernel especificado. Se o redutor tiver uma única entrada, ele será aplicado separadamente a cada banda da coleção. Caso contrário, ele precisará ter o mesmo número de entradas que a imagem de entrada tem de bandas.
Os nomes de saída do redutor determinam os nomes das bandas de saída: redutores com várias entradas usam os nomes de saída diretamente, enquanto redutores com uma única entrada prefixam o nome de saída com o nome da banda de entrada (por exemplo, '10_mean', '20_mean').
Os redutores com entradas ponderadas podem ter o peso da entrada com base na máscara de entrada, no valor do kernel ou no menor desses dois.
Uso | Retorna |
---|
Image.reduceNeighborhood(reducer, kernel, inputWeight, skipMasked, optimization) | Imagem |
Argumento | Tipo | Detalhes |
---|
isso: image | Imagem | A imagem de entrada. |
reducer | Redutor | O redutor a ser aplicado aos pixels na vizinhança. |
kernel | Kernel | O kernel que define a vizinhança. |
inputWeight | String, padrão: "kernel" | Uma das opções: "mask", "kernel" ou "min". |
skipMasked | Booleano, padrão: verdadeiro | Mascarar pixels de saída se o pixel de entrada correspondente estiver mascarado. |
optimization | String, padrão: null | Estratégia de otimização. As opções são "boxcar" e "window". O método "boxcar" é uma maneira rápida de calcular contagem, soma ou média. Ele exige um kernel homogêneo, um redutor de entrada única e MASK, KERNEL ou nenhum ponderação. O método "window" usa uma janela de execução e tem os mesmos requisitos de "boxcar", mas pode usar qualquer redutor de entrada única. Ambos os métodos exigem uma quantidade considerável de memória extra. |
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-26 UTC.
[null,null,["Última atualização 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. |"]]