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

Reduce the computation time needed for bilateral upsampling #689

Merged

Conversation

aikkala
Copy link
Contributor

@aikkala aikkala commented May 21, 2014

I took a couple of exponential functions out from the innermost loops in order to reduce the computation time. The values for those exponential functions are now saved in a matrix (val_exp_depth_matrix) and a vector (val_exp_rgb_vector), and they are referenced inside the loops. The bilateral upsampling seems to work a lot faster now.

I'm new to github, so I apologize if there are some peculiarities in the commits. I read from the guidelines that there shouldn't be any merge commits, but I don't know how to get rid of them. Also tried to squash the commits into one, but again failed to do so.

@jspricke
Copy link
Member

Hi @aikkala this sounds like a great start and welcome to PCL and Github. Try git rebase -i to clean up your branch (you need to do a git push -f to get it onto Github afterwards).

@@ -106,13 +109,14 @@ pcl::BilateralUpsampling<PointInT, PointOutT>::performProcessing (PointCloudOut
float dx = float (x - x_w),
dy = float (y - y_w);

float val_exp_depth = expf (- (dx*dx + dy*dy) / (2.0f * static_cast<float> (sigma_depth_ * sigma_depth_)));
float val_exp_depth = val_exp_depth_matrix(dx+window_size_, dy+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.

The indention seems to be wrong here.

Compute the distance values (exponential functions) in advance to reduce computation time.
jspricke added a commit that referenced this pull request May 22, 2014
Reduce the computation time needed for bilateral upsampling
@jspricke jspricke merged commit f879c39 into PointCloudLibrary:master May 22, 2014
@aikkala aikkala deleted the bilateral_upsampling_fast branch May 26, 2014 10:12
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.

4 participants