Affine Transformation Crashing

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
micahasmith
Posts: 5
Joined: 2013-08-19T07:34:06-07:00
Authentication code: 6789

Affine Transformation Crashing

Post 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?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Affine Transformation Crashing

Post by dlemstra »

Can you place your image online so we can use it for testing?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Affine Transformation Crashing

Post 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
micahasmith
Posts: 5
Joined: 2013-08-19T07:34:06-07:00
Authentication code: 6789

Re: Affine Transformation Crashing

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Affine Transformation Crashing

Post 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.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Affine Transformation Crashing

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply