0
$\begingroup$

When using the image transformation command

ImageFowardTransformation[image, function] the pixels of the image you input are in cartesian coordinates that by default are aligned with the bottom left hand corner of every 2d image.

If I want to shift the origin to the centre (from that default settings) which command would I put inside the transformation command?

$\endgroup$
  • 1
    $\begingroup$ Did you remember to set DataRange and PlotRange accordingly? $\endgroup$ – J. M. is away Mar 8 at 9:31
  • $\begingroup$ I did put DataRange -> Full but I thought DataRange just tells you the range of data values (pixels) you want to transform but not sure if that's the same as actually shifting the default origin of the coordinate system from the bottom left corner of the image to the center. $\endgroup$ – user61882 Mar 8 at 9:39
  • $\begingroup$ This question is related to one of my other pending questions "Using a numerical table in the form of an interpolating function inside the ImageTransformation command" still need to update that with my current thoughts though $\endgroup$ – user61882 Mar 8 at 9:40
  • $\begingroup$ do you get what you need using the options DataRange->Full and PlotRange -> Transpose@{function@{0, 0}, function@ImageDimensions[image]}? $\endgroup$ – kglr Mar 8 at 9:44
  • $\begingroup$ DataRange -> Full - ah, that's the lazy route. If you need to control the transformation domain, you need to specify explicit ranges. Have a look at this example: img = Rasterize[Graphics[{}, Axes -> True, PlotRange -> 3]]; ImageForwardTransformation[img, AffineTransform[{RotationMatrix[Pi/6], {2, 1}}], DataRange -> {{-3, 3}, {-3, 3}}]. $\endgroup$ – J. M. is away Mar 8 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.