Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchang2000 committed Jun 15, 2022
1 parent 1bfa9ae commit f83aa44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions data_capturing/DataCapturer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ def start_capture(self):

meta_file.close()
data_file.close()

print("All data saved!")
print("Run process_data to perform synchronization and extract capture phase.")
print("Additionally, please fill scene_meta.yaml with the objects that are in this scene.")
5 changes: 2 additions & 3 deletions data_processing/CameraPoseSynchronizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def synchronize_camera_poses_and_frames(scene_dir, cleaned_opti_poses, show_sync

#calculate virtual -> opti from ARUCO and extrinsic

camera_opti_calc = CameraOptiExtrinsicCalculator(None, None)
camera_opti_calc = CameraOptiExtrinsicCalculator()
aruco_to_opti = camera_opti_calc.get_aruco_to_opti()

dictionary = cv2.aruco.Dictionary_get(cv2.aruco.DICT_6X6_250)
Expand Down Expand Up @@ -94,8 +94,7 @@ def calculate_virtual_to_opti(row):
aruco_to_sensor[3,3] = 1
sensor_to_aruco = np.linalg.inv(aruco_to_sensor) # sensor -> aruco
sensor_to_opti = aruco_to_opti @ sensor_to_aruco # sensor -> opti
virtual_to_opti = sensor_to_opti
xyz_pos = virtual_to_opti[:3, -1]
xyz_pos = sensor_to_opti[:3, -1]
return xyz_pos

else:
Expand Down
6 changes: 0 additions & 6 deletions utils/depth_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import normalSpeed
from PIL import Image
import os
import numpy as np
Expand Down Expand Up @@ -36,11 +35,6 @@ def norm2bgr(norm):
norm = ((norm + 1.0) * 127).astype("uint8")
return norm

#depth should be in millimeters
def compute_normals(depth, fx, fy, k_size=5, distance_threshold=2000, difference_threshold=20, point_into_surface=False):
normals = normalSpeed.depth_normal(depth, fx, fy, k_size, distance_threshold, difference_threshold, point_into_surface)
return normals

def main():
ycb_root = "datasets/ycb/YCB_Video_Dataset/"
test_img = np.array(Image.open(os.path.join(ycb_root, "data/0000/000001-depth.png")))
Expand Down

0 comments on commit f83aa44

Please sign in to comment.