Rendering Line-Drawings with Limited Resources - CiteSeerX

7 downloads 2603 Views 586KB Size Report
some basic terms and definitions which are necessary ... interested in describing all the lines one can draw man- ually. .... entific illustration, offers further insight.
Rendering Line-Drawings with Limited Resources Stefan Schlechtweg, Thomas Strothotte Department for Simulation and Graphics, Otto-von-Guericke University of Magdeburg Universit¨atsplatz 2, 39106 Magdeburg, Germany e-mail: {stefans|tstr}@isg.cs.uni-magdeburg.de

Abstract

• Are there any possibilities to measure the degree of detail in a line-drawing?

Pictures play an important role in the communication process. Communicative goals can be expressed for instance with the specific use of different levels of abstraction in pictures. Especially in textbooks and scientific publications, images are used where the level of detail of different objects is deliberately changed to express the importance of an object in the picture.

• How can you—if you can measure it—change the level of detail in accordance with the measurements?

In this paper we introduce the concept of “drawing resources” for rendered line-drawings. This concept defines measures for controlling the level of detail of single objects in a drawing. We present a system which is based on a line-renderer and which enables a user to interact with the drawing thus created. The concept of drawing resources yields a new basis for formulating the user’s ideas of the appearance of the final image. Keywords: non-photorealistic rendering, drawings, level of detail, abstraction.

1

line-

Introduction

The emphasis of rendering techniques has traditionally been on producing a detailed, complete image of a geometric model. This seems to be a narrow view on computer graphics because more or less abstract images often better serve the purpose at hand. “If the ultimate goal of a picture is to convey information”, as Foley et al. pointed out [1], “then a picture that is free of the complications of shadows and reflections may well be more appropriate than a tour de force of photographic realism”. Line-drawings are particularly suited to support abstraction. We propose to control algorithmically the level of detail, and with it the level of abstraction contained in a computer generated linedrawing. More specifically, we introduce and study the following questions:

Besides rendering a more or less abstract line-drawing, we propose new interaction facilities for editing images. We argue that a close relation between the underlying geometric model and the rendered image is necessary to allow interaction directly on the rendered image. The paper is organized as follows. Section 2 deals with some basic terms and definitions which are necessary to explain the concept this paper is about. The following Section 3 gives an insight into line-drawings as a medium of expression. Related work in the field of computer generated line-drawings is examined. Section 4 explains the concept of “Drawing Resources”. This concept is used to control the level of detail in drawings as we show in Section 5. Here we also show results of our work. The paper ends with some conclusions and some visions for future work.

2

Basic Terms and Definitions

Line-drawings are pictorial representations in which the depicted objects of the reality are visualized exclusively with lines. This rather inaccurate definition serves the purpose at hand. It says that (1) line drawings are constructed with lines and (2) that due to this fact a line drawing is always an abstraction. However, this definition needs some further explanation. It is based on the term “line”, which we must deal with first. There are many ways to come up with a definition of the term “line”. Mathematicians do not use the term in general; instead they define several special types of lines like straight lines, parabolas, spline curves, etc. Their purpose is to have a tool giving the points a line

consists of in an analytical way and thus to depict spatial relationships in 2D or 3D space. In our context, however, we do not need a definition by giving each single point. We need a general description of the term “line” and a possibility to decide whether a graphical object is a line or not. We are especially interested in describing all the lines one can draw manually. Looking closer at the drawing process in art reveals another way of defining a line. When drawing a line, a visible trace is left behind by a tool on a surface. The drawing tool (a pen, a brush or some sort of etching tool) is either capable of emitting a colored substance or of scratching the surface. The drawing surface (like paper, canvas or a copper plate) itself either takes on the color or is of such a consistency that it is possible to scratch it.

Figure 1: Different line classes form a drawing.

• Internal structure lines are used to show the internal structure of an object, its composition, how it is constructed out of faces and sub-objects.

Combining both, the mathematical and the artistic way of defining a line, we come to the following definition: A line is a curve which is the result of an uninterrupted movement of a drawing tool onto a drawing surface and which is at least C 1 continuous.

• External structure lines form the contour of an object e.g. the object’s border to its environment. Hatching lines are used to show • the surface shape (is it a flat or curved surface etc.),

This definition covers all the mathematically defined lines, as long as there are two end-points (infinite lines would need an infinite movement of the drawing tool). If the movement is interrupted, the line ends. A line also ends in points without C 1 continuity. Thus polygons are divided into a set of single lines.

• the structure of the object’s surface (material properties),

A line never exists without its environment. A single line drawn in an area will never be regarded as a line alone. It is seen as inside of or in the foreground of a flat area. If one line already has relations to its environment there must be relations between multiple lines drawn on the same surface. With this relations one can construct complex objects which also relate to each other. All these relations create pictorial representations—“linedrawings”.

Hatching lines never appear alone. Their effect is caused by the “team-work” of many lines.

In line-drawings, the shape of an object as well as light and shadows are expressed by the proper use of lines. Thus when looking at line-drawings, it is conspicuous that lines are used in different ways to obtain special effects. We therefore distinguish between • structure lines and • hatching lines. Structure lines depict the shape of an object. We regard as shape the contour as well as the internal structure. This leads to a further classification:

• lightning and • shadow casting.

Figure 1 shows the different kinds of lines mentioned above and how they together create a line drawing.

3

Line-Drawings as a Medium of Expression

Pictures are a medium of expression. This is a known fact and very often stated with the saying “A picture is worth a 1,000 words.”. N. Gershon states in [2] that the usual meaning is that one could pack more information into a picture than by using words to describe the same information. Images can even convey information that words cannot. On the other hand, words are sometimes more effective than pictures. An image of an unknown person driving a car gives the information “a woman driving a car”, but not “Ms. Smith is a good driver”. This can be done by using words in addition to or instead of the picture.

Words can give definite information whereas pictures are in most cases somewhat fuzzy, sometimes they only give some general information. Due to this fuzziness pictures, like words, can be seen as an abstraction from reality. However, there is a wide range of pictures with different levels of abstraction. Thinking of photographs one can say that here the level of abstraction is very low in contrast to, for example, simple line-drawings. Objects in a photograph can often be recognized immediately, whereas in a line-drawing the mental process involved in recognizing an object is more complicated and requires more “internal knowledge” by the viewer. This might be one of the reasons why the generation of pictures on a computer started with the goal to produce photorealistic images. A simple model of the photographic process serves as basis for the image creation process, rendering. The knowledge used about the objects in a scene is limited to geometric information and environmental data (atmospheric data, light, etc.). Very seldom, more information, like object relations (hierarchical structure of a scene, etc.) or information about the importance of an object in the scene is used. The last point might be obvious when talking about photorealistic images since they are created using a model of a photographic camera.

ing different techniques. With different line widths, for instance, the importance of an object in relation to the other scene objects can be emphasized. Some of these techniques are: • Show transparency of objects by using dotted or dashed lines. • Express the importance of objects by using different dense hatching lines and different hatching styles. • Express different importance through different levels of detail. While an important object exhibits a very detailed structure, unimportant ones are drawn only with external structure lines. Because of these possibilities to show abstract information in pictures line-drawings are often used as illustrations. Examples are given in Figures 2 and 3.

Figure 3: Line-drawing used in an architecture textbook (taken from [4]).

Figure 2: Schematic surgical drawing used in a textbook (taken from [3]).

Line-drawings offer possibilities for a higher level of abstraction. The fact that everything is expressed by the exclusive use of lines is one explanation for this. Looking closer at line-drawings, especially in the field of scientific illustration, offers further insight. Here a painter can code abstract information into the picture by us-

While the use of line-drawings as illustrations is well known, the generation of line-drawings for illustrative purposes is a relatively new field within computer graphics. A look at related work reveals the pioneer work of Saito and Takahashi [7] who created linedrawings based on 3D models. They exploited Gbuffers to enhance the resulting images, data structures which provide a link between the image and the underlying model so as to allow interactive modification of the rendered image. Winkenbach and Salesin [9] mentioned the need for “visual abstraction” within computer graphics and used different hatching techniques to render more or less detailed objects.

The system of Preim and Strothotte [5] is devoted to abstraction and focusing in line-drawings. This system works basically on a statistical analysis of the linedensity within an image to decide which lines can be left out to focus on a part of an image. Simon Schofields research in the area of nonphotorealistic rendering, especially in the field of new interaction techniques (see for example [6]) had also valuable influence on our work.

• overall line count:

N=



1

all lines

• overall line length:

N  L = length(linei) i=1

• average line length: l = • object visibility:

N=

L N N 

1

all edges in model

4

“Drawing Resources”

Computer generated line-drawings are generated based on a geometric model. This can either be a description of the drawing in 2D or a 3D model of the scene. In our research, we concentrate on the second way. The image is created out of a 3D CAD model as the product of a rendering process. During this rendering process, the edges defined by the 3D model are transformed into the structure lines of the drawing. In addition, we allow the user to add hatching lines. The resultant set of lines is what we consider to be “drawing resources”. Our concept is to measure the use of “drawing resources” for each object in a scene. Based on these measures, we can tell an object to use less resources and we give methods how this reduction should be performed. Strictly speaking, we try to characterize or to formalize the arrangement and the appearance of lines in computer generated line-drawings. There are several possibilities to measure the use of resources in line-drawings which reflect the real use more or less exactly. The most simple measure is to count the lines being used for the drawing of a specific object or of the whole scene. Another possibility is to determine the sum of the lengths of the lines used. These two measures can be combined in the average line length which is defined as the sum of line lengths divided by the number of lines. All these measures are absolute, they do not reflect the size of an object with respect to other objects. Rendered line-drawings are created from a 3D model which consists of a set of edges. Taking this into consideration, it is also possible to specify the use of lines as the ratio between the number of edges in the model and the number of lines in the drawing. This measure can be seen as a clue of how good an object is visible. Two more values, which can be measured or obtained from the internal state of the drawing program, respectively, are line brightness and line width. Putting it all together the measures we use are:

• line width:

to be measured

• line brightness:

to be measured

These measures allow working directly on the drawing. There are neither modifications of the model nor interventions in the rendering process itself. The 3D model serves as a source for information about size and position of objects in 3D space. The measures are a tool to control the use of resources in a drawing. How can they be applied to the rendering process? To answer this question, we studied line-drawings in scientific illustrations. Some of the techniques used here can be explained with our concept. The importance of an object, for instance, can be expressed by: • reducing the resources for all objects adjacent to the chosen object by drawing them with brighter lines, • drawing the object itself with either darker or wider lines or • drawing the object with all structural detail (subobjects) and applying a very detailed hatching whereas the surrounding objects are drawn with less detail. For working with these measures, a structured description of the drawing is necessary. Also relations between the lines in the drawing and the corresponding objects in the 3D model are important and the more information of this kind is available, the better one can apply the concept of drawing resources. What is the additional information stored in the 3D model used for? To draw an object with more or less detail, all lines belonging to this specific object are needed. If there is a data structure available which says the object consists of several sub-objects it is possible to choose a level in this hierarchy, the reduction process should be applied to. It is also possible to change the level of detail just by removing sub-objects, leading to

a less structured drawing and thus to a higher level of abstraction. Information out of the 3D model can be used to find the external structure lines of an object or to get the topologically adjacent objects. A way for automatic reduction of drawing resources is to get the distance of an object to the viewer and to draw the objects with an amount of resources which depends on this distance. How, for example, such an automatic processing of a drawing can be done is the topic of the next section.

5

Implementation and Results

ness, • lines having different width at the end points (the effect is like using a felt pen with different pressure) and • lines having different brightness at the end points (this effect is like using a pencil with different pressure). Figure 5 shows an image after the first stage of the image creating process. It just uses different hatching lines, there were no modifications of the drawing resources done at this point.

The basis for our prototypic system is the “sketchrenderer” as presented in [8]. This renderer creates a set of 2D lines out of a 3D model. We use standard geometric models with additional information about an object structure in the scene. That means parts of the geometry are grouped into objects. These object definitions can be nested. The resultant object structure is preserved in the rendering process to build a treelike representation, which contains pointers to the objects of the scene with all lines in the image belonging to them. The renderer itself only produces structure lines. The resulting pictures can be extended by creating hatching lines.

Figure 5: An image of a nutcracker where different hatching lines are used.

The existing image is the basis for all further modifications done in the second stage. Here a user can change the level of abstraction an object is depicted with. This happens in three different ways (see Figure 6):

Figure 4: The system consists of two parts with user interaction taking place in both of them.

Generating a special line-drawing with the system is a two stage process (see Figure 4) where user interaction takes place in both stages. The first stage consists of generating the line-drawing from a 3D model by means of the renderer. This basic drawing contains only structure lines. A user can add hatching lines, which are available in three “styles”: • normal lines having a specified width and bright-

1. All attributes, e.g. line width, line brightness, hatch density, etc. are manually changed and objects which should not appear in the scene are deleted. 2. A user selects an object and specifies what level of detail he wants the object to be drawn with. The system generates a proposal by changing the attributes in a rule-based manner. 3. The system generates a proposal for the whole scene. This is done by inspecting the distance of an object from the viewer’s (camera’s) position.

• direction of hatching lines, • “style” of hatching lines (normal, different brightness, different line width). 3. The user’s intention is to emphasize the weights in the picture. This can be done differently. The chosen method here is: (a) Reduce the resources for the object “boom” to 50 percent. Use brighter lines and reduce the hatch density. (b) Draw the weights with wider structure lines. Figure 6: The limitation of drawing resources happens in three different modes which can be combined.

Another example where the boom itself is emphasized is shown in Figure 8.

The object nearest to the viewer is drawn with all detail available. The level of detail decreases with increasing distance of the object from the viewer. All these proposals can be refined by a user while interacting with the graphics in the way described above. The three interaction modes can be combined to produce the image fitting best the user’s ideas.

Figure 8: The same model as in Figure 7 with a different resource distribution. The boom itself is emphasized.

Since the model is hierarchically structured it is easy to specify the reduction values and methods for an object. The chosen method and the values are recursively applied to all sub-objects in the tree-structure.

Figure 7: A picture of a boom created with our system. The weights are of importance

To describe the work with the system the image in Figure 7 is used as an example. It has been produced in the following way: 1. The 3D model is rendered with the sketchrenderer. As a result we get all structure lines of the image. 2. A user adds hatching lines. This is done by selecting an object and adjusting the hatch parameters like: • hatch density,

The model structure is also used for interaction. The selection of a model part is done by “hierarchical picking”. This means an object is selected by picking with a pointing device (mouse) in the drawing. The selection is shown by drawing marks at the corners of the bounding rectangle. The first pick selects the highest object in the hierarchy the picked point belongs to. Every further pick goes down one level in the model hierarchy. So a user selects along a path like for instance “boom → vertical beam → front face”. The selection path goes down till the level of single polygons is reached. The implementation was done on Silicon Graphics Workstations using C++ and GL for the graphical output. The algorithms standing behind the rules which are applied as reaction of a user’s input are of different complexity. Because of an internal tree-like representation of the geometric model most operations, like

changing the line brightness or width, can be done very fast by traversing a sub-tree. Operations, which cannot be performed this way, like changing the hatch density, need more time. Here we have to compute new hatching lines to preserve an equal distance of the lines. In the current implementation, we restrict ourselves to polygonal CAD models. Best results we got using architecture models. Out hatching techniques work best with models having not to much regular faces.

6

Conclusion

The method and the tool we present helps a user to create a line-drawing fitting his needs. The system works with standard CAD models and is therefore widely applicable. With the use of different widths and brightness of lines, it is possible to express more than only different levels of detail. With lines of different brightness, the effect of depth-cueing can be simulated. Lines with different width at the end and the beginning can depict the surface shape of an object. Our system does not use free form surfaces. The use of splines and free form surfaces might increase the number of models we can handle as well as the possibilities for reducing the drawing resources. We left this examination for our future work. The support for the system coming from the model and from the underlying renderer is very important. Having more references from the 2D objects to he 3D model yields even more opportunities. Some of them which will be valuable to examine are:

the object the mouse is pointing to. This concept should lead to a very powerful interaction technique, however, a very effective way to do the rendering in near real-time as reaction to the interactions is needed. The system presented can be used for a wide variety of tasks. First of all the resulting images serve as illustrations in publications. As it is to be seen in Figure 7 and Figure 8 a user has the possibility to emphasize different aspects of a scene for instance for comparison. The created images can be exported either as bitmap or PostScript so that they can be used in any word processing system. A second—even not intended—area of application is arts, since the resulting images have a certain appeal which might be applicable for decorative purposes. See for example Figure 5 which shows an image created for a Christmas greeting card.

Acknowledgments We wish to thank all our colleagues in Magdeburg for fruitful discussion, especially Andreas Raab who implemented the sketch-renderer and Axel Hoppe who did all the modeling. Thanks also to Ute Lau, who proofread the manuscript.

References [1] J. D. Foley, A. van Dam, S. K. Feiner, J. F. Hughes: Computer Graphics. Principle and Practice. Addison Wesley Publishing Company, Reading, MA, 1990.

• The use of topological information from the 3D model. So, for example, if an object should be emphasized, all adjacent objects could be drawn with slightly less resources.

[2] N. Gershon: “The Power and the Frailty of Images. Is a Picture Worth a Thousand Words?” In: Computer Graphics, Vol.: 29, No.: 4, 1995, pp. 35–36

• If there are references from a (structure) line in the drawing to the corresponding edge in the model the classification in internal and external structure lines can be done easily. When distinguishing between internal and external structure lines, one can emphasize an object by drawing it with a detailed structure whereas all remaining objects are drawn just with their external structure lines.

[3] E. R. S. Hodges: The Guild Handbook of Scientific Illustration. Van Nostard Reinhold, New York, 1989.

To enter the hatching or reduction parameters, we currently use an OSF/Motif interface. A new method of interaction, we will study in future, is to use the pointing device as a kind of eraser, removing more and more detail when moving over a surface. Here we need a detailed structure of the model to get information about

[4] W. Koch: Baustilkunde. Mosaik-Verlag GmbH, M¨ unchen, 1991. [5] B. Preim, Th. Strothotte: “Tuning rendered line-drawings”. In: Proceedings of WSCG’95, (Plzeˇ n, February, 14—18) 1995, pp. 228–238. [6] J. Lansdown, S. Schofield: “Expressive Rendering: A Review of Nonphotorealistic Techniques”. In: IEEE Computer Graphics and Applications, Vol.: 15, No.: 3, May 1995, pp. 29— 37.

[7] T. Saito, T. Takahashi: “Comprehensible Rendering of 3-D shapes”. Proceedings of SIGGRAPH’90 (Dallas, Texas, August 6—10). In: Computer Graphics, Vol.: 24, No.: 4, 1990, pp. 197–206. [8] Th. Strothotte, B. Preim, A. Raab, J. Schumann, D. R. Forsey: “How to Render Frames and Influence People”. Proceedings of Eurographics 1994, (Oslo, September 12—16, 1994). In: Computer Graphics Forum, Vol.: 13, No.: 3, 1994, pp. 455–466. [9] G. Winkenbach, H. Salesin: “Computer generated Pen-and-Ink-Illustration”. Proceedings of SIGGRAPH’94, (Orlando, Florida, July 24—29). In: Computer Graphics, Vol.: 28, No.: 4, 1994, pp. 91–100. Citation information: Stefan Schlechtweg, Thomas Strothotte: Rendering Line-Drawings with Limited Resources. In: Proceedings of GRAPHICON’96 (St. Petersburg, Russia, July 1–5, 1996), vol. 2, pp. 131–137, 1996