PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.88k stars 4.61k forks source link

pcl_viewer needs a camera scale option #801

Open translunar opened 10 years ago

translunar commented 10 years ago

I have a point cloud taken from very, very close, such that the distance between points is on the order of 1E-5. Unfortunately, when I try to view it in pcl_viewer, it shows up as what appears to be a single point.

I can partially address this by changing between perspective and parallel projection and then very carefully zooming in on it. But eventually I get to a point where the camera motion is too big to properly center it for additional zooming.

It seems like the appropriate fix is to scale the vtkCamera. Unfortunately, I can't figure out where the code for events in pcl_viewer is even located (I spent an hour looking for it last week and no luck).

If someone could point me in the right direction, I may be able to add this option. Or if the option already exists, let me know so I can document it. =)

VictorLamoine commented 10 years ago

Can you provide a point cloud example ?

cloud.pcd

# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1 1 1
WIDTH 33
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 397
DATA ascii
2.7107999e-06 5.6745001e-05 2.0374498e-05
-8.7235003e-07 5.7124998e-05 2.06365e-05
-5.3305002e-06 5.6690002e-05 2.0457999e-05
1.3211e-05 5.7495003e-05 1.63115e-05
1.22725e-05 6.1420003e-05 1.21275e-05
1.70685e-05 5.658e-05 1.2535e-05
1.4430001e-05 5.8865e-05 1.3518499e-05
1.3375e-05 6.1170002e-05 8.8024999e-06
1.7875002e-05 5.6149998e-05 9.5544992e-06
7.9910005e-06 6.1535e-05 1.5639502e-05
3.9906499e-06 6.2189996e-05 1.6399001e-05
9.0505e-06 5.8370002e-05 1.7746501e-05
4.3343503e-06 5.8789999e-05 1.8769e-05
9.0399999e-06 6.2680003e-05 1.3066e-05
4.04305e-06 6.4329994e-05 1.3094999e-05
1.1374999e-05 6.0729999e-05 1.48355e-05
-9.3444999e-07 6.228e-05 1.6591999e-05
-5.5840001e-06 6.1880004e-05 1.6259501e-05
-1.00315e-06 5.9685e-05 1.9052e-05
-6.1599999e-06 5.9080001e-05 1.8713499e-05
-8.3294998e-07 6.4395004e-05 1.3391e-05
-5.9854997e-06 6.3615e-05 1.3109499e-05
8.2420001e-06 6.4140004e-05 9.6399999e-06
3.54605e-06 6.5514992e-05 9.2075006e-06
7.3075e-07 6.5669999e-05 8.5474994e-06
-6.9105004e-06 6.4429994e-05 9.6325002e-06
-8.6249993e-06 5.6010002e-05 2.00385e-05
-3.7278001e-05 6.7075001e-05 2.5523001e-05
-3.2985503e-05 7.1979994e-05 2.0545e-05
-3.5962501e-05 7.2724994e-05 2.1632999e-05
-3.2755001e-05 6.8120004e-05 2.1097499e-05
-3.5556001e-05 6.8834997e-05 2.3758999e-05
-3.9763996e-05 6.708e-05 2.5596999e-05

Visualize the file with: pcl_viewer cloud.pcd

capture du 2014-07-16 09 02 10

If you can't see anything try to press R to reset the camera. To show the help of the pcl_viewer program: pcl_viewer -h To show the help of the pcl_visualizer; start the pcl_viewer program and type h

The code of the pcl_viewer is located in visualization/tools

taketwo commented 10 years ago

But eventually I get to a point where the camera motion is too big to properly center it for additional zooming

Another hint would be to use "f" motion to zoom and center at the point of interest.

translunar commented 10 years ago

Sure. Here's the example:

https://dl.dropboxusercontent.com/u/42324977/view_00085.pcd

The point in the dead center is the object. The rest of the points are the far plane from the sensor. Sure enough, 'f' works — as long as I'm in parallel projection mode. Otherwise it seems to get clipped by the camera frustum.

VictorLamoine commented 10 years ago

Your point cloud associates microscopic/macroscopic points; how a camera scale option would help? f works fine but the clipping values of the camera makes it impossible to fully zoom in the point cloud.

It is a very specific point cloud!

translunar commented 10 years ago

Well, the point cloud was created from a specific pose, so it makes sense that it should also be viewable from that specific pose. Perhaps this is not a problem with camera scale at all, but something else?

VictorLamoine commented 10 years ago

Point cloud just opened with pcl_viewer cloud_start

Rotated (the upper point alone is a tiny point cloud) rotated

Zoom on the tiny point cloud; you can't zoom more; the point cloud gets clipped maximum zoom

Point cloud opened in MeshLab, note the measures. measures

Zoom on the tiny point cloud, note the measure, only 0.01 compared to 300 tiny_cloud

What do you want, what is wrong ? PCL is not a microscope :smiley:

EDIT: Here is a video showing the issue.

VictorLamoine commented 9 years ago

@mohawkjohn Can you reformulate what is your issue here?

It's not possible to easily visualize tiny/huge point clouds at the same time; this not a "point cloud library" issue, it's more of a... universal law :wink:

stale[bot] commented 4 years ago

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.