# Restoring an out of focus image [duplicate]

Folks,

I am studying ways to deblurring an image:

Sample: , an my goal is the money in that hand. Is possible improve the image, features, etc..?

I tried all the de blurring methods:

1 - first I cropped the image: ;

2 - I tried a lot of codes:

ImageDeconvolve[imag2, GaussianMatrix[2],
Method -> #] & /@ {"DampedLS", "Tikhonov", "TSVD", "Wiener"}

ImageDeconvolve[imag2, GaussianMatrix[2],
Method -> {#, "Preconditioned" -> False},
MaxIterations -> 100] & /@ {"Hybrid", "SteepestDescent",
"RichardsonLucy"}

ImageDeconvolve[imag2, GaussianMatrix[2],
Method -> {#, "Preconditioned" -> True}] & /@ {"Hybrid",
"SteepestDescent", "RichardsonLucy"}


etc... In fact, I use all the examples in: ImageDeconvolve

And My best result was:

Sharpen[imag2, 10]


Which codes can be applied and do better results (if possible, of course..)?

• Related – bobthechemist Jan 31 '15 at 13:36
• Lenses are not designed to perform optimally when not focused. Astigmatism, coma, and chromatic aberrations will all be evident in an unfocused image, so it is necessary to deconvolve with respect to the point spread function from a physical model of the lens (not just e.g. a Gaussian) to produce a focused image. Additionally it appears that your sensor is not sampling the image finely enough, or the sensor is not properly calibrated (as we see from the pixellation in the deconvolved result), and there are objects at different depths in the image. This is a very difficult problem. – Oleksandr R. Jan 31 '15 at 13:49
• I will add to Oleksandr's comment that you appear to be working with a jpeg image, so a lot of information will have been discarded by the compression algorithm. I suspect it will be impossible to get anything much better than your Sharpen result. – Simon Woods Jan 31 '15 at 13:53
• Yes, definitely. But scientific cameras typically are linear and record at 14 bits resolution or higher. Another issue is that the contrast of the given image looks blown out and it does not appear to have been recorded at high quantization depth. As such it is entirely possible that the information needed to reconstruct the focused image is simply not present in the available data even if you were to completely characterize the optics. – Oleksandr R. Jan 31 '15 at 13:58
• @locometro, or maybe it is not money but some white papers, so it will not be possible to see them anyway. More seriously, did you try to exploit the fact that you know more or less where the focus is? Also, do you know, what kind of money might it be? Recognising and image out of ten possibilities might go easier than resolving the whole image. – Alexey Bobrick Jan 31 '15 at 14:16