This commit is contained in:
hofee
2024-10-07 21:48:24 +08:00
parent dc769c5c1f
commit 2209acce1b
7 changed files with 32887 additions and 25 deletions

View File

@@ -7,6 +7,10 @@ import PytorchBoot.stereotype as stereotype
from PytorchBoot.utils.log_util import Log
from PytorchBoot.status import status_manager
import sys
sys.path.append("/home/user/nbv_rec/nbv_rec_control")
from utils.control_util import ControlUtil
from utils.communicate_util import CommunicateUtil
from utils.pts_util import PtsUtil
@@ -101,7 +105,7 @@ class CADStrategyRunner(Runner):
status_info=self.status_info
)
''' extract cam_to world sequence '''
''' extract cam_to_world sequence '''
cam_to_world_seq = []
coveraget_rate_seq = []
@@ -132,13 +136,13 @@ class CADStrategyRunner(Runner):
if __name__ == "__main__":
model_path = "/home/yan20/nbv_rec/data/test_CAD/test_model/bear_scaled.ply"
model_path = "/home/user/nbv_rec/data/mesh.obj"
model = trimesh.load(model_path)
test_pts_L = np.loadtxt("/home/yan20/nbv_rec/data/test_CAD/cam_pts_0_L.txt")
test_pts_R = np.loadtxt("/home/yan20/nbv_rec/data/test_CAD/cam_pts_0_R.txt")
cam_to_world_L = PtsUtil.register_icp(test_pts_L, model)
cam_to_world_R = PtsUtil.register_icp(test_pts_R, model)
print(cam_to_world_L)
print("================================")
print(cam_to_world_R)
test_pts_L = np.loadtxt("/home/user/nbv_rec/data/cam_pts_0_L.txt")
test_pts_R = np.loadtxt("/home/user/nbv_rec/data/cam_pts_0_R.txt")
cad_to_cam_L = PtsUtil.register_icp(test_pts_L, model)
cad_to_cam_R = PtsUtil.register_icp(test_pts_R, model)
cad_pts_L = PtsUtil.transform_point_cloud(test_pts_L, cad_to_cam_L)
cad_pts_R = PtsUtil.transform_point_cloud(test_pts_R, cad_to_cam_R)
np.savetxt("/home/user/nbv_rec/data/cad_pts_0_L.txt", cad_pts_L)
np.savetxt("/home/user/nbv_rec/data/cad_pts_0_R.txt", cad_pts_R)