1
votes

Using PCL, I'm trying to detect and localize a rectangular cut from a large steel frame(img below): Now I'm using the Concave hull class, and I do get the outlines from the rectangle. However, the outer borders of the camera view also follow. I used a passthrough filter to get rid of the borders, however that only works in specific cases. What I'm asking is, do you happen to know any methods that could give a better result?

For the holes, they are not always at the same height or location. But they are of a standard size(+/- 1 cm). A size criteria can eliminate false detections.

enter image description here

This is a gazebo simulated model, and the point cloud captured from a simulated kinect using ROS.

Using PCL, I used SAC planar segmentation, then extract a concave hull. As seen on the image, the edges of the camera view are also considered as a concave. enter image description here

pcl::SACSegmentation<pcl::PointXYZ> segmentation;
segmentation.setOptimizeCoefficients (true);
segmentation.setModelType(pcl::SACMODEL_PLANE);
segmentation.setMethodType(pcl::SAC_RANSAC);
segmentation.setMaxIterations(1000);
segmentation.setDistanceThreshold(0.01);
segmentation.setInputCloud(cloud_ptr);//breytti
segmentation.segment(*inliers, *coefficients);

pcl::ConcaveHull<pcl::PointXYZ> chull;
chull.setInputCloud (cloud_projected);

chull.setAlpha (0.1);
chull.reconstruct (*cloud_hull, hullPolygons);

Eigen::Vector4f centroid;//new object for centroid calculation
pcl::PointXYZ minpt, maxpt;//min max boundary of new cloud
pcl::compute3DCentroid(*cloud_hull, centroid);
pcl::getMinMax3D(*cloud_hull,minpt,maxpt);

To sum it up, looking for a robust method or ideas to detect a rectangular cut from the frame. Thanks

1
Could you please explain what we see in the 2nd image? - Mark Loyman
The second image is the original Pointcloud XYZRGB. The red points are the results from the concave hull. The results I want is only the inner part(the smaller rectangle). - Eymar
Doesn't the size criteria eliminate the large outer rectangle? - Mark Loyman

1 Answers

0
votes

An alternative tool could be to use CloudCompare. In version 2.12 alpha, Tools> Sand box (research) > find biggest inner rectangle 2D it can be used to detect rectangular holes.