Computer Vision News - December 2019

Open3D for 3D processing 47 uses FLANN to build the KD tree. In our example, we paint a point in red and we show how to retrieve its neighbors. We search for the point's 200 neighbors and assign them the green color. The code and the results can be seen below: print ( "Testing kdtree in open3d ..." ) print ( "Load a point cloud and paint it gray." ) pcd = o3d . io . read_point_cloud( "D:/CVN dir/november19/icppc.pcd" ) pcd . paint_uniform_color([ 0.5 , 0.5 , 0.5 ]) pcd_tree = o3d . geometry . KDTreeFlann(pcd) print ( "Paint the 1500th point red." ) pcd . colors[ 1500 ] = [ 1 , 0 , 0 ] print ( "Find its 200 nearest neighbors, paint blue." ) [k, idx, _] = pcd_tree . search_knn_vector_3d(pcd . points[ 1500 ], 200 ) np . asarray(pcd . colors)[idx[ 1 :], :] = [ 0 , 0 , 1 ] print ( "Find its neighbors with distance less than 0.2, paint green." ) [k, idx, _] = pcd_tree . search_radius_vector_3d(pcd . points[ 1500 ], 0.2 ) np . asarray(pcd . colors)[idx[ 1 :], :] = [ 0 , 1 , 0 ] print ( "Visualize the point cloud." ) o3d . visualization . draw_geometries([pcd]) Conclusion Open3d is an extensive open source library for 3D processing. It supplies many useful tools to handle 3D data structure algorithms and visualizations. It can handle many types of 3D data such as meshes, point clouds,RGBDimagesandmore. Inthisarticle,weshowed its usage on point clouds generated from a collection of 2D images. We demonstrated how to clean outliers, how to register point clouds with point to point ICP and how to use KD trees. From our experience, open3D is quite robust allowing for industry-level applications in both C++ and Python. We recommend you try it yourself with the code above. Enjoy!

RkJQdWJsaXNoZXIy NTc3NzU=