Inverse Image Filtering with Conjugate Gradient

Presented at BOOM 2003
by Zhengyun Zhang

Contents

The Problem

Suppose that we are given a filtered image, along with the exact filter that was applied to the image, how do we find/compute the original image?
Original Image
The Original Image

01210
12321
23432
12321
01210
Filter

Blurred Image
The Blurred Image

Possible Solutions

  1. Naive Inverse Convolution (details)
    Suppose we are given the above convolution filter, a straightforward approach would be to take the processed pixel and subtract out appropriately weighted values of the surrounding pixels. This is the general basis for standard "sharpen" filters.
    01210
    12321
    23432
    12321
    01210
    Original Filter

    0-1-2-10
    -1-2-3-2-1
    -2-340-3-2
    -1-2-3-2-1
    0-1-2-10
    "Inverse" Filter
  2. Matrix Inversion (details)
    If we look closely at convolution and represent an image as an extremely long vector, a convolution is actually a linear transformation on an image vector. Therefore, this means we can represent the filter as a giant matrix. Provided that the matrix is invertible, we can invert the matrix and apply it to our processed image to get the original image back. In fact, it is not necessary to invert the matrix fully. We can also factor the matrix using Gaussian elimination or Cholesky factorization.
    A=filter matrix, x=original image, y=filtered image
    Ax=y
    A-1y=x
  3. Conjugate Gradient (details)
    Following the assumption that the transformation is a matrix, we can also find the original image by using iterative methods. Moreover, if the transformation is a symmetric positive definite matrix, we can use a relatively fast method called the Conjugate Gradient method to iteratively solve for the original image.

Naive Inverse Convolution

Pros: Cons:

Matrix Inversion

Pros: Cons:

Conjugate Gradient

Pros: Cons:
e convolution filter, the matrix vector multiply is actually O(N) or O(n2) instead of O(N2). Therefore, the total running time for a nbyn image is O(n4) which is markedly better than the brute force matrix inversion algorithm.
The key advantage CG has to pure matrix inversion is storage. In each iteration, one only needs to store a few vectors, and the iteration only needs those vectors for that iteration or the one immediately afterwards. Hence, we can store the intermediate data in O(n2) space, much better than the O(n4) needed for pure matrix inversion.
  • Intermediate Values
    The nice thing about iterative methods is that they can be interrupted halfway and still compute a good approximate. The image above was not run for 254×190=48260 iterations. Rather, it was interrupted at roughly 400 iterations after the residual (a measure of how close the filtered guess is to the filtered original image) and still showed excellent results.
  • Cons:

    Conclusions

    Appendix

    Below are comparison images (zoomed in) for a 64×64 black and white text image.
    Original Image
    The Original Image

    010
    141
    010
    Original Filter

    Blurred Image
    The Blurred Image
    Blurred Image
    The Blurred Image

    0-10
    -18-1
    0-10
    Sharpen Filter

    Sharpened Image
    The Sharpened Image
    (using fixed size filter)
    Blurred Image
    The Blurred Image

    Conjugate Gradient
    100 iterations

    Deblurred Image
    The Deblurred Image
    (using conjugate gradient)
    Links