Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version Search this Thread
11-27-2009, 09:41 AM   #1
Junior Member
ProfHankD's Avatar

Join Date: Aug 2009
Location: Lexington, KY
Photos: Albums
Posts: 29
Lens Bokeh Research... Help?

I've been researching lens bokeh... and I'd like your help collecting sample PSFs.

An image is formed by a lens as the sum of the PSF (point spread function) for each point of light in the scene. The PSF shape usually is too small to be obvious for points in focus, but typically is magnified in the out-of-focus portions of images, creating the characteristics known as bokeh. The PSF of each lens is a little different, and PSF also vary with focus, aperture, position within the frame, zoom focal length, etc. However, the PSF of a lens easily can be sampled by setting manual focus as close as possible, aperture wide open, and photographing a centered distant point light source (e.g., a white LED at 10m) on a dark background.

For example, my 50mm f/1.4 SMC Takumar has the PSF shown in the first image. The bright center with darker edges is why you get such smooth bokeh from this lens.

In comparison, the second (smaller) image is from a 28mm f/3.5 Super Takumar. The brighter edges leave sharp line artifacts in the bokeh.

PSFs are very sensitive to various lens properties and defects. For example, the third image is the PSF from a 50mm lens which looks & works fine, but has a minor fungus problem. Yes, that's really a minor fungus problem... the kind you wouldn't even notice on the glass if you were not looking for it, and certainly wouldn't see in a sharp-focus photo.

Some of my group's current research at the University of Kentucky (Aggregate.Org: Digital Imaging Technologies) involves using knowledge of the PSF image to do many things, such as 3D image capture using depth-from-defocus. I need lots of real lens PSFs in order to be able to parametrically describe bokeh/PSF features....

How you could help. What I'd like to see for this research is cropped PSF images, like those attached, from as many different lenses as possible. For each, it also is important that I know what lens it came from and any lens defects that you know are present. If you wish, it also might be interesting for people to see an ordinary photo taken with the same lens (and aperture setting) that shows the bokeh in a more normal context....

Thanks.

PS: I'll assume that posts in response to this thread are by the owners of the images posted, and that it is OK for me to use these images, with acknowledgement, in research publications.

Attached Images
     
11-27-2009, 01:44 PM   #2
Veteran Member
MattGunn's Avatar

Join Date: Jun 2009
Location: Wales
Photos: Gallery
Posts: 347
QuoteOriginally posted by ProfHankD Quote
However, the PSF of a lens easily can be sampled by setting manual focus as close as possible, aperture wide open, and photographing a centered distant point light source (e.g., a white LED at 10m) on a dark background.
I'm guessing that the bokeh images you presented are very small bits of the whole image. Presumably the futher out of focus, the larger the PSF pattern so using extension rings will make the PSF pattern bigger and the sample more accurate. I will have a go at this as it look like an effective way of testing the cleanliness of lenses in addition to determining their PSF. If I get any usefull looking sampes I will post them for you use.
11-27-2009, 09:21 PM   #3
Veteran Member
Andi Lo's Avatar

Join Date: Jul 2008
Location: Halifax, Nova Scotia
Posts: 2,925
Are you saying that... bokeh is quantifiable now?
11-27-2009, 10:41 PM   #4
Junior Member
ProfHankD's Avatar

Join Date: Aug 2009
Location: Lexington, KY
Photos: Albums
Posts: 29
Original Poster
PSF size

The pixel dimensions of the PSF largely depends on the focal length, aperture, and sensor pixel pitch as well as the focus distance. For a typical fast 50mm on an APS-C DSLR, the PSF isn't all that small. A close-focus 500mm f/6.3 mirror lens gave a PSF filling the APS-C frame! Slow wide-angle lenses can have tiny PSFs.

You'll also want to watch the exposure. Although the PSF may be a small fraction of the frame, expose for it, because we want to see what's inside it.

11-27-2009, 10:56 PM   #5
Junior Member
ProfHankD's Avatar

Join Date: Aug 2009
Location: Lexington, KY
Photos: Albums
Posts: 29
Original Poster
Bokeh are quantifiable?

QuoteOriginally posted by Andi Lo Quote
Are you saying that... bokeh is quantifiable now?
In a word, yes.

If it comforts you any, it isn't as easy as it sounds. If it were, I wouldn't call it research.

Using my current approach, it would take many hours on a supercomputer to compute a reasonably accurate map of a single image using the PSF data. Fortunately, I have a supercomputer... well, several, actually . Also, the PSF data need to be sampled at the taking aperture and, for many lenses, the PSF changes in various ways as you get away from the center of the image, in which case multiple PSF samples must be taken across the frame. The PSF also differs in front vs. behind the focus distance, and some lenses even change characteristics significantly just by changing the focus distance. There also can be lens flare and internal reflections, sensor noise, etc. muddying the analysis of any given image. When I'm sure the PSF/bokeh model is good enough, I'll worry about making it faster to execute on more mundane hardware.
11-28-2009, 02:28 AM   #6
Veteran Member
heliphoto's Avatar

Join Date: May 2008
Location: Region 5
Photos: Gallery
Posts: 2,540
I'm interested and will try to get you some shots in a day or two...
A couple questions...

Are you after this information for pretty much any lens we can show you (Pentax, Canon, Porst, etc...)?

Are you interested in zoom lenses?
11-28-2009, 07:45 AM   #7
Junior Member
ProfHankD's Avatar

Join Date: Aug 2009
Location: Lexington, KY
Photos: Albums
Posts: 29
Original Poster
I'm interested in determining the full range and diversity of PSFs -- as many lenses as possible.

I've tested dozens myself, largely old M42 lenses because I can afford them and modern Minolta/Sony alpha mount because that's the body I'm using for most tests. I'm most interested in the bokeh of the ones that are common or well known -- and that I don't have and can't afford. A diversity helps, and Pentax Forums seems to be an active community with very high diversity of lens use.

Zooms generally will require multiple focal length samples. I've been using the min and max focal lengths as the primary samples.
02-20-2010, 07:37 PM   #8
Junior Member
ProfHankD's Avatar

Join Date: Aug 2009
Location: Lexington, KY
Photos: Albums
Posts: 29
Original Poster
No PSFs submitted...?

Well, it seems nobody has put forth any PSFs yet....

Contributions are still welcome, but with or without them the research continues. I expect to post some results no later than this Summer.

02-20-2010, 10:26 PM   #9
Veteran Member
heliphoto's Avatar

Join Date: May 2008
Location: Region 5
Photos: Gallery
Posts: 2,540
QuoteOriginally posted by ProfHankD Quote
Well, it seems nobody has put forth any PSFs yet....

Contributions are still welcome, but with or without them the research continues. I expect to post some results no later than this Summer.
Heh , yeah, sorry - I wanted to do this, but I couldn't get to it before I forgot, and then I forgot... I do also have a technical constraint - distance... You mention 10m, but the most I can get in my house would be about 4m or so (just eyeballing it...). Is that distance enough to get you data (I'm not too inclined to go out at night to do this )? If so I will try to do some shooting for you.
02-28-2010, 05:39 AM   #10
Senior Member
summonbaka's Avatar

Join Date: Dec 2009
Location: Kagoshima, Japan
Photos: Gallery | Albums
Posts: 237
Can you post any specific procedure to be taken? That could make things easier.
02-28-2010, 05:41 AM   #11
Veteran Member
MattGunn's Avatar

Join Date: Jun 2009
Location: Wales
Photos: Gallery
Posts: 347
QuoteOriginally posted by heliphoto Quote
Heh , yeah, sorry - I wanted to do this, but I couldn't get to it before I forgot, and then I forgot... I do also have a technical constraint - distance... You mention 10m, but the most I can get in my house would be about 4m or so (just eyeballing it...). Is that distance enough to get you data (I'm not too inclined to go out at night to do this )? If so I will try to do some shooting for you.
I also have been meaning to have a go at this but have so far failed to do so for the same reasons (the distance in particular). In order to see if it can be done effectively at shorter distances I decided to work out the bokeh diameter (circle of confusion) as a function of the object and focus distances and the lens focal length and F number. I have put the resulting equation in an Excel spreadsheet (attached in a zip file bellow) to make it easy to use.

From this I can conclude:
There are two ways of getting a large diameter bokeh so as to get a good image of it. These are:
a) The point light source must be distant and the focus must be set close (min focus distance), or
b) The point light source must be close and the focus set distant (infinity focus).

This is all as expected. Also as expected the diameter of the bokeh is inversly proportional to the F number.

The only other consideration is the light source. In order to get a measurement of the bokeh and not the light source the angular size of the light source must be as small as possible. For setup a) a 5mm LED at a distance of 10m as originally sugested would be a suitable point source but for setup b) the light source must be a lot smaller. A simple way of acheiving this would be to tape some aluminium foil over the front of the LED / torch and put a pinhole in it with a sewing needle. This should provide a small point source.

Now that I have worked out how to do it I will have to set it all up and take some pictures. Hopefully some results to follow soon...

Edit: the only contraint on how close the light source can be (asuming it is small) is that it must be more than 1 focal length away from the lens.
Attached Files
File Type: zip Bokeh diameter calculator.zip (2.9 KB, 197 views)

Last edited by MattGunn; 02-28-2010 at 05:56 AM.
03-01-2010, 04:48 AM   #12
Junior Member
ProfHankD's Avatar

Join Date: Aug 2009
Location: Lexington, KY
Photos: Albums
Posts: 29
Original Poster
QuoteOriginally posted by MattGunn Quote
From this I can conclude:
There are two ways of getting a large diameter bokeh so as to get a good image of it. These are:
a) The point light source must be distant and the focus must be set close (min focus distance), or
b) The point light source must be close and the focus set distant (infinity focus).
It is worth noting that, in theory, (a) and (b) give different PSFs that are essentially "inverses" of each other. For example, bokeh chromatic aberration generally yields fringes of opposite colors before and after the focal point. Of course, real lens PSFs can have somewhat more difference....

QuoteOriginally posted by MattGunn Quote
This is all as expected. Also as expected the diameter of the bokeh is inversly proportional to the F number.
Smaller apertures yield correspondingly smaller PSFs until diffraction effects.... This also is true for geometric vignetting effects, so a circular PSF in the center of the field often will be "clipped" to a smaller shape off-axis of the lens.

QuoteOriginally posted by MattGunn Quote
The only other consideration is the light source. In order to get a measurement of the bokeh and not the light source the angular size of the light source must be as small as possible. For setup a) a 5mm LED at a distance of 10m as originally sugested would be a suitable point source but for setup b) the light source must be a lot smaller. A simple way of acheiving this would be to tape some aluminium foil over the front of the LED / torch and put a pinhole in it with a sewing needle. This should provide a small point source.
Yes, (b) is much harder to measure accurately. A pinhole will work, although there can be sensitivity to the size and shape of the pinhole. Even for (a), part of why a LED works well is that they don't have much texture or shape within that 5mm. A good test is repeatability; if rotating the camera+lens about the optical axis still gives the same structure (i.e., the image does not rotate WRT the sensor), you've got an appropriate light source (and alignment).

Except for macro photography, case (a) is not only easier to measure, but generally is assumed to be more important. In fact, typical multi-target autofocus systems give priority to focus on the closest object.

Your PSF size calculator looks about right, and "inverting" that formula is essentially how depth-from-defocus is done. This also makes it clear why, looking only at PSF diameter for depth-from-defocus, there is an ambiguity between distances before and after the focus distance.

Last edited by ProfHankD; 03-01-2010 at 04:58 AM.
03-05-2010, 11:27 AM   #13
Veteran Member
MattGunn's Avatar

Join Date: Jun 2009
Location: Wales
Photos: Gallery
Posts: 347
It took a while to get round to starting and a while to sort out the photos afterwards but here is a first set of bokeh images. After a little trial I found that the bokeh varies quite a bit between wide open and closed by 1 to 2 stops as the aperture blades change the aperture shape. I continued and found that the diffraction effects become quite apparent at small apertures. For these reasons I have taken measurement of the bokeh over a range of apertures for each lens.
I didn’t have room for measurements at 10m but having taken onboard the comments about the reversal of the chromatic aberrations in the inverted bokeh images I made the measurements at 5m with the lenses focussed closer. Although this is half the recommended distance, the 5mm LED still has an angular diameter of only 1mrad and so in most cases I don’t think it will have too much effect. Please let me know if the closed aperture images are of no use to you as I won’t then bother with them in subsequent measurements. The images have all been uploaded to flickr and can be found here together with the information about the taking conditions: MattGunn2010's photosets on Flickr

So here are some bokeh images:

Jupiter 9 85mm f/2 , focussed to 0.8m
@ f/2


@ f/2.8


@ f/4


@ f/5.6


@ f/8


@ f/11


@ f/16




SMC Pentax A 50mm f/2,focussed to 0.45m
@ f/2


@ f/2.8


@ f/4


@ f/5.6


@ f/8


@ f/11




Tamron Adaptall 90mm f/2.5 macro, focussed to 0.42m
@ f/2.5


@ f/4


@ f/5.6


@ f/8


@ f/11


@ f/16


@ f/22




Tamron Adaptall 55BB 500mm f/8,
focussed to 2m


focussed to infinity



Centon 500mm f/8 mirror lens
focussed to infinity


focussed to 2.15m



Carl Zeiss Contax Planar T* 60mm f/2.8 macro, focussed to 0.15m
Lens has some element separation which is evident in the first image (upper left).
@ f/2.8


@ f/4


@ f/5.6


@ f/8


@ f/11


@ f/16


@ f/22



Vivitar 55mm f/2.8 macro. Focussed to 0.138m
@ f/2.8


@ f/4


@ f/5.6


@ f/8


@ f/11


@ f/16



Olympus OM Zuiko 100mm f/2.8, focussed to 1m
@ f/2.8


@ f/4


@ f/5.6


@ f/8


@ f/11



Super Takumar 50mm f/1.4, focussed to 0.45m
@ f/1.4


@ f/2


@ f/2.8


@ f/4


@ f/5.6


@ f/8



Super Takumar 55mm f/1.8, focussed to 0.45m
The aperture on this is not closing symetrically as is evident from the 2nd image in the set.
@ f/1.8


@ f/2


@ f/2.8


@ f/4


@ f/5.6


@ f/8



Super Takumar 55mm f/2, focussed to 0.45m
@ f/2


@ f/2.8


@ f/4


@ f/5.6


@ f/8

Last edited by MattGunn; 03-05-2010 at 12:18 PM.
03-05-2010, 02:36 PM   #14
Pentaxian
Lowell Goudge's Avatar

Join Date: Jan 2007
Location: Toronto
Photos: Gallery | Albums
Posts: 15,312
Interesting thread, and I am considering also contributing, as I have an extensive set of lenses both old and new.

I do have, however, some questions and observations having done some benchmarking of lenses myself. Not as complicated as this task, but having the same variables as this.

First of all, there needs to be some simple guidelines set for exposure.

Specifically you need to ask everyone to keep the histogram centered because in the center the histogram is almost linear (in greyscale value) with Fstop or Exposure value.

Secondly, you need to have every one who takes images have the contrast setting of the camera calibrated. You do this by setting the camera to a middle F stop and then change the F stop and plot greyscale as a function of F-stop. I have found for example, just changing from maximum to minimum contrast (shooting jpegs of course) that the greyscale range per stop around the mean value of 128 can change by 20% i.e. in min contrast each stop is approximately greyscale change of 40 and at maximum contrast it is 50. People offering shots with different settings will provide you with errors due to settings.

third, in looking at your image from the 50mm SMC tak lens seems to show non uniform illumination top and bottom and therefore may not be a point source as far as your camera is concerned. I find Matt's shots moch more uniform top to bottom and side to side. So, we need a more controlled definition of the light source or setup to be able for you to provide your conclusions.

what is also interesting in some of matt's shots is the color shift of the fringing as you stop down, and the change in shape of the aperture where some lenses have pronounced points at certain apertures, some lenses have essentually round apertures, and others either hexagonal or optagonal as a function of blade count, as wellas the loss of symmetry of some aperatures as you stop down. This all will also have impacts on bokeh and the creation of artifacts like bright points creating starbursts. Can you give a little moe information on exactly how you will be evaluating bokeh?
03-05-2010, 08:30 PM   #15
Junior Member
ProfHankD's Avatar

Join Date: Aug 2009
Location: Lexington, KY
Photos: Albums
Posts: 29
Original Poster
QuoteOriginally posted by Lowell Goudge Quote
First of all, there needs to be some simple guidelines set for exposure.

Specifically you need to ask everyone to keep the histogram centered because in the center the histogram is almost linear (in greyscale value) with Fstop or Exposure value.

Secondly, you need to have every one who takes images have the contrast setting of the camera calibrated. You do this by setting the camera to a middle F stop and then change the F stop and plot greyscale as a function of F-stop. I have found for example, just changing from maximum to minimum contrast (shooting jpegs of course) that the greyscale range per stop around the mean value of 128 can change by 20% i.e. in min contrast each stop is approximately greyscale change of 40 and at maximum contrast it is 50. People offering shots with different settings will provide you with errors due to settings.
Ideally, the exposures would be calibrated raw images and the histogram spike would be as close to the maximum as possible without clipping a channel. However, I'm not expecting perfection, just characterization good enough to drive a recognition and/or synthesis algorithm. The same goes for the contrast issues. Frankly, as soon as one uses JPEGs, it's all very approximate anyway....

QuoteOriginally posted by Lowell Goudge Quote
third, in looking at your image from the 50mm SMC tak lens seems to show non uniform illumination top and bottom and therefore may not be a point source as far as your camera is concerned. I find Matt's shots moch more uniform top to bottom and side to side. So, we need a more controlled definition of the light source or setup to be able for you to provide your conclusions.
Actually, I LOVE this little comparison because it is consistent with a guess I had made as to the cause. I knew it wasn't a light source defect because rotating the camera about the optical axis the pattern stays oriented with the sensor. In short, I believe the horizontal bias isn't a flaw in the light source, but a sensor reflection / mirror chamber masking artifact from my Sony A350 body -- different body, significantly different bokeh! The masking is probably the dominant effect, because Sony is quite aggressive about blocking stray light (i.e., from a full-frame lens). The 50mm f/1.4 Takumars seem to be exceptionally susceptible to this; for example, I don't see this artifact with my Opteka 85mm f/1.4.

QuoteOriginally posted by Lowell Goudge Quote
what is also interesting in some of matt's shots is the color shift of the fringing as you stop down, and the change in shape of the aperture where some lenses have pronounced points at certain apertures, some lenses have essentually round apertures, and others either hexagonal or optagonal as a function of blade count, as wellas the loss of symmetry of some aperatures as you stop down. This all will also have impacts on bokeh and the creation of artifacts like bright points creating starbursts. Can you give a little moe information on exactly how you will be evaluating bokeh?
I have been initially concentrating on wide open PSFs, however, the variations don't shock me. The little surprise for me is how evident diffraction effects are in some of the images... you don't see that much wide open.

As for exactly how I'm evaluating bokeh, it's pretty complicated, but here's how I got started.

I've been using CHDK to put various functions in cameras for research purposes for some time, and last year I supervised an undergrad senior project team at the University of Kentucky implementing depth map capture within an unmodified Canon PowerShot A620. The method used was simple depth-from-focus, capturing multiple images with different focus distances, determining which image was sharpest for each pixel location, and then creating a depth map image. It worked quite well -- where there was an edge or texture. Where there wasn't, it often hallucinated sharp edges at disturbingly incorrect distances. That's when I realized that the Gaussian blur model of defocus underlying all these algorithms was fundamentally and seriously wrong. So, last Summer I set out to develop a model of what lenses really do.

My initial models were mathematically perfect, noiseless, synthetic creations that I could use to test my matching algorithms. However, that doesn't tell me what real lenses do, nor what variations I can expect due to noise, JPEG processing, etc. That's what I've been testing lenses to determine... so far, I've measured PSFs for more than 3 dozen lenses on my Sony A350.... I've also tested quite a few compact digital cameras (most have small, but distinctive, PSFs).

My current best matching method involves a rather expensive Genetic Algorithm (GA), but it works quite well on perfect test images given enough time. The question is how well it can work with real lens PSFs, noise, etc. Using this approach, high quality depth-from-defocus should be possible from a single image... and then there are a bunch of other cool things one can do.

Here's a rather crude example of the kinds of other things one can do -- removal of obnoxious bokeh, a sample image pair from my "Technology Enabling Art" challenge series at dpreview:
http://c.img-dpreview.com/0205120-01.jpg
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
aperture, bokeh, focus, image, images, k-mount, lens, lens bokeh, pentax lens, psf, research, slr lens
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Flickr as location research tool Nass Photographic Technique 3 10-10-2010 03:23 AM
Bokina versus Bokeh Monster, which bokeh you prefer? Pentaxor Pentax SLR Lens Discussion 3 04-21-2010 01:50 AM
Eyes, Brains, Sensors, and Research mithrandir General Talk 8 02-05-2010 01:11 PM
picture editing software research nitehawk128 Digital Processing, Software, and Printing 11 01-16-2010 05:57 AM
sample research paper copcally General Talk 4 08-29-2008 11:33 AM



All times are GMT -7. The time now is 06:40 PM. | See also: NikonForums.com, part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top