File size: 3,770 Bytes
5236ead |
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 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;33m[Open3D WARNING] Read PLY failed: unable to read file: noisy_filtered.ply\u001b[0;m\n",
"Source shape: (50, 3)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"RPly: Unexpected end of file\n",
"RPly: Error reading 'view_px' of 'camera' number 0\n"
]
}
],
"source": [
"import open3d as o3d\n",
"import numpy as np\n",
"\n",
"source_path = \"noisy_filtered.ply\"\n",
"source_pcd = o3d.io.read_point_cloud(source_path)\n",
"\n",
"source_pcd_array = np.asarray(source_pcd.points)\n",
"print(\"Source shape:\", source_pcd_array.shape)\n",
"\n",
"# o3d.visualization.draw_geometries([source_pcd])"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Transformed shape: (368, 3)\n"
]
}
],
"source": [
"transformed_path = \"res/m3reg_pc.ply\"\n",
"transformed_pcd = o3d.io.read_point_cloud(transformed_path)\n",
"\n",
"transformed_pcd_array = np.asarray(transformed_pcd.points)\n",
"print(\"Transformed shape:\", transformed_pcd_array.shape)\n",
"\n",
"# o3d.visualization.draw_geometries([transformed_pcd])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;33m[Open3D WARNING] Read PLY failed: unable to read file: gt_filtered.ply\u001b[0;m\n",
"Target shape: (2048, 3)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"RPly: Unexpected end of file\n",
"RPly: Error reading 'view_px' of 'camera' number 0\n"
]
}
],
"source": [
"target_path = \"gt_filtered.ply\"\n",
"target_pcd = o3d.io.read_point_cloud(target_path)\n",
"\n",
"target_pcd_array = np.asarray(target_pcd.points)\n",
"print(\"Target shape:\", target_pcd_array.shape)\n",
"\n",
"# o3d.visualization.draw_geometries([target_pcd])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"source_pcd.paint_uniform_color([1, 0, 0])\n",
"target_pcd.paint_uniform_color([0, 1, 0])\n",
"\n",
"vis = o3d.visualization.Visualizer()\n",
"vis.create_window(window_name=\"Point Cloud Viewer\", width=1200, height=800, visible=True)\n",
"vis.add_geometry(source_pcd)\n",
"vis.add_geometry(target_pcd)\n",
"\n",
"vis.run()\n",
"vis.destroy_window()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"transformed_pcd.paint_uniform_color([1, 0, 0])\n",
"target_pcd.paint_uniform_color([0, 1, 0])\n",
"\n",
"vis = o3d.visualization.Visualizer()\n",
"vis.create_window(window_name=\"Point Cloud Viewer\", width=1200, height=800, visible=True)\n",
"vis.add_geometry(transformed_pcd)\n",
"vis.add_geometry(target_pcd)\n",
"\n",
"vis.run()\n",
"vis.destroy_window()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|