Skip to content

Commit

Permalink
add code about resolution and field of view
Browse files Browse the repository at this point in the history
  • Loading branch information
haixuanTao committed Dec 3, 2024
1 parent 3013eab commit f44745a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions node-hub/dora-pyrealsense/dora_pyrealsense/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def main():

depth_sensor = profile.get_device().first_depth_sensor()
depth_scale = depth_sensor.get_depth_scale()

rgb_profile = profile.get_stream(rs.stream.color)
depth_profile = profile.get_stream(rs.stream.depth)
rgb_intr = rgb_profile.as_video_stream_profile().get_intrinsics()
# rgb_intr = depth_profile.get_extrinsics_to(rgb_profile)
node = Node()
start_time = time.time()

Expand Down Expand Up @@ -107,10 +110,12 @@ def main():
continue

storage = pa.array(frame.ravel())

# metadata["resolution"] = [rgb_intr.width, rgb_intr.height]
# metadata["focal_length"] = [rgb_intr.fx, rgb_intr.fy]
# metadata["principal_point"] = [rgb_intr.ppx, rgb_intr.ppy]
node.send_output("image", storage, metadata)
node.send_output(
"depth_image", pa.array(scaled_depth_image.ravel()), metadata
"depth", pa.array(scaled_depth_image.ravel()), metadata
)

elif event_type == "ERROR":
Expand Down

0 comments on commit f44745a

Please sign in to comment.