Closed chencheng1560 closed 6 years ago
Hi @chencheng1560
You can get the same result with pyrealsense2
only, I would strongly advise against using pybackend2
.
Hi @dorodnic Thanks for your suggestion.
I use pyrealsense2 to implement the function to control the brightness.
I paste the code I use here, hope it can help someone who has the same requirement.
# Create a pipeline
pipeline = rs.pipeline()
#Create a config and configure the pipeline to stream
config = rs.config()
# Start streaming
profile = pipeline.start(config)
# Getting the depth sensor's depth scale (see rs-align example for explanation)
dev = profile.get_device()
##pipeline.stop()
for i in range(len(dev.sensors)):
if dev.sensors[i].is_depth_sensor() == False :
sens=dev.sensors[i]
break
print sens.get_option(rs.option.brightness)
print sens.get_option(rs.option.contrast)
print sens.get_option(rs.option.gain)
pipeline.stop()
[Realsense Customer Engineering Team Comment] Hi @chencheng1560,
Thanks for your code shared. Will close this since your have resolved it. If any more concern, you still can re-open or create another ticket.
Issue Description
I am using python wrapper provided by librealsense to control camera. There are two requirement: 1 take color/depth picture. 2 provide an api interface to control the brightness, contrast of the camera. So I "import pyrealsense2" to take color picture, and "import pybackend2" to control the brightness.
However, if this two modules import in one python file, ERR "ImportError: generic_type: type "option" is already registered!" happened.
May I know how can I solve this problem? Or is there any other method how can I meet the two requirement by python. Thanks