Virtual broom (plugin)

From CloudCompareWiki
Jump to navigation Jump to search

Introduction

The Virtual Broom plugin allows the user to clean (or segment) a point cloud semi-automatically... as one would use a broom on a (flat) surface.

QBroom plugin.JPG

Usage

Just highlight a point cloud and start the plugin (with the plugin icon or the 'Plugin > CEA Virtual Broom' menu entry).

This will display the first time a disclaimer about the author of the plugin (Wesley Grimes, Collision Engineering Associates, Inc., USA). This project is independent from CloudCompare, therefore don't hesitate to make donations if you find this plugin useful.

Then the plugin dedicated dialog will appear. It has its own 3D view in which the point cloud is displayed. Standard mouse interactions can be used (left button: rotate the view / right button: pan the view).

Position the broom

The first thing to do is to position the 'virtual' broom on the surface you wish to clean.

Click on the 'Reposition' button, then pick two points on the (flat) surface so that the plugin can determine the with of the broom and it's initial position and orientation. Once two points have been picked, you'll see a yellow rectangular box representing the 'virtual' broom and a red box representing the space above the broom in which points will be removed (or 'selected' if you want to work the opposite way).

Note: it may be easier to pick the two points when looking at the surface from above.

Setup the broom dimensions

The virtual broom (yellow) automatically sticks to the cloud. You can change its dimensions thanks to the 'broom dimensions' parameters (on the left):

  • length: the distance between the two picked points by default. Can be changed afterward. Warning: the longer the broom will be, the slower the tool might be, and the more issues you might have if the surface is curved. To clean a road for instance, the width of one or two car lines should be sufficient.
  • width: the width of the broom. 20% of the length by default. If the width is too small, the plugin might no be able to stick to the surface correctly (especially in case of a noisy surface)
  • thickness: the thickness of the broom. This is mainly used by the plugin to stick to the surface. In the default mode (cleaning), the points falling inside the broom won't be deleted. Therefore it is good to make the broom as thin as possible. However, especially for noisy or curved surfaces, the plugin won't be able to stick the broom to the surface correctly if the broom is too thin... It is sometimes a good idea to use two different brooms (first, a thick broom with a high selection volume, and then a much thinner broom with a low selection volume).

The second important set of settings concern the selection volume (red):

  • mode: you can delete (or 'select') the points above / below / above and below / or inside the broom box itself.
  • height: the height of the selection volume. This volume has the same horizontal extents as the broom box, but if the selection volume is not 'inside', its height can be modified as the user prefers (to catch all the noise, or on the contrary to avoid catching points above a given altitude). Of course the bigger the selection volume will be, the slower the tool might be.

Moving the broom

Once correctly setup, the broom can be displaced over the surface in two different modes.

Manual mode

By default, the user is supposed to manually 'sweep' the broom. Left click on the broom, keep the mouse button pressed, and then move the broom. The broom should stick to the surface, and the points falling inside the selection volume will be colored in red by default. Now all you need is time, as with a real broom ;)

Note: the 'stick to the cloud' checkbox allows you to enabled or disable the automatic broom 'sticking'. Disabling it might be a little tricky ;

Automated mode

For simple surfaces such as roads, it is possible to automate the process by drawing a rectangle over the surface in which the broom will be automatically 'swept'. Look at the surface from above, change the zoom so as to see the whole area to clean, and click on the automate button. The plugin will ask you to pick two corners of the (rectangular) area to be cleaned. Actually these are two corners on the same side of the rectangle. Then you'll be able to change the width of the rectangle interactively by moving the mouse, and you can fix it by clicking a last time on the left mouse button. Once defined, the plugin will automatically sweep the broom inside the defined area.

QBroom automate.jpg
QBroom automate result.jpg

Undo

Anytime, and whatever the chosen mode, it is possible to undo the last selection (i.e. last broom position) or the last 10 steps thanks to the two dedicated buttons ('Undo' and 'Undo 10 steps').

Delete the points

Before closing the tool, you must choose whether you want to deleted the selected (red) points or keep them. Choose the right mode thanks to the 'remove the selected points' checkbox, and then click on 'Apply' (to apply the operation and keep the plugin opened - you can then start sweeping the broom on another part of the cloud) or directly on 'Validate' to apply the operation (if any is pending) and close the plugin.

The plugin doesn't modify the original cloud. It always creates a new cloud.

Broom stuck

When the plugin loses the 'track' of the broom and can't stick the broom to the surface anymore (for instance when it is hangs an empty area and there's not enough points 'inside' the yellow part - or when there's too much noise), the broom will get stuck and the plugin will display a warning message (in the bottom left part). In this case, you can try to move the plugin back to 'safety', but it is generally more simple to hit the 'Undo' button once or twice.