LoginSignup
0
0

More than 1 year has passed since last update.

pyrealsenseでdepthにthread_filterをかける方法

Posted at

目的

↓これの"Score Minimum Threshold"と"Score Maximum Threshold"をpyrealsenseで同じことをしたい

realsense_1.png

方法


depth_frame = frames.get_depth_frame()
t = rs.threshold_filter(min_dist=1, max_dist=2)
depth_frame = t.process(depth_frame)

実行結果

プログラム
import pyrealsense2 as rs

pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
config.enable_stream(rs.stream.color, 640, 480, rs.format.rgb8, 30)

pipeline.start(config)

align_to = rs.stream.color
align = rs.align(align_to)

for x in range(10):
  pipeline.wait_for_frames()

frames = pipeline.wait_for_frames()
frames = align.process(frames)

depth_frame = frames.get_depth_frame()
t = rs.threshold_filter(min_dist=1, max_dist=2)
depth_frame = t.process(depth_frame)

pipeline.stop()
  • 生画像

2.png

  • thread_filter(max_depth=1)

3.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0