﻿ Barycentric

The Barycentric transformation - Practical Example

In this section we'll explain how to perform the Barycentric transformation with CorrMap (please refer to section Basic concepts | Barycentric for the concepts and the algorithm). To do so, we will follow a practical example. So let's start a new CorrMap project as explained in section Basic Operations[****]| Starting a new project and select the MAP3.PNG file from the CorrMap samples folder (see section Getting started | Samples and demo version). The map will be opened in CorrMap, we then select the Grid transformation in the menu on top as shown in Fig. TR.B1 (1) and we are ready to start.

Fig. TR.B1 – A new map ready for the Barycentric transformation.

This is the same map we used for the Grid transformation example in section Transformation | Grid even though we have cropped the area to which we are interested in. For a clearer explanation we have drawn on the raster some red circles indicating the map points that correspond to building edges that we have found and surveyed in the field (Fig. TR.G2 and Fig. TR.G3 in section Transformation | Grid). In fact, as we mentioned in section Basic concepts | Barycentric this transformation is a preferable alternative to the Affine technique when you can't rely on grid points in the map (because they're not present), or you don't want to rely on them (because you think they're not reliable).

So, in this example we will perform the geo-referencing based on the survey "local coordinates" as defined in point 1 of paragraph How to trace the map boundary back on the field in section Transformation | Grid. Therefore, once you have surveyed the points, all you have to do is to calculate their local coordinates, using your topographical software as shown in Fig. TR.B2 (*), and then export the values in a CSV file format.

Fig. TR.B2 – The local coordinates of the surveyed points.

 (*) The tables and calculations reproduced above come from the software Geocat, another of Tecnobit's topographical programs which interact with CorrMap.

The CSV is a very popular text format which simply provides a row of data for each point, containing the values separated by comma: point-name, X, Y, Z. Here is the file MAP3_BARYC.XYZ for our example:

100,0.000,0.000,0.000

1,-7.734,69.142,-2.263

2,19.479,-38.450,4.997

3,-87.839,-94.047,-5.959

4,-96.650,-97.222,-6.397

5,-135.987,-35.301,-11.671

6,-151.987,44.055,-14.438

7,-152.831,49.329,-14.064

Almost all topographical software exports this format, but if this is not the case, you can easily type it yourself using a normal text editor, such as Windows Notepad. Once you have obtained the CSV file, you only need to rename its extension as .XYZ which is the type of file CorrMap is looking for.

Well, with the coordinates XYZ file ready to use, we can start the Barycentric transformation by clicking the Reference point button on CorrMap toolbar (2 in Fig. TR.B1). This command allows you to click the raster points on which to calculate the geo-referencing. So let's zoom in the first of the 7 reference points in the map, the number 1 on top-right. Once the point has been clicked, the window shown in Fig. TR.B3 appears, asking us for the survey coordinates. We can type the values in the E/N cells if we want, alternatively we can click the From File button and select the BARIC.XYZ file (listed above). This way, the points contained in this file are listed in the drop-down cell on the bottom-left and we can simply select a point, n. 1 in this case, so that its coordinates will be automatically assigned to cells E/N.

Fig. TR.B3 – The insertion of a building corner needed to link the map to the real survey point.

Once we confirm the point by clicking OK on the window, we’ll see a blue X appearing on the map and the row shown in Fig. TR.B4 in the Reference points table of the Output window.

Fig. TR.B4 – The point is defined by a blue X on the map and a row of data in the Reference points table.

This row contains the following data:

Point: a progressive number assigned to each inserted reference point.

East/North raster: the raster coordinates, i.e. the distances in pixels for both directions between the point and the raster origin, the low-left corner of the raster image.

East/North real: the survey coordinates that we assigned to the reference point.

At this stage, all we have to do is to repeat the operation for the other reference points (*). Once we are finished, the map will appear as in Fig. TR.B5 with all the 7 X's. The Reference points table now contains all these points with their raster and survey coordinates and so we are ready for calculation. This is run by clicking the Calculate button on CorrMap’s toolbar (3 in Fig. TR.B1) and it produces the results shown in Fig. TR.B6.

 (*) a.Consult section Transformations | Affine | Renumbering reference points to learn about the CorrMap utility for automatically renumbering reference points once you have already insert them.  b.Read section Basic Operations | Common commands | Guide lines for the explanation on how to trace guide lines in order to click map points at the maximum precision even when the map lines present very slight deviations.

Fig. TR.B5 – Here are all the reference points inserted: the blue X on building corners.

Fig. TR.B6The results of the transformation for the reference points.

These results are:

East/North georef: these two columns now contain the raster coordinates transformed into the survey reference system by applying the algorithm explained in section Basic concepts | Barycentric. As we can see, these values are close to those we have inserted from our survey (columns East/North real) but they differ slightly. Why? Obviously because this raster map had been subjected to deformation due to the possible causes described in section Basic concepts | Why do raster maps need to be geo-referenced? - The map deformation.

Dev. East/North: this are the deviations (residual values) in both East and North directions calculated by the least squares algorithm of this transformation and it’s due to the abundance of reference points used, 7 compared to the minimum of 2 required by the algorithm. For a detailed explanation of these values, please refer to the correspondent paragraph in section Transformations | Affine. In that text we explain how important these values are in order to let you evaluate the reliability of each point, thus excluding or removing a point resulting in a high deviation (Disable or Remove option form the right-click context menu shown  in Fig. TR.B7).

Fig. TR.B7 – How to exclude a reference point presenting a high deviation.

Like the Affine transformation, also this Barycentric calculation determines the 4 parameters explained in section Basic concepts | Affine. You can see them in the Results box in CorrMap toolbar at the top, as in Fig. TR.B8. You can find the explanation of these values in section Transformations | Affine | Fig. TR.A8. The only differences are the following:

1.The East/North translations (cells East/North) are the distances applied to the origin of the raster map to port it to the real survey coordinates.

2.The rotation value is the angle that the raster has been rotated to position it to the local North of the survey.

Fig. TR.B8The 4 parameters of the transformation.

Well, we have finally calculated the transformation. Now we can export the geo-referenced raster map into some common file formats so that we can use it in other applications, such as CAD software. To do so, you can use the GeoTIFF/TFW and DXF drawing commands of the Export box in CorrMap toolbar (4 and 5 in Fig. TR.B1). These commands are exactly the same as in the Affine transformation. So, for their explanation, please refer to the section Transformations | Affine | Exporting the geo-referenced map.

Fig. TR.B9 shows the DXF drawing of our example containing the just transformed map. We can see that it has been geo-referenced by verifying the coordinates of the reference points using the CAD Inquiring command. As you can see, getting the coordinates of point 5, we obtain the exact survey values reported in the East real / North real columns of Fig. TR.B6. This means that if we get the coordinates of any other point of the map we are interested in, their values are now those of our survey reference system and, as such, we can easily calculate the observation data to trace these points back in the field.

Fig. TR.B9Reference points have now their real survey coordinates.

However, like the Affine transformation, the Barycentric algorithm does not remove the deformation of the map, i.e. it does not rectify the raster. So, as we explained in section Transformations | Affine | Fig. TR.A15, this means that this method can not be suitable for tasks in which you are required a higher level of precision. For these kind of tasks, you need to use the other CorrMap transformations (Grid, Homography, Rubber-Sheeting, Trilateral) which do rectify the map.