18

Since there is an algorithm to blur images, so that part of it cannot be recognised, can we reverse the algorithm and unblur part of than image?

Is there a program that already does that, is that even possible, even in a near future?

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
mahen23
  • 1,120
  • 1
  • 9
  • 23
  • Do you mean as in a full un-blurring of images, or just enough that you can tell what something was with a fair degree of accuracy? – rjzii Jun 24 '11 at 16:39
  • just enough that you can tell what something was with a fair degree of accuracy – mahen23 Jun 24 '11 at 17:20
  • 2
    Well... I guess it depends on *what* the something is and *how blurry* it is. So the answer is... Maybe! See @Greg Jackson's answer for the technical details. – FrustratedWithFormsDesigner Jun 24 '11 at 17:31
  • 2
    You may be interested in this classic Stackoverflow competition: http://stackoverflow.com/questions/891643/twitter-image-encoding-challenge – Tyler Jun 24 '11 at 17:36
  • Do you want to reconstruct data or "make up" possibly realistic data? If so, take a look at this: http://www.wisdom.weizmann.ac.il/~vision/SingleImageSR.html – Birgit P. Feb 01 '13 at 12:31
  • 2
    Hollywood proves it! https://www.youtube.com/watch?v=3EwZQddc3kY&t=0m11s – Thomas Eding Oct 03 '14 at 20:48
  • If you look not at the decoded bitmap (ie what you see on the screen), but instead of the raw code of the image. Then a blurry image is simply just an image with bitmap that can be compressed further because there are multiple pixels where you can compress. So at the end of the day, what is a blurry image? Is it an image with less raw encoding length or is it an image with blurry part when you decode into bitmap? I am not sure, I am not an expert in this area. Now if you have two images, how do you measure which one is "blurrier" than the other so you can "recover"? – InformedA Nov 19 '14 at 22:57

6 Answers6

39

Deconvolution (also see here and here) can partially deblur a photo. There is plenty of software out there that implements it, and this was even a fairly basic excersise in an image processing class I took in College. It's not possible to completely reverse the blurring, since it is lossy, but a lot of information can be restored (also see here (PDF)).

A motion blurred photo will be easier to restore than something that's simply out of focus, though both can be restored to a degree.

Greg Jackson
  • 1,844
  • 11
  • 14
  • yep, i tried a software called Focus Magic, but i need to play around with it more. – mahen23 Jun 24 '11 at 17:38
  • 1
    When the applied convolution is finite and the margins are preserved (i.e. image is let growing untrimmed), is it a fully reversible operation? – vines Jun 24 '11 at 21:02
  • @vines: I'll be honest, it's been too long since I've dealt with this stuff to give you a good answer. My gut says no, a blur is lossy even if you allow it to extend outside of the original image, but I also remember there was something special about such blurs. In a very limited test setting, it may be possible. The important thing, though, is that in the real world, you will never come across such an image, so while interesting mathematically, it's a moot point, practically speaking, as to whether that's the case or not. – Greg Jackson Jun 27 '11 at 17:00
  • I'm pretty sure no information is being restored - at least not in the Shannon sense. – jk. Feb 01 '13 at 07:40
  • 2
    the links do not work anymore – jgauffin Feb 01 '13 at 09:08
  • 1
    Adobe showed off this technology 3 years ago. http://tv.adobe.com/watch/max-2011-sneak-peeks/max-2011-sneak-peek-image-deblurring/ – Adrian J. Moreno Oct 03 '14 at 18:31
  • Interesting, I wasn't aware they had a video demo of it. For what it's worth, the mathematical technique has been around longer than Adobe has :) – Greg Jackson Oct 03 '14 at 18:48
7

Reversing image manipulation depends on how something has been manipulated.

Since the image is a representation of the object and we only have the visual data in that image, we can't "unblur" it, since we don't have the data.

Imagine a blurred image (like a pixelated faced) is similar to an email without all of the characters, we wouldn't be able to take the characters that we do have available to make up the exact words of the original email.

There may be ways to make a rough appropriation what the image may be, but they'll only ever be approximations, nothing like Action film "enhance!" representation of image manipulation.

Update: obligatory link to a page about the "swirled face" http://sciencenotes.wordpress.com/2007/10/20/what-computers-can-swirl-computers-can-unswirl/

StuperUser
  • 6,133
  • 1
  • 28
  • 56
  • I've seen some pretty amazing real-world uses of image manipulation to unblur things that appeared completely unrecoverable. Although yes, an approximation...they're getting pretty damn good at approximating. Nothing like a blurred area in an image, but very poorly focused images brought into focus such that you can begin seeing detail even in far away things. – Edward Strange Jun 24 '11 at 16:15
  • 2
    "there may be ways?" So in other words, you don't really know that much about it right? – Jeremy Jun 24 '11 at 16:16
  • @Jeremy yes, I've forgotten most of computer graphics module. – StuperUser Jun 24 '11 at 16:18
  • Speaking as a guy who sees the world really blurry with his glasses off, it's possible to recognize things whose actual features have been blurred away, if there's some artifact of the blurring still visible (different colors, etc.). If my visual cortex can do it, a sufficiently powerful computer with sufficiently sophisticated software can. – David Thornley Jun 24 '11 at 16:28
  • @David Thornley - there's a difference between recognising something and creating a clear image of something. As you've said. – StuperUser Jun 24 '11 at 16:30
  • 1
    @StuperUser - that's exactly the approach taken by maximum entropy based deconvolution. If the object was a straight line, what would the blur look like, compare to the image, adjust the line - repeat. – Martin Beckett Jun 24 '11 at 16:35
  • 1
    @David - one big difference is that wrt your glasses, the information is all still there, it just needs to be adjusted. Wrt images though, the information is not there and has to be recreated/approximated. – Edward Strange Jun 24 '11 at 16:48
  • @Crazy Eddie: The light that hits my eyes has all the information, yes. That information doesn't even reach my brain, as the internal processing creates a representation based on the light as it hit (i.e., blurry). Compare the number of rods and cones with the size of the optic nerve: images are very heavily processed and compressed in the eye itself. – David Thornley Jun 24 '11 at 17:39
  • 2
    It doesn't even hit the rods and cones, its being distorted by your lens and it amounts to a lossy compression. Still, you can interpolate missing information. – Jeremy Jun 24 '11 at 19:16
3

In the article Why blurring sensitive information is a bad idea the authors describe an method of 'unblurring' numbers and text.

The process is similar to a dictionary attack: you make blurred images (of similar pattern) from characters/numbers and then match these with the blur.

Jan Doggen
  • 1,140
  • 4
  • 16
  • 22
2

If the convolution function is continuous then it should be possible. But since we pass through it to a band limited filter, the function cannot be continuous, some information is lost. But you can still find a close approximation.

Howard
  • 39
  • 1
  • 2
    Could you explain your answer to the point where someone who hasn't had a signal processing class (but a professional programmer nonetheless) could understand it? –  Feb 01 '13 at 03:37
2

No, you cannot reverse the algorithm. At some level, most blur filters work by summing and averaging over pixel values. If you add two pixel values and replace each number with the average of both, you can not later determine which values you had originally.

pixel1 = 3
pixel2 = 5

blurredPixel = (pixel1 + pixel2) / 2 = 4

newPixel1 = blurredPixel = 4
newPixel2 = blurredPixel = 4

If you only have newPixel 1 and 2, you cannot find out if the original pixels where 3 and 5, 1 and 7 or any other possible combination.

TheFogger
  • 793
  • 1
  • 7
  • 6
  • 8
    But in an image with a lot of data, you can use probabilistic models to predict what those might have been. – Greg Jackson Jun 24 '11 at 16:32
  • 1
    If there was originally pixels 1..N, and what you've got is the average of each adjoining pixel, then the value of each pixel is completely determined by the value of any one pixel. If you have some idea of what the original was likely to be (perhaps limits on the likely values) you may well be able to come up with something very close to the original. – David Thornley Jun 24 '11 at 20:31
2

No, because blurring is like lossy compression: it removes information which cannot be recovered afterwords.

egrunin
  • 137
  • 3