MathGroup Archive 2006

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

Search the Archive

Re: surface plot of an image

  • To: mathgroup at
  • Subject: [mg70921] Re: surface plot of an image
  • From: bghiggins at
  • Date: Wed, 1 Nov 2006 03:56:21 -0500 (EST)
  • References: <ei4mb2$e2t$>


Suppose you have imported your grayscale image and it is called
myimage. This should be an 2-D array of real numbers between 0 and 1.
The function ListInterpolation takes a matrix of real numbers and then
returns an  InterpolationFunction that allows one to treat the image as
a continuous function.


The output should look like

InterpolatingFunction[{{1., 336.}, {1., 448.}}, <>]

where  the original image had dimensions (336 , 448)

Now suppose we want to see how the image varies at some x value. Well
we can plot myinterpolationImage for that x-value, say x=150 :

Plot[myinterpolationImage[150, y], {y, 1, 448}, PlotStyle ->
RGBColor[0, 0, 1]];

One can also get a 3D plot of myinterpolationImage over a selected

Plot3D[myinterpolationImage[x, y], {x, 1, 300}, {y, 1, 400}, PlotPoints
-> 50,
      Axes -> False, Boxed -> False, ViewPoint -> {0.801, -1.730,

Hope this helps



alemarabi at wrote:
> Hi,
> I have a microscopy image in gray levels and would like to convert it
> to a surface plot, in order to visualize the differences in grey values
> accros the picture.
> Is there an easy (or already) existing way to do that?
> Thank you in advance,
> Ale

  • Prev by Date: Two small problems compute OK, but not their sum.
  • Next by Date: Context headache
  • Previous by thread: Re: surface plot of an image
  • Next by thread: Re: surface plot of an image