Generate canopy height raster image using cloudcompare command line
Posted: Sun Jun 21, 2020 2:32 pm
hello,
I am doing the following using GUI (Cloudcompare version 2.11)
1. I have a pointcloud data from which I have already separated the higher elevations(trees) and ground cloud points using CSF filter(python code).
2. Now I compute normal of the ground point cloud(QUADRIC model works best with mst knn 6). Then I create a ground mesh(DELAUNAY XY).
3. Then I calculate the cloud to mesh distance.
4. Finally, I rasterize the distance map(leaving missing values empty) and save the scalar fields. The resulting image is a single band geotiff image.
Now, I want to automate this process using command line(cloudcompare was installed via snap in ubuntu 18.04). But there are some issues.
1. For computing normal, I run the following command(Most of these commands were assumed from documentation, so they can be mistaken)
2. That generates a file. Then I try to generate mesh.
3. Then I tried to load the trees point cloud and the mesh_ground.bin in cloudcompare gui to see the output of the mesh. But whenever I load the mesh and tree point cloud(by dragging to the cloudcompare window), both disappears.
4. Still I generate the cloud to mesh distance file.
5. That generates a file which can be visualized in cloudcompare. But when rasterized using cloudcompare GUI, it has some strange gridlike lines, which do not appear when I do the entire process using GUI.
6. I tried to generate raster image using the following command,
But this file has 2 bands instead of 1 and the image is very blurry compared to when the entire process is done using GUI.
So can anyone help me with the commands?
Thanks in Advance.
I am doing the following using GUI (Cloudcompare version 2.11)
1. I have a pointcloud data from which I have already separated the higher elevations(trees) and ground cloud points using CSF filter(python code).
2. Now I compute normal of the ground point cloud(QUADRIC model works best with mst knn 6). Then I create a ground mesh(DELAUNAY XY).
3. Then I calculate the cloud to mesh distance.
4. Finally, I rasterize the distance map(leaving missing values empty) and save the scalar fields. The resulting image is a single band geotiff image.
Now, I want to automate this process using command line(cloudcompare was installed via snap in ubuntu 18.04). But there are some issues.
1. For computing normal, I run the following command(Most of these commands were assumed from documentation, so they can be mistaken)
Code: Select all
snap run cloudcompare.CloudCompare -SILENT -o path/of/point/cloud -OCTREE_NORMALS auto -MODEL QUADRIC -ORIENT_NORMS_MST 6
Code: Select all
snap run cloudcompare.CloudCompare -SILENT -AUTO_SAVE OFF -o /path/to/generated/file/from/1 -DELAUNAY -AA -MAX_EDGE_LENGTH 0 -SAVE_MESHES FILE mesh_ground.bin
4. Still I generate the cloud to mesh distance file.
Code: Select all
snap run cloudcompare.CloudCompare -SILENT -o /path/to/trees/file -o mesh_ground.bin -c2m_dist
6. I tried to generate raster image using the following command,
Code: Select all
snap run cloudcompare.CloudCompare -SILENT -AUTO_SAVE OFF -o /pathg/to/cloud/to/mesh/distance/file -RASTERIZE -GRID_STEP 0.1 -PROJ MAX -SF_PROJ AVG -OUTPUT_RASTER_Z
So can anyone help me with the commands?
Thanks in Advance.