MathGroup Archive 2010

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

Search the Archive

Re: Line into Image

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107480] Re: [mg107470] Line into Image
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Sun, 14 Feb 2010 05:58:20 -0500 (EST)
  • References: <201002131024.FAA25612@smc.vnet.net>

Hi,

you could do it with ImageCompose. Just overlay your Image with the
lines you want to have:

SetAttributes[lines, HoldRest];
lines[img_Image, output_] := DynamicModule[
   {nx, ny, h, v},
   {nx, ny} = ImageDimensions[img];
   Column[{
     Dynamic[
      output = 
       ImageCompose[img, 
        Graphics[{Cyan, Thick, Line[{{1, h}, {nx, h}}], 
          Line[{{v, 1}, {v, ny}}]}, PlotRange -> {{1, nx}, {1, ny}}]]],
     Slider[Dynamic[h], {1, ny}],
     Slider[Dynamic[v], {1, nx}]
     }]
   ];

lines[Import["http://sipi.usc.edu/database/misc/4.1.04.tiff";], outimg]


your final image is stored in the variable "outimg" here.

Cheers
Patrick

On Sat, 2010-02-13 at 05:24 -0500, Francisco Javier Chávez Contreras
wrote:
> Good Evening:
> 
> I have a PNG image from a chart (curves), and i need to insert into it two
> lines of cyan color. These lines have to be moved into the PNG using two
> Sliders (one for the vertical line, and other for the horizontal line).
> 
> I created the Slider using the "Control" function, because provide me the
> option for enter the values or "slide" a value.
> 
> I created both cyan lines and saved into a variable, but i cant superpose
> these lines and move them.
> 
> Can anyone of you help me "math friends"?
> 
> Sorry my english!
> 
> 
> Cheers,
> Francisco Ch=E1vez C.
> Santiago, Chile.
> 
> 



  • References:
    • Line into Image
      • From: Francisco Javier Chávez Contreras <francisco.chavez@usach.cl>
  • Prev by Date: Re: Park's and Bergstrom's packages
  • Next by Date: Shadow error when trying to use ParallelTable
  • Previous by thread: Line into Image
  • Next by thread: Re: Line into Image