python-pcl icon indicating copy to clipboard operation
python-pcl copied to clipboard

How to set Coefficients in Project inliers object

Open n-patiphon opened this issue 6 years ago • 4 comments

According to this official tutorial http://www.pointclouds.org/documentation/tutorials/project_inliers.php#project-inliers, Project inliers has "setModelCoefficients" method to set planar coefficients. However, I couldn't call this method. Could anyone suggest a way to set these coefficients?

n-patiphon avatar Mar 12 '18 08:03 n-patiphon

Hi ,i meet this too . Can you deal with it? and the examples\offical\fitering.py only have the point cloud that PointXYZ but my point cloud is PointCloudXYZRGBA

ZGX010 avatar May 30 '19 06:05 ZGX010

I am interested in this too. I want project point cloud using a parametric curved surface model, anyone can help me?

qiyang77 avatar Sep 19 '19 12:09 qiyang77

@Sirokujira any update on this?

However, you can manually implement a function like this to do the projection to a given plane with coefficients.

` def project(cloud, coefficients) :

normal = np.array(coefficients[:-1])

cloud_array = np.asarray(cloud)

projected_cloud_list = []

for point in cloud_array:
    projected_cloud_list.append(point - (normal*(np.dot(point,normal)/np.dot(normal,normal))))

projected_cloud_array = np.array(projected_cloud_list, dtype=np.float32)
return pcl.PointCloud(projected_cloud_array)

`

Wishmitha avatar Nov 25 '19 22:11 Wishmitha

anyone solve a problem? have a nice day

enting8696 avatar Sep 15 '20 06:09 enting8696