I'm interested in writing some software to eventually replace the current photogrammetry system I use at work. Distortion correction (among other calibrations) is an important factor in getting high accuracy measurements across the whole sample volume. With a lens at a fixed focal length and fixed focus, do the distortion correction factors change slightly as you move the subject in and out of the focal plane?
In short, yes the focus distance has an impact on calibration parameters. For further information on that, refer to this paper by D. C. Brown on Close-Range Calibration. Generally, it is advised to have the camera focused at infinity when capturing photographs for calibration purposes. To do that, you simply have to calculate the hyperfocal distance for your camera. There is an Android app that has many preloaded camera setups called Hyperfocal that does just that.
The distortion will change as a function of object distance unless the lens is image space telecentric and has no distortion to begin with. This is because for a nonzero chief ray angle, the image will enlarge as the object draws closer -- this is referred to as "focus breathing." This in combination with the variation in aberrations that affect distortion (notably, coma) with object distance will lead to changes in the measured or perceived distortion as a function of distance.
You may also encounter a failure of the mapping function of the lens you use if the object is sufficiently near. E.g. a rectilinear ultra wide angle lens looks "ok" at a great distance, but very distorted at a near distance. The lens is not distorted, the center of the FoV is simply much closer to the lens. This is a failure of the mapping function.
I think I may have found a solution that implies there is indeed no relation of distortion and focus. This relies on the fact that a lens system can be accurately modeled by Zernike polynomials (I am not sure what the assumptions of this model are with respect to lens/sensor systems, and how they differ from reality).
- Tilt: α1 × ρ cos(θ); α2 × ρ sin(θ)
- Defocus: α3 × (2ρ2 - 1)
- Astigmatism: α4 × ρ2 cos(2θ); α5 × ρ2 sin(2θ)
- Coma: α6 × (3ρ2 - 2) ρ cos(θ); α7 × (3ρ2 - 2) ρ sin(θ)
- Spherical Aberration: α8 × (6ρ4 - 6ρ2 + 1)
As you can see, none of these terms (and indeed the infinite form summation) include a term for displacement from the aperture (only polar position on the image plane: ρ, θ).
I would appreciate any comments anyone has on the validity of this model in realistic applications.
Moving a subject in or out of the focal plane only defocuses, does not distort.
The distortion I believe you are referring to is relative size to distance based on the fixed focal length of the lens.
While there may be no relationship between distortion and being out of focus in respect to one's position to the focal plane, do you not need to know where, if the subject you are measuring, is in front of or behind the focal plane?
If you are trying to come up with a formula to be able to tell how tall a person is based on items in the image and the focal length of your lens, the wrong lens will give you compression as another factor to deal with.
And your formulas are not just relegated to lens imperfections.
Tilt is as much based on how level the photographer holds his lens to the subject. How can you tell the difference?
Defocus is either you have the wrong focal point, or the subject is not in the focal plane. That the photographer has as much to do with as the lens.
Your question is just a bit too ambiguous to give you an answer. I just disproved several of your formulas as they must include the photographer factor.