Featured image of post Memo: Lib - Points | Processing Point Cloud

Memo: Lib - Points | Processing Point Cloud

Table of contents

(Feature image from: 3D point set processing in python: a quick overview - Medium)


Read-Write

plyfile

(2024-03-27)

  1. Read ply file (Polygon File Format): Docs

    1
    2
    3
    4
    5
    6
    7
    
    import numpy
    from plyfile import PlyData, PlyElement
    
    with open('/home/yi/Downloads/DTU_SampleSet/MVS Data/Points/stl/stl001_total.ply', 'rb') as f:
        plydata = PlyData.read(f)
    
    np.array(plydata.elements[0].data)[0]
    

    Output:

    1
    
    (49.720848, -54.11675, 672.04956, 0.9649841, -0.08213623, -0.24911714, 102, 70, 44)
    

    The returned tuple is a single data, whose datatype has 9 members. I want to only take the first 3 values: x,y,z. But it’s not allowed to use syntax like [:3] to slice it.

  2. Write a ply file

    Example in 3DGS:


Read Numer of Points

  1. Problems:

    1. Given a .ply file, obtain the number of pints

Open3D

(2024-03-27)

  1. Compare open3d, plyfile, pyntcloud, and meshio


Read

  1. Various file formats

    1. Open3d read .ply file

      1
      2
      3
      
      import open3d as o3d
      
      pcd = o3d.io.read_point_cloud("/home/yi/Downloads/DTU_SampleSet/MVS Data/Points/stl/stl001_total.ply", format='ply')
      

    ::: aside

    • References:
      1. Docs :::

  1. Open3D converts pcd to np.array and visualize it: Docs

    1
    2
    3
    4
    
    import numpy as np
    xyz_load = np.asarray(pcd.points) # (2880879, 3)
    print(f'xyz_load:\n {xyz_load}')
    o3d.visualization.draw_geometries([pcd])
    

    Setting camera directions:

    1
    2
    3
    4
    
    lookat = np.array([[500.],[500.], [500.]])
    up = np.array([[0.853452],[-0.447425], [0.267266]])
    front = np.array([[0.417749],[0.893913],[0.162499]])
    o3d.visualization.draw_geometries([pcd], width=500, height=500, lookat=lookat, up=up, front=front, zoom=1.0)
    

Visualize

  1. Open3D visualizes a point cloud from a specified camera pose:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    
    vis = o3d.visualization.VisualizerWithKeyCallback()
    
    vis.create_window()
    vis.add_geometry(pcd)
    vis.get_render_option().background_color = np.asarray([1,1,1])
    
    view_ctl = vis.get_view_control()
    w2c = np.array([[-0.636298, -0.727666, 0.25618,  -143.534],
                    [0.0315712,  0.307237, 0.951109, -579.42],
                    [-0.770797,  0.613276, -0.172521, 759.831],
                    [ 0.0,       0.0,      0.0,       1.0]]) # cam 38
    cam = view_ctl.convert_to_pinhole_camera_parameters()
    cam.extrinsic = w2c
    view_ctl.convert_from_pinhole_camera_parameters(cam, True)
    
    vis.run()
    vis.destroy_window()
    
    • Note: crete_window() must precedes add_geometry()

  1. Options for rendering

    (2024-07-08)

    1. Set zoom of the visualizer. r1-Docs

      1
      
      view_ctl.set_zoom(0.14)
      
    2. Set window size r2:

      1
      2
      
      vis = o3d.visualization.VisualizerWithKeyCallback()
      vis.create_window(width=800, height=800)
      
    3. Capture the current window:

      1
      2
      3
      
      # vis.run()
      vis.capture_screen_image("PC01_upPC_240709.png", do_render=True)
      vis.destroy_window()
      

    ::: aside


Shortcuts

  • Open3D Shortcut keysr1-Docs

    (2024-07-10)

    1. Press H will show help message in terminal or output cell.

    ::: aside

    Help info (0.18)
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    
    -- Mouse view control --
      Left button + drag         : Rotate.
      Ctrl + left button + drag  : Translate.
      Wheel button + drag        : Translate.
      Shift + left button + drag : Roll.
      Wheel                      : Zoom in/out.
    
    -- Keyboard view control --
      [/]          : Increase/decrease field of view.
      R            : Reset view point.
      Ctrl/Cmd + C : Copy current view status into the clipboard.
      Ctrl/Cmd + V : Paste view status from clipboard.
    
    -- General control --
      Q, Esc       : Exit window.
      H            : Print help message.
      P, PrtScn    : Take a screen capture.
      D            : Take a depth capture.
      O            : Take a capture of current rendering settings.
      Alt + Enter  : Toggle between full screen and windowed mode.
    
    -- Render mode control --
      L            : Turn on/off lighting.
      +/-          : Increase/decrease point size.
      Ctrl + +/-   : Increase/decrease width of geometry::LineSet.
      N            : Turn on/off point cloud normal rendering.
      S            : Toggle between mesh flat shading and smooth shading.
      W            : Turn on/off mesh wireframe.
      B            : Turn on/off back face rendering.
      I            : Turn on/off image zoom in interpolation.
      T            : Toggle among image render:
                     no stretch / keep ratio / freely stretch.
    
    -- Color control --
      0..4,9       : Set point cloud color option.
                     0 - Default behavior, render point color.
                     1 - Render point color.
                     2 - x coordinate as color.
                     3 - y coordinate as color.
                     4 - z coordinate as color.
                     9 - normal as color.
      Ctrl + 0..4,9: Set mesh color option.
                     0 - Default behavior, render uniform gray color.
                     1 - Render point color.
                     2 - x coordinate as color.
                     3 - y coordinate as color.
                     4 - z coordinate as color.
                     9 - normal as color.
      Shift + 0..4 : Color map options.
                     0 - Gray scale color.
                     1 - JET color map.
                     2 - SUMMER color map.
                     3 - WINTER color map.
                     4 - HOT color map.
    

Other Libs

(2024-05-10)


Wis3D

(2024-04-07)

zju3dv/Wis3D


PCL


Compile on Ubu 22.04 ✅

(2024-05-11)

Reference: Docs

System specs:

  • Ubuntu 22.04.4 LTS x86_64, Kernel: 6.5.0-28-generic,
  • gcc (Ubuntu 9.5.0-1ubuntu1~22.04) 9.5.0
  • Cudatoolkit: cuda_11.6.r11.6/compiler.30794723_0
  • Nvidia Driver: 545.23.08
  • GPU: 3090Ti
  • CPU: AMD Ryzen 7 5700X (16) @ 3.400GHz
  • Board: X570 AORUS PRO WIFI -CF. Memory: 16GB.

Steps:

  1. Download source.tar.gz (pcl-1.14.1)

    Uncompress: tar xvf source.tar.gz

  2. Build:

    1
    2
    
    cd pcl
    cmake -B ./build -DCMAKE_BUILD_TYPE=RelWithDebInfo
    
  3. Compile and install:

1
2
3
cd ./build
make -j8
sudo make -j8 install

The library is installed in /usr/lib and /usr/include/

Install paths {{{
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
-- Installing: /usr/local/lib/libpcl_kdtree.so.1.14.1
-- Installing: /usr/local/lib/libpcl_kdtree.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_kdtree.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_kdtree.so
-- Installing: /usr/local/lib/pkgconfig/pcl_kdtree.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/kdtree/kdtree.h
-- Installing: /usr/local/include/pcl-1.14/pcl/kdtree/io.h
-- Installing: /usr/local/include/pcl-1.14/pcl/kdtree/kdtree_flann.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/kdtree/impl/io.hpp
-- Installing: /usr/local/include/pcl-1.14/pcl/kdtree/impl/kdtree_flann.hpp
-- Installing: /usr/local/lib/libpcl_octree.so.1.14.1
-- Installing: /usr/local/lib/libpcl_octree.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_octree.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_octree.so
-- Installing: /usr/local/lib/pkgconfig/pcl_octree.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/octree/octree_base.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/octree/impl/octree_base.hpp
...
-- Installing: /usr/local/lib/libpcl_search.so.1.14.1
-- Installing: /usr/local/lib/libpcl_search.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_search.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_search.so
-- Installing: /usr/local/lib/pkgconfig/pcl_search.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/search/search.h
-- Installing: /usr/local/include/pcl-1.14/pcl/search/kdtree.h
...
-- Installing: /usr/local/lib/libpcl_sample_consensus.so.1.14.1
-- Installing: /usr/local/lib/libpcl_sample_consensus.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_sample_consensus.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_sample_consensus.so
-- Installing: /usr/local/lib/pkgconfig/pcl_sample_consensus.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/sample_consensus/boost.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/sample_consensus/impl/mlesac.hpp
-- Installing: /usr/local/lib/libpcl_filters.so.1.14.1
-- Installing: /usr/local/lib/libpcl_filters.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_filters.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_filters.so
-- Installing: /usr/local/lib/pkgconfig/pcl_filters.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/filters/boost.h
-- Installing: /usr/local/include/pcl-1.14/pcl/filters/impl/farthest_point_sampling.hpp
-- Installing: /usr/local/lib/pkgconfig/pcl_2d.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/2d/convolution.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/2d/impl/convolution.hpp
...
-- Installing: /usr/local/lib/pkgconfig/pcl_geometry.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/geometry/boost.h
-- Installing: /usr/local/include/pcl-1.14/pcl/geometry/eigen.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/geometry/triangle_mesh.h
-- Installing: /usr/local/include/pcl-1.14/pcl/geometry/impl/polygon_operations.hpp
-- Installing: /usr/local/lib/libpcl_io_ply.so.1.14.1
-- Installing: /usr/local/lib/libpcl_io_ply.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_io_ply.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_io_ply.so
-- Installing: /usr/local/include/pcl-1.14/pcl/io/ply/byte_order.h
-- Installing: /usr/local/include/pcl-1.14/pcl/io/ply/io_operators.h
-- Installing: /usr/local/include/pcl-1.14/pcl/io/ply/ply.h
-- Installing: /usr/local/include/pcl-1.14/pcl/io/ply/ply_parser.h
-- Installing: /usr/local/lib/libpcl_io.so.1.14.1
-- Installing: /usr/local/lib/libpcl_io.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_io.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_io.so
-- Installing: /usr/local/lib/pkgconfig/pcl_io.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/io/boost.h
-- Installing: /usr/local/include/pcl-1.14/pcl/io/eigen.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/compression/octree_pointcloud_compression.h
-- Installing: /usr/local/include/pcl-1.14/pcl/compression/color_coding.h
-- Installing: /usr/local/include/pcl-1.14/pcl/compression/compression_profiles.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/io/impl/ascii_io.hpp
-- Installing: /usr/local/include/pcl-1.14/pcl/io/impl/pcd_io.hpp
-- Installing: /usr/local/include/pcl-1.14/pcl/io/impl/octree_pointcloud_compression.hpp
-- Installing: /usr/local/lib/libpcl_features.so.1.14.1
-- Installing: /usr/local/lib/libpcl_features.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_features.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_features.so
-- Installing: /usr/local/lib/pkgconfig/pcl_features.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/features/boost.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/features/boundary.h
-- Installing: /usr/local/include/pcl-1.14/pcl/features/range_image_border_extractor.h
-- Installing: /usr/local/include/pcl-1.14/pcl/features/impl/board.hpp
...
-- Installing: /usr/local/include/pcl-1.14/pcl/features/impl/boundary.hpp
-- Installing: /usr/local/include/pcl-1.14/pcl/features/impl/range_image_border_extractor.hpp
-- Installing: /usr/local/lib/libpcl_ml.so.1.14.1
-- Installing: /usr/local/lib/libpcl_ml.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_ml.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_ml.so
-- Installing: /usr/local/lib/pkgconfig/pcl_ml.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/ml/feature_handler.h
-- Installing: /usr/local/include/pcl-1.14/pcl/ml/multi_channel_2d_comparison_feature.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/ml/dt/decision_forest.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/ml/ferns/fern.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/ml/impl/dt/decision_forest_evaluator.hpp
...
-- Installing: /usr/local/include/pcl-1.14/pcl/ml/impl/svm/svm_wrapper.hpp
-- Installing: /usr/local/lib/libpcl_segmentation.so.1.14.1
-- Installing: /usr/local/lib/libpcl_segmentation.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_segmentation.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_segmentation.so
-- Installing: /usr/local/lib/pkgconfig/pcl_segmentation.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/segmentation/boost.h
-- Installing: /usr/local/include/pcl-1.14/pcl/segmentation/extract_clusters.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/segmentation/impl/extract_clusters.hpp
...
-- Installing: /usr/local/include/pcl-1.14/pcl/segmentation/impl/cpc_segmentation.hpp
-- Installing: /usr/local/lib/libpcl_surface.so.1.14.1
-- Installing: /usr/local/lib/libpcl_surface.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_surface.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_surface.so
-- Installing: /usr/local/lib/pkgconfig/pcl_surface.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/surface/boost.h
-- Installing: /usr/local/include/pcl-1.14/pcl/surface/eigen.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/surface/poisson.h
-- Installing: /usr/local/include/pcl-1.14/pcl/surface/3rdparty/poisson4/allocator.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/surface/impl/gp3.hpp
-- Installing: /usr/local/include/pcl-1.14/pcl/surface/impl/grid_projection.hpp
-- Installing: /usr/local/include/pcl-1.14/pcl/surface/impl/marching_cubes.hpp
...
-- Installing: /usr/local/lib/libpcl_registration.so.1.14.1
-- Installing: /usr/local/lib/libpcl_registration.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_registration.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_registration.so
-- Installing: /usr/local/lib/pkgconfig/pcl_registration.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/registration/eigen.h
-- Installing: /usr/local/include/pcl-1.14/pcl/registration/boost.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/registration/transforms.h
-- Installing: /usr/local/include/pcl-1.14/pcl/registration/transformation_estimation.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/registration/gicp.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/registration/impl/default_convergence_criteria.hpp
-- Installing: /usr/local/include/pcl-1.14/pcl/registration/impl/correspondence_estimation.hpp
...
-- Installing: /usr/local/include/pcl-1.14/pcl/registration/impl/transformation_estimation_3point.hpp
-- Installing: /usr/local/lib/libpcl_keypoints.so.1.14.1
-- Installing: /usr/local/lib/libpcl_keypoints.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_keypoints.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_keypoints.so
-- Installing: /usr/local/lib/pkgconfig/pcl_keypoints.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/keypoints/keypoint.h
-- Installing: /usr/local/include/pcl-1.14/pcl/keypoints/narf_keypoint.h
-- Installing: /usr/local/include/pcl-1.14/pcl/keypoints/sift_keypoint.h
...
-- Installing: /usr/local/lib/libpcl_tracking.so.1.14.1
-- Installing: /usr/local/lib/libpcl_tracking.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_tracking.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_tracking.so
-- Installing: /usr/local/lib/pkgconfig/pcl_tracking.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/tracking/tracking.h
-- Installing: /usr/local/include/pcl-1.14/pcl/tracking/tracker.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/tracking/impl/tracking.hpp
-- Installing: /usr/local/include/pcl-1.14/pcl/tracking/impl/tracker.hpp
...
-- Installing: /usr/local/lib/libpcl_recognition.so.1.14.1
-- Installing: /usr/local/lib/libpcl_recognition.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_recognition.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_recognition.so
-- Installing: /usr/local/lib/pkgconfig/pcl_recognition.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/recognition/boost.h
...
-- Installing: /usr/local/include/pcl-1.14/pcl/recognition/ransac_based/auxiliary.h
...
-- Installing: /usr/local/lib/libpcl_stereo.so.1.14.1
-- Installing: /usr/local/lib/libpcl_stereo.so.1.14
-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpcl_stereo.so.1.14.1" to "/usr/local/lib"
-- Installing: /usr/local/lib/libpcl_stereo.so
-- Installing: /usr/local/lib/pkgconfig/pcl_stereo.pc
-- Installing: /usr/local/include/pcl-1.14/pcl/stereo/stereo_grabber.h
-- Installing: /usr/local/include/pcl-1.14/pcl/stereo/stereo_matching.h
...
-- Installing: /usr/local/bin/pcl_pcd_convert_NaN_nan
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_pcd_convert_NaN_nan" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_pcd2ply
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_pcd2ply" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_ply2pcd
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_ply2pcd" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_xyz2pcd
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_xyz2pcd" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_pclzf2pcd
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_pclzf2pcd" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_pcd2vtk
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_pcd2vtk" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_add_gaussian_noise
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_add_gaussian_noise" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_pcd_change_viewpoint
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_pcd_change_viewpoint" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_concatenate_points_pcd
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_concatenate_points_pcd" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_demean_cloud
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_demean_cloud" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_generate
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_generate" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_convert_pcd_ascii_binary
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_convert_pcd_ascii_binary" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_pcd_introduce_nan
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_pcd_introduce_nan" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_hdl_grabber
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_hdl_grabber" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_ply2obj
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_ply2obj" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_ply2ply
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_ply2ply" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_ply2raw
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_ply2raw" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_plyheader
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_plyheader" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_plane_projection
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_plane_projection" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_compute_hausdorff
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_compute_hausdorff" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_compute_cloud_error
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_compute_cloud_error" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_voxel_grid
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_voxel_grid" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_passthrough_filter
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_passthrough_filter" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_radius_filter
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_radius_filter" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_outlier_removal
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_outlier_removal" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_fast_bilateral_filter
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_fast_bilateral_filter" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_morph
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_morph" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_local_max
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_local_max" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_grid_min
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_grid_min" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_cluster_extraction
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_cluster_extraction" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_progressive_morphological_filter
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_progressive_morphological_filter" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_mls_smoothing
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_mls_smoothing" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_uniform_sampling
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_uniform_sampling" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_sac_segmentation_plane
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_sac_segmentation_plane" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_train_unary_classifier
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_train_unary_classifier" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_unary_classifier_segment
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_unary_classifier_segment" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_crf_segmentation
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_crf_segmentation" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_train_linemod_template
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_train_linemod_template" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_normal_estimation
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_normal_estimation" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_boundary_estimation
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_boundary_estimation" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_fpfh_estimation
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_fpfh_estimation" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_vfh_estimation
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_vfh_estimation" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_spin_estimation
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_spin_estimation" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_extract_feature
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_extract_feature" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_marching_cubes_reconstruction
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_marching_cubes_reconstruction" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_gp3_surface
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_gp3_surface" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_poisson_reconstruction
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_poisson_reconstruction" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_icp
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_icp" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_icp2d
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_icp2d" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_elch
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_elch" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_lum
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_lum" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_ndt2d
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_ndt2d" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_ndt3d
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_ndt3d" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_transform_point_cloud
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_transform_point_cloud" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_transform_from_viewpoint
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_transform_from_viewpoint" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_match_linemod_template
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_match_linemod_template" to "/usr/local/lib"
-- Installing: /usr/local/bin/pcl_linemod_detection
-- Set non-toolchain portion of runtime path of "/usr/local/bin/pcl_linemod_detection" to "/usr/local/lib"

}}}


(2024-06-25)

I can’t cmake the project: dtcMLOps/upsamplingCloudPCL, with errors shown below.

Error: {{{
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
(base) zichen@homepc:~/Downloads/upsamplingCloudPCL$ cmake -Bbuild
 
=========================================
Project: upsampling_cloud 
=========================================
CMake Warning (dev) at /usr/local/share/pcl-1.14/Modules/FindFLANN.cmake:45 (find_package):
  Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
  variables.  Run "cmake --help-policy CMP0144" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
 
  CMake variable FLANN_ROOT is set to:
 
    /usr
 
  For compatibility, find_package is ignoring the variable, but code in a
  .cmake module might still use it.
Call Stack (most recent call first):
  /usr/local/share/pcl-1.14/PCLConfig.cmake:250 (find_package)
  /usr/local/share/pcl-1.14/PCLConfig.cmake:295 (find_flann)
  /usr/local/share/pcl-1.14/PCLConfig.cmake:551 (find_external_library)
  CMakeLists.txt:29 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- FLANN found (include: /usr/include, lib: /usr/lib/x86_64-linux-gnu/libflann_cpp.so)
-- Could NOT find Pcap (missing: PCAP_LIBRARIES PCAP_INCLUDE_DIRS) 
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/patches/99/FindHDF5.cmake:241 (try_compile):
  Unknown extension ".c" for file
 
    /home/zichen/Downloads/upsamplingCloudPCL/build/CMakeFiles/hdf5/cmake_hdf5_test.c
 
  try_compile() works only for enabled languages.  Currently these are:
 
    CXX
 
  See project() command to enable other languages.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/patches/99/FindHDF5.cmake:596 (_HDF5_test_regular_compiler_C)
  /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/VTK-vtk-module-find-packages.cmake:444 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/vtk-config.cmake:150 (include)
  /usr/local/share/pcl-1.14/PCLConfig.cmake:264 (find_package)
  /usr/local/share/pcl-1.14/PCLConfig.cmake:313 (find_VTK)
  /usr/local/share/pcl-1.14/PCLConfig.cmake:548 (find_external_library)
  CMakeLists.txt:29 (find_package)
 
 
CMake Error at /usr/local/share/pcl-1.14/PCLConfig.cmake:335 (string):
  string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.
Call Stack (most recent call first):
  /usr/local/share/pcl-1.14/PCLConfig.cmake:548 (find_external_library)
  CMakeLists.txt:29 (find_package)
 
 
-- Checking for module 'libusb-1.0'
--   No package 'libusb-1.0' found
-- Could NOT find libusb (missing: libusb_LIBRARIES libusb_INCLUDE_DIR) 
-- Found Qhull version 8.0.2
 
 
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/patches/99/FindHDF5.cmake:241 (try_compile):
  Unknown extension ".c" for file
 
    /home/zichen/Downloads/upsamplingCloudPCL/build/CMakeFiles/hdf5/cmake_hdf5_test.c
 
  try_compile() works only for enabled languages.  Currently these are:
 
    CXX
 
  See project() command to enable other languages.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/patches/99/FindHDF5.cmake:596 (_HDF5_test_regular_compiler_C)
  /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/VTK-vtk-module-find-packages.cmake:444 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/vtk-9.1/vtk-config.cmake:150 (include)
  /usr/local/share/pcl-1.14/PCLConfig.cmake:264 (find_package)
  /usr/local/share/pcl-1.14/PCLConfig.cmake:313 (find_VTK)
  /usr/local/share/pcl-1.14/PCLConfig.cmake:548 (find_external_library)
  CMakeLists.txt:29 (find_package)
 
 
CMake Error at /usr/local/share/pcl-1.14/PCLConfig.cmake:335 (string):
  string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.
Call Stack (most recent call first):
  /usr/local/share/pcl-1.14/PCLConfig.cmake:548 (find_external_library)
  CMakeLists.txt:29 (find_package)
 
 
-- PCL status:
--     version: 1.14.1
--     directory: /usr/local/share/pcl-1.14
CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FetchContent.cmake:1331 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  cmake/functions.cmake:5 (FetchContent_Declare)
  CMakeLists.txt:39 (fetch_project)
This warning is for project developers.  Use -Wno-dev to suppress it.
 
CMake Warning (dev) at build/_deps/cloudparse-src/CMakeLists.txt:18 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
 
  CMake variable PCL_ROOT is set to:
 
    /usr/local
 
  For compatibility, CMake is ignoring the variable.
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- PCL status:
--     version: 1.14.1
--     directory: /usr/local/share/pcl-1.14
CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FetchContent.cmake:1331 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  cmake/functions.cmake:5 (FetchContent_Declare)
  CMakeLists.txt:44 (fetch_project)
This warning is for project developers.  Use -Wno-dev to suppress it.
 
=========================================
Project: upsampling_cloud COMPILED WITH CMAKE 3.28.0-rc3
=========================================
-- Configuring incomplete, errors occurred!

}}}


Attempts:

  1. I installed libvtk9-dev: sudo aptitude install libvtk9-dev and sudo apt-get install libpcap-dev libusb-1.0-0-dev

    Compile again.

  2. And I

    Enable C language: Add the following line near the top of your CMakeLists.txt file, right after the project() command: enable_language(C) (Following the instrction of Claude3.5 Sonnet)

    Error:
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    
    (base) zichen@homepc:~/Downloads/upsamplingCloudPCL$ cmake -B build
    -- The CXX compiler identification is GNU 9.5.0
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- The C compiler identification is GNU 9.5.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    
    =========================================
    Project: upsampling_cloud 
    =========================================
    CMake Warning (dev) at /usr/local/share/pcl-1.14/Modules/FindFLANN.cmake:45 (find_package):
      Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
      variables.  Run "cmake --help-policy CMP0144" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.
    
      CMake variable FLANN_ROOT is set to:
    
        /usr
    
      For compatibility, find_package is ignoring the variable, but code in a
      .cmake module might still use it.
    Call Stack (most recent call first):
      /usr/local/share/pcl-1.14/PCLConfig.cmake:250 (find_package)
      /usr/local/share/pcl-1.14/PCLConfig.cmake:295 (find_flann)
      /usr/local/share/pcl-1.14/PCLConfig.cmake:551 (find_external_library)
      CMakeLists.txt:30 (find_package)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Checking for module 'flann'
    --   Found flann, version 1.9.1
    -- Found FLANN: /usr/lib/x86_64-linux-gnu/libflann_cpp.so  
    -- FLANN found (include: /usr/include, lib: /usr/lib/x86_64-linux-gnu/libflann_cpp.so)
    -- Found OpenMP_CXX: -fopenmp (found version "4.5") 
    -- Found OpenMP: TRUE (found version "4.5") found components: CXX 
    -- Found Pcap: /usr/lib/x86_64-linux-gnu/libpcap.so  
    -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")  
    -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.37") 
    CMake Error at /usr/local/share/pcl-1.14/PCLConfig.cmake:335 (string):
      string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
      command.
    Call Stack (most recent call first):
      /usr/local/share/pcl-1.14/PCLConfig.cmake:548 (find_external_library)
      CMakeLists.txt:30 (find_package)
    
    
    -- Checking for module 'libusb-1.0'
    --   Found libusb-1.0, version 1.0.25
    -- Found libusb: /usr/lib/x86_64-linux-gnu/libusb-1.0.so  
    -- Found Qhull version 8.0.2
    CMake Error at /usr/local/share/pcl-1.14/PCLConfig.cmake:335 (string):
      string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
      command.
    Call Stack (most recent call first):
      /usr/local/share/pcl-1.14/PCLConfig.cmake:548 (find_external_library)
      CMakeLists.txt:30 (find_package)
    
    
    -- Found PCL_COMMON: /usr/local/lib/libpcl_common.so  
    -- Found PCL_KDTREE: /usr/local/lib/libpcl_kdtree.so  
    -- Found PCL_OCTREE: /usr/local/lib/libpcl_octree.so  
    -- Found PCL_SEARCH: /usr/local/lib/libpcl_search.so  
    -- Found PCL_SAMPLE_CONSENSUS: /usr/local/lib/libpcl_sample_consensus.so  
    -- Found PCL_FILTERS: /usr/local/lib/libpcl_filters.so  
    -- Found PCL_2D: /usr/local/include/pcl-1.14  
    -- Found PCL_GEOMETRY: /usr/local/include/pcl-1.14  
    -- Found PCL_IO: /usr/local/lib/libpcl_io.so  
    -- Found PCL_FEATURES: /usr/local/lib/libpcl_features.so  
    -- Found PCL_ML: /usr/local/lib/libpcl_ml.so  
    -- Found PCL_SEGMENTATION: /usr/local/lib/libpcl_segmentation.so  
    -- Found PCL_SURFACE: /usr/local/lib/libpcl_surface.so  
    -- Found PCL_REGISTRATION: /usr/local/lib/libpcl_registration.so  
    -- Found PCL_KEYPOINTS: /usr/local/lib/libpcl_keypoints.so  
    -- Found PCL_TRACKING: /usr/local/lib/libpcl_tracking.so  
    -- Found PCL_RECOGNITION: /usr/local/lib/libpcl_recognition.so  
    -- Found PCL_STEREO: /usr/local/lib/libpcl_stereo.so  
    -- PCL status:
    --     version: 1.14.1
    --     directory: /usr/local/share/pcl-1.14
    CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FetchContent.cmake:1331 (message):
      The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
      not set.  The policy's OLD behavior will be used.  When using a URL
      download, the timestamps of extracted files should preferably be that of
      the time of extraction, otherwise code that depends on the extracted
      contents might not be rebuilt if the URL changes.  The OLD behavior
      preserves the timestamps from the archive instead, but this is usually not
      what you want.  Update your project to the NEW behavior or specify the
      DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
      robustness issue.
    Call Stack (most recent call first):
      cmake/functions.cmake:5 (FetchContent_Declare)
      CMakeLists.txt:40 (fetch_project)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at build/_deps/cloudparse-src/CMakeLists.txt:18 (find_package):
      Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
      Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
      command to set the policy and suppress this warning.
    
      CMake variable PCL_ROOT is set to:
    
        /usr/local
    
      For compatibility, CMake is ignoring the variable.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- PCL status:
    --     version: 1.14.1
    --     directory: /usr/local/share/pcl-1.14
    CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FetchContent.cmake:1331 (message):
      The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
      not set.  The policy's OLD behavior will be used.  When using a URL
      download, the timestamps of extracted files should preferably be that of
      the time of extraction, otherwise code that depends on the extracted
      contents might not be rebuilt if the URL changes.  The OLD behavior
      preserves the timestamps from the archive instead, but this is usually not
      what you want.  Update your project to the NEW behavior or specify the
      DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
      robustness issue.
    Call Stack (most recent call first):
      cmake/functions.cmake:5 (FetchContent_Declare)
      CMakeLists.txt:45 (fetch_project)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    =========================================
    Project: upsampling_cloud COMPILED WITH CMAKE 3.28.0-rc3
    =========================================
    -- Configuring incomplete, errors occurred!
    
  3. Then I suspect the pcl version mismatch, as that project used 1.12.1. So I want to find the previous verions in their “Downloads” and found there is an option for linux: sudo apt install libpcl-dev.

    But my Ubuntu 22.04 run into errors:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    
    (base) zichen@homepc:~/Downloads/upsamplingCloudPCL$ dpkg -l |  grep pcl
    (base) zichen@homepc:~/Downloads/upsamplingCloudPCL$ 
    (base) zichen@homepc:~/Downloads/upsamplingCloudPCL$ sudo apt install libpcl-dev
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
    libqt5webkit5-dev : Depends: libqt5webkit5 (= 5.212.0~alpha4-15ubuntu1) but it is not installable
    qttools5-dev : Depends: qttools5-dev-tools (= 5.15.3-1)
    E: Unable to correct problems, you have held broken packages.
    

    So I try to install it on Ubuntu 20.04. It can be installed, but the error for cmake the upsamplingCloudPCL persists.


(2024-06-27)

Recompile pcl after vtk installed.

  1. Install dependencies:

    • If vtk or libopenni-dev are missing, ccmake .. will stop at the log page (press l), where you can see which packages are not found.
    • Set env: export VTK_DIR=~/vtk/build
    1
    2
    3
    4
    
    cd build
    ccmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
    make -j8
    sudo make install
    
  2. Compiling with CUDA and GPU options turned on under cuda-11.8 fails:

    cuda header cannot found:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    
    [ 51%] Built target pcl_outofcore
    [ 51%] Building CXX object gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/record_tsdfvolume.cpp.o
    [ 51%] Building CXX object gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/capture.cpp.o
    [ 51%] Building CXX object gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/evaluation.cpp.o
    [ 51%] Linking CXX shared library ../lib/libpcl_surface.so
    In file included from /home/zichen/Downloads/pcl/gpu/kinfu/tools/../src/internal.h:42,
                     from /home/zichen/Downloads/pcl/gpu/kinfu/tools/kinfu_app.cpp:84:
    /home/zichen/Downloads/pcl/gpu/kinfu/tools/../src/safe_call.hpp:40:10: fatal error: cuda_runtime_api.h: No such file or directory
       40 | #include "cuda_runtime_api.h"
          |          ^~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make[2]: *** [gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/build.make:76: gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/kinfu_app.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    [ 51%] Building CXX object tools/CMakeFiles/pcl_viewer.dir/pcd_viewer.cpp.o
    In file included from /home/zichen/Downloads/pcl/gpu/kinfu/tools/../src/internal.h:42,
                     from /home/zichen/Downloads/pcl/gpu/kinfu/tools/record_tsdfvolume.cpp:52:
    /home/zichen/Downloads/pcl/gpu/kinfu/tools/../src/safe_call.hpp:40:10: fatal error: cuda_runtime_api.h: No such file or directory
       40 | #include "cuda_runtime_api.h"
          |          ^~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    
  3. Recompiling pcl without turning on CUDA and GPU options succeeds.


Compile on Ubu 20.04 ✅

Compile PCL for leveraging Nvidia GPU: Tutorials

I’m concerning GPU version is not good for debugging.


(2024-05-13)

System info:

  • OS: Ubuntu 20.04.6 LTS x86_64, Kernel: 5.15.0-105-generic
  • CPU: Intel i7-9700 (8) @ 4.700GHz
  • GPU: NVIDIA GeForce GTX 1050 Ti; GPU: Intel UHD Graphics 630
  • Memory: 5010MiB / 15809MiB
  • gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
  • Cudatoolkit: Cuda compilation tools, release 11.6, V11.6.55. Build cuda_11.6.r11.6/compiler.30794723_0
1
2
3
4
5
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install g++-7 -y

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc

Open GPU options in ccmake, which is an interactive interface How do I install ccmake? - SE

1
2
3
4
5
# install ccmake
sudo apt-get install cmake-curses-gui

mkdir build; cd build
ccmake ..

I turned ON 2 options: BUILD_CUDA and BUILD_GPU

Press c again to finish configurations and then press g to generate makefiles.

1
2
3
# cd build
make 
sudo make install

Fix install vtk

(2024-06-25)

I can’t cmake the project: dtcMLOps/upsamplingCloudPCL on alienware. I though I missed some dependencies.

Install (developer-version) dependencies:

  1. opengl: How to Install OpenGL Library on Ubuntu 20.04 LTS (Focal Fossa) DDG

    1
    2
    3
    
    sudo apt update && sudo apt upgrade
    sudo apt install freeglut3-dev libpcap-dev libusb-1.0-0-dev
    dpkg -L freeglut3-dev
    
  2. vtk: Getting Started-vtk

    1
    
    sudo apt install libvtk7-dev
    
  • After them, I didn’t compile the pcl again. I found there a pre-built libpcl-dev provided for linux, which is said “the recommended installation method” Download page

    1
    
    (base) yi@yi-Alienware-Aurora-R8:~$ sudo apt install libpcl-dev
    
    The version is 1.10.0
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    
    (base) yi@yi-Alienware-Aurora-R8:~$ dpkg -l | grep pcl
    ii  libdapclient6v5:amd64                 3.20.5-1                  amd64      Client library for the Network Data Access Protocol
    ii  libpcl-apps1.10:amd64                 1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - apps library
    ii  libpcl-common1.10:amd64               1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - common library
    ii  libpcl-dev                            1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - development files
    ii  libpcl-features1.10:amd64             1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - features library
    ii  libpcl-filters1.10:amd64              1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - filters library
    ii  libpcl-io1.10:amd64                   1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - I/O library
    ii  libpcl-kdtree1.10:amd64               1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - kdtree library
    ii  libpcl-keypoints1.10:amd64            1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - keypoints library
    ii  libpcl-ml1.10:amd64                   1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - ml library
    ii  libpcl-octree1.10:amd64               1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - octree library
    ii  libpcl-outofcore1.10:amd64            1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - outofcore library
    ii  libpcl-people1.10:amd64               1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - people library
    ii  libpcl-recognition1.10:amd64          1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - recognition library
    ii  libpcl-registration1.10:amd64         1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - registration library
    ii  libpcl-sample-consensus1.10:amd64     1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - sample consensus library
    ii  libpcl-search1.10:amd64               1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - search library
    ii  libpcl-segmentation1.10:amd64         1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - segmentation library
    ii  libpcl-stereo1.10:amd64               1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - stereo library
    ii  libpcl-surface1.10:amd64              1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - surface library
    ii  libpcl-tracking1.10:amd64             1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - tracking library
    ii  libpcl-visualization1.10:amd64        1.10.0+dfsg-5ubuntu1      amd64      Point Cloud Library - visualization library 
    

    And pcl-1.10 can be found:

    1
    2
    
    (base) yi@yi-Alienware-Aurora-R8:~$ whereis pcl-1.10
    pcl-1: /usr/include/pcl-1.10
    
  • cmake has no error:

    cmake output
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    
    (base) yi@yi-Alienware-Aurora-R8:~/Downloads/upsamplingCloudPCL$ cmake -Bbuild
    -- The CXX compiler identification is GNU 9.4.0
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    
    =========================================
    Project: upsampling_cloud 
    =========================================
    CMake Warning (dev) at /usr/local/share/pcl-1.14/Modules/FindFLANN.cmake:45 (find_package):
      Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
      variables.  Run "cmake --help-policy CMP0144" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.
    
      CMake variable FLANN_ROOT is set to:
    
        /usr
    
      For compatibility, find_package is ignoring the variable, but code in a
      .cmake module might still use it.
    Call Stack (most recent call first):
      /usr/local/share/pcl-1.14/PCLConfig.cmake:260 (find_package)
      /usr/local/share/pcl-1.14/PCLConfig.cmake:305 (find_flann)
      /usr/local/share/pcl-1.14/PCLConfig.cmake:570 (find_external_library)
      CMakeLists.txt:29 (find_package)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Checking for module 'flann'
    --   Found flann, version 1.9.1
    -- Found FLANN: /usr/lib/x86_64-linux-gnu/libflann_cpp.so  
    -- FLANN found (include: /usr/include, lib: /usr/lib/x86_64-linux-gnu/libflann_cpp.so)
    -- Found OpenMP_CXX: -fopenmp (found version "4.5") 
    -- Found OpenMP: TRUE (found version "4.5") found components: CXX 
    -- Found Pcap: /usr/lib/x86_64-linux-gnu/libpcap.so  
    -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")  
    -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.37") 
    -- The imported target "vtkParseOGLExt" references the file
       "/usr/bin/vtkParseOGLExt-7.1"
    but this file does not exist.  Possible reasons include:
    * The file was deleted, renamed, or moved to another location.
    * An install or uninstall procedure did not complete successfully.
    * The installation package was faulty and contained
       "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
    but not all the files it references.
    
    -- The imported target "vtkRenderingPythonTkWidgets" references the file
       "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
    but this file does not exist.  Possible reasons include:
    * The file was deleted, renamed, or moved to another location.
    * An install or uninstall procedure did not complete successfully.
    * The installation package was faulty and contained
       "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
    but not all the files it references.
    
    -- The imported target "vtk" references the file
       "/usr/bin/vtk"
    but this file does not exist.  Possible reasons include:
    * The file was deleted, renamed, or moved to another location.
    * An install or uninstall procedure did not complete successfully.
    * The installation package was faulty and contained
       "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
    but not all the files it references.
    
    -- The imported target "pvtk" references the file
       "/usr/bin/pvtk"
    but this file does not exist.  Possible reasons include:
    * The file was deleted, renamed, or moved to another location.
    * An install or uninstall procedure did not complete successfully.
    * The installation package was faulty and contained
       "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
    but not all the files it references.
    
    -- Checking for module 'libusb-1.0'
    --   Found libusb-1.0, version 1.0.23
    -- Found libusb: /usr/lib/x86_64-linux-gnu/libusb-1.0.so  
    -- Found Qhull: /usr/lib/x86_64-linux-gnu/libqhull_r.so  
    -- QHULL found (include: /usr/include, lib: /usr/lib/x86_64-linux-gnu/libqhull_r.so)
    -- Found PCL_COMMON: /usr/local/lib/libpcl_common.so  
    -- Found PCL_KDTREE: /usr/local/lib/libpcl_kdtree.so  
    -- Found PCL_OCTREE: /usr/local/lib/libpcl_octree.so  
    -- Found PCL_SEARCH: /usr/local/lib/libpcl_search.so  
    -- Found PCL_SAMPLE_CONSENSUS: /usr/local/lib/libpcl_sample_consensus.so  
    -- Found PCL_FILTERS: /usr/local/lib/libpcl_filters.so  
    -- Found PCL_2D: /usr/local/include/pcl-1.14  
    -- Found PCL_GEOMETRY: /usr/local/include/pcl-1.14  
    -- Found PCL_IO: /usr/local/lib/libpcl_io.so  
    -- Found PCL_FEATURES: /usr/local/lib/libpcl_features.so  
    -- Found PCL_ML: /usr/local/lib/libpcl_ml.so  
    -- Found PCL_SEGMENTATION: /usr/local/lib/libpcl_segmentation.so
    -- Found PCL_SURFACE: /usr/local/lib/libpcl_surface.so  
    -- Found PCL_REGISTRATION: /usr/local/lib/libpcl_registration.so
    -- Found PCL_KEYPOINTS: /usr/local/lib/libpcl_keypoints.so  
    -- Found PCL_TRACKING: /usr/local/lib/libpcl_tracking.so  
    -- Found PCL_RECOGNITION: /usr/local/lib/libpcl_recognition.so  
    -- Found PCL_STEREO: /usr/local/lib/libpcl_stereo.so  
    -- Found PCL_CUDA_COMMON: /usr/local/include/pcl-1.14  
    -- Found PCL_CUDA_FEATURES: /usr/local/lib/libpcl_cuda_features.so  
    -- Found PCL_CUDA_SEGMENTATION: /usr/local/lib/libpcl_cuda_segmentation.so  
    -- Found PCL_CUDA_SAMPLE_CONSENSUS: /usr/local/lib/libpcl_cuda_sample_consensus.so  
    -- Found PCL_GPU_CONTAINERS: /usr/local/lib/libpcl_gpu_containers.so  
    -- Found PCL_GPU_UTILS: /usr/local/lib/libpcl_gpu_utils.so  
    -- Found PCL_GPU_OCTREE: /usr/local/lib/libpcl_gpu_octree.so  
    -- Found PCL_GPU_FEATURES: /usr/local/lib/libpcl_gpu_features.so
    -- Found PCL_GPU_KINFU: /usr/local/lib/libpcl_gpu_kinfu.so  
    -- Found PCL_GPU_SEGMENTATION: /usr/local/lib/libpcl_gpu_segmentation.so  
    -- PCL status:
    --     version: 1.14.1
    --     directory: /usr/local/share/pcl-1.14
    CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FetchContent.cmake:1331 (message):
      The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
      not set.  The policy's OLD behavior will be used.  When using a URL
      download, the timestamps of extracted files should preferably be that of
      the time of extraction, otherwise code that depends on the extracted
      contents might not be rebuilt if the URL changes.  The OLD behavior
      preserves the timestamps from the archive instead, but this is usually not
      what you want.  Update your project to the NEW behavior or specify the
      DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
      robustness issue.
    Call Stack (most recent call first):
      cmake/functions.cmake:5 (FetchContent_Declare)
      CMakeLists.txt:39 (fetch_project)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at build/_deps/cloudparse-src/CMakeLists.txt:18 (find_package):
      Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
      Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
      command to set the policy and suppress this warning.
    
      CMake variable PCL_ROOT is set to:
    
        /usr/local
    
      For compatibility, CMake is ignoring the variable.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- PCL status:
    --     version: 1.14.1
    --     directory: /usr/local/share/pcl-1.14
    CMake Warning (dev) at /usr/local/share/cmake-3.28/Modules/FetchContent.cmake:1331 (message):
      The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
      not set.  The policy's OLD behavior will be used.  When using a URL
      download, the timestamps of extracted files should preferably be that of
      the time of extraction, otherwise code that depends on the extracted
      contents might not be rebuilt if the URL changes.  The OLD behavior
      preserves the timestamps from the archive instead, but this is usually not
      what you want.  Update your project to the NEW behavior or specify the
      DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
      robustness issue.
    Call Stack (most recent call first):
      cmake/functions.cmake:5 (FetchContent_Declare)
      CMakeLists.txt:44 (fetch_project)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    =========================================
    Project: upsampling_cloud COMPILED WITH CMAKE 3.28.0-rc3
    =========================================
    -- Configuring done (2.1s)
    CMake Warning at CMakeLists.txt:57 (add_executable):
      Cannot generate a safe runtime search path for target upsampling_cloud
      because files in some directories may conflict with libraries in implicit
      directories:
    
        runtime library [libfreetype.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libexpat.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libpng16.so.16] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libtiff.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libpython3.8.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libsz.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libxml2.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libQt5Widgets.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libQt5Gui.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libQt5Sql.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libQt5Core.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libgomp.so.1] in /usr/lib/gcc/x86_64-linux-gnu/9 may be hidden by files in:
          /home/yi/anaconda3/lib
    
      Some of these libraries may not be found correctly.
    
    
    CMake Warning at build/_deps/cloudparse-src/CMakeLists.txt:31 (add_library):
      Cannot generate a safe runtime search path for target cloudparse because
      files in some directories may conflict with libraries in implicit
      directories:
    
        runtime library [libpng16.so.16] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libexpat.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libtiff.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libQt5Widgets.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libQt5Gui.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libQt5Sql.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libQt5Core.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libsz.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libxml2.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libpython3.8.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libfreetype.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/yi/anaconda3/lib
        runtime library [libgomp.so.1] in /usr/lib/gcc/x86_64-linux-gnu/9 may be hidden by files in:
          /home/yi/anaconda3/lib
    
      Some of these libraries may not be found correctly.
    
    
    -- Generating done (0.0s)
    -- Build files have been written to: /home/yi/Downloads/upsamplingCloudPCL/build
    

    But make has error:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    
    (base) yi@yi-Alienware-Aurora-R8:~/Downloads/upsamplingCloudPCL/build$ make 
    [ 25%] Building CXX object _deps/cloudparse-build/CMakeFiles/cloudparse.dir/src/parser.cpp.o
    In file included from /home/yi/Downloads/upsamplingCloudPCL/build/_deps/cloudparse-src/include/cloudparse/parser.hpp:19,
                     from /home/yi/Downloads/upsamplingCloudPCL/build/_deps/cloudparse-src/src/parser.cpp:1:
    /home/yi/Downloads/upsamplingCloudPCL/build/_deps/cloudparse-src/include/cloudparse/concrete_parses.hpp:13:10: fatal error: pcl/io/vtk_lib_io.h: No such file or directory
       13 | #include <pcl/io/vtk_lib_io.h>
          |          ^~-~-~-~-~-~-~-~-~-~
    compilation terminated.
    make[2]: *** [_deps/cloudparse-build/CMakeFiles/cloudparse.dir/build.make:76: _deps/cloudparse-build/CMakeFiles/cloudparse.dir/src/parser.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:144: _deps/cloudparse-build/CMakeFiles/cloudparse.dir/all] Error 2
    make: *** [Makefile:156: all] Error 2
    
    • Maybe I need to re-compile pcl.
  • Re-compile pcl:

    Error:
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    
    [ 42%] Linking CXX executable ../bin/pcl_vtk2ply
    [ 42%] Built target pcl_vtk2ply
    Scanning dependencies of target pcl_viewer
    [ 42%] Building CXX object tools/CMakeFiles/pcl_viewer.dir/pcd_viewer.cpp.o
    [ 42%] Built target pcl_hdl_viewer_simple
    Scanning dependencies of target pcl_pcd2png
    [ 43%] Building CXX object tools/CMakeFiles/pcl_pcd2png.dir/pcd2png.cpp.o
    [ 43%] Linking CXX shared library ../lib/libpcl_surface.so
    [ 43%] Linking CXX executable ../bin/pcl_compute_cloud_error
    [ 43%] Built target pcl_compute_cloud_error
    Scanning dependencies of target pcl_convert_pcd_ascii_binary
    [ 43%] Linking CXX executable ../bin/pcl_obj2vtk
    [ 44%] Linking CXX executable ../bin/pcl_ply2pcd
    [ 44%] Building CXX object tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/convert_pcd_ascii_binary.cpp.o
    [ 44%] Built target pcl_obj2vtk
    Scanning dependencies of target pcl_pcd_introduce_nan
    [ 44%] Building CXX object tools/CMakeFiles/pcl_pcd_introduce_nan.dir/pcd_introduce_nan.cpp.o
    [ 44%] Built target pcl_ply2pcd
    Scanning dependencies of target pcl_outofcore
    [ 44%] Building CXX object outofcore/CMakeFiles/pcl_outofcore.dir/src/cJSON.cpp.o
    [ 44%] Linking CXX executable ../bin/pcl_compute_hausdorff
    [ 44%] Built target pcl_surface
    Scanning dependencies of target pcl_record_tsdfvolume
    [ 44%] Building CXX object gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/record_tsdfvolume.cpp.o
    [ 45%] Building CXX object outofcore/CMakeFiles/pcl_outofcore.dir/src/outofcore_node_data.cpp.o
    [ 45%] Built target pcl_compute_hausdorff
    Scanning dependencies of target pcl_kinfu_app
    [ 45%] Building CXX object gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/kinfu_app.cpp.o
    In file included from /home/yi/Downloads/pcl/gpu/kinfu/tools/../src/internal.h:42:0,
                     from /home/yi/Downloads/pcl/gpu/kinfu/tools/record_tsdfvolume.cpp:52:
    /home/yi/Downloads/pcl/gpu/kinfu/tools/../src/safe_call.hpp:40:10: fatal error: cuda_runtime_api.h: No such file or directory
     #include "cuda_runtime_api.h"
              ^~-~~-~-~-~-~-~-~-~-
    compilation terminated.
    make[2]: *** [gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/build.make:63: gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/record_tsdfvolume.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:2346: gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    [ 45%] Building CXX object gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/capture.cpp.o
    In file included from /home/yi/Downloads/pcl/gpu/kinfu/tools/../src/internal.h:42:0,
                     from /home/yi/Downloads/pcl/gpu/kinfu/tools/kinfu_app.cpp:84:
    /home/yi/Downloads/pcl/gpu/kinfu/tools/../src/safe_call.hpp:40:10: fatal error: cuda_runtime_api.h: No such file or directory
     #include "cuda_runtime_api.h"
              ^~-~~-~-~-~-~-~-~-~-
    compilation terminated.
    make[2]: *** [gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/build.make:63: gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/kinfu_app.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    [ 45%] Building CXX object outofcore/CMakeFiles/pcl_outofcore.dir/src/outofcore_base_data.cpp.o
    [ 45%] Linking CXX executable ../bin/pcl_convert_pcd_ascii_binary
    [ 45%] Built target pcl_convert_pcd_ascii_binary
    [ 45%] Linking CXX executable ../bin/pcl_pcd2png
    [ 45%] Built target pcl_pcd2png
    [ 45%] Linking CXX shared library ../lib/libpcl_outofcore.so
    [ 45%] Built target pcl_outofcore
    make[1]: *** [CMakeFiles/Makefile2:2379: gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/all] Error 2
    [ 45%] Linking CXX executable ../bin/pcl_pcd_introduce_nan
    [ 45%] Built target pcl_pcd_introduce_nan
    [ 45%] Linking CXX executable ../bin/pcl_viewer
    [ 45%] Built target pcl_viewer
    [ 45%] Linking CXX shared library ../lib/libpcl_sample_consensus.so
    [ 45%] Built target pcl_sample_consensus
    make: *** [Makefile:152: all] Error 2
    
    • I suspect the problem is the libvtk7-dev installed before: During ccmake configuration, the vtk is detected, so cuda will be called to build for some functions. But I don’t know why cuda can’t be found.

(2024-06-26)

  1. Change conda env doesn’t work

    • Change a conda env can avoid some warnings about lib hidden when ccmake configuration.
    1
    2
    3
    4
    5
    6
    7
    8
    
    (base) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl$ conda activate casmvsnet_pl
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl$ cd build/
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl/build$ rm -r *
    rm: cannot remove '*': No such file or directory
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl/build$ ls
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl/build$ ccmake ..
    
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl/build$ make
    
  2. Set the following env variables doesn’t work:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    
    # CUDA
    export CUDA=11.6
    export PATH=/usr/local/cuda-$CUDA/bin${PATH:+:${PATH}}
    export CUDA_PATH=/usr/local/cuda-$CUDA
    export CUDA_HOME=/usr/local/cuda-$CUDA
    export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH
    export LD_LIBRARY_PATH=/usr/local/cuda-$CUDA/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
    export NVCC=/usr/local/cuda-$CUDA/bin/nvcc
    export CFLAGS="-I$CUDA_HOME/include $CFLAGS"
    
  • Then I wonder “how to verify vtk installed on my system” (DDG)
  1. Remove libvtk7-dev and re-compile pcl:

    1
    
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl/build$ sudo apt remove --purge libvtk7-dev
    

    Recompile again, but this time VTK can’t be found at ccmake configuration:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    
     CMake Warning at cmake/pcl_find_vtk.cmake:31 (find_package):
       By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has
       asked CMake to find a package configuration file provided by "VTK", but
       CMake did not find one.
    
       Could not find a package configuration file provided by "VTK" with any of
       the following names:
    
         VTKConfig.cmake
         vtk-config.cmake
    
       Add the installation prefix of "VTK" to CMAKE_PREFIX_PATH or set "VTK_DIR"
       to a directory containing one of the above files.  If "VTK" provides a
       separate development package or SDK, be sure it has been installed.
     Call Stack (most recent call first):
       CMakeLists.txt:398 (include)
    
    • Therefore, the vtk-dev is required for some options.

    • The functions related to VTK are supposed to be ignored, so the compile suceeded (make -j8).

  2. Install vtk from src code: Building - VTK doc

    1
    2
    
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/vtk/build$ cmake --build ~/vtk/build
    [5091/5091] Creating library symlink lib/libvtkFiltersFlowPaths-9.3.so.1 lib/libvtkFiltersFlowPaths-9.3.so
    
  3. Recompile pcl

    The warning still occurs: CMake Warning at cmake/pcl_find_vtk.cmake:31 (find_package):

    I need to specify the path to vtk:

    1
    2
    3
    
    (base) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl/build$ export VTK_DIR=/home/yi/vtk/build
    (base) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl/build$ conda activate casmvsnet_pl
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/pcl/build$ ccmake ..
    

    The cuda headers: cuda_runtime_api.h still can’t be found:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    
    Scanning dependencies of target pcl_oni_viewer
    [ 45%] Building CXX object tools/CMakeFiles/pcl_oni_viewer.dir/oni_viewer_simple.cpp.o
    In file included from /home/yi/Downloads/pcl/gpu/kinfu/tools/../src/internal.h:42:0,
                     from /home/yi/Downloads/pcl/gpu/kinfu/tools/record_tsdfvolume.cpp:52:
    /home/yi/Downloads/pcl/gpu/kinfu/tools/../src/safe_call.hpp:40:10: fatal error: cuda_runtime_api.h: No such file or directory
     #include "cuda_runtime_api.h"
              ^~-~~-~-~-~-~-~-~-~-
    compilation terminated.
    make[2]: *** [gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/build.make:63: gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/record_tsdfvolume.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:2346: gpu/kinfu/tools/CMakeFiles/pcl_record_tsdfvolume.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    [ 45%] Building CXX object gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/capture.cpp.o
    [ 45%] Building CXX object outofcore/CMakeFiles/pcl_outofcore.dir/src/outofcore_base_data.cpp.o
    [ 46%] Linking CXX executable ../bin/pcl_pcd2png
    [ 46%] Built target pcl_pcd2png
    [ 46%] Building CXX object gpu/kinfu/tools/CMakeFiles/pcl_kinfu_app.dir/evaluation.cpp.o
    In file included from /home/yi/Downloads/pcl/gpu/kinfu/tools/../src/internal.h:42:0,
                     from /home/yi/Downloads/pcl/gpu/kinfu/tools/kinfu_app.cpp:84:
    /home/yi/Downloads/pcl/gpu/kinfu/tools/../src/safe_call.hpp:40:10: fatal error: cuda_runtime_api.h: No such file or directory
     #include "cuda_runtime_api.h"
              ^~-~~-~-~-~-~-~-~-~-
    compilation terminated.
    
    • Compilation succeeds when I don’t turn on CUDA and GPU options, so I installed a CPU version.

    • I may try to paste the cuda envs into .bashrc and compile again, can it found?

  4. The header <pcl/io/vtk xxx> still can’t be found when make the project [upsamplingCloudPCL].

    1
    2
    3
    4
    5
    6
    7
    8
    
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/upsamplingCloudPCL/build$ make
    [ 25%] Building CXX object _deps/cloudparse-build/CMakeFiles/cloudparse.dir/src/parser.cpp.o
    In file included from /home/yi/Downloads/upsamplingCloudPCL/build/_deps/cloudparse-src/include/cloudparse/parser.hpp:19:0,
                     from /home/yi/Downloads/upsamplingCloudPCL/build/_deps/cloudparse-src/src/parser.cpp:1:
    /home/yi/Downloads/upsamplingCloudPCL/build/_deps/cloudparse-src/include/cloudparse/concrete_parses.hpp:13:10: fatal error: pcl/io/vtk_lib_io.h: No such file or directory
     #include <pcl/io/vtk_lib_io.h>
              ^~-~~-~-~-~-~-~-~-~-
    compilation terminated.
    

    Should I create a symblic link: /usr/include/pcl instead of /usr/include/pcl-1.14 (containing pcl/), similar to the symblic link /usr/local/cuda directly contains dirs like bin/ wihouth an outer extra intermediate folder? So, when I’m checking the folders, I found the date of the pcl folder is 24-05-13. I realized I haven’t install the pcl after compilaiton.

    I sudo make install the pcl (Log file)

    The vtk_lib_io.h can be found!

    Another error:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    
    (casmvsnet_pl) yi@yi-Alienware-Aurora-R8:~/Downloads/upsamplingCloudPCL/build$ make
    [ 25%] Building CXX object _deps/cloudparse-build/CMakeFiles/cloudparse.dir/src/parser.cpp.o
    [ 50%] Linking CXX shared library libcloudparse.so
    [ 50%] Built target cloudparse
    [ 75%] Building CXX object CMakeFiles/upsampling_cloud.dir/src/main.cpp.o
    In file included from /home/yi/Downloads/upsamplingCloudPCL/src/main.cpp:5:0:
    /home/yi/Downloads/upsamplingCloudPCL/build/_deps/argparse-src/include/argparse/argparse.hpp:36:10: fatal error: charconv: No such file or directory
     #include <charconv>
              ^~-~-~-~-~
    compilation terminated.
    make[2]: *** [CMakeFiles/upsampling_cloud.dir/build.make:76: CMakeFiles/upsampling_cloud.dir/src/main.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/upsampling_cloud.dir/all] Error 2
    make: *** [Makefile:156: all] Error 2
    

    Claude3.5 remindes me this is a feature of C++17. I remember I had set g++ to 7 for compiling pcl.

    Once I switch g++ to 9, this error is gone. And the compilation for upsamplingCloudPCL succeeds. (Log file)

    Summary:

    1
    2
    3
    4
    
    ccmake -DCMAKE_BUILD_TYPE=Debug ..
    # Use the default options without turnning on CUDA and GPU
    make -j8
    sudo make -j8 install
    

Convert ply pcd

(2024-05-11)

Ref: Convertion of .ply format to .pcd format - SO

1
2
3
import open3d as o3d
ply = o3d.io.read_point_cloud("source_pointcloud.ply")
o3d.io.write_point_cloud("sink_pointcloud.pcd", ply)

Then use loadPCDFile to a PCLPointCloud2 template point cloud.

1
2
pcl::PCLPointCloud2 cloud_blob;
pcl::io::loadPCDFile ("../pcl/test/bun0.pcd", cloud_blob);

In this way, however, there is no triangle formed, as shown in the last line of the file “mesh.vtk”: POLYGONS 0 0. VTK file formats

(2024-05-13)


Read Ply file

(2024-05-12)

Docs

1
2
#include <pcl/io/ply_io.h>
pcl::io::loadPLYFile ("../CasMVSNet_pl-comments/results/dtu/image_ref/scan1/points3d.ply", cloud_blob);

Debug

Repo-Github

(2024-05-12)

  • The C/C++ extension in VSCode can’t cannot open source file "pcl/point_types.h"C/C++(1696)

  • Set IncludePath referring to Visual Studio Code cannot open source file “iostream” - SO

    • BTW, To find the path to C++: gcc -v -E -x c++ -

    • Create c_cpp_properties.json by pressing Ctrl+Shift+p and select C/C++: Edit Configurations (JSON)

    • Append includePath

      1
      2
      3
      4
      5
      
      "includePath": [
                      "${workspaceFolder}/**",
                      "/usr/local/include/pcl-1.14",
                      "/home/zichen/.local/include/eigen3"
                   ]
      
    • Eigen must be installed: cannot open source file "Eigen/StdVector" (dependency of "pcl/io/pcd_io.h")C/C++(1696)

      Installation Guide: Eigen - GitHub Pages

      It's installed in .local/include/eigen/ {{{
        1
        2
        3
        4
        5
        6
        7
        8
        9
       10
       11
       12
       13
       14
       15
       16
       17
       18
       19
       20
       21
       22
       23
       24
       25
       26
       27
       28
       29
       30
       31
       32
       33
       34
       35
       36
       37
       38
       39
       40
       41
       42
       43
       44
       45
       46
       47
       48
       49
       50
       51
       52
       53
       54
       55
       56
       57
       58
       59
       60
       61
       62
       63
       64
       65
       66
       67
       68
       69
       70
       71
       72
       73
       74
       75
       76
       77
       78
       79
       80
       81
       82
       83
       84
       85
       86
       87
       88
       89
       90
       91
       92
       93
       94
       95
       96
       97
       98
       99
      100
      101
      102
      103
      104
      105
      106
      107
      108
      109
      110
      111
      112
      113
      114
      115
      116
      117
      118
      119
      120
      121
      122
      123
      124
      125
      126
      127
      128
      129
      130
      131
      132
      133
      134
      135
      136
      137
      138
      139
      140
      141
      142
      143
      144
      145
      146
      147
      148
      149
      150
      151
      152
      153
      154
      155
      156
      157
      158
      159
      160
      161
      162
      163
      164
      165
      166
      167
      168
      169
      170
      171
      172
      173
      174
      175
      176
      177
      178
      179
      180
      181
      182
      183
      184
      185
      186
      187
      188
      189
      190
      191
      192
      193
      194
      195
      196
      197
      198
      199
      200
      201
      202
      203
      204
      205
      206
      207
      208
      209
      210
      211
      212
      213
      214
      215
      216
      217
      218
      219
      220
      221
      222
      223
      224
      
      -- Configured Eigen 3.3.7
      -- 
      -- Some things you can do now:
      -- --------------+--------------------------------------------------------------
      -- Command       |   Description
      -- --------------+--------------------------------------------------------------
      -- make install  | Install Eigen. Headers will be installed to:
      --               |     <CMAKE_INSTALL_PREFIX>/<INCLUDE_INSTALL_DIR>
      --               |   Using the following values:
      --               |     CMAKE_INSTALL_PREFIX: /home/zichen/.local
      --               |     INCLUDE_INSTALL_DIR:  include/eigen3
      --               |   Change the install location of Eigen headers using:
      --               |     cmake . -DCMAKE_INSTALL_PREFIX=yourprefix
      --               |   Or:
      --               |     cmake . -DINCLUDE_INSTALL_DIR=yourdir
      -- make doc      | Generate the API documentation, requires Doxygen & LaTeX
      -- make check    | Build and run the unit-tests. Read this page:
      --               |   http://eigen.tuxfamily.org/index.php?title=Tests
      -- make blas     | Build BLAS library (not the same thing as Eigen)
      -- make uninstall| Removes files installed by make install
      -- --------------+--------------------------------------------------------------
      -- 
      -- Configuring done (3.0s)
      -- Generating done (1.1s)
      -- Build files have been written to: /tmp/eigen/build
      + make install
      Install the project...
      -- Install configuration: "Release"
      -- Installing: /home/zichen/.local/include/eigen3/signature_of_eigen3_matrix_library
      -- Installing: /home/zichen/.local/share/pkgconfig/eigen3.pc
      -- Installing: /home/zichen/.local/share/eigen3/cmake/Eigen3Targets.cmake
      -- Installing: /home/zichen/.local/share/eigen3/cmake/UseEigen3.cmake
      -- Installing: /home/zichen/.local/share/eigen3/cmake/Eigen3Config.cmake
      -- Installing: /home/zichen/.local/share/eigen3/cmake/Eigen3ConfigVersion.cmake
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Cholesky
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/CholmodSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Core
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Dense
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Eigen
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Eigenvalues
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Geometry
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Householder
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/IterativeLinearSolvers
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Jacobi
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/LU
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/MetisSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/OrderingMethods
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/PaStiXSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/PardisoSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/QR
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/QtAlignedMalloc
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/SPQRSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/SVD
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/Sparse
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/SparseCholesky
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/SparseCore
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/SparseLU
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/SparseQR
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/StdDeque
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/StdList
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/StdVector
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/SuperLUSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/UmfPackSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Householder
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/DenseBase.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/functors/StlFunctors.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/CwiseTernaryOp.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/products
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/Transpositions.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/NoAlias.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/util
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/util/BlasUtil.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/DenseStorage.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/ZVector
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/ZVector/Complex.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/Default
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/Default/Settings.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/Default/ConjHelper.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/AVX
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/AVX/Complex.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/SSE
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/SSE/Complex.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/CUDA
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/CUDA/Complex.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/CUDA/MathFunctions.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/AltiVec
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/AVX512
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/AVX512/MathFunctions.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/AVX512/PacketMath.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/NEON
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/NEON/Complex.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/NEON/MathFunctions.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/PardisoSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/CholmodSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Jacobi
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Jacobi/Jacobi.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Eigenvalues
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/misc
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/misc/Image.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SuperLUSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/OrderingMethods
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/OrderingMethods/Ordering.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseCore
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseCore/SparseDot.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/IterativeLinearSolvers
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/QR
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/QR/CompleteOrthogonalDecomposition.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/StlSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/StlSupport/StdList.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/LU
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/LU/Determinant.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/LU/arch
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/LU/arch/Inverse_SSE.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/PaStiXSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SVD
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SVD/JacobiSVD.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Geometry
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Geometry/Umeyama.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseCholesky
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/plugins
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/plugins/BlockMethods.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/MetisSupport
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/MetisSupport/MetisSupport.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Cholesky
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Cholesky/LLT_LAPACKE.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Cholesky/LDLT.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/Cholesky/LLT.h
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseLU
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseQR
      -- Installing: /home/zichen/.local/include/eigen3/Eigen/src/SparseQR/SparseQR.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/AdolcForward
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/FFT
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/EulerAngles
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/EulerAngles/EulerAngles.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/EulerAngles/EulerSystem.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/MatrixFunctions
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/Eigenvalues
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/AutoDiff
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffJacobian.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/BVH
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/BVH/BVAlgorithms.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/BVH/KdBVH.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/NumericalDiff
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/Splines
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/SpecialFunctions
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/SparseExtra
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/Polynomials
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/MoreVectorization
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/MoreVectorization/MathFunctions.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/KroneckerProduct
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/Skyline
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/NonLinearOptimization
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/src/IterativeSolvers
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/CXX11/Tensor
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/CXX11/TensorSymmetry
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/CXX11/ThreadPool
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/CXX11/src
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/CXX11/src/Tensor
      ...
      -- Installing: /home/zichen/.local/include/eigen3/unsupported/Eigen/CXX11/src/util
      ...
      

      }}}


CloudCompare

Homepage | Download page

Install:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sudo apt install flatpak

# Add the Flathub repository
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

# Install CloudCompare
flatpak install flathub org.cloudcompare.CloudCompare

# Run the app
flatpak run org.cloudcompare.CloudCompare
# (base) yi@Alienware:~$ flatpak run org.cloudcompare.CloudCompare
  • It pops to warn about Python 3.11 requirement. But it’s okay to run in my conda env with Python 3.8.

Open a .vtk file:

The mesh.vtk result of greedy_projection.cpp for dtu scan1 point cloud (.ply) indeed doesn’t have mesh:

1
2
[19:15:38] [VTK] vtk output
[19:15:39] An error occurred while loading 'mesh': nothing to load

MeshLab

Remeshing

(2024-05-13)

Version: MeshLab 64bit dp v2023.12d built on Dec 12 2023 with GCC 9.4.0 and Qt 5.15.2.

Tutorial: MeshLab: Point Cloud to Mesh - Design Support - Greenwich Blogs (Search: “meshlab convert point cloud to mesh”)

Filters -> Remeshing, Simplification and Reconstruction -> Surface Reconstruction: Screened Poisson (or Ball Pivoting)

Poisson (defalut) Ball Pivoting (default)
Recon depth: 8 Clustering radius: 20%

Triangulation

Ball-Pivoting

Open3D

open3d.geometry.TriangleMesh - Docs

Ref: 5-Step Guide to generate 3D meshes from point clouds with Python - Medium - Florent Poux, Ph.D

  1. Basic code

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    
    import open3d as o3d
    import numpy as np
    
    pcd = o3d.io.read_point_cloud("/home/yi/Downloads/CasMVSNet_pl-comments/results/dtu/image_ref/scan1/points3d.ply", format='ply')
    
    distances = pcd.compute_nearest_neighbor_distance()
    avg_dist = np.mean(distances)
    # The radius of the ball should be larger than the avg distance between points
    radius = 3 * avg_dist
    
    # Ball-Pivoting Algorithm
    bpa_mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_ball_pivoting(pcd,o3d.utility.DoubleVector([radius, radius * 2]))
    
    dec_mesh = bpa_mesh.simplify_quadric_decimation(100000)
    
    dec_mesh.remove_degenerate_triangles()
    dec_mesh.remove_duplicated_triangles()
    dec_mesh.remove_duplicated_vertices()
    dec_mesh.remove_non_manifold_edges()
    
    o3d.io.write_triangle_mesh("bpa_mesh.ply", dec_mesh)
    
  2. Open the .ply file with ParaView:

    • The ball-pivoting algorithm result is better than possion on this point cloud.

  1. Retrieve triangles vertices:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    
    print(np.asarray(dec_mesh.triangles).shape)
    print(dec_mesh.triangles[0])
    print(np.asarray(dec_mesh.vertices).shape)
    print(dec_mesh.vertices[100567])
    # print(np.asarray(dec_mesh.triangle_uvs).shape)
    print(dec_mesh)
    
    vertices = np.asarray(dec_mesh.vertices)    # (220_583, 3)
    vertices = torch.from_numpy(vertices)
    triangles = np.asarray(dec_mesh.triangles)  # (100_000, 3)
    triangles = torch.from_numpy(triangles)
    K = 3 # number of vertices
    # Coordinates of 3 vertices of each triangle
    nnCoords = vertices.gather(dim=0, index=triangles.reshape(-1,1).expand(-1,3).type(torch.int64)).view(-1,K,3)  # (100_000,K,3)
    

Poisson

Open3D

  1. Basic Code:

    1
    2
    3
    4
    5
    6
    
    poisson_mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_poisson(pcd, depth=8, width=0, scale=1.1, linear_fit=False)[0]
    
    bbox = pcd.get_axis_aligned_bounding_box()
    p_mesh_crop = poisson_mesh.crop(bbox)
    
    o3d.io.write_triangle_mesh("p_mesh_c.ply", p_mesh_crop)
    
  2. Visualization in ParaView

    • Don’t know if the normals of the input .ply caused the Poisson reconsturction bad. It seems like a sheet is blown up.

Delaunay

(2024-06-21)

Search: “open3d delaunay triangulation” in DDG


PCL

(2024-05-13)

Search: “pointcloudlibrary triangulation” in DDG


Open3D

(2024-06-21)

Search: “open3d delaunay triangulation” in DDG doesn’t reveal Docs related to delaunay.

  • I asked perplexity: “Doesn’t the Open3D library have an implementation of Delaunay triangulation?”

    • Open3D does have since 0.8.0

geogram

(2024-06-21)

Repo: BrunoLevy/geogram (Found in DDG)


scipy

(2024-06-21)


PyVista

(2024-06-21)


Projection

Greedy Projection

  1. Code: PCL-Tutorial

    • Change the path to .pcd file:

      1
      
      pcl::io::loadPCDFile ("../../pcl/test/bun0.pcd", cloud_blob);
      
    • Save point cloud as .vtk file:

      1
      
      pcl::io::saveVTKFile ("mesh.vtk", triangles);
      
    • Build and compile:

      1
      2
      
      cmake -B ./build -DCMAKE_BUILD_TYPE=Debug
      make -C ./build
      
    • Execute: ./greedy_projection will generate a mesh.vtk


  1. Use ParaView to open .vtk files.

    • Uncompress:

      1
      
      tar xvf ParaView-5.12.0-MPI-Linux-Python3.10-x86_64.tar.gz
      
    • Execute:

      1
      
      ./home/jack/Programs/ParaView-5.12.0-MPI-Linux-Python3.10-x86_64/bin/paraview
      
    • Open the vtk file and open the “eye”.


Stitch Clouds

(2024-04-01)

Stitching point clouds from multiple cameras - camcalib


Resampling

MLS

PCL

(2024-05-28)

  • Interpolate point cloud base on Moving Least Squares. Tutorial

    1
    2
    3
    4
    
    mkdir -p pcl_resampling && cd $_
    nvim resampling.cpp
    cmake -B ./build -DCMAKE_BUILD_TYPE=Debug
    make -C ./build
    

Built with Hugo
Theme Stack designed by Jimmy