[magick-users] Pinbarrel distortion correction
Anthony Thyssen
A.Thyssen at griffith.edu.au
Sun Mar 29 19:37:43 PDT 2009
On Sun, 29 Mar 2009 17:22:47 -0700
Fred Weinhaus <fmw at alink.net> wrote:
|
|
| >The program is not available anymore and I do not have a copy.
| >I believe it is used more for photo scanning of documents and books
| >rather than real world images at a longer distance.
| >
| >However taking a straight on photo of a picket fence or equally spaced
| >houses, should be able to produce a similar set of lines. Though one
| >which an automatic coordinate extraction program would not be able to
| >directly handle.
| >
| >But I understand how the program works in automatically finding the
| >line crossings of the equally spaced parallel lines, and once it has
| >determined those coordinates the rest is much like your spread sheet
| >but with far more coordinates, spread over a larger radial range.
| >
| >That allows for better matching by least squares function fitting.
| >Something IM already does for handing large numbers of 'control
| >points' than the minimum needed for affine, perspective, or (still
| >undocumented) polynomial distortions, in pixel coordinates.
| >
| >
| >FYI Polynomial Distortion
| > -distort polynomial 'order, coordinate-pairs, ....'
| >Where order is largest X or Y power of for the polynomial
| >and determines the minimum number of coordinates needed
| > order function minimum coodinates
| > 0 constant 1
| > 1 affine 3
| > 1.5 bilinear 4
| > 2 quadratic 6
| > 3 cubic 10
| > 4 quartic 15
| > 5 quintic 21
| >
| >For example a cubic distortion (order 3)
| >distorts the image using the reverse mapping function
| > Xsrc = a0 + a1*x + a2*y # affine terms
| > + a3*x*y # bi-linear term
| > + a4*x^2 + a5*y^2 # quadratic terms
| > + a6*x^3 + a7*x^2*y + a8*x*y^2 + a9*y^3 # cubic terms
| >
| >and a similar but completely separate Y coordinate mapping function.
| >
|
|
| Anthony,
|
| Currently your least squares fit only works with X,Y coordinate to
| fit an X equation and a Y equation. I am not sure you have anything
| that will work directly with fitting a single polynomial in
| R=sqrt(X^2+Y^2). Or do you?
|
I was thinking of extracting coordinates in terms of radii, then
feeding them into the polynomial just a X coordinates, so as to get the
verbose best fit polynomial X formula. Then the parameters can be
scaled appropriately for their order to get the barrel parameters.
It is an Idea, but I need an image of parallel lines to try out.
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
-----------------------------------------------------------------------------
The better the monkeys got at answering those questions, the more
baffling the universe became; knowledge increases ignorance.
-- Terry Pratchett, "The Science of Diskworld"
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
More information about the Magick-users
mailing list