no name when load a .pcd file with the debug version

All about Windows versions
Post Reply
ZilongS
Posts: 21
Joined: Tue Oct 09, 2018 8:12 pm

no name when load a .pcd file with the debug version

Post by ZilongS »

<t>Hi, Daniel,<br/>
<br/>
As I have compiled the CC, in debug version, I can load a .pcd file, in the file tree window, the folder name can be shown correctly, but the file is named as 'no name', as show in the photo, where the one above is a .pcd file and the one below is from a .txt file.<br/>
How can we fix this issue?<br/>
[img][C:\Users\SHAO\Desktop\Capture.PNG]</t>
ZilongS
Posts: 21
Joined: Tue Oct 09, 2018 8:12 pm

Re: no name when load a .pcd file with the debug version

Post by ZilongS »

Here is the image.
Attachments
Capture.PNG
Capture.PNG (30.05 KiB) Viewed 23252 times
ZilongS
Posts: 21
Joined: Tue Oct 09, 2018 8:12 pm

Re: no name when load a .pcd file with the debug version

Post by ZilongS »

By the way, with the RANSAC function, the entities detected (with the Detect function of RansacShapeDetector class) are listed in the file tree Window, under primitive, however, for cylinder, it only shows the radius and height, and for sphere, only the radius, how can I get the other parameters like the axis of the cylinder or the center of the sphere?

Best regards

Zilong
daniel
Site Admin
Posts: 7382
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: no name when load a .pcd file with the debug version

Post by daniel »

For the "no name" I guess the PCD filter is not doing its job properly.

The cloud should be named somewhere in the PcdFilter class (probably at the end of the loadFile method) with the 'setName' method.

By default I believe the cloud should be named "unnamed - Cloud" so that CloudCompare can automatically replace the "unnamed" part by the filename. Otherwise you can set anything you want.

And for the center of the sphere, you can take the center of the bounding-box (also displayed in the sphere entity properties).
For the axis of the cylinder, it's more tricky. This one must be read from the 'Transformation history' matrix. This will be 3rd column of the matrix.
Daniel, CloudCompare admin
ZilongS
Posts: 21
Joined: Tue Oct 09, 2018 8:12 pm

Re: no name when load a .pcd file with the debug version

Post by ZilongS »

Daniel,
The transformation history is interesting for a primitive, however, it is not presented in the manual (for a primitive).

I tested with some cases, it's true that the third column of the matrix gives the axis (direction) of the a cylinder.

Something I found :

1. For a plane, the 3rd column gives the normal and the 4th column gives the position of a point on the plane, and this point is the center of the plane which encloses the support points, is this correct?
2. For a cylinder, the 3rd column gives the direction of the axis and the 4th column gives the position of a point on the axis,and this point is the center of the ideal cylinder which encloses the support points, is this correct?

So as you said, this center for a sphere is also the center of the bounding-box of the center primitive.

One more question on the RANSAC, as presented in the manual, the most important parameter it the minimal number of support points, if this number is too small, the routine gives many more primitives than the one to be detected, if this number is too big, maybe the goal primitive cannot be detected, however, given a point cloud, how to estimate the support points of a primitive?
daniel
Site Admin
Posts: 7382
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: no name when load a .pcd file with the debug version

Post by daniel »

Yes all your observations are correct (and they are not detailed in the documentation because no one ever asked for them ;)

You could consider the typical dimension of the primitives you are looking for, and estimate the density inside a neighborhood of the right radius? But clearly you generally have to test with various values until you find the right one...
Daniel, CloudCompare admin
ZilongS
Posts: 21
Joined: Tue Oct 09, 2018 8:12 pm

Re: no name when load a .pcd file with the debug version

Post by ZilongS »

Thanks for your confirmation.

Is there a function in CC which gives the minimal distance between any two points in a point cloud?
daniel
Site Admin
Posts: 7382
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: no name when load a .pcd file with the debug version

Post by daniel »

You can compute the approximate density which is actually for each point the distance to its nearest neighbor (see CCLib::GeometricalAnalysisTools::ComputeLocalDensityApprox - with the 'densityType=DENSITY_KNN'). If you retrieve the minimum distance from the generated scalar field, you'll know the minimum distance between two points inside the cloud.
Daniel, CloudCompare admin
Post Reply