What tolerances can you expect from raster to vector conversion?

When we sold raster to vector conversion software we were sometimes asked whether our software would convert to tolerances of hundredths, or even thousandths of an inch.

To get an idea of the tolerances that are possible, we created a drawing of a 1" square (25.4 mm) in CAD. We printed it out onto smooth high quality paper using a laser printer, scanned the printed square at 200, 400 and 600 dpi using a desktop scanner, vectorized it, imported it back into our CAD program and measured the results.

Here are the measurements:

    200 dpi     400 dpi     600 dpi  
  Horizontal     0.9900000"     0.9912500"     0.9908333"  
  Vertical     1.0000000"     0.9987484"     0.9981235"  

The most accurate result we got was exactly one inch. The least accurate result we got was 0.9900000" (25.146 mm), so the error in this very small experiment varied between +/- 0" and 0.01" (0.254 mm).

This indicates that tolerances of thousandths of an inch are out, and even if you want tolerances of hundredths of an inch you are pushing it.

Further, the results above were created under ideal circumstances. In real life, as the proverb says, there's many a slip 'twixt cup and lip. Or, in this case, 'twixt original and vectorized image.

The following are all potential slips:

  • The accuracy of the original drawing itself, or of the item being scanned.
     
  • If you are scanning a drawing, the state of the drawing. For example, if it has undergone stretching or shrinkage in storage, or has been folded, or if parts of it are obscured by coffee stains, its accuracy will be reduced.
     
  • If you are scanning a physical item, shadowing. Shadowing obscures the item's true boundary. See this article for some suggestions on how to deal with shadowing.
     
  • The accuracy of the scanner. Large format scanners are prone to accuracy errors if not calibrated frequently. Further, different paper types pass through scanners at different speeds, resulting in accuracy errors along the scan.
     
  • The skill and care with which the drawing or part is scanned. If it is scanned skew, or with an inappropriate settings, accuracy will be reduced.
     
  • The threshold setting. The threshold setting you use when scanning will determine the thickness of scanned lines and the exact size of any scanned part in the scan. For example, consider the following:
     
    Scanned part   Zoomed view of scanned hole
    a) A section of a scan of a part.   b) A zoomed in view of the hole outlined in red in (a). The hole has some shadowing and its edge is not cleanly demarcated.
     
    Thresholded hole   Thresholded hole
    c) The hole thresholded using a value of 156.   d) The hole thresholded using a value of 250.
     
    Vectorizations    
    e) Vectorizations of (c) and (d) superimposed over the original scan. The two different threshold settings have resulted in two differently sized vectorizations of the hole.
     
       
  • The scanning resolution. For example, if you scan at 200 dpi, each pixel in your scan will be 1/200 or 0.005 of an inch. This means that if your scan or vectorization is out by just one pixel, there is already an error of .005 of an inch.

Although our little experiment showed that tolerances of a hundredth of an inch may be within the bounds of possibility under perfect circumstances, raster to vector conversion is not really suitable for high tolerance applications. There are just too many opportunities for error.