pcl-Point Cloud Segmentation (minimum cut algorithm)

Source: Internet
Author: User

1. Precision of Point cloud segmentation

In the previous two chapters, the point cloud segmentation algorithm based on sampling consistent and near search was introduced. The point cloud Segmentation algorithm based on sampling consistency is obviously stream of consciousness, it can only cut out the approximate point cloud (may be part of the cup, but the cup saucepan definitely not split). The point cloud segmentation based on European algorithm is powerless in the face of implicated point clouds (such as kites and people, it is impossible to divide kites and humans before the three-dimensional morphology is removed from the middle line). The area growth algorithm based on the normals and other information is more effective on the plane and cannot be used to divide the bowls and cups on the table. In other words, the above algorithm is more concerned about can not be divided, in addition, we also need a method to solve the "good bad" problem of segmentation. In other words, there is no way that can be at a point not much, a little bit more than the case, the target and "other" separate.

The answer is yes, which is the minimum cut algorithm to be solved in this blog post.

2. Minimum cut algorithm

The minimum cut (min-cut) is not a very fresh thing. It has long been used in network planning, solving bridge problems, image segmentation and other fields, was transplanted to the cloud segmentation is not surprising. The minimum cut algorithm is a concept in graph theory, its function is to separate two points in some way, of course, the middle of these two points may be connected by countless points.

If you want to separate the leftmost point and the rightmost point, both the red and green methods are feasible, but the redline crosses three lines and the Green Line crosses only two. From the number of cross-line alone can be drawn to the green line of this cutting method more excellent conclusion. But assuming that there are different weights on the line, then the optimal cut is related to the weight value. How the hell did it find the Green line anyway? All in all, there is an algorithm that when you give a point between the "graph" (generalized), to

3. Point cloud "figure"

Obviously, the cutting has two very important factors, the first one is to obtain the topological relationship between points and points, that is, to generate a "graph". The second one is to give the appropriate weights to the lines in the diagram. As long as these two elements are appropriate, the minimum cut algorithm will do the rest. Point Cloud is a very good object for segmentation (the third time I emphasize this thing), point Cloud has a naturally separate point. Once you have a point, just connect all the dots in the cloud. The connection algorithm is as follows:

1. Find the nearest n points for each point

2. Connect the n points to the parent point

3. Find the minimum distance of two blocks (a point in block A and a point in block B), and connect

4. Repeat 3 until only one block is left

Now that you have the "figure", just attach the appropriate weights to the diagram and complete all the tasks. Object segmentation gives a visual impression that the point belongs to the object and should not be too far from one another. In other words, the weights can be constructed using the Euclidean distance between the points and the points. The weights of all lines can be mapped to functions of line length.

Looks like we're done with everything now, but it's not. Segmentation always has a goal, and this precision strike algorithm, obviously you have to tell me who the target is, the scope of the attack-the goal requires human designation (center), size needs to be given in advance (RADIUS).

OK, now that we have a hit object (specifying a point on the target object), the next thing to do is to keep the object apart from being protected from being hit. The method of protection is to consider weighting values beyond the target range (penalty function)

The above process does not seem smart enough, if there is a way to let me just click the mouse, select the object to be divided, then the computer for me to worry about other things, that would be great. This is actually achievable, called automatic regime. But the PCL does not encapsulate this algorithm, ignoring the table.

Realization of the minimum cut algorithm for 4.PCL
//Generating a splitterPCL::MINCUTSEGMENTATION<PCL::P ointxyz>seg; //split input split targetSeg.setinputcloud (Cloud); //Specify strike target (target point)PCL::P OINTCLOUD<PCL::P ointxyz>::P tr foreground_points (NewPCL::P OINTCLOUD<PCL::P ointxyz> ());  PCL::P ointxyz Point; Point.x=68.97; Point.y= -18.55; Point.z=0.57; Foreground_points-Points.push_back (point);  Seg.setforegroundpoints (foreground_points); //Specify the weight function sigmaSeg.setsigma (0.25); //approximate range of objectsSeg.setradius (3.0433856); //How many graphs are generated?Seg.setnumberofneighbours ( -); //the weights of the points connected to the target point (at least 14)Seg.setsourceweight (0.8); //Split resultStd::vector <PCL::P ointindices>clusters; Seg.extract (clusters);

Obviously, the minimum cut algorithm pays more attention to the accuracy of segmentation rather than the automatic segmentation. The minimum cut algorithm is widely used for semi-automatic segmentation and recognition, which is suitable for computer vision and urban spot cloud analysis. But for a robot, it may be better to combine with the feature point detection algorithm to achieve good results.

The graph shows that the minimum cut algorithm succeeds in finding a car that is close by. Obviously the European algorithm r is too large to distinguish between the car, R is too small to distinguish between the front and the body (glass is not reflective, there is no point cloud).

pcl-Point Cloud Segmentation (minimum cut algorithm)

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.