Velocity Reviews > Fixing an unfocused image theoretically straightforward?!

# Fixing an unfocused image theoretically straightforward?!

223rem
Guest
Posts: n/a

 04-20-2007
If an unfocused image = convolution of the focused image with a Gaussian
kernel, then this is a linear thus invertible transform, and therefore
the focused image could in principle be recovered by guessing the sigma
of the blurring Gaussian!

Right? Most likely not, but why?

MarkČ
Guest
Posts: n/a

 04-20-2007
223rem wrote:
> If an unfocused image = convolution of the focused image with a
> Gaussian kernel, then this is a linear thus invertible transform, and
> therefore the focused image could in principle be recovered by
> guessing the sigma of the blurring Gaussian!
>
> Right? Most likely not, but why?

But how would it detect which portions of the image are blurred simply due
to desired, normal DOF limitations vs. the focussing mistake within the
frame? A perfectly focussed subject/portion is rarely surrounded by
perfectly-focussed elements unless you're shooting a wholly distant
landscape, a flat-to-sensor subject, or at such huge DOF settings as to be
nearly identically sharp, near to far. I frankly wouldn't even attempt to
answer your question with math, proof, etc. I'm just thinking the above is
one reason why there would be problems. Maybe Roger Clark, or perhaps David

--
Images (Plus Snaps & Grabs) by MarkČ at:
www.pbase.com/markuson

Kevin McMurtrie
Guest
Posts: n/a

 04-20-2007
In article <(E-Mail Removed)> ,
223rem <(E-Mail Removed)> wrote:

> If an unfocused image = convolution of the focused image with a Gaussian
> kernel, then this is a linear thus invertible transform, and therefore
> the focused image could in principle be recovered by guessing the sigma
> of the blurring Gaussian!
>
> Right? Most likely not, but why?

Not true.

First, the signal to noise ratio quickly heads towards zero when you
undo a blur. The worse the blur, the less unique signal is left in each
pixel to extract.

Second, focus blur is not uniform for objects with different distances.
The amount of blur correction can only be guessed.

Mild haze from a cheap lens can often be completely corrected but lack
of focus can only be slightly corrected. Some enhancement applications
will use pattern matching to guess what the picture used to look like
and redraw it as a sharp image. It can produce a pleasing image if
enough of its guessing is right. Sometimes is goes horribly wrong, too.

HvdV
Guest
Posts: n/a

 04-20-2007
Hi 223rem,
>
>
>>If an unfocused image = convolution of the focused image with a Gaussian
>>kernel, then this is a linear thus invertible transform, and therefore
>>the focused image could in principle be recovered by guessing the sigma
>>of the blurring Gaussian!
>>
>>Right? Most likely not, but why?

If it were indeed Gaussian, and the image noise-free, then indeed you could
do an inversion resulting in unlimited resolution. However, the blur function
is band limited, varies from point to point in your image AND there is noise,
always.

But that doesn't mean there is nothing you can do...

-- Hans

> Mild haze from a cheap lens can often be completely corrected but lack
> of focus can only be slightly corrected. Some enhancement applications
> will use pattern matching to guess what the picture used to look like
> and redraw it as a sharp image. It can produce a pleasing image if
> enough of its guessing is right. Sometimes is goes horribly wrong, too.

Yes!

Mike Russell
Guest
Posts: n/a

 04-20-2007
"223rem" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> If an unfocused image = convolution of the focused image with a Gaussian
> kernel, then this is a linear thus invertible transform, and therefore the
> focused image could in principle be recovered by guessing the sigma of the
> blurring Gaussian!
>
> Right? Most likely not, but why?

Probably not, or it would have been done already, at least for a flat
subject with low noise.

Here's a similar problem I've always thought might be interesting, that may
be easier to solve: inverting a bevel. Since a bevel is computed by
subtracting pixels offset by a constant distance along a line, integrating
along the same line should restore the original image, plus or minus a
constant.
--
Mike Russell
www.curvemeister.com/forum/

Ron Hunter
Guest
Posts: n/a

 04-20-2007
223rem wrote:
> If an unfocused image = convolution of the focused image with a Gaussian
> kernel, then this is a linear thus invertible transform, and therefore
> the focused image could in principle be recovered by guessing the sigma
> of the blurring Gaussian!
>
> Right? Most likely not, but why?

One needs to know the parameters of the lack of focus, and much
processing is required for mediocre results, at least in my experience.

Ilya Zakharevich
Guest
Posts: n/a

 04-20-2007
[A complimentary Cc of this posting was sent to
HvdV
<(E-Mail Removed)>], who wrote in article <46287046\$0\$2026\$(E-Mail Removed)>:

> If it were indeed Gaussian, and the image noise-free, then indeed
> you could do an inversion resulting in unlimited
> resolution. However, the blur function is band limited, varies from
> point to point in your image AND there is noise, always.

Another point is quantization (which could be considered as noise too,
of course). E.g., at 5sigma, one loses 18 bits of S/N; even if there
is no noise, one needs to quantize the result at about 28bits to get
decent results. [Here "at 5sigma" means the spacial frequency;
e.g., for a Gauss blur with radius r, this corresponds to wavenumber
5/r, or half-wavelength of r*pi/5. E.g., this is applicable to
maximal resolution details blurred with a gaussian of radius 1.6 pixels.]

But indeed, the main "theoretical" reason is that diffraction is not
Gaussian; it COMPLETELY cuts off the high frequencies (see keywords
"Fourier optic" for math behind this; this is what is called "band
limited" above, but I wanted to emphasize it more).

And adding lens aberrations on top of diffraction can only worsen
things by adding some additional zeros in the MTF...

Hope this helps,
Ilya

bugbear
Guest
Posts: n/a

 04-20-2007
223rem wrote:
> If an unfocused image = convolution of the focused image with a Gaussian
> kernel, then this is a linear thus invertible transform, and therefore
> the focused image could in principle be recovered by guessing the sigma
> of the blurring Gaussian!
>
> Right? Most likely not, but why?

Only if there are no depth of field issues.

BugBear

HvdV
Guest
Posts: n/a

 04-20-2007
Hi Ilya,
>
>
> Another point is quantization (which could be considered as noise too,
> of course). E.g., at 5sigma, one loses 18 bits of S/N; even if there
> is no noise, one needs to quantize the result at about 28bits to get
> decent results. [Here "at 5sigma" means the spacial frequency;
> e.g., for a Gauss blur with radius r, this corresponds to wavenumber
> 5/r, or half-wavelength of r*pi/5. E.g., this is applicable to
> maximal resolution details blurred with a gaussian of radius 1.6 pixels.]

Good point! -- Hans

Robert Haar
Guest
Posts: n/a

 04-20-2007
On 4/20/07 12:56 AM, "223rem" <(E-Mail Removed)> wrote:

> If an unfocused image = convolution of the focused image with a Gaussian
> kernel, then this is a linear thus invertible transform, and therefore
> the focused image could in principle be recovered by guessing the sigma
> of the blurring Gaussian!
>
> Right? Most likely not, but why?

Digitization effects