Invent Civil

Civil Engineering news, technology, and opinions

26 Nov, 2008

Img2cad vs Wintopo – A Study in Vectorization

Posted by: Skylar In: Civil3d|technology

A short while ago, I posted about “Wintopo”, discussing how well it converts an image to a vector file for use in AutoCAD.  Since I was getting mixed results (particularly for more complex plans), I thought I’d do a little comparison between two different programs to see if I could get some more usable results.

The drawing I will use in this analysis can be found through a simple google search for “stormwater drawing”.  Here’s a thumbnail of the image:

Example SWM Plan

I chose this drawing because it’s a practical example, and also because the plan is large and complicated.  As such, there should be lots of room for discussion.

Step 1: Conversion using default settings

Starting out using only the default settings for the two programs seems like the most logical place to start.  Using Wintopo’s “one-step vectorization”, I retrieved a beautiful dxf file along these lines:


Using all the default options in img2cad, I came up with this drawing:


Now, both drawings look almost identical to the original when you just see a thumbnail from far away.  So, let’s look at one particular example – the property line on the south side of the site.  Here’s the line created by Wintopo:


And by img2cad:


Img2cad’s results had a tendency to provide slightly more consistent lines, compared to Wintopo’s more choppy results.  However, the difference is almost unnoticeable.

Step 2: Adjusting tolerances

Probably the most significant difference between the two programs is the amount of lines created during the vectorization process.  From the img2cad program, my drawing contained only 83400 polylines.  For the Wintopo results, the drawing had over 307800 polylines.  As such, I tried to adjust some of the tolerances within Wintopo to decrease the amount of polylines produced.  As it turns out, I was unable to get a vectorization for this drawing with significantly less than 300,000 polylines in wintopo.

When I adjusted the tolerance in the img2cad options, I noticed that with higher tolerances, the results no longer matched the original shape of the drawing.  To get the most accurate results, it is probably best to leave the value relatively close to the default tolerance.

Step 3: Working with what we have:

So, in both cases the greatest downfall to vectorization is the large amount of small, choppy lines that are created from stray pixels in your original image.  As such, I thought it would be interesting to try a lisp routine that removed all polylines under a certain length.  I downloaded the routine “tlen.lsp” from this page, and modified it to do what I wanted.  Click here to see the revised routine: LENDEL (1.08 KB).  Now, here is the difference before and after the lisp routine:

Wintopo – Before:




Img2cad – Before:





It seems that it’s not just the program that dictates the final results in vectorization.  Both programs provided similar results – results that still require a lot of cleanup before they can be used in any practical way.  That said, vectorization may prove handy if you want some reference points to use to snap to, or perhaps in the rare case where your drawing doesn’t require a straight, defined line.

As far as the two programs go, it seems like simplicity wins out.  Img2cad is clearly the more simplistic program to use, and it’s default settings seem to provide more usable results.  The more continuous lines are also more useful in conjunction with the lisp program that I used.  That said, there is certainly a list of wintopo features that I did not even consider.  Wintopo offers a large degree of customization, as long as you’re willing to spend the time figuring out how to go about it.

No Responses to "Img2cad vs Wintopo – A Study in Vectorization"

Comment Form


This site is dedicated to providing interesting and helpful articles and resources for people in the Civil Engineering field.

The articles presented on this site represent my own personal opinions and not those of my employer. All information, links, and downloads on this site are for general information only, and are provided as-is without warranty.