Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: progressive morphological filter to extract ground returns #574

Merged

Conversation

chambbj
Copy link
Contributor

@chambbj chambbj commented Mar 17, 2014

No description provided.


/** \brief Get the maximum window size to be used in filtering ground returns. */
int
getMaxWindowSize () { return (max_window_size_); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May add const here.

@taketwo
Copy link
Member

taketwo commented Mar 17, 2014

I do not really like this organization with recursive calls to iteratePMF, and especially the function signature:

std::vector<int>
iteratePMF (const typename PointCloud::ConstPtr &source,
            int iteration, float height_threshold, float window_size,
            std::vector<int> indices);

First is that a vector is used as a return type. Yes, most compilers will apply RVO, but as far as I know it is not guaranteed. Second is passing a vector inside by value, which will require a copy.

@chambbj
Copy link
Contributor Author

chambbj commented Mar 17, 2014

@taketwo Let me know if you're more comfortable with this updated version.

window_size = cell_size_ * ( 2.0f * iteration++ * base_ + 1.0f );
}

// Seed the indices vector with indices into the input point cloud.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class derives from PCLBase which allows users to supply indices so that only a subset of points is processed. (Which is a quite useful feature actually.) So you should seed from indices_.

@chambbj
Copy link
Contributor Author

chambbj commented Mar 21, 2014

@taketwo Where do we stand on this?

@taketwo
Copy link
Member

taketwo commented Mar 21, 2014

@chambbj Sorry got busy with other things. I will try to review this and the other request over the weekend.

@chambbj
Copy link
Contributor Author

chambbj commented Mar 21, 2014

@taketwo Thanks. Both had issues with Travis (one failed and the other didn't even seem to trigger), so I can rebase with master and re-push to try and get clean builds prior to your review.

@taketwo
Copy link
Member

taketwo commented Mar 21, 2014

Don't worry, I can build myself. I guess there will be some more rebases anyways so we'll see how Travis reacts.

@taketwo
Copy link
Member

taketwo commented Mar 24, 2014

Still, I do not understand the need for recursion. It increases the memory usage and (IMHO) makes the code less comprehensible. Why can't we just use a good old for loop?

PCL_INFO ("[Batch processing mode] Added %s for processing.\n", itr->path ().string ().c_str ());
}
}
//batchProcess (pcd_files, output_dir, resolution);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

@chambbj
Copy link
Contributor Author

chambbj commented Mar 24, 2014

@taketwo I believe all issues have been addressed with the latest commit. Let me know if you find anything else.

@taketwo
Copy link
Member

taketwo commented Mar 24, 2014

Thanks, I think this version is so much better. I would ask you to add a space at line 116 and then I think we are ready to merge.

Oh, and just in case. I do not know the details of the algorithm and the assumptions that you may make about z values, but when I see something like this:

float diff = cloud->points[p_idx].z - cloud_f->points[p_idx].z;
if (diff < height_thresholds[i])
   pt_indices.push_back (ground[p_idx]);

it rings a bell for potentially missing std::fabs.

@chambbj
Copy link
Contributor Author

chambbj commented Mar 25, 2014

I'm comfortable with the difference and comparison. cloud_f is guaranteed to be lower than cloud given the opening operation. It's an estimate of the ground plane. If input points are within a given tolerance of the ground plane, they are retained as ground returns, otherwise they are considered object returns. Although we may have to deal with points below ground for various reasons, it isn't the goal of this segmentation routine, so anything below the ground plane is passed through as well.

@chambbj
Copy link
Contributor Author

chambbj commented Mar 25, 2014

@taketwo One test timed out, but I think we may be able to merge now. Final thoughts?

taketwo added a commit that referenced this pull request Mar 26, 2014
Add: progressive morphological filter to extract ground returns
@taketwo taketwo merged commit 7d990eb into PointCloudLibrary:master Mar 26, 2014
@chambbj chambbj deleted the progressive-morphological-filter branch March 26, 2014 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants