Closed m10507323 closed 4 years ago
Could you try inserting this line directly below depth = frames.get_depth_frame() please:
if not depth: continue
So that it looks like this:
try:
while True:
frames = pipeline.wait_for_frames()
depth = frames.get_depth_frame()
if not depth: continue
colorizer = rs.colorizer()
@m10507323 , it seem that you're building from source from development
and not the master
branch.
If that's the case you'd need to pass in the stream index 0 so it would look
depth = frames.get_depth_frame(0)
Note that development
is used for experiments and in this case the change will be reverted.
@MartyG-RealSense , @ev-mp Hi, sorry for my late reply, https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md I follow this toturial to build librealsense, and I've already try both of your suggestion, here is my update code.
pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
profile = pipeline.start(config)
try:
while True:
frames = pipeline.wait_for_frames()
depth = frames.get_depth_frame(0)
if not depth:
continue
colorizer = rs.colorizer()
colorized_depth = np.asanyarray(colorizer.colorize(depth).get_data())
colorized_depth_rgb = cv2.cvtColor(colorized_depth, cv2.COLOR_BGR2RGB)
cv2.imshow('depth_colormap_rgb', colorized_depth_rgb)
cv2.waitKey(1)
finally:
pipeline.stop()
But I got new error:
No protocol specified
(depth_colormap_rgb:17537): Gtk-WARNING **: cannot open display: :0.0
In this case, should I change other setting or install any package? Thanks.
I find out that the problem isn't come from realsense but from Xserver. I'll try other way to solve it, thanks for your help.
Thanks very much for the update @m10507323 - good luck!
Hi, I build librealsense in arm base system and try to run demo python program, here is my program, and my camera model is D435.
But I got error message like this:
Is anyone know how to solve it? Any suggestion with be appreciated.