Browse Source

add code about resolution and field of view

tags/0.3.8-rc
haixuanTao haixuantao 1 year ago
parent
commit
b8413cee2e
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      node-hub/dora-pyrealsense/dora_pyrealsense/main.py

+ 8
- 3
node-hub/dora-pyrealsense/dora_pyrealsense/main.py View File

@@ -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()

@@ -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":


Loading…
Cancel
Save