Skip to content
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

How to change Disparity Shift in Python #2015

Closed
Litvak1 opened this issue Jul 8, 2018 · 3 comments
Closed

How to change Disparity Shift in Python #2015

Litvak1 opened this issue Jul 8, 2018 · 3 comments
Assignees

Comments

@Litvak1
Copy link

Litvak1 commented Jul 8, 2018

Required Info  
Camera Model D415
Firmware Version 05.08.15.00
Operating System & Version Linux (Ubuntu 16.04)
Kernel Version (Linux Only) 4.13.0-45-generic
Platform PC
SDK Version ?
Language Python

I want to take images of a table with objects, from different heights. As I have seen in realsense-viewer, if I change the value of Disparity Shift from 0 to 128, I can get images from half the MinZ range.

I need to change the Disparity Shift value during a script in python. How can I do that?

I found pyrealsense2.STDepthTableControl.disparityShift but didn't understand how to use it.

Thanks

@dorodnic
Copy link
Contributor

dorodnic commented Jul 9, 2018

Hi @Litvak1
Please see python-rs400-advanced-mode-example.py

@Litvak1
Copy link
Author

Litvak1 commented Jul 9, 2018

Hi @dorodnic ,

I actually looked at the example you've mentioned before and didn't understand it. Trying again I realized what I had to do:

device = rs.context().query_devices()[0]
advnc_mode = rs.rs400_advanced_mode(device)
depth_table_control_group = advnc_mode.get_depth_table()
depth_table_control_group.disparityShift = 128
advnc_mode.set_depth_table(depth_table_control_group)

Thanks!

@Litvak1 Litvak1 closed this as completed Jul 9, 2018
@dorodnic
Copy link
Contributor

Hi @Litvak1
Sorry, we certainly can add more comments to make it easier to understand.
Glad you figured it out, always feel free open more issues if you encounter any problems!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants