How can I utilize pcfitcylinder to generate a model that more accurately matches my data? Is there a way to define a cylinder model for the pcfitcylinder?

3 views (last 30 days)
I'm using the computer vision tool box in 2015b to utilize the 3d point cloud processing functions, specifically to fit point clouds to geometric shapes (pcfitcylinder, pcfitplane, and pcfitsphere).
I have a 3d point cloud scene that contains various objects, and I want to detect the telephone poles in the scene using pcfitcylinder. I used pcfitplane to remove the ground plane, so now I have a scene of only objects. When I try to run pcfitcylinder on objects in the ROI, it generates a cylinder model that connects several of the objects. When I run pcfitcylinder on a smaller ROI, it still generates a cylinder model much larger than the ROI. When I run pcfitcylinder on a ROI containing only a single pole, it uses the pole as only part of the cylinder model surface and generates a model that is the correct height of the pole, but still several times too wide (the closest I could get it was r = .9 meters).
I've tried tweeking all of the arguments (maxDistance, referenceVector, maxAngularDistance) and Name Value pair arguments (sampleIndices, MaxNumTrials, Confidence), but I still cannot produce an accurate cylinder model. Is there a way to define a (smaller) cylinder model for pcfitcylinder? Is there a way to contrain the size of the model?
Example: [cymodel, cyInlier, cyOutlier] = pcfitcylinder(ptCloudD, .5, referenceVector); ptCloudIn = select(ptCloudD, cyInlier); ptCloudOut = select(ptCloudD, cyOutlier);
pcshow(ptCloudIn.Location, 'r'); hold on pcshow(ptCloudOut); hold on plot(cymodel); hold off
  2 Comments
Zheng
Zheng on 8 Oct 2015
Right now all pcfit* functions do not allow users to add constraints on the size. It is very difficult to fit a cylinder with an expected radius in this case, because the algorithms only take two points (randomly) to fit the model. A naive enhancement requires modification of the algorithm to reject hypotheses whose radius are out of certain range.
pcfitcylinder also relies on normal vector estimation. You may consider to call pcnormals with the the tunable parameter K to get a better estimates before calling pcfitcylinder. Sometimes it helps.
Basically this is an inherent drawback of RANSAC with uniform sampling. An enhanced version of sampling technique that is sensitive to point distance has to be incorporated in future.
wu changrui
wu changrui on 5 Jan 2018
Hello Zheng! I'm trying to understand pcfitcylinder's method, but I just can't get enough information about the "2 normal vectors fit a cylinder" and "M-Estimator SAC", could you recommend me some paper or principle about these things? I have read the pcfitcylinder documentation many times but it can't support enough information.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!