Blog | All About Reference Points
The Summer 2019 Software Update included a much-anticipated feature which makes it easier for Virtual CRASH 4 users to position images, point arrays, and point clouds with respect to a global coordinate system. Prior to this update, users had to follow a more complex multi-step process to position data within a global coordinate system.
The way the new positioning feature works is by using a new “reference point” attribute. Below we explain this new attribute using scene data from Crash Test #1 of the 2019 IPTM Symposium on Traffic Safety.
To create this orthomosaic image, a DJI Mavic 2 Pro was flown over the scene to collect a series of images. The images were then processed by Pix4D to generate the orthomosaic and point cloud. Here we set the image’s position-local value to (0,0) which places it at (0,0) in the Virtual CRASH frame coordinate system. Below we placed a red circle at (0,0) to highlight the origin.
Here we see the tfw file from Pix4D.
The TFW file can be used to both scale and position the orthomosaic in global space. This can be done automatically by using the “load TFW file” option. Remember, you can always start your project by simply importing the TFW file first and use the Smart Alignment Tool to load and align your image with point cloud and total station/RTK data. In our example here, we’ve started by first importing the image, then we use the TFW file reader.
Now that we’ve loaded our TFW file, we see our image’s scale has been adjusted such that the physical pixel size matches what’s indicated in the TFW file. The upper left pixel position of the image has been placed at (0,0) in the Virtual CRASH frame.
To further explore this, let’s change location to (50,50) and reference point to (20,60). Here we see the image is now shifted and the upper left pixel center is no longer at (0,0) in the VC frame. Note the x’ and y’ axes are rotated 180 degrees with respect to the Virtual CRASH frame x and y axes. This is simply for convenience to keep the x and y value magnitudes and signs exactly equal for location and reference point when the TFW file is loaded.
Aligning Multiple Image Tiles
Using the reference point attribute, multiple image tiles can be aligned (see blog post on exporting multiple image tiles from Pix4D). This process is shown in the video below.
Note, in the first example shown in the video, the reference point (x,y) values for all image tiles were set equal to the (x,y) value of the upper left pixel specified in the TFW file for the first tile. This positions the first tile in the scene such that its upper left corner pixel sits at (0,0) in the Virtual CRASH frame. All of the other tiles will be properly positioned around this first tile.
Notice the reference point x and y values have been changed as well as the “location” x and y values. The “location” attribute defines the position of the absolute (physical) global frame’s origin within the Virtual CRASH frame. The reference point x and y values then define the position of the image’s upper left pixel’s center with respect to this absolute frame origin. Notice both the location and reference point x and y values are equal to the values from the TFW file. This guarantees that the upper left pixel center comes in at (0,0) in the Virtual CRASH frame.
Below we see the true absolute (physical) location of the image tiles (not shown to scale), with the corresponding positions in the Virtual CRASH frame.
Since all of the reference point (x,y) values are the same, the position of each image tile with respect to the location (x,y) position is identical for all tiles. This means the images maintain their proper alignment relative to one another. You are free to set the reference point (x,y) values to any arbitrary value. As long as the values are the same for all image tiles, they will maintain proper relative alignment.
In the second example shown in the video, the image tiles were aligned with respect to the placement of the single large orthomosaic image. In this case we input the large orthomosaic image’s (x,y) position for the upper left pixel given by it’s TFW file as the reference point (x,y) values for all image tiles.
Point Cloud Imported without Point Array
Point cloud objects also have an adjustable reference point attribute. The “location” attribute for point clouds does not need to be set as it does for images since the point cloud data already has positioning data given by the coordinates themselves. The location position is set as the (x,y) position of point #1 in the point cloud dataset. The z position is set by the z value of the lowest point in the point cloud. This ensures that the lowest point sits on the x-y plane rather than below when the point cloud is imported into the scene. When the “load TFW file” option is used, the reference point (x,y) values are set to the same value as used for the upper left pixel position from the TFW file. This ensures that both the point cloud and the orthomosaic are shifted by the exact same displacement vector with respect to their absolute global space position, and thus are properly aligned.
Point Array Imported Without Point Cloud or With Point Cloud Using Smart Alignment Tool
If a point array is imported into Virtual CRASH using a TFW file, the reference point (x,y) values are set to the position of the upper left pixel defined in the TFW file. The z reference point value of the point array is set to the lowest z value in the point array. This ensures the lowest point in the point array sits on the x-y plane.
If both a point cloud and point array are imported at the same time with the Smart Alignment Tool, Virtual CRASH will set the point cloud and point array reference point values to the (x,y) value of the upper left pixel defined in the TFW file. The z reference point value of both the point array and point cloud are set to the lowest z value in the point array. This means, currently, the point array will be imported such that the lowest point sits on the x-y plane, with the point cloud positioned properly in z with respect to the point array. This may result in point cloud points sitting beneath the x-y plane. If this occurs, simply adjust the reference point z position for the point cloud and point array to a value (the same value) that brings all point cloud points above the x-y plane. This is illustrated below.
Placing objects at their absolute global position
If you want to place your orthomosaic, point cloud, or point array at its absolute global position in Virtual CRASH, simply set the reference point x,y, and z values to (0,0,0).