Correcting difference in Z between two point cloud data sets

460 views
Skip to first unread message

Ben

unread,
Sep 19, 2018, 10:02:31 PM9/19/18
to LAStools - efficient tools for LiDAR processing
Hello,

I have two datasets;
1. Point cloud created from RGB photography aquired from a Hasselblad A6D and processed in Photoscan
2. Point cloud sourced from a commercial LiDAR provider with ground classified.

The area covered by both data sets is approximately 7km x 23km

I am attempting to adjust the z value of my Photoscan sourced point cloud to match a LiDAR sourced DEM.

I am making the assumption that the LiDAR sourced DEM is positioned correctly.

The two datasets match very well in x and y only the z requires adjustment

The following workflow throws an error if I have the -step less than 100 for the LAStools function lasthin. 

REM Use LiDAR Class 2 points to create control point file
lasthin -i INPUT_FOLDER\*.las -odir OUTPUT_FOLDER -keep_class 2 -step 75 -central

REM Merge thinned files
lasmerge -v -i INPUT_FOLDER\*.las -o OUTPUT_FOLDER\merge_thin.las

REM Convert merged control point las to csv file
las2txt -i INPUT_FOLDER\merge_thin.las -o OUTPUT_FOLDER\cp.csv -parse xyz -sep comma

REM Apply control point file to photoscan sourced point cloud
lascontrol -i INPUT_FOLDER\*.las -cp INPUT_FOLDER_CONTROL_POINT\cp.csv -adjust_z -odir OUTPUT_FOLDER


The following error was thrown for -step 75
U:\>lascontrol -i INPUT_FOLDER\*.las -cp INPUT_FOLDER_CONTROL_POINT\cp.csv -adjust_z -odir OUTPUT_FOLDER
WARNING: files have different point types: 2 vs 1
WARNING: files have different point sizes: 26 vs 28
ERROR (TINclean): failed malloc for 54611274 TINtriangles.
ERROR: cannot alloc enough TIN triangles to triangulate 27305637 points.
       contact martin....@rapidlasso.com for help on what to do.

The following error was thrown for -step 50
U:\>lascontrol -i INPUT_FOLDER\*.las -cp INPUT_FOLDER_CONTROL_POINT\cp.csv -adjust_z -odir OUTPUT_FOLDER
WARNING: files have different point types: 2 vs 1
WARNING: files have different point sizes: 26 vs 28
ERROR: cannot realloc point_buffer for 40000000 points.
       contact martin....@rapidlasso.com for help on what to do.

The following error was thrown for -step 90
U:\>lascontrol -i INPUT_FOLDER\*.las -cp INPUT_FOLDER_CONTROL_POINT\cp.csv -adjust_z -odir OUTPUT_FOLDER
WARNING: files have different point types: 2 vs 1
WARNING: files have different point sizes: 26 vs 28
ERROR (TINclean): failed malloc for 38750484 TINtriangles.
ERROR: cannot alloc enough TIN triangles to triangulate 19375242 points.
       contact martin....@rapidlasso.com for help on what to do.

When I set lasthin -step to greater than 100 lascontrol processes the files successfully (I assume).

This is the last couple of lines from a successful lascontrol using lasthin -i INPUT_FOLDER\*.las -odir OUTPUT_FOLDER -keep_class 2 -step 100 -central

2.83026,143.15,436243.89,6194047.01,140.32
WARNING: there were 359 control points without sufficient LIDAR coverage.
sampled TIN at 19671 of 20030 control points.
avgabs/rms/stddev/avg of elevation errors are 11.5168/15.4981/10.9885/10.9293 meter. skew is 0.695508.

Is there a way to process the lidar tiles without merging so that I can create an increased control point resolution?
Is 100m x 100m control point resolution more than enough?



---------------------------------------------------------

This question is a continuation of a question I asked Martin Isenburg.

Hello Martin,


We are using a Hasselblad A6D in a Cessna 172 and processing the images and outputting a non-classified dense point cloud using Agisoft Photoscan (Classified using LASTools).

 

We have recently acquired ground classified LiDAR data from Fugro in Western Australia.

 

What I am attempting to do.

 

I want to calculate the height of the trees using the surface model from the photogrammetric point cloud sourced from photoscan and use the ground classified points from LiDAR.

 

The problem that I have is there is around 5m difference in Z between the two data sets.

 

I am currently using the las2las -reoffset 0 0 -5 function but have noted that the lascontrol tool maybe a better solution.

 

Is there a way to create a control file from the LiDAR sourced DEM that I could then use to vertically reposition my photoscan pointcloud in Z.

 

And is this a good way to approach the problem or is there other solutions.



And this is Martins reply


don't use reoffset for small translations as this changes the offsets in the LAS header without moving the data but it can have bad side-effect to do this (i.e. integer overflow). use '-translate_z 5.0' or   '-translate_z -5.0'.

 

Maybe you can use lasthin to create a control point file. What spacing do you want? But you should only pick control points in areas where the photoscan poincloud points are *all* on the ground.

 

lasthin -i lidar.laz -keep_class 2 -step 10 -central -o controlpoints.laz

 

Maybe we can discuss this (with links to example data) in the LAStools user forum. There is only a vertical error? No horizontal one?


Regards
Ben

Martin Isenburg

unread,
Sep 21, 2018, 11:02:11 AM9/21/18
to LAStools - efficient command line tools for LIDAR processing
Hello Ben,

the workflow looks good. But you should look at the individual vertical differences that are getting reported. I assume often the photogrammetry point cloud will have forest or trees or other objects in the area where the LiDAR has a ground point. That could mean very bad differences that should not be used for adjustment. If you have a rough idea what your adjustments should look like you can eliminate differences above and below certain thresholds with

-cp_ignore_diff_above 14

and

-cp_ignore_diff_below 8

all your errors are memory allocation errors. we could try to optimize the workflow but instead let's try to brute force it and just use more memory by switching to the 64 bit executables. just download the latest version of LAStools (180919) from


and then add '-cpu64' to your command line and choose appropriate values for 14 and 8

lascontrol -i INPUT_FOLDER\*.las ^
                -cp INPUT_FOLDER_CONTROL_POINT\cp.csv ^
                -cp_ignore_diff_above 14 ^
                -cp_ignore_diff_below 8
                -adjust_z ^
                -odir OUTPUT_FOLDER -olaz ^
                -cpu64

http://rapidlasso.com/lascontrol
http://lastools.org/download/lascontrol_README.txt

Regards,

Martin @rapidlasso

Ben

unread,
Sep 27, 2018, 8:02:00 AM9/27/18
to LAStools - efficient tools for LiDAR processing
Hello,

Thank You for your assistance.

I was not able to use lascontrol as I could not achieve a good ground classification in the RGB point cloud. Because the RGB point cloud was created from very dense forest and the ground could not be seen the majority of the time. This is why I wanted to merge the LiDAR ground classification into the RGB point cloud. But I did have success (I think) using the las2las -translate_z switch.

Regards
Ben
Reply all
Reply to author
Forward
0 new messages