MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: affine transformation to rasters


I think that translations and scalings were performed - but I'm not certain 
of the composition of your affine transform. In any case, add a Frame to 
your plot to better see what is happening.

oce = Import["ExampleData/ocelot.jpg"];
oceras = oce[[1]];

 Frame -> True]

  AffineTransform[{{{-0.139, 0.263}, {0.246,
      0.224}}, {0.57, -0.036}}]],
 Frame -> True]

The following shows that scalings and translations are performed on Rasters.

  ScalingTransform[{1/200, 1/200}]],
 Frame -> True]

  TranslationTransform[{-100, -100}]],
 Frame -> True]

The DrawGraphics6 package has alternative forms of all the geometric 
transforms so that they can be applied directly to pieces of graphics as 
postfix operations.


     // TranslateOp[{-100, -100}]
    // RotateOp[Pi/4]
   // ShearingTransformOp[Pi/4, {1, 0}, {0, 1}]},
 Frame -> True]

David Park
djmpark at

"juan flores" <juanfie at> wrote in message 
news:fguqhg$pi7$1 at
> Hi all,
> I am working on fractals through IFS (Iterated Function Systems).  An
> IFS ca be defined as a set of affine transformations that are
> iteratively applied to an initial image.  All examples in the Wolfram
> Demonstrations Project do IFSs with polygons.  When you apply an
> affine transformation to a raster image, you get the rotations,
> reflections, and shearings right, but not the translations nor the
> scalings.
> I am reading a jpg file with import, extracting the raster from it,
> and applying an affine transformation.
> oce = Import["ExampleData/ocelot.jpg"];
> oceras = oce[[1]];
> Graphics[GeometricTransformation[oceras,
>  AffineTransform[{{{-0.139, 0.263},
>                            {0.246, 0.224}},
>                           {0.57, -0.036}}]]]
> In this case, the affine transformation is a composition of
> translation, rotation, reflection, and shearing.
> Any ideas on how to proceed?  Any tricks?
> Regards,
> Juan Flores
> Universidad Michoacana
> Mexico

  • Prev by Date: Re: Re: Can you get a package back to a notebook easily?
  • Next by Date: ContourPlot Problem
  • Previous by thread: Re: affine transformation to rasters
  • Next by thread: What is #6 to SphericalPlot3D[]