Creating "First Class" lens descriptions for LensDoc

The most accurate lensdoc curves are created by shooting a test target and carefully measuring it.  All the lens specific curves supplied with lensdoc were created that way.  The procedure to create these lens descriptions is not trivial, but can be done with no special equipment other than your camera, a little practice, and patience.  It's basically a 3 step procedure.

  1. Shoot a test target for a range of focal lengths.
  2. Measure each test shot to produce a table of coordinates.
  3. Add some descriptive text to the raw tables of coordinates to organize them into a lens description.
Lensdoc Target Setup

The basic basic test shot is of a ruler which spans the diagonal of the frame.  The ideal setup looks like the picture at the right.  The ruler extends from beyond the upper left corner to beyond the lower right corner of the frame, and several vertical lines are also present.  The diagonal will be measured to produce the lens description, and the verticals will provide a check that the resulting correction is good.  The scene should also include a slate showing the current lens and focal length to avoid any possible confusion later on.

The exact form of the ruler is unimportant, all we'll care about are the relative spacing of the marks.  This printable file  could be cut and pasted onto a suitable backing, or you could use an ordinary steel tape measure.

The extra verticals can be made by hanging weighted ropes, or you could use any naturally occuring straight edge.  A garage door makes a good backstop, and many garage doors have suitable vertical or horizontal features to act as reference lines.

Your camera should be perpendicular to the center of the measurement target, but absolute precision is not required. 
 

Lensdoc Measurement Setup
For a zoom lens, shoot a variety of  focal lengths from shortest to longest, at least 3 and perhaps as many as 7 different focal lengths for lenses with extreme zoom ranges.  At each focal length you should be able to see 10 or so of the uniformly spaced  marks.  Again, the exact number doesn't matter.  It's best to shoot all the frames from the same camera position starting with the widest angle.

 

Lensdoc Measurement


  • Before you spend a lot of time making measurements, check your images to see of they're likely to produce good results.  If the center of ruler doesn't come reasonably close to both corners, you should reshoot with better aim.
  • Measure the skew ofthe image, to make sure the camera was reasonably close to the center of the test setup.  Lensdoc uses this measurement to correct for small errors placing the camera at dead center. You'll need this measurement in the final correction table, but if it is too far from 1.0, you should consider reshooting.
  • Create two new lines and position them to measure the length of the segment nearest the upper left corner and the lower right corner of the image. 
  • Divide the length of upper-left segment by length of lower-right segment.  This number should be close to 1.0.  If it is not between 0.95 and 1.05, you should reshoot with the camera placed more precisely.

  •  

    completed measurement
    (click to enlarge)

    For each  individual test shot, measure the apparent x,y position of marks from upper left to center.  The exact number of measurement points doesn't matter, but they must be uniformly spaced on the ruler.  Andromeda's measurement filter is the perfect tool for  the task (no kidding!).  But you could use plain photoshop somewhat less easily. Your goal is to produce a table of numbers like the one at the right.
     
    1. Bring up your picture in photoshop. it might be useful to use the line tool to draw a true diagonal line, perpendicular to the target line,  for reference locating the center.
    2. Enter the measure filter, maximize the window size, create a line by clicking on the lne icon on the tools palette.  Move the endpoints of the line to target points nearest the corner and nearest the center of your test shot.  If the picture appears "washed out" move the "fader" slider at the top of the picture window all the way to the right.
    3. Duplicate the line (saving the copy line as a parallel reference  line to the measurement line). This will keep you line of measurements from accidentally curving.
    4. Select the "add points" tool. Subdivide the measurement line at each of  the target points.
    5. Zoom in on one of the endpoints.
    6. Switch from "sampled points" to "actual points" mode in the modes palette.
    7. Switch from "pixels" to "pix" units. If necessary, define "pix = 1 pixel"  in the custom units dialog.  (This gets you sub pixel accuracy aiming for the center of the targets)
    8. Select the "move points" tool, fine tune the position of the knots in  the line.
    9. Switch to "points and angles" mode, voila! your table of x,y coordinates. Lensdoc will ignore the extra columns in the table, but you should look at them as a corss check that you've targeted the right points.  the "angles" colum should all be close to zero, and the difference between any two adjacent values in x and y ought to be about the same.  Any big jumps probably mean you put the measurement point in the wrong location. 

    10. Save the table to clipboard or directly to a file. 
    table of numbers
     
     

     
     
     
     

    Create lens description file



    For each table of coordinates, create a file with overall format similar to the one at the right. 
     
    • The names of the individual files is unimportant, but should be descriptive.
    • the ID: line should be identical for all the lens descriptions in the group.
    • the NAME: line should be different for each member of the group.
    • the FOCAL-LENGTH: line should reflect the actual focal length of the lens corresponding to this table of numbers.
    • the CENTER: line should be the location of the true center of the frame (i.e.; half the frame size)
    • the SKEW: line is the ratio of lengths you calculated for this shot.
    Finally, move the whole collection of files to the "lensdoc filter presets" folder.  We recommend you create a new subdirectory to avoid mixing your additions with the distributed descriptions.
    name: Nikon Coolpix 950 @50
    id: Nikon Coolpix 950
    focal-length: 50
    center: 800,600
    skew: .9927
    data: 
      0,   67.59,   44.75, ----- , ----- , First Exact
      1,  142.12,  100.81, ----- ,     37, Exact
      2,  217.48,  157.00,     -0,     37, Exact
      3,  293.33,  214.19,      0,     37, Exact
      4,  369.18,  272.52,      1,     38, Exact
      5,  445.69,  331.19,     -0,     37, Exact
      6,  523.03,  390.03,     -0,     37, Exact
      7,  600.87,  448.86,     -0,     37, Exact
      8,  679.69,  507.70,     -0,     37, Exact
      9,  757.63,  566.90,      0,     37, Exact
      10,  835.66,  626.57,      0,     37, Last Exact

    Testing the Result

     You will need to restart photoshop to force lensdoc to rescan the presets folder.  If you have made any gross format errors in your new files, lensdoc will complain when it is first started.  (informatively we hope).

    If your new lens description is successful, you should have a new lens description in the "specific lens" group, and you should  be able to use lensdoc to correct any of your test photos by simply dialing in the correct focal length in expert mode.