Deconvolution Filters

Deconvolution Kernel Filter in Java

         Deconvolution acts as the reverse matrix operation to a convolution filter. When a convolution transformation, like the application of a Gaussian blur kernel filter, is performed, attempting to undo this operation cannot completely recover the original image. This limitation arises from the averaging of pixel values during convolution, leading to a loss of some details. Nevertheless, deconvolution holds significance in image restoration and deblurring processes.

         In the given showcase, we first apply a Gaussian blur convolution filter and subsequently restore the original image using a Deconvolution filter:

// gaussian 3x3 convolution kernel
{
  {1, 2, 1,},
  {2, 4, 2,},
  {1, 2, 1,},
};
DeconvolutionFilterOptions(ConvolutionFilter.GetGaussian(Size, Sigma))

         While the restored image may not precisely match the original, it does reveal more details following the deblurring process.

Original image
Deconvolution filter
Original building image
Deconvolution Gaussian blur kernel filter in Java
Deconvolution kernel filter

Java code example

         The comprehensive Java code example provided below demonstrates the application of the Aspose.Imaging for Java API. Employ the `ConvolutionFilter` class with the "GetGaussian" blurring method and then proceed to deblur using the DeconvolutionFilterOptions. In this illustration, image templates in PNG and SVG formats are loaded from the "templates" folder, and filters are applied from a predefined list.