PointCloudLibrary / PointCloudLibrary/pcl

Normals at edges all go trough origin

Open
#3,269 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: stale
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

The issue is best illustrated in an image:
Screenshot from 2019-08-05 17-24-16

Your Environment

  • Operating System and version: Ubuntu 18.04
  • Compiler: Used Ubuntu pre built binaries
  • PCL Version: 1.8.1

Context

I try to estimate the normals of some bricks lying on the floor. But as seen in the image all the normals at edges connect to the origin.

Expected Behavior

Proper normals estimation

Current Behavior

Code to Reproduce

void compute_normals(pcl::IntegralImageNormalEstimation<pcl::PointXYZRGB, pcl::Normal>& ne, pcl::visualization::PCLVisualizer& viewer,
                     pcl::PointCloud<pcl::PointXYZRGB>::Ptr& input_cloud, pcl::PointCloud<pcl::Normal>::Ptr& output_cloud, float normal_smoothing_size,
                     int normal_cloud_visualization_densitiy){
  ros::WallTime start = ros::WallTime::now();
  ne.setNormalSmoothingSize(normal_smoothing_size);
  ne.setInputCloud(input_cloud);
  ne.compute(*output_cloud);
  viewer.removeAllPointClouds();
  viewer.addPointCloudNormals<pcl::PointXYZRGB, pcl::Normal>(input_cloud, output_cloud, normal_cloud_visualization_densitiy);
  viewer.spinOnce ();
  stop(start, "Normals");
}

I could upload a rosbag if needed.

Possible Solution

I have no clue, but I saw that the neighborhoud search radius makes the problem worse the bigger it is. The above image uses a radius of 15. The one below uses a radius of 5:
Screenshot from 2019-08-05 17-24-30

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the compute_normals entry point and the pcl::IntegralImageNormalEstimation call shown in the issue. Reproduce the edge-normal behavior with an equivalent point cloud and compare the neighborhood sizes of 15 and 5; done means edge normals no longer connect to the origin while normal estimation remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.