Fractal Terrain Generation

1 downloads 0 Views 675KB Size Report
Slihouette Rendering Algorithms is one of the technique that important in creating non-photorealistic image. It has ... The data then convert into the format that suitable for existing 3D silhouette software. .... In each of these methods the front facing polygons are rendered first with .... Generated Watercolor, Computer Graphics.
3D Silhouette Rendering Algorithms using Vectorisation Technique from Kedah Topography Map Ruzinoor Che Mat and Norani Nordin Fakulti Pengurusan Teknologi Universiti Utara Malaysia 06010 Sintok, Kedah Darulaman. Malaysia. [email protected], [email protected]

Abstract: Most of the applications in real world today are more toward non-photorealistic rather than photorealistic. Slihouette Rendering Algorithms is one of the technique that important in creating non-photorealistic image. It has been successful used in various applications such as game engine, communicating shape, cartoon rendering and 3D terrain visualization. This paper explores how silhouette rendering algorithms could be created using a data that have been extracted from Kedah topography map. Contour data from a topography map are convert from raster to vector (vectorisation) in order to create a grid terrain Digital Elevation Model (DEM) data. The vectorisation software has been used for producing these data. The data then convert into the format that suitable for existing 3D silhouette software. The results produced compatible terrain images of Sik District, Kedah that are closer to human drawn illustration and look like an artistic style. Keywords: terrain visualisation, silhouette, vectorisation and topography maps. 1. Introduction This paper is actually the extension from what has been done by Ruzinoor [16]. The different is that the data used in this paper are created using vectorisation technique. The aim of this paper is to explore how silhouette rendering algorithms could be created using a data that have been extracted from a topography map. Vectorisation technique is used to convert a contour data in topography map from raster to vector and then processed the data into DEM grid terrain data. These can be done by using a vectorisation software call R2V Able [1]. The data then converted into the format that suitable for existing 3D silhouette software [22]. The topography map chosen in this paper is Sik District in Kedah. The evaluation of the effectiveness of silhouette rendering algorithms in terrain visualisation is also discussed in this paper. The silhouette rendering algorithms used in this paper is still Wireframe Method which introduced by Raskar and Cohen [13] and adapted by Liu [10]. These algorithms have been successfully proved by Ruzinoor [16] in producing terrain image as silhouette style. 2. Related Work In recent years, most of the researchers have turned their attention away from photorealism and toward developing non-photorealistic rendering technique (NPR) in a variety of style and simulated media such as technical illustration[5], watercolour [3], and graphite pencil [18]. This paper falls within the area

of NPR, which was defined by Green et al. [6] as concerned with producing imagery that look as if an artist had drawn it. NPR has also described by Hertzmann [7] as "any attempt to create images to convey a scene without directly rendering a physical simulation". The purpose of this technique is to produce images that appear to have been drawn by hand. The work that has been done by Ruzinoor [16] is very much related to this paper. He proposed a new technique of NPR by representing the terrain using silhouette rendering algorithms which used wireframe method. The results shown that silhouette rendering algorithm could used in 3D terrain visualization and given very promising terrain image. Balaz et al. [12] used an interactive NPR system, which proposed for fast viewing of different types of data sets without assuming any a priori knowledge about the density value. They have shown that using a simple contour enhancement approach different important detail can be visualized simultaneously. Different with Green et al [6] which introduce interactively display of a custom shaded model and edge lines. However, the reality is that NPR software (Piranesi) is now available on the market [14], which has a capability for rendering any 3D image as a Non-photorealistic image. Silhouettes Edges Detection Rendering objects in an artistic style requires the use of edges to highlight different areas of the object. Many times the silhouette edges of the object are also

drawn to clearly delineate the object. The method for detecting silhouette edges is fairly straightforward. The basic approach is to find edges that are shared between front facing and back facing polygons. A front facing polygon is defined as a polygon whose normal points towards the viewer. Lake et al. [9] have defined the silhouette edge as “the edge shared by a front-facing and a back-facing polygons (see Figure 1.0). The silhouette in each frame, can be found by taking the dot products of the face normal of the two faces adjacent to an edge with the viewing vector (see Equation 1.0) and comparing the product of these two dot products with zero. If the result of this computation is less than or equal to zero, the edge is a silhouette edge and it is flagged for rendering”. Silhouette Edge = (face normal1.eyevect) * (facenormal2.eyevect) ≤ 0

Equation 1.0

Figure 1.0: Silhouette edge detection (Image from Lake et al. [9]) Hertzmann [7] has provided an extensive review on silhouettes and the survey of the technological problem for finding visible silhouettes of 3D surfaces. He mentioned that "silhouette are important both perceptually and aesthetically. Efficient silhouette detection is an interesting technical problem, because silhouettes typically occur only in a few places on a 3D shape at any given moment". The use of silhouette edges has been discussed by several researchers, Saito and Takahashi [17] showed how silhouette edges can be used to enhance the display of images. The silhouette edges can be rendered by highlighting the discontinuities in the zbuffer derivative. In a similar fashion creases or folds in the image can be rendered by highlighting discontinuities in the second derivative of the zbuffer. Rosignac [15] used the z-buffer to render silhouette edges by first rendering the object in white then rendering the scene in thick wire-frame mode. The polygons in the second pass are pushed away in the z direction. This results in a silhouette display of the objects. Bremer and Hughes [2] have using ray tracing technique for rendering the silhouette. The aim of this technique is to produce a non-photorealistic rendering of an implicit surface. Silhouette and some shading near silhouettes are rendered using these

techniques. Their method was directly inspired by Markosian et al. [11] that produce real time silhouette renderings of a polygonal model. This algorithm starts with finding the silhouette edges and information for shading, tests the edges for occlusion, and then draws the edges and shading information. The work done by Raskar and Cohen [13] renders the silhouette edges using a traditional polygonal rendering setup. The silhouette edges can be rendered by simply pulling the back-facing polygons towards the camera. This technique does not require pre-processing or adjacency information for dynamic scenes. The pseudo-code to render silhouette edges in black on white background are described below:• Draw background with white colour. • Enable back face culling, set depth function to “Less Than” • Render (front facing) polygons in white. • Enable front face culling, set depth function “Equal To”. • Draw (back-facing) polygons in black wireframe. • Repeat for a new viewpoint. These methods of producing silhouettes are called the general method. Raskar and Cohen [13] provided three techniques for rendering the silhouette, namely a) Wireframe Rendering b) Translated back-facing polygons c) View-dependent modification of back-facing polygons. In each of these methods the front facing polygons are rendered first with z-buffer write enabled. The back facing polygons are then rendered using one of three methods to produce the silhouette edges. This is an extension of the work presented by Rossignac [15]. Ruzinoor [16] and Liu [10] have adapted the first technique for highlighting silhouettes. Ruzinoor [16] has been adapted these technique to be used in 3D terrain visulisation and proven to be very useful for creating terrain image. This paper extends what has been done by Ruzinoor [16] using different data approach. Vectorisation Technique The current vectorization methods can be classified into three categories: thinking-based [4], contour based [8], and Run Length Encoding (RLE)-based [19]. Thinning-based method usually employs an iterative boundary erosion process to remove outer pixels, until only one-pixel-wide skeleton remain. The contour based method extracts image contours first then finds the medial axis between the contours. The RLE method constructs a line adjacency graph after computing the run-length encoding of an image. This paper applied the second technique which

involve contour based method for creating grid terrain data. 3. Implementation Borland C++ Builder Version 5.0 was used for adapting Raskar and Cohen [13] demo program, written in Visual C++. A successful 3D-terrain model was developed by reading the DEM data from the file. The simple Graphical User Interface (GUI) was built using the Forms on Borland C++ Builder and produced a user-friendly environment for the user. The DEM grid file data that produce from R2V software then was converted into the data style which can be read in 3D silhouette rendering algorithm software. The converting program was done using Visual C++ programming. Then the converting file was applied into the 3D silhouette rendering algorithm software and produce 3D terrain image in silhouette fashion (see Figure 2.0). The code for the 3D silhouette rendering algorithm was written in an object oriented fashion. The advantage of using Borland C++ Builder is that it makes easier to implement the Graphical User Interface (GUI) and also creates a professional appearance. Other than that, by writing code in object oriented fashion, it makes it easier to extend this program for another purpose. This program runs successfully on Windows 9x and Window NT.

modelling. For example, Bukit Jelutong Dua have the highest peak and Bukit Tok Bidan is the lowest peak in Sik District. This criteria was chosen as to get a good terrain image, the area needs to have many hill. For the purpose of evaluating the results in the next section, a DEM grid data from Gunung Kemerlong has been chosen. The aim of this section is to explain how the DEM grid data was constructed from a topography map. Then the DEM grid data was applied to the 3D silhouette programming in order to produce silhouette terrain image in 3D.

Figure 3.0: Gunung Kemerlong data scanning Steps for Creating a DEM grid data menu

1. Data Scanning from a topography maps

title

scrollbar

2. Decrease Colour Depth of the image Image

OpenGL Component Panel

3. Editing Colour Palette

button

Figure 2.0: GUI for the program 4. DEM Data Construction The data that were used in this research are taken from an original topography map. The area covering in this paper is Sik District, in Kedah. There are five areas that has been scanned for testing the result which is Bukit Jelutong Dua, Gunung Kemerlong, Bukit Tok Bidan, Bukit Tanah Liat and Bukit Pandan (see Figure 3.0). The areas are chosen because from all topography maps in Kedah, Sik District has the most promising contours to be created in 3D terrain

4. Editing Contour Line 5. Convert the image from Raster to Vector 6. Overlay Line ID’s 7. Setting Contour Line Value 8. Create 3D DEM Grid File

5. Evaluation, Result and Discussion This section discusses and evaluates the results of this paper. Gunung Kemerlong has been chosen as the area for investigation. The chosen techniques seemed appropriate for this project and were evaluated to establish whether they can produce perceptually appropriate results for terrain visualisation.

comprehend. The silhouette represented by the orthographic camera projection looks better and showed more information of the terrain.

For investigation on this method, there are many different approaches have been used for testing; shading and silhouette. a) Gunung Kemerlong setting as perspective camera projection

a) Gunung Kemerlong represent as shading b) Gunung Kemerlong setting as orthographic camera projection Figure 4.0: Comparison of silhouette edges using different camera projection.

b) Gunung Kemerlong represent as silhouette Figure 3.0:Comparison of different rendering. The aim of this testing is to show that by representing the DEM as a silhouette, the information of the terrain can still be perceived by the user. It means that the photorealism can be changed to non-photorealism. The results show that the silhouette rendering captures from Gunung Kemerlong has shown clearly the hills and valleys as silhouette. It seem that the terrain image produced from silhouette gave better results than terrain image produced from shading. The second approach involves setting the different camera projections for displaying the terrain image. The camera projection includes perspective and orthographic. Figure 4.0 shows the comparison between these two camera projections. The result shows that the silhouettes are best represented by orthographic camera projections rather than perspective camera projections. The silhouettes in perspective camera projections are seem close together in which makes them difficult to

The third approach involves rotating the object in y direction at 20%, 40%, 60% and 80% from the original camera projection. Figure 5.0 shows the image of the result. The calculation for the percentage of the projection is set by formula below:-

2 θ 10 Calculation for 20% rotation tan θ = 2/10 θ = tan-1 0.2 θ = 0.197396 degree = θ * 180 PI = 11.31

but for Figure 5(d) gave better results by showing many information of the terrain slope and breaking slope more clearly. The fourth approach involves setting the terrain using different scaling in perspective camera projection. In terrain image, it is necessary to use different values of scaling, to make them look correct, otherwise if the terrain image is drawn with no scaling, they tend to look flatter. a) Bukit Pandan DEM shown using orthographic camera projection set as 20%.

a) Gunung Kemerlong setting as perspective camera projection and scaling by 1 b) Bukit Pandan DEM shown using orthographic camera projection set as 40%

b) Gunung Kemerlong setting as perspective camera projection and scaling by 3 c) Bukit Pandan DEM shown using orthographic camera projection set as 60%.

Figure 6.0: Comparison of silhouette edges using different scaling in perspective projections. Figure 6.0 shows the effect of changing the scaling in perspective camera projection for showing the terrain image. It can be observed that the image in scaling by 1 shows the terrain images are being too flat and half of the silhouette edge has been lost. In contrast with the other terrain image, the image is shown more clearly but some of the lines in the slope area look joined together.

d) Bukit Pandan DEM shown using orthographic camera projection set as 80%

The last approach is by comparing the silhouette edges in different place around Sik District.

Figure 5.0: Comparison of silhouette edges using different y direction. The result showed that, all of the terrain in each orientation seems to produce different results from less silhouette edges to more silhouette edges. The results on Figure 5(a) showed many areas on the terrain are loss information of the silhouette edges a) Silhouette edges of Bukit Jelutong Dua

6. Conclusion

b) Silhouette edges of Gunung Kemerlong

c) Silhouette edges of Bukit Pandan

On the whole, silhouette rendering algorithms are found to be sufficient enough for visualising the terrain as an artistic sketch. The results of silhouette rendering algorithms that created from topography map using vectorisation technique are giving the same results as the data that taken from the real terrain [16]. By setting the edges as a different type of line and setting different camera projections, the user can get different information from terrain image. The area chosen for this investigation is very important, in order to produce a good terrain image where the hilly area like Gunung Kemerlong is producing a good terrain image rather than terrain that produce from Bukit Tanah Liat. This research may contribute to the many areas such as farming, geographical, environmental, cartography and real estate. All of these areas can apply this research for investigation in any areas in Malaysia in term of terrain information. By using this research, the user can visualise the terrain as silhouette edges as long as they have topography maps for the area. This is one of a main advantage for this research. 7. References [1] Able Software Corp., “Vectorize your scanned maps fast and easy way”, 2004. http://www.ablesw.com/r2v/index.html [Accessed 4/05/2003]

d) Silhouette edges of Bukit Tanah Liat Figure 7.0: Comparison of silhouette edges in different places. The result shows that, all of the terrain in each place seems to produce different results. Each of the places has it own advantage in producing the terrain image as silhouette. Figure 7(a) shows a good result where the silhouette edges shown very clear the slope and breaking slope of the terrain. This is because these areas have a high hill and lower hill. Figure 7(b) and Figure 7(c) also produce good results but in some places of the hill the line are seem to be joining together. Other than that, the line also seems to be close together until the area of the hill look as black area. However the results in Figure 7(d) have a different problem where the silhouette edge is lost in a flat area but for the hill it give a better results.

[2] Bremer, D.J.; Hughes, J.F.; “Rapid Approximate Silhouette Rendering of Implicit Surfaces”, In Proc. The Third International Workshop on Implicit Surfaces, 1998. http://citeseer.nj.nec.com/cache/papers2/cs/1176 8/http:zSzzSzwww.cs.brown.eduzSzpeoplezSzjf hzSziszSzpaper.pdf/rapid-approximatesilhouette-rendering.pdf [Accessed 18/5/2003] [3] Curtis, C.J.; Anderson, S.E.; Seims J.E.; Fleischer, K.W.; Salesin, D.H; ComputerGenerated Watercolor, Computer Graphics (Proceedings of SIGGRAPH '97), Annual Conference Series, pp. 421 - 430. 1997 [4] Datta, A., Parui, S.K., “A robust parallel thinning algorithm for binary images”, Pattern Recognition, Vol. 27, No. 9, pp. 1181 – 1192, 1994. [5] Gooch A.; Gooch B.; Shirley P.; Cohen E.; “A Non-Photorealistic Lighting Model for Automatic Technical Illustration”, Proceeding of SIGGRAPH 98, pp. 447 – 452, 1998.

[6] Green, S.; Salesin, D.; Schofield S.; Hertzmann, A.; Litwinowicz, P.; Gooch, A.; Curtis, C.; Gooch. B.; “Non-Photorealistic Rendering”, SIGGRAPH 99 Course Notes, 1999. http://www.cs.utah.edu/npr/papers/npr_course_S ig99.pdf [Accessed 28/03/2004] [7] Hertzmann, A.; “Algorithm for Rendering in Artistic Styles”, PhD Thesis Department of Computer Science, New York University, 159pp, 2001. [8] Hori, O., Tanigawa,S., “Raster-to-vector conversion by line fitting based on contours and skeletons, Proceeding of the International Conference on Document Analysis and Recognition, pp. 353-358, 1993. [9] Lake, A.; Marshall, C.; Harris, M.; Blackstein, M.; “Stylised Rendering Techniques For Scalable Real-Time 3D Animation”, Graphics Algorithms and 3D Technologies Group (G3D) Intel Architecture Labs(IAL) University of North Carolina at Chapel Hill, 2001. ftp://download.intel.com/ial/3dsoftware/toon.pdf [Accessed 4/12/2003] [10] Liu, J; “Computer Generated pen-and-ink Illustration”, Technical Reports Department of Computer Science SUNY at stony brook, 2001. http://www.cs.sunysb.edu/~jliu/cse528/final_pro j_report.html [Accessed 8/11/2003] [11] Markosian, L.; Kowalski,M.A.; Trychin, S.J.; Lubomir, Bourdev, L.D.; Goldstein, D.; Hughes, J.F.; “Real-Time Nonphotorealistic Rendering”, Computer Graphics (Proceedings of SIGGRAPH '97), Annual Conference Series, pp. 415 – 420, 1997. [12] Northrup, J.D.; Markosian, L.; “Artistic Silhouettes: A Hybrid Approach”, To appear in the proceedings of NPAR 2000, 2000. http://citeseer.nj.nec.com/cache/papers2/cs/1439 0/http:zSzzSzwww.cs.brown.eduzSzresearchzSz

graphicszSzresearchzSzpubzSzpaperszSzsil300dpi.pdf/northrup00artistic.pdf [Accessed 1/11/2001] [13] Raskar, R.; Cohen, M.; “Image Precision Silhouette Edges”, Proceedings of the 1999 symposium on Interactive 3D graphics, Atlanta, GA USA, pp. 135 – 140, 1999. http://www.cs.unc.edu/~raskar/NPR/sil.html [Accessed 3/11/2001] [14] Richens, P.; “Technical Details”, Informatix Software International, 2000. http://www.informatix.co.uk/pir_ajart.htm [Accessed 5/5/2002]. [15] Rossignac, J.; van Emmerick, M.; “Hidden Contours on a Framebuffer”, Proceedings of the 7th Eurographics Workshop on Computer Graphics Hardware, Cambridge, UK, Sept. 1992. [16] Ruzinoor, Che Mat,. ” Effectiveness of Silhouette Rendering Algorithms in Terrain Visualisation”, Proceeding of National Conference on Computer Graphics and Multimedia, 2002. [17] Saito, T.; Takahashi, T.; “Comprehensible Rendering of 3D Shapes”, Computer Graphics (Proceeding of SIGGRAPH '90), 24(4), pp. 197 – 206, 1990. [18] Sousa, M.C.; Buchanan, J.W.; “Computergenerated graphite pencil rendering of 3D polygonal models”, Computer Graphics Forum, 18(3), pp. 195 – 207, 1999. [19] Zenzo, S.D., Cinque, L., Levialdi, S. (1996),”Run-based algorithms for binary image analysis and processing, IEEE Transition PAMI, Vol. 18, No. 1,pp. 83-89.