ImageTransformations.jl icon indicating copy to clipboard operation
ImageTransformations.jl copied to clipboard

Warp seems to be off

Open ChantalJuntao opened this issue 1 year ago • 1 comments

I don't know if this used to be a problem too, but I'm having trouble reproducing some image transformations I had saved last month, and I found that warp doesn't seem to be making accurate rotations right now?

using ImageTransformations, TestImages, ImageView, Rotations, OffsetArrays, CoordinateTransformations

mri = centered(testimage("mri"));
tfm = AffineMap(RotXYZ(2*pi,0,0), [0, 0, 0]);
imgw = warp(mri, tfm, axes(mri));

imshow(colorview(RGB, mri.data, imgw, zeroarray));

ChantalJuntao avatar Dec 08 '23 06:12 ChantalJuntao

Is this the transformation you are looking for?

mri = testimage("mri")
tfm = recenter(RotXYZ(pi/4, 0, 0), center(mri))
imgw = warp(mri, tfm,  axes(mri))
imshow(colorview(RGB, mri.data, imgw, zeroarray));

with:

[150eb455] CoordinateTransformations v0.6.3
  [02fcd773] ImageTransformations v0.10.0
  [6fe1bfb0] OffsetArrays v1.12.10

Your centered is unknown:

UndefVarError: `centered` not defined  

The transformation, tfm, in my definition is an AffineMap that first rotates the image about origin, and then translates it on the direction defined by the center of the image testimage("mri").

empet avatar Dec 08 '23 22:12 empet