[comp.graphics] Image Contouring algorithm wanted

jdye@ADS.COM (John W. Dye Jr.) (11/15/90)

Sorry if this is a subject that has been discussed before, but I
waited until the "monthly message" came out and found no mention
there, so here goes.

  I need an algorithm for creating contour lines on a discretely
sampled surface (a 2d image).  I would like to be able to vary the
distance (in value space) between the contours.  What I want to
produce is a graphic overlay like the elevation contours on a map.

  Since my graphics environment is non-standard, I probably can't
easily use previously written software, so I am more interested in
the "central" mathematics of the algorithm than any specific 
implementations.

	Please respond via email if you can help with a reference or
with a pseudocode (or a realcode) example of the contouring algorithm.

Thanks,

JD
John Dye
jdye@ads.com

landheim@bbn.com (Greg Landheim) (11/15/90)

In article <_}*^0+=@ads.com> jdye@ADS.COM (John W. Dye Jr.) writes:
>
>  I need an algorithm for creating contour lines on a discretely
>sampled surface (a 2d image).  I would like to be able to vary the
>distance (in value space) between the contours.  What I want to
>produce is a graphic overlay like the elevation contours on a map.
>

Like a lot of other questions for which I have potential answers, this
one is on my PC at home.  My PC video display is gronked, so I can't
look up a lot of things.  But I do have a file of references on this
subject somewhere.

A lot depends on what you mean by "discretely sampled."  If you sample
on a grid, I have a reference describing a very easy to implement and
extremely reliable contour map generator.  If you sample at scattered
locations, you can either interpolate your surface and get grid points
to feed to this algorithm, or use an algorithm that generates contours
within triangles formed by your scattered points.

I agree that a short bibliography of references on this subject is
suitable for the frequently asked questions posting.  Unfortunately, not
only is my PC at home gronked, but I am changing office locations
over the next week and my entire computing base will be unreliable, or
I would volunteer to collect references and post them.  If someone
else wants to volunteer, I will _try_ to remember to dig out everything I
have filed away and forward it to the volunteer.

Greg L.