Menu

#194 contour/image mismatch

open-later
None
3
2005-01-15
2005-01-15
Dan Kelley
No

Sometimes, Gri contours and images do not match. This can cause
a problem when drawing an image underneath a set of
contours, as a way to get "floodd" contours.

The attached file is zoomed in from an example discussed on the
help forum at http://sourceforge.net/forum/forum.php?
thread_id=1211232&forum_id=16975 .

Although this 'help' thread is recent, this sort of image/contour
problem comes up a lot. One difficulty (not necessarily in the
above-cited case -- I've not checked that) is that images are stored
only to 8-bit resolution. That is sometimes not enough to ensure
matching of image-colour transitions to contours. Another issue is
that the algorithm for interpolating within images is a bit different
to that used in contouring.

This is not a large problem, but it comes up enough to be worth a
bug report, so that uses can track the progress of development.

Below, are some thoughts, which I've put here mainly so that I can
return to them, or so that others can discuss them, as time goes
on.

It would be easier if gri drew contours as line segments within grid
"patches", as matlab does. Instead, Gri traces contours through
the whole graphing space. This yields the advantage that the line
segments join cleanly (postscript knows how to do proper corners,
but only if it knows which segment links with which). With thick
contours, a patch-oriented scheme could produce ugly segment
transitions.

However, a strength of the patch-oriented over the contour-tracing
scheme is that the former makes it easy to fill in the space
between contours. (Just sweep up a column of the grid, drawing
contours and colours as needed.)

It would be quite complicated to implement between-contour
colouring in the present gri scheme, I think. For contours that
close within the graphing region, it's easy, using a fill-curve
scheme. But for contours that intersect the boundaries of the
plotting region, a bit of thought would be required, to insert "fake"
points on the contour path, for filling.

Discussion

  • Dan Kelley

    Dan Kelley - 2005-01-15

    snapshot of contour/image mismatch

     
  • Dan Kelley

    Dan Kelley - 2005-01-15
    • priority: 5 --> 3
    • status: open --> open-later
     
  • Dan Kelley

    Dan Kelley - 2005-01-15

    Logged In: YES
    user_id=31559

    Another point that I forgot to note is that the Gri algorithm "knows" about
    the full extent of a contour, and therefore it can "think" about where to
    put a contour label. If things were done on a grid-patch level, then a
    second stage would be required to link the line segments in the patches
    into paths, so that contours were drawn using full information about
    contour length, etc.

     

Log in to post a comment.

MongoDB Logo MongoDB