IT

Photogrammetry and drones · Laser scanning, SLAM and LiDAR · 12 October 2018

How to handle tall grass in a point cloud

In a photogrammetric survey, grass can hide the ground. Here's a quick, non-rigorous way to handle it in CloudCompare, and when not to use it.

In this article I’ll explain how to handle grass and (low) vegetation in a point cloud with the open source software CloudCompare.

Photogrammetry is a passive technique

If you have to process a point cloud from an aerial photogrammetric survey, you might find yourself facing a field of tall grass or a maize plantation.
If you need the ground height, this scenario may not be easy to deal with.

Photogrammetry is a passive survey technique: it takes the information about what it reconstructs from the photos.
That’s why anything hidden from the camera sensor isn’t represented.

If you fly a photogrammetric survey over a field of grass 50 cm tall and then process the data in photogrammetry software (with structure from motion algorithms), you’ll hardly be able to find the height of the ground underneath.
You’ll probably get a point cloud that represents the top of the grass fairly well, not the ground.
But the ground is exactly what you have to deliver when you do a topographic survey.

A grassy meadow with woodland in the distance

You have two options

If you’re in a case like the one I’ve just described, you have two practical options.
A rigorous one.
And another that’s decidedly less so.

This article is about the less rigorous technique.
So first I’ll briefly tell you about the rigorous one, so there’s a better chance you’ll read it without leaving the article after learning the other method.
😛

Integrate the survey with ground measurements

The correct method, which you should always follow when there are areas covered by vegetation within an aerial photogrammetric survey, is to add topographic measurements there, using ground-based instruments.

If there’s a small wood in the middle of a ploughed field or in an urban area, it’s a good idea to measure some points under the trees with a total station (a GNSS receiver will hardly work well under the canopy).

If instead there’s a field of maize two metres tall, you can measure some ground points inside it with a satellite receiver, perhaps raising the pole a bit more than usual to get the antenna well clear of the maize.

And you can do the same in a grassy meadow or on the bed of a stream with flowing water (yes, because water also hides the bed from the photos).

Measure as many points as you need to describe and define the shape of the ground.
Survey small irrigation channels in a farming area, ditches and dunes, irregularities and notable features.

Unfortunately you won’t match the density of information a photogrammetric survey gives you.
And you probably won’t even come close.
It would be mad to measure a point every 5 cm!
But at least you’ll have consistent data to complete the overall survey and deliver a result that can be validated and is true to reality.

In practice, during processing you “punch holes” in the photogrammetric point cloud where the vegetation is.
Then you fill the holes with the sparser measurements taken on the ground.

Well, that’s the rigorous method.
It might be a starting point for another, more detailed article on a real case.

And now I’ll tell you about the less rigorous one!

Lower the heights of the points on the grass

I know that put like this it may sound a bit extreme.
And I won’t deny it is.

But you might not have done the survey yourself, and still need to work on it for your own job.
Or you might be in a case where the grass is all the same height (to a good, reasonable approximation).
Or again, you might need rough indications of ground heights to build a coarse digital terrain model, DTM, useful for example for preliminary surface runoff analyses.

In short, I’ve tried to give you some valid reasons to use this method.
If you have others, let me know!

If you know the height of the grass at several points and the ground isn’t too complex, you can subtract the average grass height from the heights of the point cloud representing the top of the grass. That gets you a bit closer to the ground height.

Now I’ll tell you how to do it quickly with the open source software CloudCompare.

CloudCompare

CloudCompare is open source software for processing point clouds.
I’ve written quite a few articles about it by now, not because it sponsors 3DMetrica but because I think it’s excellent software, functional and fairly “powerful”, that lets anyone work on 3D point clouds without turning to commercial software.

Without boring you with CloudCompare’s virtues, I’ll refer you to what I’ve already written on this blog.

I wrote two articles on using CloudCompare to make cross-sections from point clouds.
You’ll find them at these links: a cross-section from a point cloud, cross-sections with CloudCompare.

If you want to know how to generate a Digital Elevation Model and contour lines, I wrote about it here.

Here I wrote about how to clean a point cloud of vegetation and man-made features on the ground.
But careful, because that method doesn’t work with “carpets” of grass, dense woodland or very thick shrubs.
It’s better suited to isolated vegetation and wouldn’t work well for the purposes of this article.

Finally, here I wrote about how to lighten a dense point cloud, making it more manageable even on a computer that isn’t very powerful.

The “Apply Transformation” function

The command to lower the heights of the points of a cloud is Apply Transformation, which you’ll find in the Edit menu or with CTRL+T.

Import the point cloud

Start by importing the point cloud you want to treat.

A dense point cloud of a farming area in CloudCompare

The example in these images isn’t very apt, because the grass you see had just been cut.
It’s at the same height as the ploughed fields around it and doesn’t really need to be treated and lowered.

Unfortunately I don’t have a dataset suited to the purposes of this article.
Please take what you read as guidance for treating your specific case, without focusing too much on my example.
Just look at the method and the steps.
And thanks a lot for understanding!

Separate the area to treat from the rest of the cloud

If you only need to treat part of the point cloud, there’s an important preliminary step: separate the cloud to be treated from the part that will stay unchanged.

You can do this with the Segment command, also in the Edit menu.

When you launch the command, you can outline a portion of the cloud which, in the next step, will be separated from the rest.
It’s fairly simple, but I covered it in more depth in the article on cleaning point clouds.

Segmenting a point cloud in CloudCompare Separating a point cloud in CloudCompare

The result of the segmentation is two separate point clouds.
One contains the points inside the segmentation outline and the other the part left outside.

The result of segmenting a point cloud in CloudCompare: two separate clouds

Apply Transformation

Now you can launch the Apply Transformation command.
CTRL+T
Or the Edit menu, Apply Transformation.

You’ll see a window like the one in the image below.

The Apply Transformation command in CloudCompare

This tool lets you transform the point cloud you’ve selected (in fact other entities too: polylines and meshes).
And the transformations can basically be of two types: translation or rotation.

You have several choices.

You can work on a transformation matrix.
You can choose a rotation, a translation or a combination of the two.
You can choose to work with Euler angles, also applying a translation vector.

You can also apply the inverse transformation by ticking the relevant checkbox.

Careful, because Apply Transformation doesn’t create a copy of the point cloud: it moves the entity you chose to treat!

I won’t go into all the parameters you can choose and will go straight to the point to solve the problem in this article.
You need a translation along the z axis.

Obviously this assumes the point cloud is correctly oriented and georeferenced, with the z axis corresponding to the vertical.

The command for a translation along the z axis in CloudCompare

Choose the Axis/Angle tab.
Find the translation section and enter in the z box a negative value (because you want to lower the heights of the points) whose absolute value is the height of the grass you want to treat.
Click OK and you’ll see the cloud move by the value you set.

You can also check what happened to the cloud in the properties panel, at the bottom left of the workspace, where there’s a box called “Transformation History”.
It keeps a record of the changes you’ve made to the point cloud.

The history of the transformations applied in CloudCompare

The transformation matrix in CloudCompare

If you then explore the transformation matrix, you’ll see the translation you’ve just applied, as well as any other transformation you’ve made to the cloud.
In short, it keeps track of everything.

Mind the gap!

Now that you’ve translated the point cloud, watch out for the step that forms between the part you moved and the part that stayed in place.

If the translation was done well, i.e. if you lowered the grass by the right height, you shouldn’t have very obvious steps.
At most you might have a slight “detachment” here and there.

If instead something didn’t go right, if you didn’t select the cloud to treat precisely, entered a wrong value for the translation vector, or the grass wasn’t really uniform in height, you could end up with empty steps like the one in the image below.

The results of translating a point cloud

If you’re in a case like this, I really wouldn’t recommend going on.
If you applied this method to bring the surface of the grass down to ground level, this result clearly can’t be satisfactory.

If instead you have small, localised holes due to the particulars of your case, you could split the area into many sub-clouds and handle them separately with dedicated translations.
It might work.

In conclusion

I’ll leave you with two closing thoughts.

This technique doesn’t work with woodland

If you’re wondering whether you can apply this technique to wooded areas with dense trees, I’m sorry, but you can’t.

Trees generally have irregular shapes, even within the same species.
A wood will hardly have trees all with the same crown at the same height.
And that doesn’t let you find an average height, valid for all the trees in the area, to use in the transformation.

For it to work you need surfaces that are as uniform as possible.
The best are grassy meadows (not abandoned, but at least roughly maintained) or farmland with crops that grow evenly over the whole area.

And it’s important to take a few measurements of the vegetation height, spread over the area.
That way you can treat the point cloud consistently with the conditions you actually find in the field.

Drawing of trees seen from the side Drawing of grass and a lawn

Don’t overdo it

And I’ll finish with a frank, personal recommendation: “don’t overdo it!”

This method can help you in a few particular situations and is meant for treating small vegetated parts within larger areas surveyed with aerial photogrammetry.
Don’t apply it to large meadows or big maize fields.
It’s already not very rigorous in itself; don’t turn it into an excessive stretch!
🙂

In those cases it’s better to give up on photogrammetry and go straight to a traditional ground survey.

I hope I’ve given you some useful information, should you ever have to deal with grass in your point clouds.
Not in that sense!!!
🙂

The idea for this article came from an online exchange of messages with the architect Riccardo Deregibus of StudioR3D, whom I can only thank!

If you have doubts, questions or specific observations, get in touch!

My favourite way is a message or voice note on Telegram, @paolocorradeghini, but any way you choose to contact me is fine. You’ll find my email address on the contact page.

Thanks again for giving me some of your time.

See you soon!

← All articles