fredmiranda.com
Login

Moderated by: Fred Miranda
  New fredmiranda.com Mobile Site
  New Feature: SMS Notification alert
  New Feature: Buy & Sell Watchlist
  

FM Forums | Canon Forum | Join Upload & Sell

       2       end
  

Archive 2009 · Micro Focus Adjustment Technique

  
 
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #1 · Micro Focus Adjustment Technique


I have developed a method for performing micro-focus adjustment that is both fast, accurate and does not cost anything. I thought I would share it here.

This method requires a tripod, a flat focus target, and an environment with constant lighting. A computer is not required. I can calibrate a given lens in less than 5 minutes with dead-on and reproducible results.

This methods uses JPEG file size (bigger is sharper) to determine optimal micro focus adjustment. A sharply focused image has more high frequency content than a poorly focused image. JPEG compression attempts to preserve high frequency image information and for any given quality setting will produce larger files for images with greater detail. In order to determine optimal micro focus adjustment you simply step through the adjustments and capture a JPEG. You then review the images in-camera and select the one with the largest file size and set the MFA to the value used for that shot. This is easily done using image review with the info screen selected that displays both file size and MFA adjustment value.

To produce accurate and reproducible results, however, a few critical setup details must be observed. The basic goal is to take images in which the only variable is the MFA setting.

Camera must be on a tripod. Use MLU and 2 second shutter delay.
Target illumination should be constant.
Use manual exposure with widest aperature for the lens.
Set ISO to 100.
Use any white balance other than automatic.
Use JPEG large and fine.
Use One Shot Autofocus

The MOST important part of the setup is the target and its orientation to the camera. Failure to observe the three first items below will produce inaccurate results.

The target must be large enough to fill the entire field of view.
The target must be flat.
The target must be perpendicular to the axis of the lens.

The target image itself is not that critical. It should be black and white with a pattern at the center suitable for autofocus to acquire lock and a bunch of detail elsewhere. A white wall "decorated" with black tape would be fine.

I use a three passes to arrive at my final MFA settings.

First pass: -15,-10,-5,0,5,10,15 (increments of five)

Second pass: Increments of two centered on the previous high file size
(example if high file size was on 5, then retake at -1,1,3,5,7,9,11)

Third pass: Increments of one centered on the previous high file size
(example if high file size was on 7, then retake at 4,5,6,7,8,9,10)

Set MFA to the setting used for the highest file size on the last pass. Done.

I manually defocus the lens between each test shot to ensure that the autofocus has to actually move the focus elements each time. I also put the MFA adjustment menu into My Menu for faster adjusting and I also delete all images between each pass so as not to get confused. I want my lenses accurate at the distances I most often use them so that is how I determine how far away to set the target. If you prefer to use a multiple of focal length that will work as well.

If your setup is correct you will see highly repeatable results which will be confirmed by pixel peeping back at your computer if you so desire.

Enjoy.






Jan 28, 2009 at 03:21 PM
Colin Key
Offline
• • •
Upload & Sell: Off
p.1 #2 · Micro Focus Adjustment Technique


Have you tried using this method with a 500mm f/4 (or any other long telephoto) on a 1D Mk3?

Colin

P.S. It does not work




Jan 28, 2009 at 03:41 PM
jaclarkaus
Offline
• • •
Upload & Sell: Off
p.1 #3 · Micro Focus Adjustment Technique


Photonic wrote:
A computer is not required. ...This methods uses JPEG file size (bigger is sharper) to determine optimal micro focus adjustment.


How do you tell file size without a computer?

Other than that, sound ingenious!



Jan 28, 2009 at 03:43 PM
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #4 · Micro Focus Adjustment Technique


Colin,

I used this for all my lenses which includes a 300-800mm f5.6. Worked fine.

Jaclarkaus,

File size is shown right on the image review screen (when set in the right mode by stepping through the info button).



Jan 28, 2009 at 03:46 PM
nathanlake
Offline
• • • • •
Upload & Sell: Off
p.1 #5 · Micro Focus Adjustment Technique


This sounds reasonable, but I would think that proper exposure would be important and you don't mention it.

I would also think that something more complex than a white wall would give a bigger variation in file size and therefore better results. For example, a complex print of some kind with lots of shapes and edges.

What about the sharpening setting? I would think that also impacts the results. Should we turn sharpening all the way up or all the way off?



Jan 28, 2009 at 04:16 PM
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #6 · Micro Focus Adjustment Technique


Nathan,

In my recommendtation I indicate you should use manual exposure. I should have also stated that you should set a reasonable exposure. It does not need to be perfect but it does need to be constant.

A white wall alone will not work. A white wall with a detailed black and white pattern at the center would be nice for a target.

The sharpening setting will definately impact the file size. For the purpose of this method (which is really looking for relative differences in file size) it is only important that the sharpening setting remain constant. I did my adjustments with it set at the factory default.



Jan 28, 2009 at 05:06 PM
ben egbert
Offline
• • • • • •
Upload & Sell: Off
p.1 #7 · Micro Focus Adjustment Technique


Sounds good to me. My lenses were all calibrated but I got worried that I did not test far enough with my 500f4 and at 700 (1.4x attached). I took some shots of a sign 280 feet distant and visually determined that my original settings were best, and the file size was also larger on the sharpest images.

I plan to follow the system outlined here next time as it is much faster than what I did over about a year ago.

By the way, I tested at a distance about 20X focal length the first time, and it worked the same at 280 feet which is much more than the 50X Canon suggests. I think the target distance is not as crucial as Canon suggests.



Jan 28, 2009 at 05:40 PM
L. H. Smith
Offline
• •
[X]
p.1 #8 · Micro Focus Adjustment Technique


Photonic,

I'm impressed. :-0

This is one of those "Why didn't I think of that?" ideas.

Unless someone disproves your procedure, sounds good to me.

The target/center images won't download for me,...any chance you can post them as jpegs?

If you kept records, can you give us an idea of the file size-variation between your best and next-best results? I.e., how definitive are the numbers once you get close? (level 1/level2/level3)

Thanks!


Photonic wrote:
Here is a link to an image of the target I used.

Target

Here is a link to a close up of the center of the target.

Center Crop of Target

You will notice a small hole in the center. Attached to and directly behind the hole in the target is another similar size hole. By sighting through the lens and both holes it is possible to ensure that the axis of the lens and the target are perpendicular which is absolutely essential for this method to work.




Jan 28, 2009 at 05:56 PM
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #9 · Micro Focus Adjustment Technique


I will continue to work on posting the JPEGs (having some trouble with that for whatever reason).

Total file size variation is on the order of 200KB between best and worst (this was with my target, lighting, etc.) Typical first run on my 5DM2 might looked like

5.26M, 5.34M, 5.42MB, 5.45MB, 5.43MB, 5.36MB, 5.29MB

Final run might only differ in the 10KB range, often with identical sizes on either side of the best setting.

Occasionally (1 in 20 times), I would get an outlier. If that happened I reran that particular run. I watched the distance readout on the lens and noticed that outliers occurred when the lens did more than the normal amount of "settling".

Excluding outliers the data was monotonic up and monotonic down around the center. If I had taken the time to plot it, I suspect it would have been a bell curve shape. The test for me of any calibration method is how repeatable it is. I ran my first lens three times and generated the same MFA setting each time. After that I ran through my full set of ten lenses in a little over an hour. After each final setting I compared the autofocused result to a live view (10x mag) manually focused image at maximum magnification. Could not pick one from the other.

You will only get this level of accuracy if:

Your target fills the frame
Your target is flat
Your target is perpendicular to the axis of the lens.

An ideal target is black on a white background, has something good to autofocus on at the center, and includes plenty of detail in the central area.

You could use plenty of detail edge to edge but then you would be more sensitive to any misalignment of the lens axis to the target.



Jan 28, 2009 at 07:10 PM
nathanlake
Offline
• • • • •
Upload & Sell: Off
p.1 #10 · Micro Focus Adjustment Technique


I strongly suggest you apply for a patent or a copyright or something to protect this idea....and hurry up.


Jan 28, 2009 at 10:09 PM
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #11 · Micro Focus Adjustment Technique


What I am really hoping for is that someone who writes software for a living and is familiar with the Canon SDK could automate the entire process.

It would be fantastic if you could aim the camera at the target and then have the computer run through every micro focus adjustment step and select the optimal value (a graph of MFA vs file size would be very nice as well). The only step that I am not sure could be automated is the defocusing of the lens between captures. This would require an available command to ask the lens to go to min or max focus position and it seems unlikely that this would be available. I am not sure this step is actually necessary but it seemed like a good idea and once I started that way I calibrated all my lenses in the same fashion.

If someone did write such a program based on this idea, a free copy would be payback enough for the concept.

I considered (for all of a millisecond) the possibility of commercializing this idea. The problem is that so much depends on the user. If the target is not perpendicular to the lens axis the whole method does not work and I could just hear the complaints rolling in.

If someone reading this does have the ability to write software and is familiar with the camera interface I have an even better method that really would lend itself to commercialization. Feel free to contact me.



Jan 28, 2009 at 11:31 PM
nathanlake
Offline
• • • • •
Upload & Sell: Off
p.1 #12 · Micro Focus Adjustment Technique


I design software (in my other job) and I have suggested on a number of occasions here on FM that cameras could do auto-adjust. I think if you are going to have software do the job, it would be much better to directly measure the sharpness of an image rather than rely on a secondary indicator of sharpness (i.e. file size). Relying on file size is probably better suited for use when you don't have a computer app to do the job.

It would be best to embed auto-calibrate functions in the camera, but Canon does not allow for the development of 3rd party in-camera apps (another of my suggestions).

I don't personally work with the Canon apps, but know some people that do. If you wanted to send me a PM we can discuss your other idea. I would be willing to sign a NDA if you wish.



Jan 29, 2009 at 09:45 AM
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #13 · Micro Focus Adjustment Technique


Nathan,

Could not agree more with you on both points.

It will probably take a competitor to beat Canon to the punch on in-camera micro-focus calibration before they add it. It could easily be offered as a firmware upgrade to their current cameras with MFA.

Second, a direct measure of sharpness would be far superior to using file size as a surrogate if you have access to the right software and a computer. This is in fact the basis of my other idea.

Here is the basic approach for a computer based application to perform MFA calibration.

> Tripod mounted camera is tethered via USB and aimed at a target with good AF pattern (target choice is much less critical then the Photonic Method, might as well give it a name)
> Launch Micro Focus Callibration application.
> Application sets appropriate camera configuration (center focus point, MLU, 2 sec delay, etc.) and proper exposure and takes a reference frame using Live View (either with contrast autofocus or manual focus at 10x zoom, user selectable).
> Application turns live view off and sequentially captures an image at each micro focus setting with all other variables locked down, ideally sending the lens focus rack to one end or the other (user selectable) in between each shot.
> Application compares each image to the reference and selects the one that most closely matches the reference frame in the area of the central AF sensor and programs the corresponding MF offset into the camera.
> Done

If anyone out there has the programming skills to do this, I think folks would pay for such an application. I of course, would appreciate a complimentary copy for the idea



Jan 29, 2009 at 11:30 AM
ben egbert
Offline
• • • • • •
Upload & Sell: Off
p.1 #14 · Micro Focus Adjustment Technique


Another thing occurred to me. If you keep the field of view constant between lenses, would it be possible to determine the relative sharpness of each lens.




Jan 29, 2009 at 11:39 AM
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #15 · Micro Focus Adjustment Technique


Ben,

Conceptually, this should work (and would be really useful). In practice, however, I don't think you could match the field of views as accurately as necessary. JPEG uses a discrete cosine transform on 8x8 blocks of pixels. With the same lens on a sturdy tripod and MLU you could reasonably expect to keep the detail in the pattern aligned with these blocks relatively well (supported by the consistent results I have seen). If you changed lenses and adjusted the tripod distance to maintain the field of view, I think it would be highly unlikely that these 8x8 blocks of pixels would line up the same way with respect to the target and this would impart some change to the compression results.

Having said this, it would be an easy experiment to do and I never argue with results.



Jan 29, 2009 at 04:48 PM
Daan B
Offline
• • • • •
Upload & Sell: Off
p.1 #16 · Micro Focus Adjustment Technique


Cool concept... I will give this a try myself to double check my own method (which takes much more time ). I am not sure about keeping the target perpendicular to the axis of the lens though... I wonder how I pull that one off?


Jan 29, 2009 at 05:06 PM
ben egbert
Offline
• • • • • •
Upload & Sell: Off
p.1 #17 · Micro Focus Adjustment Technique


Photonic wrote:
Ben,

Conceptually, this should work (and would be really useful). In practice, however, I don't think you could match the field of views as accurately as necessary. JPEG uses a discrete cosine transform on 8x8 blocks of pixels. With the same lens on a sturdy tripod and MLU you could reasonably expect to keep the detail in the pattern aligned with these blocks relatively well (supported by the consistent results I have seen). If you changed lenses and adjusted the tripod distance to maintain the field of view, I think it would be highly unlikely that these 8x8 blocks of pixels
...Show more


Just a thought. I have one more question. You need to align the target holes so that the axis is perfectly perpendicular to the plane of your target, How do you accomplish this?



Jan 29, 2009 at 05:09 PM
nathanlake
Offline
• • • • •
Upload & Sell: Off
p.1 #18 · Micro Focus Adjustment Technique


A simple way to make sure the sensor plane and the plane of the target are parallel....

Place the target on a wall (ensures vertical) and select the spot that will be used for focusing. Measure the height of that point and then set the camera so that the center of the sensor is at that height. Place the center AF point on the selected spot of the target (ensures camera horizontal). Unless the floor or walls are cockeyed, this should give you parallel sensor and target.



Jan 29, 2009 at 05:38 PM
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #19 · Micro Focus Adjustment Technique


Ben,

My target is mounted to an MDF (medium density fiberboard) backing (very flat).
The alignment hole is in a thin piece of plywood that is mounted behind the target on two MDF standoff's. Before gluing the assembled standoffs to the back of the target, I place a long rod of the same diameter as the holes through both the rear alignment hole and the hole in the target. I then used a precision right angle square (my other passion is woodworking) to check both horizontal and vertical alignment and clamped the standoffs in that position. I let the glue dry for 30 minutes, pulled out the rod and it was done.

Daan,

Yeah, the alignment is the only tricky bit. The method described here will work for a DIY stand alone target. If you want to tape a target to a wall I can suggest another idea, but I have not tried this myself. Take a thin rod (say 1/4" by 12") and mount it to a flat base (say 10x10"). Make sure it is perpendicular using a right angle. Have an assistant hold it on the wall over the center of the target while you align the camera position/angle to provide a totally symmetrical view of the rod. If you want to avoid the need for an assistant and possibly end a marriage just drive a long nail through the center of the target preferrably into a stud behind the drywall. Snip the head of the nail off and bend it as necessary to achieve perfect perpendicularity checking with a square.



Jan 29, 2009 at 05:41 PM
Photonic
Offline
• • •
Upload & Sell: Off
p.1 #20 · Micro Focus Adjustment Technique


Nathan,

Matching heights of the target center and lens center will get you alignment in one plane. If you use the same concept in the other axis (distance of target center from the side wall of the room matched to the distance of the lens center to the side wall - assuming a square room) you will get the other axis as well. Hope this helps.



Jan 29, 2009 at 05:48 PM
       2       end




FM Forums | Canon Forum | Join Upload & Sell

       2       end
    
 

Welcome back
Log in to your account