-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReConSystem.py
More file actions
36 lines (34 loc) · 1.44 KB
/
ReConSystem.py
File metadata and controls
36 lines (34 loc) · 1.44 KB
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
# ---------------------------------------------------------
#Author: Wentao , Shanghai University, 2022
# ---------------------------------------------------------
from PoseSolver import PoseSolver
from MeshCreator import MeshCreator
from open3d import visualization
import open3d as o3d
from RGBDCollector import RecorderOneRGBDWithCallback
from RGBDdataLoader import get_rgbd_file_lists
import os
class ReConSystem:
def __init__(self,config,mode) -> None:
self.mode = mode
self.config = config
self.poseSolver = PoseSolver(config)
def run(self):
if self.mode == 1:
self.recorder = RecorderOneRGBDWithCallback()
self.recorder.run()
color_files, depth_files = get_rgbd_file_lists()
poseGraph = self.poseSolver.getPosegraph(color_files, depth_files)
for i in range(len(poseGraph.nodes)):
print(poseGraph.nodes[i].pose)
self.meshCreater = MeshCreator(self.config,poseGraph=poseGraph)
meshModel = self.meshCreater.integrateRgbdFrames(color_files, depth_files)
ply_name = os.path.dirname(os.path.abspath(__file__)) +"/recorder_dataset/fragmentmesh.ply"
o3d.io.write_triangle_mesh(ply_name,meshModel)
vis = visualization.Visualizer()
vis.create_window(width=512, height=512)
vis.add_geometry(meshModel)
# while True:
vis.run()
else:
pass