This is more like a PCL question. Though I can give some insight.
As it is told in pcl tutorial Normal Estimation,
To compute a single point normal, use:
computePointNormal (const pcl::PointCloud<PointInT> &cloud, const std::vector<int> &indices, Eigen::Vector4f &plane_parameters, float &curvature);
Where cloud is the input point cloud
that contains the points, indices
represents the set of k-nearest
neighbors from cloud, and
plane_parameters and curvature
represent the output of the normal
estimation, with plane_parameters
holding the normal (nx, ny, nz) on the
first 3 coordinates, and the fourth
coordinate is D = nc . p_plane
(centroid here) + p.
To be able to estimate a normal for a single point you need to use neighbouring points to estimate a surface. Without those you can not have a normal for a point. For those neighbouring points you should use a method like kNN. In PCL we have kNN implementation with KdTree Class.
Depending on your application you can use KdTree
to gather k-nearest neighbour points to your target point for normal estimation. Then, you should supply indices of those points to computePointNormal
method. For usage of KdTree
, you can check this tutorial.
Hope this helps. For further questions you can visit pcl-users.org.
Update
About your code in your answer,
computePointNormal
waits const pcl::PointCloud<PointInT> &cloud
as first argument, but you are passing point cloud pointer. Possibly it will be fine if you change it to this (Note the *
);
computePointNormal(*filteredCloud1,pointIdxRadiusSearch,plane_parameters,curvature);