9.2. Non-Local Means

Non-Local Means is a denoising filter that computes filtered pixel values as a weighted average of pixels in the spatial neighborhood, where the weights are determined as a function of color distance.


from nd.filters import NLMeansFilter
nlm = NLMeansFilter(dims=('y', 'x', 'time'), r=(3, 3, 1),
                    sigma=1, h=1, f=1)
ds_filtered = nlm.apply(ds)