Using Shepard Distortion

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
User avatar
Anand
Posts: 3
Joined: 2011-04-20T05:22:25-07:00
Authentication code: 8675308

Using Shepard Distortion

Post by Anand »

Hello i want to use shepard distortion of image magic in Iphone,but how to use it means how to pass the parameters to the distortion method .kindly suggest me.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Using Shepard Distortion

Post by anthony »

The parameters are straight forward, a string of a pairs of coodinate pairs. That is 4 numbers for every point you want to move (or not move).

NOTE that moving only one point moves the whole image. As such you may want to fix the image corners.

See IM examples
http://www.imagemagick.org/Usage/distorts/#shepards
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
Anand
Posts: 3
Joined: 2011-04-20T05:22:25-07:00
Authentication code: 8675308

Re: Using Shepard Distortion

Post by Anand »

extern MagickExport Image
*DistortImage(const Image *,const DistortImageMethod,const size_t,
const double *,MagickBooleanType,ExceptionInfo *exception)

this is the method through which we can distort image defined in distort.h of IM.

Mine Code --->>>>
final = DistortImage(images, ShepardsDistortion , ? , ?, 1, exception);
images is my image to be distorted,method of distortion is ShepardsDistortion, at first ? we have to give number of arguments according to documentation,and at second ? we have to give an array. So i want this solution for iphone.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Using Shepard Distortion

Post by anthony »

On in a MagickCore function call..

One is a array of floating point (double) values. The other the number of values in that array!
Simple as that!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply