How can i improve our depth image resolution in d435
Hi, im using d435 to get depth image for pose detection. While working for our project, the resolution of our depth image cant satisfy our expect. So, we tried to change pixel value from (640,480) to (1280,720) but, there are some problem.
import pyrealsense2 as rs
import numpy as np
import matplotlib.pyplot as plt
import cv2
# Configure depth and color streams
pipeline = rs.pipeline()
config = rs.config()
# Get device product line for setting a supporting resolution
pipeline_wrapper = rs.pipeline_wrapper(pipeline)
pipeline_profile = config.resolve(pipeline_wrapper)
device = pipeline_profile.get_device()
device_product_line = str(device.get_info(rs.camera_info.product_line))
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
# Start streaming
pipeline.start(config)
try:
while True:
frames = pipeline.wait_for_frames()
depth_frame = frames.get_depth_frame()
colorizer = rs.colorizer()
decimation = rs.decimation_filter()
decimation.set_option(rs.option.filter_magnitude, 2)
decimated_depth = decimation.process(depth_frame)
colorized_depth = np.asanyarray(colorizer.colorize(decimated_depth).get_data())
# Show images
cv2.namedWindow('RealSense', cv2.WINDOW_NORMAL)
cv2.imshow('RealSense', colorized_depth)
cv2.waitKey(1)
finally:
# Stop streaminghttp://localhost:8888/notebooks/capstone_project.ipynb
pipeline.stop()
after we change (640, 480) to (1280,720), then there are runtime error message occurs.
RuntimeError Traceback (most recent call last) <ipython-input-1-65350a342a9c> in <module>() 24 25 # Start streaming ---> 26 pipeline.start(config) 27 28 try: RuntimeError: Couldn't resolve requests
how can we improve our resolution?
-
Hi Blake58 Is your camera on a USB 2 connection, or plugged into a USB 3 port but being detected as USB 2? The error message RuntimeError: Couldn't resolve requests indicates that the SDK cannot fulfill the stream configuration request, either because the requested resolution / FPS mode is not currrently supported by the camera or because of a mistake in the instruction.
If you have defined the stream like this:
config.enable_stream(rs.stream.depth, 1280, 720, rs.format.z16, 30)
then a USB 2 connection would prevent this instruction from working. This is because on USB 2 the resolution 1280x720 is limited to an FPS speed of 6 (on the D455 model the minimum FPS is 5).
https://www.intelrealsense.com/usb2-support-for-intel-realsense-technology/

Please sign in to leave a comment.


Comments
3 comments