pcl-low-level vision-point cloud Filtering (preliminary processing) __PCL

Source: Internet
Author: User
Tags image filter

Turn from: http://www.cnblogs.com/ironstark/p/4991232.html


The concept of point cloud filtering

Point cloud Filtering is the basic step of point cloud processing, and it is also the preprocessing that must be done before high level three-dimensional image processing. The function is similar to the filter in signal processing, but the method is different from the signal processing. I think there are several reasons for this: the point cloud is not a function, and the x,y,z of complex three-dimensional shapes is not defined by some regularity or numerical relationship. So the point cloud cannot establish a link between the horizontal ordinate. The point cloud is discrete in space. And the image, the signal is not the same, not defined in a region, can not be in the form of a template to filter it. In other words, the point cloud does not have a well-defined domain of images and signals. Point clouds are widely distributed in space. Every point in the whole point cloud, and the relationship between points and points is the most difficult. Unlike images and signals, there are traces to follow. Point cloud filtering relies on geometric information, not numerical relationships.

To sum up, point cloud filter only in the abstract sense and signal, image filter similar. Because the filtering function is to highlight the need for information. method of point cloud filtering

The methods of PCL conventional filtering are well encapsulated. The filtering of the point cloud is accomplished by calling each filter object. The main filters are straight-through filters, body-lattice filters, statistical filters, RADIUS filters and so on. Different characteristics of the filter constitute a more complete point cloud pretreatment family, and the combination of the completion of the task. In fact, the selection of filtering methods and collection methods are inseparable. If we use the method of line structured light scanning to collect the point cloud, the object must be distributed widely along the z-direction, but the x,y distribution is in a limited range. At this time can use a straight-through filter to determine the point cloud in the X or Y direction of the range, can be quickly cut off from the group point, to achieve the first step coarse processing purposes. If you use a high-resolution camera and other devices to collect point clouds, often point clouds will be more intensive. Excessive number of point clouds can be difficult for subsequent partitioning. The body lattice filter can achieve downward sampling without destroying the geometrical structure of the point cloud itself. The geometrical structure of point cloud is not only the macroscopic geometrical shape, but also its microscopic arrangement, such as horizontal and similar dimensions, and the same distance. Although the efficiency of random sampling is higher than that of the volume filter, it will destroy the microscopic structure of the point cloud. Statistical filters are used to remove obvious outliers (outliers are often introduced by measurement noises). It is characterized by sparse distribution in space, which can be understood as: each point expresses a certain amount of information, the more dense a region point may be the greater the amount of information. The noise information belongs to the useless information and the quantity is small. So the information expressed by outliers can be ignored. Given the characteristics of outliers, it is possible to define a point cloud that is less than a certain density, and the point cloud is not valid. Calculates the average distance from each point to its nearest K point. The distance in the point cloud should form a Gaussian distribution. Given the mean value and variance, the points outside the 3∑ can be removed. The RADIUS filter is simpler and more brutal than the statistical filter. Draw a circle at a point to calculate the number of points that fall in the circle, and when the quantity is greater than the given value, the point is preserved and the quantity is less than the given value. This algorithm runs fast, in order the points left by the iteration must be the most dense, but the radius of the circle and the number of points in the circle need to be manually specified.

In fact, the method of point cloud filtering and the traditional signal filter and image filter in the degree of automation, filtering effect there is still a big gap. Most scholars pay attention to the image recognition and registration algorithm in point cloud processing, but the filtering algorithm less attention. In fact, the point cloud pretreatment has great influence on the measurement precision and the speed of recognition.

realization of filtering algorithm based on Point Cloud library

All of these filtering algorithms are already included in the Point Cloud library. The implementation of the PCL filtering algorithm is done through the filter class, when the filtering function is needed, a new filter object is created and the parameters are set. It can be used to deal with the point cloud with different filter parameters for different filtering tasks.

Straight-Through filter:

  Create the Filtering Object
  PCL::P ASSTHROUGH<PCL::P ointxyz> Pass;
  Pass.setinputcloud (cloud);
  Pass.setfilterfieldname ("z");
  Pass.setfilterlimits (0.0, 1.0);
  Pass.setfilterlimitsnegative (true);
  Pass.filter (*cloud_filtered);

BODY element Filter:

  Create the Filtering object
  PCL::VOXELGRID<PCL::P clpointcloud2> sor;
  Sor.setinputcloud (cloud);
  Sor.setleafsize (0.01f, 0.01f, 0.01f);
  Sor.filter (*cloud_filtered);

Statistical filter:

  Create the Filtering object
  PCL::STATISTICALOUTLIERREMOVAL<PCL::P ointxyz> sor;
  Sor.setinputcloud (cloud);
  Sor.setmeank (m);
  Sor.setstddevmulthresh (1.0);
  Sor.filter (*cloud_filtered);

RADIUS Filter:

    Build the filter
    PCL::RADIUSOUTLIERREMOVAL<PCL::P ointxyz> outrem;
    Outrem.setinputcloud (cloud);
    Outrem.setradiussearch (0.8);
    Outrem.setminneighborsinradius (2);
    Apply Filter
    Outrem.filter (*cloud_filtered);

Obviously, the different filters in the filtering process, always first create an object, then set the object parameters, and finally call the filter function to the Point cloud processing (Point cloud for the smart pointer to a piece of area)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.