Restoration of defocused and blurred images (2012)
21–30 of 48 posts
Re: Restoration of defocused and blurred images (2012)
#22The way to use it in image processing is to basically think of each pixel as a point on a graph, with edges between its adjacent pixels. Then you apply a least squares penalty with an additional regularization penalty on the absolute value of the difference between neighboring pixels. The result is regions of constant pixel color.
Re: Restoration of defocused and blurred images (2012)
#23Wow, that's very impressive, and very un-intuitive (to me) that it's possible at all. So, who is the first to dig out some pictures that were 'redacted before publication' and can be de-obfuscated this way?
Indeed, there is no free lunch. This is only possible because the restoration algorithms are making some rather strong assumptions about the original picture. For example, they assume that evey blury area in the blury picture has a corresponding sharp edge in the original picture.
It works fairly well on pictures with a lot of sharp edges such as the ones in the article: buldings, text etc.
I'm guessing that it wouldn't work as well on natural landscapes or human faces, because they don't usually have edges likes this.
For example, in this restored picture,
http://hsto.org/storage2/9d8/554/c15/9d8554c156e63a213797502...
the sky in this picture contains edges that do no exist in the original picture. The algorithm is trying to find edges where there are none. This is a very visible impact of this assumption.
Re: Restoration of defocused and blurred images (2012)
#24These really de-focused images are interesting for the article but if you can take a slightly out of focus image and make is laser-sharp then it is extremely useful for all kinds of photo and video applications. It's really tough to fix a shot that was slightly off when you're going for professional quality where you can't tell it was sharpened.
Highly agreed! I would be really curious to see if someone could take a slightly defocused picture and run it through this to see what it would produce / if it would introduce a bunch of undesirable effects or not.
I've found a few things out: Firstly, many articles mention some form of Richardson Lucy with regularization as if de-convolution with a known Point Spread Function is a solved problem. The regularization can indeed produce better results, but usually introduces new parameters. I've found, with real photographs, I have had far better results using less statistically sound methods. This is especially true as I've found that RL, more often than not, begins to diverge quite early.
The reality is that there are papers surrounding deconvolution and blind deconvolution that get apparently good results and work poorly in practice. It is only once implemented that the flaws of the algorithms proposed are exposed. This is compounded by the fact that we have a wonderful error metric with this inverse problem: the euclidean distance between 1. the solution convolved with the point-spread function used for deconvolution; and 2. the original (blurred) image. With many algorithms, lowering the euclidean distance decreases the perceived quality by introducing more artefacts. Nonetheless, I have only seen a handful of papers that include this metric when considering a proposed regularisation scheme, and this is one of the only times when this particular metric makes any sense in computer vision -- if your deconvolution is working, and your PSF is correct (which it is in many cases as the blur is synthetic) then the euclidean distance is the measure you want.
I have since switched to least squares using L-BFGS-B for fitting which has lowered again the Euclidean distance and produced the best, most natural-looking results by far on real photographic images. Unfortunately, estimating the PSF is difficult for small out-of-focus blurs. Optics applied to an ideal lens would suggest a disc kernel, but at this scale other factors are playing a part.
I'll probably do a writeup of this when I'm done -- though I don't know when that will be. I'll also be putting any code on Github in due course. In the meantime if anybody has any pointers or is interested in further details or source code please grab my email address from my profile.
Re: Restoration of defocused and blurred images (2012)
#25Strangely enough, the author only mentions total variation denoising in passing as a feature of SmartBlur. I would say this method is one of the most common, especially when your image has sharp transitions and lots of solid regions of color (e.g. pictures of buildings). I wrote what is effectively one of two of the fastest TV denoising algorithms and implementations out there: https://github.com/tansey/gfl The way t…
Either way, the results of overdoing it with TV are the same: cartoony images with large regions of constant colour. The difference is that incorporating TV within iterative deconvolution reduces some compression artefacts and removes some of the ripples around large discontinuities shown in the author's pictures.
Re: Restoration of defocused and blurred images (2012)
#26Re: Restoration of defocused and blurred images (2012)
#27Are there security implications? If the last example was a blurred out license key or address for instance, this technique might be able to restore it.
Re: Restoration of defocused and blurred images (2012)
#28Imagine that you are learning a deep neural network on a huge amount of movies. You have access to all of the lovely Hollywood movies. You downscale them to a 480p resolution, and then try to learn a deep neural network to upscale the thing, maybe upscaling only 16x16 blocks of the image.
It works amazingly well, and looks like magic.
Maybe there was no visibility of pores on the face in the 480p downscale, but your model can learn to reproduce them faithfully.
Sony has access to billions of movie frames in extremely large resolutions. Their engineers are definitely using this large amount of information to create statistical filters which upscale your non-hd, or maybe your HD to 4k HD. These filters work better than deterministic methods in this article. Why? Because the filters know much more about the distribution of the source (distribution of values of each individual pixel). They have exact information that one instead tries to assume (author in the article assumed that something in the source - be it noise or something else - behaves according the to Gaussian). If you know how to find the proper distribution, instead of assuming it, you can move closer to the information theoretical limits.
Just imagine how fast these filters can be if you put them on an FPGA, it also explains why TV sometimes cost more than $2k.
If you knew that your images would only contain car registration plates, you could definitely learn a filter that would be very precise in reconstructing the image when zoomed, you'd now find CSI zooming a little bit more realistic :D
Re: Restoration of defocused and blurred images (2012)
#29Note that this works for out of focus photos, not for enlarging tiny details of in focus photos. They may look similarly blurry, but are mathematically very different.
Re: Restoration of defocused and blurred images (2012)
#30Note that this works for out of focus photos, not for enlarging tiny details of in focus photos. They may look similarly blurry, but are mathematically very different.
How's that? Can't you think of a pixel as the average value of it's subpixels (=blur)?
However, when images are downscaled, all the information from 'subpixels' is kept within the reduced-resolution-image-pixel, and all replaced with a single RGB value. There is no 'spread out' information from those pixels. The 'blur' only applies to a region with sharp edges that exactly coincide with the unit of information. So, none of the data from the sub-pixels remain. To reconstruct the pixels that were within you have to essentially guess based on the context of the surrounding pixels.