08.12.2012 Views

Imatest Documentation

Imatest Documentation

Imatest Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Imatest</strong> <strong>Documentation</strong><br />

center. This counteracts barrel distortion... The internal unit used for rsrc and rdest is the smaller of the two image lengths divided by<br />

2.<br />

This equation drives me nuts! rsrc and rdest are reversed from the equations on this page; it only goes up to fourth power (when<br />

you include rdest outside the parentheses; third power if you don't); and it has even order terms (a and c) when the theory implies<br />

that distortion can be modeled with odd terms only. Give me a higher order term (h * rdest 4 ) and dump a * rdest 3 and c * rdest. But<br />

nonetheless it works pretty well.<br />

Mike Collins has posted a technique for finding PTlens parameters on a dpreview.com forum. I haven't checked to verify it.<br />

Briefly,<br />

1) take a shot of the grid pattern and run <strong>Imatest</strong> distortion. Note the k1 (which is the r^3) parameter.<br />

2) divide my magic number = -3.397. This result is now used as the b (r^3) parameter in Ptlens.<br />

3) Edit the profile file used in Ptlens to include this new lens. Use the bodies multiplier, lens name, focal length, a, b, c ( make a and<br />

c 0.000000; and b from calculation in 2) ). More details on the post.<br />

Modeling distortion of super-wide-angle lenses for architectural and archaeological applications by G. E.<br />

Karras, G. Mountrakis, P. Patias, E. Pets<br />

Algorithm for calculating correction coefficients.<br />

The coefficients of the standard distortion equations are calculated using nonlinear optimization that straightens the lines (minimizes<br />

their curvature). The equations are<br />

ru = rd + k1 rd 3 (3rd order) rd is the distorted (input) radius; ru is the undistorted (output) radius.<br />

ru = rd + h1 rd 3 + h2 rd 5 (5th order)<br />

ru = tan(10 p1 rd ) ⁄ (10 p1 ) ; h1 > 0 (arctan/tan; barrel distortion)<br />

ru = tan -1 (10 p1 rd ) ⁄ (10 p1 ) ; h1 < 0 (arctan/tan; pincushion distortion)<br />

The optimizer<br />

finds the average locations of vertical and horizontal lines in the image,<br />

scans between the lines to find (x,y) locations on the lines (and if there is room, scans lines that intersect the image<br />

boundaries),<br />

finds polynomial fit for each line,<br />

minimizes the sum of squares of the second order polynomial coefficients, which are the line curvatures. For the 5th order<br />

case the optimizer minimizes the sum of squares of the second and fourth order polynomial coefficients— a slightly different<br />

error function from the 3rd order and arctan/tan cases.<br />

Since optimization is performed only to straighten curved lines, this algorithm is relatively insensitive to perspective distortion and<br />

small amounts of camera misalignment.<br />

360 of 451

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!