You are here: Technology Digitization Сontour lines digitization

Сontour lines digitization

Rate this item
(1 Vote)

Construction of 3D-terrain model - a frequent problem. As a rule, the starting materials are the topological map in one form or another. Getting out of these materials mathematical basis for building 3D-models is quite a laborious task. Fortunately, most of the work can be automated using Easy Trace Pro.

Any chain is as weak as its weakest link. A Process flowsheet is just a chain. Let us consider and strengthen the links!

Vectorizing of contour lines consists of:

  1. Extraction of a black-and-white image;
  2. Vectorizing;
  3. Deletion of vector "rubbish";
  4. line sewing together across gaps;
  5. Topology correction;
  6. Shape correction;
  7. line form optimization;
  8. Elevation (Z) input.
But this is a rough description only. Many additional fine points are skipped. Let us consider every stage in more details.

Extraction of a black-and-white image

We want to get a black-and-white image containing isoline segments of maximal possible integrity (length) and free of noise and line adhesion.


  1. A high-quality image (16M colors, 400-600 dpi, neither too light nor dark, lossless saving as a TIFF file with LZW compression).
  2. Vector objects – relief elements (cliffs, escarps, scours) vectorized manually. Band polygons are formed around cliffs that absorb the «battlement».
  3. Optionally – grid lines extracted from the «black» image.

Method of cooking:

  1. Make sure that the color image is a high-quality one indeed. This file can not be less than 100Mb otherwise something is wrong with the image - low resolution, or 256 colors only, or JPEG compression. If that is the case, emergency measures should be taken (as it was done in the video-example – JPEG, 300dpi, 21Mb).

    The measures include image multiplication by 2 (resample up with interpolation). It does not add information but enables use of main tools for image editing. If there are only 256 colors in the image palette, the color mode should be changed for True Color (16M colors). The file will increase up to 500-800 Mb but the result is worthy of it. New image positioning (registration) will be necessary after resampling (but the latest ET versions allow resampling of already registered image in the Project directly).

  2. Make a copy of the image. All extractions will be based on copies and the registered source image remains inviolable.
  3. First operation – divide the window in four zones and place there most Problematic parts of the map (as it is shown in the Vectorizing of polygons in Easy Trace Pro). These may be most light and dark areas e.g., isolines against green background of the wood and crossing points of isolines and grid lines. The scale should be sufficient for discerning of individual pixels.
  4. Second operation – blurring. The better is the image, the smaller are mask diameter and factor. The goal is to average the color and delete holes in the lines.
  5. Third operation (optional) – Contrast Enhancement of the target color (red in our case). This operation is recommended for images containing a lot of light lines. Mask size should be equal to line width at factor 100-300. Increase the diameter if clearings appear within thick lines.
  6. First suppression of the background with the Subject Layer Extraction Tool ("Red" channel). Select white color for replacement of background pixels. Switch off all controllers but the target channel. Move both sliders to the rightmost position. The screen becomes white. Now click the lower slider and rotate the mouse wheel AWAY FROM YOURSELF. The sliders move to the left together.

    The goal is to delete "unjustified" gaps in lines - ones that are not caused by intersections with objects of other colors. Ignore all artifacts of non-target colors.

    After that, start to rotate the mouse wheel TOWARD YOURSELF to move the lower slider to the right. The goal is to delete some of the artifacts but to preserve integrity of contour lines.

    Switch the target channel off and the brightness channel on. Specify the borders of the range to be extracted from top (light background) and bottom (black lines). Be sure that holes do not appear in thick contour lines (it happens against the green background usually).

    Switch the brightness channel off and the green channel on. The sequence of operations is similar to one for brightness. The same for the blue channel.

    Don't pay attention to line adhension at bottlenecks - we shall correct it later.

    Switch on ALL channels at once. Find optimal positions of sliders (delete "unjustified" gaps). Switch the channels off in turn to find out which of them is responsible for a gap. Start filtering and select its parameters. Correct position of every slider once again and click the Apply button.

  7. If separation of lines and "rubbish" is poor (a lot of blue or green artifacts remained), apply the same tool in the "Substitute object pixels" mode to delete the rubbish. The target color will be blue or green of course. Additional channels work conversely in this mode - they Protect light and dark areas or areas with a specified range of a non-target channel.

    It is necessary sometimes to delete green, blue, or gray "rubbish" separately (but it is not the case of a high-quality image).

  8. Blurring again to dissolve small artifacts (fringe on line ends in particular) and to fill casual holes.
  9. Separation of agglutinate lines. Apply Unsharp Mask at mask radius = 2/3 of thick lines' width and mask factor sufficient for clearing of zones between lines.
  10. Repeat extraction of the target channel.
  11. Apply Subject Layer Extraction to "kill" all colors but black and white. Substitute object pixels for black ones for the brightness range 0-254
  12. Save in the black-and-white color mode.
  13. Image inversion.
  14. Image thinning.
  15. Rasterize manually vectorized relief elements (and grid optionally) to delete Problematic areas from the image.
  16. Apply Mask Filtering, the strategy «Large garbage removal» up to objects as large as 4x4 (switch off larger masks). You may also try the «Thin isolines» strategy depending on the image.

Automatic vectorizing and preparing for manual shape correction

The object is to trace automatically long contour lines, to delete noise, adhesions, branches, vectorized inscriptions, to sew up gaps and adjust contour lines with relief elements.


  1. The thinned black-and-white image with deleted remains of relief elements;
  2. Vector objects – relief elements. Band polygons around cliffs are needless any more.

Method of cooking:

  1. Automatic vectorizing within the Project frame. The width of raster lines should be specified for the color image you used to extract the thinned black-and-white one.
  2. Sew together most reliable segments of lines. Specify the layers of relief elements as barrier ones at the «short-distance» breakups joining. Search distance should be 2-3 line width, and angle of line convergence 140 deg.
  3. Vector line filtering to delete "branches", "bridges", "strokes", "loops". Specify parameters for every artifact type in the following way:
    • select the type of artifact;
    • specify minimal possible values of parameters;
    • specify examples on the screen.
    It is better to input sift parameters individually - switch off all types of artifacts but the current one. Fulfill filtering several times successively until the utility finds no more artifacts.
  4. Topology Correction - drag line ends to the Project frame and relief elements.
  5. «Long-distance» breakups joining. Gap length 100-150 px, angle of line convergence up to -20 deg. It will join rubbish artifacts and wrong joinings will become evident. The lines are ready for final shape correction.

Final optimization of line form, preparing for input of Z-values

The object is to find and correct mistakes, gross violation of line shape and wrong joinings as well as to delete remaining artifacts and optimize line form.


  1. Vector contour lines sewed together across gaps;
  2. Vector objects – relief elements, Project frame;
  3. Topology Check-up utility – search for incorrect structure of isolines;
  4. The Eraser Tool – correction of broken integrity;
  5. Camber Tool – correction of shape defects.

Method of cooking:

  1. Apply the Topology Check-up utility to find and mark «Dangling nodes» and «Nodes of degree more or equal 3». Layers of the Project frame and relief elements should be specified as reference ones. The «Dangling nodes» test may result in too many error marks. It is recommended for Projects with few unclosed supplementary contours.
  2. Review the marks and correct errors with the Eraser. Sew together gaps that are obviously unfit for automatic breakup joining but do not waste time for the rest.
  3. breakup joining, Topology Correction to drag line ends, repeated check-up and correction.
  4. When topological errors are removed, select the Inspector Tool and correct gross shape defects applying the Eraser and the Camber Tools. To avoid unnecessary work, you may fulfill line Form Optimization and then use the UNDO – REDO commands to appraise the defects to be corrected.
  5. (Attention! The AutoSave operation makes it impossible to cancel results of line Form Optimization. Prepare beforehand a copy of the layer with all the objects!)

  6. Final optimization should be done after shape correction only.
More in this category: « Prev

Add comment

Security code