MathGroup Archive 2010

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

Search the Archive

Re: overimpose graphics on an imported image

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106311] Re: overimpose graphics on an imported image
  • From: Fred Klingener <gigabitbucket at BrockEng.com>
  • Date: Fri, 8 Jan 2010 04:14:25 -0500 (EST)
  • References: <201001011037.FAA05346@smc.vnet.net> <hhn5mk$75g$1@smc.vnet.net>

On Jan 5, 1:49 am, "alexxx.ma... at gmail.com" <alexxx.ma... at gmail.com>
wrote:
>...
> I just would like the coordinates were less confusing in M !
> ...
> -----Original Message-----
> From: alexxx.ma... at gmail.com [mailto:alexxx.ma... at gmail.com]
> Sent: Tuesday, 05 January, 2010 07:50
> Subject:  Re: overimpose graphics on an imported image
>
> ...
> I just would like the coordinates were less confusing in M !
> ...

Me too.

One of the common tasks I seem to set for myself is drawing on top of
imported images, and I like Inset[] for that.

img = Import["http://sipi.usc.edu/database/misc/5.1.12.tiff";];

Manipulate[
 Graphics[{
   Rotate[
    Inset[
     img
     , {0., 0.}
     , center
     , scale
     ] (* Inset *)
    , angle
    , {0., 0.}
    ] (* Rotate *)
   , {Blue, Opacity[0.5], Disk[{0., 0.}, 0.5]}
   }
  , PlotRange -> {{-0.5, 1.5}, {-0.5, 1.2}}
  , Axes -> True
  , AxesOrigin -> 0
  , ImageSize -> {200, 170}
  ] (* Graphics *)
 , {{scale, 1}, 0.5, 3}
 , {{angle, 0.}, -Pi/12, Pi/12}
, {{center, {189, 124}}, {150, 100}, {200, 150}}
 ]

This form lets me scale and align the image, then use GetCoordinates
from the 2D drawing palette to pick key matching points on the image
in my drawing coordinate system.

My final construction uses the same Inset[] structure but with frozen
scale and alignment parameters.

Hth,
Fred Klingener


  • Prev by Date: Re: Integrate 'learns'?
  • Next by Date: Re: FullForm puzzle.
  • Previous by thread: Re: Re: overimpose graphics on an imported image
  • Next by thread: Re: overimpose graphics on an imported image