Forums

"Repairing" an out-of- focus picture

Started by Nitram May 29, 2010
On May 29, 9:21&#2013266080;pm, robert bristow-johnson <r...@audioimagination.com>
wrote:
> On May 29, 6:14&#2013266080;pm, Jerry Avins <j...@ieee.org> wrote: > > > > > > > On 5/29/2010 3:04 PM, robert bristow-johnson wrote: > > > > On May 28, 11:52 pm, "Nitram"<morris.vian@n_o_s_p_a_m.gmail.com> > > > wrote: > > > >> Firstly, I was wondering if it is possible to compensate for a picture > > >> taken by an out-of-focus digital camera by doing a 2D deconvolution on it > > >> (MMSE filtering or something like that), in order to recover &#2013266080;the in-focus > > >> picture > > > > my understanding is that the in-focus image is run through a sorta low- > > > pass filter in 2D which blurs it. &#2013266080;maybe the 2D deconvolution can be > > > run through a compensating high-pass filter, if you knew the > > > characteristics of the blurring filter closely. > > > >> Secondly, can the optical transfer function between a properly focused > > >> picture and an out of focus picture be parameterized in such a way that a > > >> user could recover the image by gradually varying that parameter until the > > >> image is in focus? &#2013266080;If this is indeed possible, what is that transfer > > >> function? (any references to existing literature would be welcome). > > > > i really don't know what the LPF characteristics of blurring would be > > > if a well-shaped lens in the camera is just moved away from the > > > correct focal length. &#2013266080;it seems like i should be able to figure that > > > out (as a function of the deviation from the correct focal position) > > > but i don't know where to begin to set up the problem. > > > It depends in part on the shape of the aperture. A mirror lens makes > > donut-shaped "circles" of confusion. With ordinary lenses, you can count > > the number of blades in the diaphragm if they're few enough. All of that > > is summed up as "bokeh" Seehttp://en.wikipedia.org/wiki/Bokehfor > > etymology and more. > > > > maybe someone else (like Clay or Glen or some other physiker) would > > > know. &#2013266080;you guys, if it's a good lens, just bumped away from the > > > correct position by a little, does it change the impulse response (in > > > 2D) from an impulse (nice sharp image) to a rect() function? &#2013266080;the > > > farther the lens is outa focus, the wider the rect() function? > > > deconvolving a rect() function is a sorta bitch because of dividing by > > > zero in the frequency domain. > > > Not quite. Which is to say, that the point-turned-disc isn't necessarily > > illuminated uniformly. > > okay, i would like to know how it is, assuming a regular old lens > (with spherical surfaces, so the focal length cannot be very tight) > and the film surface spaced a little bit away from where it's s'posed > to be. > > r b-j- Hide quoted text - > > - Show quoted text -
Hey Robert, The radial diffraction amplitude (far field case) from a circular aperture is J1(r)/r where "r" is the radial distance (scaled to the wavelength/diameter of the aperture) from the center. You may look up Airy's Disc for details. Clay
On May 28, 11:52&#2013266080;pm, "Nitram" <morris.vian@n_o_s_p_a_m.gmail.com>
wrote:
> Hi, > > My question might be simplistic as neither optics nor image processing is > my field. > > Firstly, I was wondering if it is possible to compensate for a picture > taken by an out-of-focus digital camera by doing a 2D deconvolution on it > (MMSE filtering or something like that), in order to recover &#2013266080;the in-focus > picture > > Secondly, can the optical transfer function between a properly focused > picture and an out of focus picture be parameterized in such a way that a > user could recover the image by gradually varying that parameter until the > image is in focus? &#2013266080;If this is indeed possible, what is that transfer > function? (any references to existing literature would be welcome). > > Thank you for your help.
Yes to some extent it is possible, if you lookback to the 1980s when Kodak introduced the Disc camera. Its trick was the point spread function (optical equivalent of a 2-d impuse response) was know by Kodak so when they processed the disc film (it was only 16mm), a computer would deconvolve out the point spread function effectively sharpening the image. Since this was only available for this camera, the disc film had a market advantage. But soon this technology was incorporated into 35mm film printers (even with an unknown point spread function) to provide for image sharpening. Some of the early stuff was over sharpened and the holoes in the images were a bit distracting. Today, one buys software with lens correction details for a library of lens and a picturer's EXIF info is used to select the corrections. The following is one of the leaders in this field now: http://www.dxo.com/intl/photo Clay Clay
On May 29, 3:04&#2013266080;pm, robert bristow-johnson <r...@audioimagination.com>
wrote:
> On May 28, 11:52&#2013266080;pm, "Nitram" <morris.vian@n_o_s_p_a_m.gmail.com> > wrote: > > > > > Firstly, I was wondering if it is possible to compensate for a picture > > taken by an out-of-focus digital camera by doing a 2D deconvolution on it > > (MMSE filtering or something like that), in order to recover &#2013266080;the in-focus > > picture > > my understanding is that the in-focus image is run through a sorta low- > pass filter in 2D which blurs it. &#2013266080;maybe the 2D deconvolution can be > run through a compensating high-pass filter, if you knew the > characteristics of the blurring filter closely. > > > Secondly, can the optical transfer function between a properly focused > > picture and an out of focus picture be parameterized in such a way that a > > user could recover the image by gradually varying that parameter until the > > image is in focus? &#2013266080;If this is indeed possible, what is that transfer > > function? (any references to existing literature would be welcome). > > i really don't know what the LPF characteristics of blurring would be > if a well-shaped lens in the camera is just moved away from the > correct focal length. &#2013266080;it seems like i should be able to figure that > out (as a function of the deviation from the correct focal position) > but i don't know where to begin to set up the problem. > > maybe someone else (like Clay or Glen or some other physiker) would > know. &#2013266080;you guys, if it's a good lens, just bumped away from the > correct position by a little, does it change the impulse response (in > 2D) from an impulse (nice sharp image) to a rect() function? &#2013266080;the > farther the lens is outa focus, the wider the rect() function? > deconvolving a rect() function is a sorta bitch because of dividing by > zero in the frequency domain. > > just a guess. > > r b-j
Hello Robert, In photography, people worry about a lens' "bokeh" Bokeh refers to the quality of out of focus regions in images. Bekeh comes from Japanese for "blur." Essentially a point of light becomes a circle when out of focus (there are exceptions like with motion picture camers with triangular apertures) and a lens with over or under spherical correction can render either hard or soft edges to the circles depending on if the out of focus point is closer or furthur from the camera than the focal plane. For large aperture lenses, bokeh becomes one of the most important criteria in lens selection. Sometimes it is interesting to see the bokeh when a viration reduction lens is used. Here an internal prism is tilted dynamically to keep the image stationary and this tilting can result in assymetric bokeh effects. Often in portraiture, I turn off the VR so the bokeh remains symmetric. If the image is slightly out of focus deconvolving with J1(r)/r (polar coords) can work pretty well. But when you get a lot out of focus, things may deteriorate quickly. Clay
On May 29, 4:51&#2013266080;pm, spop...@speedymail.org (Steve Pope) wrote:
> robert bristow-johnson &#2013266080;<r...@audioimagination.com> wrote: > > >On May 28, 11:52&#2013266080;pm, "Nitram" <morris.vian@n_o_s_p_a_m.gmail.com> > >> Firstly, I was wondering if it is possible to compensate for a picture > >> taken by an out-of-focus digital camera by doing a 2D deconvolution on it > >> (MMSE filtering or something like that), in order to recover &#2013266080;the in-focus > >> picture > >my understanding is that the in-focus image is run through a sorta low- > >pass filter in 2D which blurs it. &#2013266080;maybe the 2D deconvolution can be > >run through a compensating high-pass filter, if you knew the > >characteristics of the blurring filter closely. > > Yes. &#2013266080;In the simplest case I believe the blur of defocusing is > like a 2-D sinc function. > > Steve > > > > >> Secondly, can the optical transfer function between a properly focused > >> picture and an out of focus picture be parameterized in such a way that a > >> user could recover the image by gradually varying that parameter until the > >> image is in focus? &#2013266080;If this is indeed possible, what is that transfer > >> function? (any references to existing literature would be welcome). > > >i really don't know what the LPF characteristics of blurring would be > >if a well-shaped lens in the camera is just moved away from the > >correct focal length. &#2013266080;it seems like i should be able to figure that > >out (as a function of the deviation from the correct focal position) > >but i don't know where to begin to set up the problem. > > >maybe someone else (like Clay or Glen or some other physiker) would > >know. &#2013266080;you guys, if it's a good lens, just bumped away from the > >correct position by a little, does it change the impulse response (in > >2D) from an impulse (nice sharp image) to a rect() function? &#2013266080;the > >farther the lens is outa focus, the wider the rect() function? > >deconvolving a rect() function is a sorta bitch because of dividing by > >zero in the frequency domain. > > >just a guess. > > >r b-j- Hide quoted text - > > - Show quoted text -
The amplitude for circular diffraction goes as J1(r)/r. But the sensor records the energy, so it goes to the square of J1(r)/r. Clay
Clay <clay@claysturner.com> wrote:
(snip)
 
> Yes to some extent it is possible, if you lookback to the 1980s when > Kodak introduced the Disc camera. Its trick was the point spread > function (optical equivalent of a 2-d impuse response) was know by > Kodak so when they processed the disc film (it was only 16mm), a
If I remember it right, 8mmx10mm. Also, that the disc cameras were the first mass production cameras with a non-spherical lens. It seems not so hard to do with molded plastic, as with individually ground glass.
> computer would deconvolve out the point spread function effectively > sharpening the image. Since this was only available for this camera, > the disc film had a market advantage. But soon this technology was > incorporated into 35mm film printers (even with an unknown point > spread function) to provide for image sharpening. Some of the early > stuff was over sharpened and the holoes in the images were a bit > distracting.
-- glen
On Jun 1, 1:59&#2013266080;pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> Clay <c...@claysturner.com> wrote: > > (snip) > > > Yes to some extent it is possible, if you lookback to the 1980s when > > Kodak introduced the Disc camera. Its trick was the point spread > > function (optical equivalent of a 2-d impuse response) was know by > > Kodak so when they processed the disc film (it was only 16mm), a > > If I remember it right, 8mmx10mm.
I know it was small. Also this is when they announced the Extar emulsion which quickly replaced Kodacolor II as their C-41 film for use in 35mm.
> > Also, that the disc cameras were the first mass production cameras > with a non-spherical lens. &#2013266080;It seems not so hard to do with molded > plastic, as with individually ground glass. >
Nowadays, molded aspherics are becoming common. My 17-35mm nikkor zoom has a highly aspheric front element. Its shape reveals itself by simply reflecting a light off of the front of the lens as you tilt it. Its central region is concave whereas it is convex on the outer region! Clay