kornia.filters#

Differentiable image filtering on batched (B, C, H, W) tensors. Every function has an nn.Module counterpart on the same page.

Blurring

Gaussian, box, median, bilateral, guided and motion blur; blur pooling; unsharp masking.

Edge detection

Sobel, Laplacian and Canny edge detectors and spatial gradients in 2D and 3D.

Thresholding

Range thresholding and Otsu’s threshold.

Filtering API

Apply your own 2D, separable or 3D kernels with filter2d(), filter2d_separable() and filter3d(), or by correlation or convolution with correlate2d(), convolve2d(), correlate3d() and convolve3d(); fft_conv() filters in the frequency domain.

Kernels

Gaussian, box, Hanning, Laplacian, gradient and motion kernels used by the filters above.