-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.py
More file actions
23 lines (19 loc) · 661 Bytes
/
view.py
File metadata and controls
23 lines (19 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import numpy as np
import pandas as pd
import cv2
import pyvista as pv
import os
import matplotlib.pyplot as plt
# Read the generated np file
points = np.loadtxt('data/point_cloud_side.txt')
import open3d as o3d
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(points)
o3d.visualization.draw_geometries([pcd])
# Create a mesh from the Delaunay triangulation using PyVista
mesh = pv.PolyData(points)
mesh = mesh.delaunay_3d(alpha=0.025)
mesh = mesh.texture_map_to_plane(inplace=True)
# texture = pv.read_texture('calibration_pictures/front.jpg')
# Plot the mesh
mesh.plot(show_edges=True, line_width=0.1, color='w', background='black')