Technology
Digitization
Color separation
Image
preprocessing
Useful hints
 
Go to Forum
ÔÎÐÓÌ
edition of 14.02.05
Digitization of graphs in Easy Trace PRO

Coordinates of every point in a vectorized graph should correspond to the value the point has in the graph considering the scale. In this connection, three tasks emerge:

  1. To digitize the graph.
  2. To transform coordinates so that they correspond to the values they represent in the graph (considering the scale).
  3. To export coordinates of the points into a text file.

Step 1. Raster transformation
Step 2. Project creation and graph digitizing
Step 3. Coordinate transformation

About source data
The indexed (256 color) Graph.tif file scanned at 200 DPI resolution is taken as an example.


Load image GRAPH.TIF (ZIP-archive)
Step 1. Raster transformation

Let us load the source image Graph.tif to Easy Trace.

It is necessary to align the image first of all - its scale bar must be parallel to the image axis. Apply the ALign command to achieve it. Use the black vertical lines for alignment - they must be parallel to the side of the project frame.

A grey-scale source image must be converted into the Mono color mode for further semiautomatic digitizing. How to preserve image quality at this operation as far as possible? Let us apply the Contrast Enhancement tool first to make all black lines distinct but leave as little "rubbish" as possible on the white background. Try to make black lines 1-3 pixels wide. Now the image may be converted into a black-and-white one ("Mono" color mode) and then inverted.

Poor quality of the image causes numerous "adhering peaks " which impend automatic tracer passing along the graph. Apply Raster Filtering to improve the image - select the "Peak" strategy in the corresponding dialog box and click the "Run" button to start the operation. You may also correct the image manually (the Brush tool).

 

Image Filtering (the"Peak" strategy).

 

  Added pixels
  Deleted pixels

Save the prepared image as graph_mono.tif. If your source image was a color one, read about its preprocessing in the Digitization of color rasters article.

Step 2. Project creation and graph digitizing.

We recommend to attribute every graph to an individual layer. To create a new layer, apply the Add Vector Layer command in the Project Layer Settings dialog box.

Vectorize every graph in the semiautomatic mode.

It is better to select the "Winding lines" strategy for line form optimization

Step 3. Coordinate transformation.

Coordinates of every point in the graph must correspond to the correct value considering the scale. The simplest way to get a text file of transformed coordinates is to export them into the CSV format. As the graphs are attributed to different layers, an individual file will be generated for every curve.

Coordinate transformation itself may be done in two ways:

  1. applying external file of control points;
  2. applying a specialized layer of control points.

 

Export at external file use.

As an example, let us consider coordinate transformation for the two curves related to the scale bar (0;80). To transform coordinates, apply three (ore more) points that don't belong to a straight line.

First of all, place the cursor on the scale bar - on the point marked "0" and then "80". Write down coordinates shown in the lower left corner of the project. In the example you may load from our side, coordinates of the point 0 are (45;23), and 80 - (60;23).

We are ready now to create a CPT-file (an external file containing coordinates of reference points before and after transformation). Make the Transform.CPT file, open it with the Notepad, and input the following:

45 23 0 0
60 23 80 0
45 28 0 5

It means:
point (45;23) will be transformed into (0;0);
(60;23) - into (80;0);
(45;23+5) - into (0;5).

Five is an arbitrary value - you may take any other (on condition that Y-coordinate remains within the project frame). The file specifies a shift of the coordinate system and stretching along the X-axis.

If the vertical scale unit differs from mm (for example, 1 mm corresponds to 6 units of the vertical scale) , the (45;23+5) point must be transformed into (0;5*6), i.e.:

45 23 0 0
60 23 80 0
45 28 0 30

Export our digitized graphs to the CSV-format. Click the "Transform coordinates using control points from the file" option on the Transform page and select the created Transform.CPT file.

 

 
Export at control point layer use
1. Add an additional vector layer and name it Control points. Make a point database for this layer and insert in it two fields of Numeric or Float type called _X_CPT_ and _Y_CPT_. These fields will contain coordinates of control points in the target system.
 

2. Input point object just on the marks 0 and 80, and attribute them to the Control points layer. Fill the database fields: point 0 (_X_CPT_ - 0; _Y_CPT_ - 0 ) and point 80 (_X_CPT_ - 80; _Y_CPT_ - 0 ). To input one more point object, specify its coordinates in the Coordinates field: (X0;Y0+5) ( X0;Y0 – coordinates of the point 0). Five is an arbitrary value - any number will do if it is comparable with the image size along the Y-axis.
Attributes of the third point:

  • if the scale along the Y-axis is unknown, we consider the unite equal to 1 mm. Then (_X_CPT_ - 0; _Y_CPT_ - 5 )
  • if the unit of the Y-axis is not equal to 1 mm (for example, 1 mm corresponds to 6 units of the scale), then (_X_CPT_ - 0; _Y_CPT_ - 6*5 )

3. Export the curves to the CSV-format. Click the "Transform coordinates using control points from the layer" option on the Transform page and select the Control point layer

 

Note.
The scale in our example is linear. And if this is not the case (see example on the right)?

This scale may be processed as a logarithmic one. A common logarithm will correspond to every mark of the scale. Resulting CSV-files will also contain common logarithms of true values. The last may be calculated as X = .

 

So, to process this curve, we repeat all the operations described above but coordinates of the 1,0 mark – (X1;Y1) will be associated with (0,0) – origin of the scale, and coordinates of the 1000 mark – (X1000;Y1000) - with (3,0), as = 1, and = 1000. Dependence along the Y-axis remains linear, and thus the third point (X1;Y1+5) must be transformed into (0;5) – we consider that the axis begins at the 0 point and its unite is mm.

NOTE! If several scales are used in the project, an individual layer (or file) of control points should be done for each of them. Export of curves related to different scales should be done separately, applying relevant layer (file) for transformation.

Home | About | News | Products | Technology | Download
 

Easy Trace Group
Copyright © 1993, 2007 Easy Trace Group. Send all questions and comments regarding
this site's construction to webmaster@easytrace.com