Is there something like an anti-filter in image processing?

Say for instance, I am filtering an image using the following 13 tap symmetric filter:

{0, 0, 5, -6, -10, 37, 76, 37, -10, -6, 5, 0, 0} / 128

Each pixel is changed by this filtering process. My question is can we get back the original image by doing some mathematical operation on the filtered image.

Obviously such mathematical operations exists for trivial filters, like:

{1, 1} / 2

Can we generalize this to complex filters like the one I mentioned at the beginning?

Thanks, Anil.

  • 1
    $\begingroup$ maybe what you're looking for is called an Inverse Filter or DECONVOLUTION. $\endgroup$
    – CyberMen
    May 3 '12 at 15:33

What you're describing is call deconvolution. It's a concept frequently used for distorted images and for equalization in communications. As such you should be able to find a number of resources for your specific application. In general, the original image may not be recoverable exactly (it often isn't).

However, you can do a pretty good job depending on how severe the image has been undesirably filtered. In addition, many methods will attempt deconvolution by estimating the filter which it appears the signal has been affected by. If the assumption that the signal was convolved with a linear filter is a poor one, your performance may be severely inhibited.

  • $\begingroup$ Since I already know the exact filter that is affecting the signal, I should be able to get a good reconstructed image after deconvolution, right? Thanks for the information - will look it up. $\endgroup$
    – Anil Katti
    May 1 '12 at 21:21
  • 1
    $\begingroup$ Anil- Yes absolutely. A common misconception is that one can simply multiply the signal in the z-domain by 1/H(z), where H(z) is the unwanted filter's z-transform. However, if H(z) is not minimum phase, causality and stability are not guaranteed for the inverse filter. In addition, sometimes it may be necessary to limit our solution to an FIR filter, in which case our original filter must be an all-pole filter. For these reasons and more, there are more sophisticated methods of deconvolution. It all depends on your application and the original filter. $\endgroup$
    – Bryan
    May 1 '12 at 21:31
  • $\begingroup$ Thanks Bryan. Since I do not have much EE background, would it be possible for you to point me to some good resources on deconvolution? $\endgroup$
    – Anil Katti
    May 1 '12 at 21:47
  • $\begingroup$ Anil- Hopefully someone else can chime in; I don't do much in line of image signal processing, so I'm afraid I'm not a good authority on where to find good content specifically aimed at that. All my resources on deconvolution are application-agnostic and EE-intensive which it sounds like you're not looking for. $\endgroup$
    – Bryan
    May 1 '12 at 21:54
  • 1
    $\begingroup$ I heard that blind deconvolution often does better job that exact deconvolution inferred from the convolution formula. $\endgroup$
    – Libor
    May 1 '12 at 22:28

In this particular case, this would be quite difficult. The filter is a low pass with 30 dB of attenuation (mostly) but it has also two zeros on the unit circle. You can design an approximation for the inverse filter but it won't be perfect

  1. The filter is linear phase, so the inverse filter is also linear phase but non-causal. In practice this means you'll loose some pixels around the edges
  2. You cannot recover any content around the frequencies where the zeros are on the unit circle. This would require infinite gain
  3. You will need to apply a fair amount of boost (30dB to 40dB) at a sizable frequency range which will add some unintended noise to the picture

Consider the frequency response of the filter. If the source image contains data with spectrum exactly at the frequency of a notch in the filter, this data will be lost after convolution. There is no operator that can reasonably recover non-zero data from an image filtered into a bunch of zeros.

There can also be arithmetic quantization issues, thus making the filter convolution potentially informationally lossy. These two effects can combine, making merely low spots in the filter response curve also lossy.

  • 1
    $\begingroup$ Yes, and this is directly related to the instability I mentioned in my comment. A zero in your distorting filter will be a pole in your equalizer filter. If you look at Wiener deconvolution, it can be thought of as your inverse filter followed by a smoothing filter to reduce these large variances that can occur. $\endgroup$
    – Bryan
    May 1 '12 at 21:59
  • $\begingroup$ @Bryan : Yes, thus I up-voted your answer. My answer was an attempt to use a bit less EE math terminology. $\endgroup$
    – hotpaw2
    May 1 '12 at 22:03
  • $\begingroup$ hotpaw2- I appreciate it! I wasn't trying to indicate you were restating my answer or the like, but rather building on it since mine wasn't in layman's terms. Sorry to piggy back on your answer, I was simply trying to link it with my answer which was more convoluted. $\endgroup$
    – Bryan
    May 1 '12 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.