quad_to_square.pl - transform an arbitrary quadrilateral to a square.
Courtesy Richard Fairhurst:
I've been using it to rectify ("square up") a load of roughly scanned maps, so that an arbitrary quadrilateral is resized into a square. The transform2 function is ideal for that.
Thought you might be interested to see what people are doing with Imager - feel free to include this in the sample code.