Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9169705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:54:57+00:00 2026-06-17T15:54:57+00:00

Setting I have a PCL point cloud of type PointXYZ . I need to

  • 0

Setting

I have a PCL point cloud of type PointXYZ. I need to convert it to a grid map of type vector<vector<bool> >, where map[x][y] should be true iff there is at least one point it. The map should represent a certain region of the point cloud (say 20×30 cells covering the point cloud dimensions of x=[-10,10],y=[-15,15].

What I have now

At the moment I have two approaches:

  1. Scan through all points and set the corresponding cell in the map to true.
  2. Project the points to plane, create a Kd-Tree and then for each cell in the map query the tree for the closest point and set cell to true if it falls into the cell.

Now, the first approach is good for small point clouds: O(n), with n being the number of points in the point cloud.

The second approach is good for large clouds, I think. The final query is only O(m), where m is the size of the map. However, building the Kd-tree and projecting the cloud onto the plane should both be about O(n).

I am thinking the second approach is always worse but I’ll run a test to see.

Question

Are there any better approaches? Maybe something with Octree or Voxel-Grid (in 2D)? The problem with approach one is, that I am needlessly looking at points that are outside the region of interest.

It seems to me that I can’t be the first to have this problem, right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:54:57+00:00Added an answer on June 17, 2026 at 3:54 pm

    If the point cloud is already "organised" (as would happen for example if it was straight from an RGBD sensor) you may be able to beat O(N) in the best-case by traversing the 2D array cleverly. For information about organizsed point clouds, see https://pcl.readthedocs.io/projects/tutorials/en/latest/basic_structures.html

    If the point cloud is not organised then there is no information in the point cloud about the spatial organisation apart from the points themselves, so you will in almost every case have to touch every one of them. If the map is small enough you can exit when it gets full but that is unlikely to happen I guess.

    If you are happy with probabilistic results then you can build the map by sampling the point cloud randomly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a setting in environment/production.rb of HEROKU = true This should change my
Does setting this value have the same effect as setting the debug=true in the
I have a setting in Root.plist with Key = 'latestNews' of type PSToggleSwitchSpecifier and
I have tried setting a line-height for sIFR3 in both the sifr-config.js and my
I have a setting stored in database which has a value .jpg|.gif|.png . I
I have been setting up an IP blocklist reciently and I was wondering is
I have tried setting the debug flags using the set command in cmake but
I have problems setting the focus on an input element that has been created
I would like to read custom setting which i have done in ServiceConfiguration.cscfg &
I guess this is kind of an odd question but I have tried setting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.