Re: Problems combining new v7.0 Image command with other graphics
- To: mathgroup at smc.vnet.net
- Subject: [mg95176] Re: Problems combining new v7.0 Image command with other graphics
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 8 Jan 2009 06:43:35 -0500 (EST)
- Organization: Uni Leipzig
- References: <gjv732$ov0$1@smc.vnet.net> <gk1rj5$oq5$1@smc.vnet.net> <gk3fda$dv5$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi,
you have not understood the problem. Your example does just this what
the OP wishes, it draw the Locator[] over the image, and keep the
vector structure of the Locator[]. But there is no LinePane[]/
CirclePane[]/ PolygonPane[], to do that. And something like
raster = Image`ToGraphicsRaster[img][[1]] /.
Raster[bm_, dim_, args___] :>
Raster[bm, {{0, 0}, Reverse[Take[Dimensions[bm], 2]]}, args];
dim = ImageDimensions[img];
Graphics[{raster, Locator[Dynamic[p]],
Text[Dynamic[p /. ImageScaled[a_] :> Round[a*dim]],
Dynamic[p], {-1, -1}]}]
is not possible with LocatorPane[].
It is a principle error of the Image[], that Image[] itself
is no Graphics-object (very logic). And it would take only a little work
to display and Image[] alone as well as to allow that
Graphics[{Image[..],..}]
work correct. The problem is, that Image[] has not the position/size
information that Raster[] has. However a position and size information
is necessary for several image processing algorithms, like all forms of
image registration.
Regards
Jens
Sjoerd C. de Vries wrote:
> Easy:
>
> LocatorPane[{50, 50}, ImageCompose[Image[img], Graphics@Circle[]]
>
> Cheers -- Sjoerd
>
> On Jan 7, 2:10 pm, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de>
> wrote:
>
>>> 3. You can combine bitmapped Images with vector based Graphics using
>>> ImageCompose:
>>> ImageCompose[Image[img], Graphics@Circle[]]
>> That destroy the vector information and work with the
>> full image. Try to move a Locator[] object on the image
>> in that way, and not with
>> Graphics[{Image`ToGraphicsRaster[img][[1]],Locator[p]}]
>>
>