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.
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.

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
