Region growing segmentation clusters are wrong?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Region growing segmentation clusters are wrong?

I am performing a region growing segmentation of a point cloud I have of my room.
The colored cloud looks like the following:

As you can see most of the clusters look according to the surface.
However, when i show each cluster separatedly, these are some of the results:

I am using this code to store the clusters into separated point clouds:

    //Store clusters into new pcls and all the clusters in an array of pcls
        std::vector<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> clusters_pcl;
        for (int i = 0; i < clusters.size(); ++i) {
                pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_cluster(
                                new pcl::PointCloud<pcl::PointXYZRGB>);
                cloud_cluster->width = clusters[i].indices.size();
                cloud_cluster->height = 1;
                cloud_cluster->is_dense = true;
                for (int j = 0; j < clusters[i].indices.size(); ++j) {
                        //Take the corresponding point of the filtered cloud from the indices for the new pcl
                //pcl::removeNaNFromPointCloud(*cloud_cluster, *cloud_cluster, indices2);

Is it my code that is doing something wrong or is the output of the region growing segmentation actually right?