This action might not be possible to undo. Are you sure you want to continue?

7, October 2010

Vectorization Algorithm for Line Drawing and Gap filling of Maps

Ms.Neeti Daryal Lecturer,Department of Computer Science, M L N College, Yamuna Nagar

Dr Vinod Kumar Reader,Department of Mathematics J.V.Jain College,Saharanpur

Abstract

Vectorization, i.e. raster-to-vector conversion is heart of graphics recognition problems, as it deals with converting the scanned image to a vector form suitable for further analysis. Many vectorization methods have been designed. This paper deals with the method of raster-to-vector conversion which proposed for capturing line drawing images. .In the earliest works on vectorization, only one kind of method was introduced. The proposed algorithm combines the features of thinning method and medial line extraction method so as to produce best line fitting algorithm. There are several steps in this process. The first step is Pre-processing, in which find the line into original raster image. Second is developing an algorithm for gap filling between the adjacent lines to produce vectorization for scanned map. Result and Literature about the above mentioned methods is also included in this paper. Key Words: Vectorization, Gap filling, Line drawing, Thinning algorithm, Medial algorithm

1. INTRODUCTION Graphics recognition is concerned with the analysis of graphics-intensive documents, such as technical drawings, maps or schemas. Vectorization, i.e. raster-to-vector conversion, is of course a central part of graphics recognition problems, as it deals with converting the scanned map to a vector form suitable for further analysis. Line drawing management systems store visual objects as graphic entities. Many techniques have already been proposed for the extraction and recognition of graphic entities from scanned binary maps. In particular, various raster-tovector conversion methods have been developed which convert image lines

into vector lines automatically. In this paper, a new raster-to-vector conversion method is proposed for capturing highquality vectors in a line drawing. Bitmap Image: Vector Graphic:

Figure 1[1]: Raster Vector Graphics

Figure1[2] Graphics

There are two kinds of computer graphics - raster (composed of pixels)

253

http://sites.google.com/site/ijcsis/ ISSN 1947-5500

(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 7, October 2010

and vector (composed of paths)[1]. Raster images are more commonly called bitmap images. Vector graphics are called object-oriented graphics as shown in Figure 1[2].

edges of the shape) before the medial axis between the two side edges is

2. NEED OF VECTORIZATION

In general, vector data structure produces smaller file size than raster image because a raster image needs space for all pixels while only point coordinates are stored in vector representation [3]. This is even truer in the case when the graphics or images have large homogenous regions and the boundaries and shapes are the primary interest.

3. RELATED

Figure 2: Defects of the thinning method

WORK

Vectorization techniques have been developed in various domains and a number of methods have been proposed and implemented. These methods are roughly divided into two classes: Thinning based methods and Nonthinning based methods [4]. Thinning based methods are applied in most of the earlier vectorization schemes [4]. These methods usually employ an iterative boundary erosion process to remove outer pixels until only onepixel-wide skeleton remains like “peeling an onion” [5]. A polygonal approximation procedure is then applied to convert the skeleton to a vector, which may be a line segment or a plotline. The thinning method tends to create noisy junctions at corners, intersections, and branches as shown in the Figure 2[6]. Among the non-thinning based methods. Medial line extraction methods, surveyed in were also popular in the early days of vectorization [7]. Methods of this class extract image contours (the

found. The midpoint of two parallel lines is given by the midpoint of a perpendicular line projected from one side to the other, and these midpoints are coordinates which represent vectors [5].The medial line extraction method often misses pairs of contour lines at branches as shown in Figure 3[6] consequently it fails to find the midpoint of parallel lines [8].

Figure 3: Defects of the medial line extraction method

Other classes of non-thinning based methods that also preserve line width have been developed recently [5]. These include run graph based methods mesh pattern based methods and the Orthogonal Zig-Zag (OZZ) method. These methods are not included in this paper. We are working with above said two methods only. The disadvantages of thinning based methods and medial line extraction

254

http://sites.google.com/site/ijcsis/ ISSN 1947-5500

(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 7, October 2010

methods lead to a failure in fitting a line properly. But the thinning method is able to maintain connectivity but loses shape information. Interestingly, the medial line extraction method has the complementary features; that is, it maintains shape information but tends to lose line connectivity. In combination, they could be realized; good-quality extracted lines could be obtained.

(1) Linking short line Segments longer integrated ones.

into

(2) Correcting the defects at junctions. (3) Modifying vector attributes such as endpoints intermediate points and line width. Linking short line segments into longer ones may yield the correct line width and overcome some junction problems. Other defects at junctions, such as corners and branches are subject to special processing [9]. The precise intersection points. i.e. the endpoints of the vectors, are calculated. The combination has several steps in this process. The first step is preprocessing in which find the line into original raster image. Second is Gap filling between the adjacent lines.

4. PROPOSED

VECTORIZATION PROCESS

The following is an implementation of the line fitting concept. The purpose of the particular method has been carefully designed to offer practical performance with both acceptable processing speed and good vector quality. Figure 4 shows a flowchart for the whole procedure [5].

4.1 PREPROCESSING

• A scanned line drawing is converted from binary raster image data to run length code data. Processed into skeletons and Tracked for contours. Each skeleton fragment is linked to neighboring contour fragments. Processed into skeleton and contour fragment respectively.

• • •

4.2 GAP FILLING

Figure 4: Flowchart of line fitting method based on contours and skeletons

Basic vectorization following tasks:

requires the

In a contour image the contour lines are split and the different contour levels are written in the gap. This causes problems in automatic vectorization of images. Since the text are erased and not taken into account while vectorizing, the final

255

http://sites.google.com/site/ijcsis/ ISSN 1947-5500

(IJCSIS) International Journal of Computer Science and Information Security, Vol. 8, No. 7, October 2010

output has gaps in between lines. Gaps are also produced due to noise. Thus gap filling should be given prime importance after processed into skeleton and contour fragment respectively. A poor-quality line drawing often has gaps which prevent correct vector extraction [10]. Following algorithm shows the steps for gap filling ALGORITHM Step 1: Reading the input and getting the x and y coordinates of the line. Step2: Get x and y coordinates of the endpoints. Step3: Find distance between endpoints. After finding the end points we find the distance between the end points using the Euclidean distance formula which can be mathematically represented as, D = p(x1 − x2)2 + (y1 − y2)2 Where D is the Euclidean distance and (x1, y1) and (x2, y2) are endpoints. Step 4: IF distance < threshold then set the threshold otherwise stop. Step5: Setting the threshold. Step6: Get the x and y coordinate of end points and five adjacent points corresponding to the line then we get the x and y coordinate of the end points that have distance that is less than the set threshold. Step7: Check if any of the distance are equal then we go to step 8 (slope function) otherwise go to step 9 (Least Square Parabola). Step8: Slope Function Step9: Least Square Parabola fitting.

Using these coordinates we perform least square parabola fitting to get the values of the coefficient, a, b and c. Using the values of a, b and c and the x coordinates of the two lines we can get an approximate value of y. There are other cases where we can directly extend the line and we do not have to approximate the curve. The X and Y coordinate are chosen based on four cases as shown below. Let us consider that (x1, y1) and (x2, y2) are the end points of two lines whose distance is less than the threshold value. Consider Figure 6, the end points are highlighted in red. Here we can see that x1≠ x2 and y1 ≠ y2 and x1 ≠ y1 and x2 ≠ y2. In this case since x ≠ y we cannot connect it using a straight line and so we will use Least Square parabola to interpolate the points in between the endpoints. Using the x and y coordinates of the two lines we get the value of a, b and c using the steps explained in the above section. After we get the values of a, b and c we increment minimum value of x by 1 until it reaches maximum value of x and substitute the vale of x in the following equation to get the corresponding y value,

Figure 5: Example of Gapfilling

256

http://sites.google.com/site/ijcsis/ ISSN 1947-5500

interpolate and get the x coordinate to get the corresponding y coordinate.

5. Results

The result obtained has been shown using all the foresaid discussed methods displayed in the form of results as follows. Figure 8 is the scanned image and Figure 9 the corresponding gap filled image. Since this is an iterative process all the gaps that are within the threshold are filled.

Figure 6: Case 4: Gap Filling f(x) = a + bx + cx2 Where f(x) = y. The least squares line method uses this equation to get the parabola graph. After getting the value of y we approximate the number to a natural number. The condition for approximation being that if the decimal value is greater than or equal to 0.5 then it is approximated (rounded) to the next number and if it is less than 5 then it is approximated to the real number. For example if the value of y is 4.75 then it is approximated to 5 and if the value of y = 4.30 then it is approximated to 4. An example of gapfilling of this case is shown in Figure 7.

Figure 8: Contour Image with Gap

Figure 9: Gap Filled Contour Image

6. CONCLUSION

Figure 7: Example of Gapfilling Rounding the number or approximating is only done for raster images and not for vector data since there is no need to rasterized the curve. LSP is used only for case four because in the other cases we get the exact coordinates by just extending the line and we do not have to In this paper, we have discussed the line formation, which has been done through the combination of line fragment and contour fragment algorithm for building a vectorization method which leads to filling the gap between the lines. More specifically, the gap between the lines have been filled by Least Square

257

http://sites.google.com/site/ijcsis/ ISSN 1947-5500

Parabola fitting algorithm This resultant of this method has been applied for the correction of scanned map, shown as Figure 8 & 9.

6. REFRENCES

[l] J.Jimenez and J .L.Navalon, “Some experiments in image vectorization,” IBM J. Res. Develop. 26, pp.724734(1982) [4] R.O.Duda, P.E.Hart, “Use of Hough transformation to detect lines and curves in pictures,” Commun.ACM, 15, 1, pp.11-15(1972) [5] J. Jimenez and J.L. Navalon, -‘Some Experiments in Image Vectorization’ , IBM J. Res. Develop. 26, pp724-734, 1982. Smith R.W. (1978). Computer processing of line images: A survey. Pattern Recognition x; 20(1):7-15.

[2]

[7] Kasturi, S. T. Bow. W. El-Masri. J. Shah, J. R. Gattiker, and U. B. Mokate; ”A System for Interpretation of Line Drawings”, IEEE Trans. on PAMI, 12( IO), pp978-992, 1990. [8] Borgefors. Distance Transforms in Digital Images. Computer Vision, Graphics and Image Processing, 34:344371, 1986. [9] J.Canny. A Computational Approach to Edge Detection. IEEE Transactions on PAMI, 8(6):679-698, 1986.\ [10] R.W. Smith, “Computer Processing of Line Images: “A Survey”, Patteni Recognition, 20( l), pp7-15, 1987.

[3] R.Kasturi, S.Siva, and L.O’Gorman, “Techniques for Line Drawing Interpretation: An Overview,” Proc. IAPR Workshop on Machine Vision Applications, pp. 15 1-160( 1990) [4] H.Tamura, “A Comparison of line thinning algorithms from digital geometry viewpoint,” Proc.4th Int. Jt Conf. on Pattern Recognition, Kyoto, Japan, pp715719, IEEE(1978). [5] F.Chang, Y.-C. Lu, and T. Pavlidis. Feature Analysis Using Line Weep Thinning Algorithm. IEEE Transactions on PAMI, 21(2):145-158, Feb. 1999. [6] Tainura, “A Comparison of Line Thinning Algorithms from Digital Geometry Viewpoint”, Proc. of 4th hit. Jt. Conf. on Pattem Recognition. Kyoto. Japan, pp715-719, 1978.

258

http://sites.google.com/site/ijcsis/ ISSN 1947-5500

- Journal of Computer Science IJCSIS March 2016 Part II
- Journal of Computer Science IJCSIS March 2016 Part I
- Journal of Computer Science IJCSIS April 2016 Part II
- Journal of Computer Science IJCSIS April 2016 Part I
- Journal of Computer Science IJCSIS February 2016
- Journal of Computer Science IJCSIS Special Issue February 2016
- Journal of Computer Science IJCSIS January 2016
- Journal of Computer Science IJCSIS December 2015
- Journal of Computer Science IJCSIS November 2015
- Journal of Computer Science IJCSIS October 2015
- Journal of Computer Science IJCSIS June 2015
- Journal of Computer Science IJCSIS July 2015
- International Journal of Computer Science IJCSIS September 2015
- Journal of Computer Science IJCSIS August 2015
- Journal of Computer Science IJCSIS April 2015
- Journal of Computer Science IJCSIS March 2015
- Fraudulent Electronic Transaction Detection Using Dynamic KDA Model
- Embedded Mobile Agent (EMA) for Distributed Information Retrieval
- A Survey
- Security Architecture with NAC using Crescent University as Case study
- An Analysis of Various Algorithms For Text Spam Classification and Clustering Using RapidMiner and Weka
- Unweighted Class Specific Soft Voting based ensemble of Extreme Learning Machine and its variant
- An Efficient Model to Automatically Find Index in Databases
- Base Station Radiation’s Optimization using Two Phase Shifting Dipoles
- Low Footprint Hybrid Finite Field Multiplier for Embedded Cryptography

Sign up to vote on this title

UsefulNot usefulVectorization, i.e. raster-to-vector conversion is heart of graphics recognition problems, as it deals with converting the scanned image to a vector form suitable for further analysis. Many vectori...

Vectorization, i.e. raster-to-vector conversion is heart of graphics recognition problems, as it deals with converting the scanned image to a vector form suitable for further analysis. Many vectorization methods have been designed. This paper deals with the method of raster-to-vector conversion which proposed for capturing line drawing images. .In the earliest works on vectorization, only one kind of method was introduced. The proposed algorithm combines the features of thinning method and medial line extraction method so as to produce best line fitting algorithm. There are several steps in this process. The first step is Pre-processing, in which find the line into original raster image. Second is developing an algorithm for gap filling between the adjacent lines to produce vectorization for scanned map. Result and Literature about the above mentioned methods is also included in this paper.

- CP0450_01-Aug-2011_RM01
- mca2_4
- Computer Graphics Lec_1
- Computer Graphics Lab 3
- BT9301, Computer Graphics
- Recursion-projectAlgorithms, Recursion and Induction- Euclid and Fibonacci
- 9fcfd50de27096d036
- DAA Imprt Qns
- 1-s2.0-S1434841110001986-main
- Primswithtable Examples
- 00 Overview
- DFA Minimizing State Machines Using Hash- Tables
- V.kartHIKEYAN Published Article4
- Edmonds Karp
- Algorthim Concept
- 1988 - The World’s Fastest Scrabble Program
- 10.1.1.50
- SI-LS 2008-09 - Group 15 - Sorbini, Savioli, Reale - Presentation Slides
- aos-5
- V2I210
- Algo cybernetics
- Proceeding of the 3rd International Conference on Informatics and Technology,
- 10.1.1.110.7614 (1)
- Propose System1m
- Fall05-ShortestPaths
- Paper 3
- 028
- A MPI Parallel Algorithm for the Maximum Flow Problem
- File Format Help Sheet 2
- Big O Notation
- Vectorization Algorithm for Line Drawing and Gap filling of Maps