-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inverted Color on Depth images #3363
Comments
@Xiphosphere For visual preset, could you elaborate more about "unable to successfully change"? Do you mean you can't see any change with visual preset or you got any error? Thanks! |
Hi, thanks for the prompt reply, but i am unable to see any changes in the visual preset when i try to change it via the python code. However, the visual presets do change as per normal when running the realsense-viewer. |
@Xiphosphere Sorry for late response! I can see the difference from visual preset 5 and preset 2. What values did you test? I'll attach the snapshot of my testing. |
@Xiphosphere Please see the snapshot of visual preset 5 as below. And below is the snapshot of visual preset 2. They showed some difference. |
@Xiphosphere Any other questions about this ticket? Looking forward to your update. Thanks! |
@Xiphosphere If no other questions, will close the ticket accordingly. Thanks! |
Hi apologies for the super late responses due to other tests being conducted, just tested on another Raspberry Pi and there has been a difference in the visual preset. Will close this ticket. Thanks again for all the hard work! |
Your code you provided is very beneficial. Regarding the laser power, I have a question. How can I determine IR power on python script? I can arrange it via Realsense Viewer, but I dont know is there a way for python script? |
Issue Description
Tried applying colorizer to the depth image but colors are inverted where red is near and blue is far.
Depth image works fine on realsense-viewer.
in issue #856 also tried to change the visual preset in the sample code provided by Dorodnic but unable to successfully change.
New to RealSense and programming as a whole, so do need some pointers in the right direction.
rs.txt
Code attached is a modified version of the opencv_viewer_example.py:
import pyrealsense2 as rs
import numpy as np
import cv2
pipeline=rs.pipeline()
config=rs.config()
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 15)
config.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 15)
config.enable_stream(rs.stream.infrared, 640, 480, rs.format.y8, 15)
cfg = pipeline.start(config)
dev = cfg.get_device()
colorizer = rs.colorizer()
colorizer.set_option(rs.option.color_scheme, 0)
depth_sensor = dev.first_depth_sensor()
depth_sensor.set_option(rs.option.visual_preset, 2)
try:
while True:
finally:
The text was updated successfully, but these errors were encountered: