Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".

After some heavy discussions about the methematics of perspective transformations, and the generating of the appropriate formulas, with 'Hugemann' in the IM forums, I can now present the results of that discussion.

Note that the final formula involved 8 floating point values, which unlike the 6 used for affine transformations do not relate specifically to variuos 'linear' transfortations. It is also EXTREMELY slow, due to the amount of parsing needed by the FX expression.

It is hoped that the formula will soon become a IM built in function, though may need a 8 dimmensional matrix solver to be added to IM, if we want the input to be in terms of 2 (before,after) by 4 coordinates.

All the numbers are in image coordinates and color should have no effect.
Actually as all colors are normalised quality shouldn't effect the fx formulas either

Hmmm are you sure you have the input numbers right?

Are the constants in the formula generated by the "perspective_transform" script the same?
There are 8 numbers all floating point and any change in one will effect the whoel result.

DID your reverse the 2 sets of coordinates? Destination set first, then original image set?
I have done a lot of editing to try to make it clear that it is the REVERSE transformation
EG destination coordinate to source coodrinate
that is actually needed and used by the distortion algorithim.

That is very strange then because what is displayed on the IM Examples webpage is the actual code and results used to generate that webpage. I designed it that way to ensure there is a direct one to one match with what I use and what results I get.

Hugemann is working of a VB equivelent to the perl script that includes its own Gussian Elimination Algorithim to solve the equations needed to convert the coordinates into the 8 constants shown in the formula. This formula actually generates a perspective matrix.

You can check the foruma by substituting a destination coordinate for the i,j values, and see if you get the appropriate x,y values in the original image.

That is 100,123 actually maps to 85,122 I verified this by hand, so the forumla is correct. As such something must be wrong with the -fx application for your version of IM.
The Version number of the IM that was used is given at the bottom of every IM Examples page. Every time I re-generate all the examples that last image on the page is also updated to reflect the IM version used (under linux).

As for the Math::MatirxReal. The 'pm' file in the CPAN distribution isn't compiled but used as is. so you should have no problems installing it. Hmmm The version of the module I am using (personal install) is version 2.01, which is the latest. which can be downloed from http://leto.net/code/Math-MatrixReal/

I used it as I have it available, as I basied my own Perl Module contribution Math::VectorReal, data store on that same format providing cross and dot multiplication for row matrix vectors. That is proper vector math operators for 3d vector handling.
This was done as part of my studies in Polyhedral Objects.