Computer Vision News - December 2019

We Tried for You 46 Next, we align the two point clouds to one another. Usually, a global registration algorithm has to be applied in order to give a good initial guess for the rough transformation. Since we know what is the true transformation, we start with a perturbed version of it. Note that the ICP algorithm only refines the transformation, hence a good initial guess is required. The code below performs the point to point registration. The first function is for visualization while the rest is the ICP algorithm. def draw_registration_result (source, target, transformation): source_temp = copy . deepcopy(source) target_temp = copy . deepcopy(target) source_temp . paint_uniform_color([ 1 , 0.706 , 0 ]) target_temp . paint_uniform_color([ 0 , 0.651 , 0.929 ]) source_temp . transform(transformation) o3d . visualization . draw_geometries([source_temp, target_temp]) source = o3d . io . read_point_cloud( "D:/CVN dir/november19/icppc.pcd" ) target = o3d . io . read_point_cloud( "D:/CVN dir/november19/icppc2.pcd" ) threshold = 0.002 trans_init = np . asarray([[ 0.9 , 0.01 , - 0.50 , 0.55 ], [ - 0.1 , 0.9 , - 0.2 , 0.7 ], [ 0.45 , 0.25 , 0.83 , - 1.4 ], [ 0.0 , 0.0 , 0.0 , 1.0 ]]) draw_registration_result(source, target, trans_init) print ( "Initial alignment" ) evaluation = o3d . registration . evaluate_registration(source, target, threshold,trans_init) print (evaluation) print ( "Apply point-to-point ICP" ) reg_p2p = o3d . registration . registration_icp( source, target, threshold, trans_init, o3d . registration . TransformationEstimationPointToPoint()) print (reg_p2p) print ( "Transformation is:" ) print (reg_p2p . transformation) print ( "" ) draw_registration_result(source, target, reg_p2p . transformation) Below you can see the final alignment we were able to achieve: KD-tree The last tool that we present in this article is the KD-tree (K dimensional tree). This is a data structure for point cloud that is used to perform fast retrieval of points and nearest neighbors from the point cloud. It partitions the space into a tree-like data structure, in which a search can be done efficiently. We will usually use it when we would like to inspect some specific areas in the cloud. Open3d

RkJQdWJsaXNoZXIy NTc3NzU=