Page 1 of 1

ScaleRotateTranslateDistortion in 6.3.5-5

Posted: 2007-08-04T16:23:34-07:00
by rmagick
Anthony,

I'm testing the RMagick interface to DistortImage and I noticed that the ScaleRotateTranslateDistortion can return a NULL image without setting any error fields in the ExceptionInfo argument. Is this intentional or just a product of DistortImage being a work-in-progress?

I'm looking at 6.3.5-5:

Version: ImageMagick 6.3.5 08/03/07 Q16 http://www.imagemagick.org

Re: ScaleRotateTranslateDistortion in 6.3.5-5

Posted: 2007-08-04T20:34:35-07:00
by magick
The current beta release has improved exception reporting.

General Distortion in 6.3.5-5

Posted: 2007-08-09T22:40:30-07:00
by anthony
The whole set of routines are under development, and in fact the interface changed slightly. Nothing is completely settled with this function as yet.

Actually a lot of extra exception handling is needed, as well as a lot more distortion methods, and even some low level 'out of band' options that are normally not needed, are yet to be handled.

In fact any views you may have on this function... NO is a good time to express them before things become set in stone.

Currently I am on a hold, as I research things such as resize filters, areas sampling, super and adaptive sampling, and Elliptically Weighted Average sampling functions are looked at in an attempt to enhance the 'minification' aliasing that is occuring in extreme distortions. For example the center of a very strong 'implosion' or toward the vanishing points of a extreme perspective distortion.

Suggestions are most welcome.


In any case how is your testing going? And findings or problems?

Re: ScaleRotateTranslateDistortion in 6.3.5-5

Posted: 2007-08-10T13:11:44-07:00
by rmagick
Hi, Anthony! The latest release seems to be working fine.

I'm not testing the distortions themselves - I leave that up to you guys. All I'm doing (indeed, all I do for all of the ImageMagick APIs) is check to make sure that the RMagick method accepts the right number and type of arguments, returns the right kind of object, and handles errors properly. It was my test for error handling that caught the missing ExceptionInfo data. Occasionally one of my example scripts uncovers a problem, but it's not because I'm deliberately testing ImageMagick.

Re: ScaleRotateTranslateDistortion in 6.3.5-5

Posted: 2007-08-10T21:08:59-07:00
by anthony
Did you pick up on the extra boolean that was added to the interface?

This boolean will turn on 'bestfit' where the output image size and virtual offset will
be adjusted to hold the complete distortion input image. (no clipping). A bit like what Arc distort will always do. It also turns on the input image virtual offsets.

This boolean is mapped to the -/+ aspect of the command line API option, so -distort generally uses the same size as the input image while +distort 'bestfits' the result to the distorted image.

Other options may be added but using special settings. for example
a output 'scaling' or posibly 'super-sampling'. Development is in progress.

Re: ScaleRotateTranslateDistortion in 6.3.5-5

Posted: 2007-08-11T12:57:08-07:00
by rmagick
Thanks for pointing this out, Anthony. I take a day off and the whole API changes :-) I'll update RMagick so it can compile w/o errors with the new DistortImage signature and release an updated beta.

I notice that DistortImage is back to returning a NULL without setting any ExceptionInfo fields when an error occurs, though.

Re: ScaleRotateTranslateDistortion in 6.3.5-5

Posted: 2007-08-12T03:49:40-07:00
by anthony
The NULL means a new image was not generated, For the command line it means the input source image should not be replaced, what other API's should do is unknown. Exceptions are still to be added, to the interface.

Warning, do not expect the number of argument in Affine, Perspective, and Bilinear to be fixed. IN photomosaics (creating panarama images from multiple photos) they often use a least squraes fitting of the distortion to multiple control points beyond the minimum 3 or 4 control points needed. In fact it may be that the number of input control points could be in the order of 20 to 100 points!

Also we may even allow the use of proper rubber-sheeting and control point morphing to create true image morphing between images.

These distort functions is opening up a whole range of very very advanced image processing options, not posible to implement with out it. Of course most of this is on ToDO lists, but help could be appreciated in developing applications using the new functions.

Re: ScaleRotateTranslateDistortion in 6.3.5-5

Posted: 2007-08-12T15:58:30-07:00
by rmagick
Gotcha. When the API is a little more "cooked" I'm thinking about doing some kind of "Cover Flow" demo in RMagick. That should get a little attention.

Re: ScaleRotateTranslateDistortion in 6.3.5-5

Posted: 2007-08-12T16:55:59-07:00
by anthony
If it makes you feel any better, the PerlMagick API interface for Distort is still showing the initial first draft of the function call, and the 'best-fit' flag is hardcorded to false until someone gets around to looking at it.