Page 1 of 1

Affine Transformation Crashing

Posted: 2013-08-19T07:39:06-07:00
by micahasmith
Windows 7 Enterprise, ImageMagick-6.8.6-Q16

When i run the following command:

convert 130819-1429336609f8faaa-c.jpg -verbose -matte -virtual-pixel Transparent -affine -1.7011346,6.7284627,-6.7284627,-1.7011346,1809.1752,-887.252 -transform -compose over -flatten 130819-14293757012b9bfc-e.jpg

It says the following:

Affine Projection:
-distort AffineProjection \
'-1.701135,6.728463,-6.728463,-1.701135,1809.175200,-887.252000'
Affine Distort, FX Equivelent:
-size 17908x25087 -page -16098-4012 xc: +insert \
-fx 'ii=i+page.x+0.5; jj=j+page.y+0.5;
xx=-0.035318*ii +0.139693*jj +187.839545;
yy=-0.139693*ii -0.035318*jj +221.393046;
v.p{ xx-v.page.x-.5, yy-v.page.y-.5 }' \

Then it pauses there and just continually soaks up more and more memory until my i have to manually kill the process. The img its operating on is less than 1mb.

Any ideas why this is happening?

Re: Affine Transformation Crashing

Posted: 2013-08-19T08:16:21-07:00
by dlemstra
Can you place your image online so we can use it for testing?

Re: Affine Transformation Crashing

Posted: 2013-08-19T10:01:52-07:00
by fmw42
convert 130819-1429336609f8faaa-c.jpg -verbose -matte -virtual-pixel Transparent -affine -1.7011346,6.7284627,-6.7284627,-1.7011346,1809.1752,-887.252 -transform -compose over -flatten 130819-14293757012b9bfc-e.jpg
there does not appear to me to be a second image involved with the -compose over -flatten. Thus you probably should be specifying a -background color for -flatten


you might try using -distort affineprojection in place of -affine ... -transform. see http://www.imagemagick.org/Usage/distor ... projection


Further analysis would need you to provide a link to your input image and how you computed your coefficients

Re: Affine Transformation Crashing

Posted: 2013-08-19T11:03:23-07:00
by micahasmith
Sure, the image is located at http://imgsrv.print.io/images/temp/b9c4 ... 338531.jpg.

The command works with the matrix 1,0,0,1,0,0 which tells me its not necessarily the other command args, would you agree?

The coefficients were computed using java/android ImageView image manipulations.

Re: Affine Transformation Crashing

Posted: 2013-08-19T12:31:59-07:00
by fmw42
The coefficients were computed using java/android ImageView image manipulations.
What is it that you are trying to accomplish? What formulae did you use to get the transformation coefficients and from what data points in the image?
It could be you are giving it incorrect transformation coefficients.

Re: Affine Transformation Crashing

Posted: 2013-08-19T14:20:39-07:00
by dlemstra
Are you sure you have the correct matrix? It takes ages but in the end you will get a jpeg image. It is 17908x25087 pixels and 2.77MB but only the top left corner is showing a part of the input image.