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 set the minimum possible reading distance, from the python script (L515) #8244

Closed
agenis opened this issue Jan 27, 2021 · 3 comments
Closed

Comments

@agenis
Copy link

agenis commented Jan 27, 2021


Required Info
Camera Model {L515}
Firmware Version 01.05.02.00
Operating System & Version Win10
Platform PC
SDK Version 2.40.0.2482
Language python
Segment others

Issue Description

Hello, i'm working with L515 and python pyrealsense2. My question is related to tuning the camera to see the closest object possible. In the specs it's said around 25cm, but when i change some tunings in the viewer (short range mode, min distance slider, etc.), we get to see objects as close as ~5cm on the 3d viewer. It seems to me that I have to change the setup manually in the viewer, and then the camera saves it when run from python... But I coulnd't find any example in python on how to do this directly from the code. Are there any examples of such code?
Thanks

@agenis agenis changed the title change minimun distance settings from the python script get minimum possible distance setting from the python script (L515) Jan 27, 2021
@gusrbgks
Copy link

I'm also looking for this issue.
In Viewer, you can see the depth image close by adjusting the Min Distance.
However, it cannot be checked when executed in Python code.
I would like to know the code to change this.

@agenis agenis changed the title get minimum possible distance setting from the python script (L515) how to set the minimum possible reading distance, from the python script (L515) Jan 29, 2021
@agenis
Copy link
Author

agenis commented Feb 15, 2021

I used that code that seems to work:

        import pyrealsense2 as rs
        pipeline = rs.pipeline()
        profile = pipeline.get_active_profile()
        profile.get_device().query_sensors()[0]  # 0 for depth sensor, 1 for camera sensor
        sensor.set_option(rs.option.min_distance, 0)
        sensor.set_option(rs.option.enable_max_usable_range, 0)

This, and maybe for a real close measurement, one might want as well to reduce the laser power below 50% (sensor.set_option(rs.option.laser_power, 80)) and keep receiver_gain rather high value (18 for me).

This reproduces some of the differences between the default mode and the close range mode.

@agenis agenis closed this as completed Feb 15, 2021
@DesmondZuo
Copy link

Thanks agenis! That actually worked for me!

just one typo, instead of:

profile.get_device().query_sensors()[0] # 0 for depth sensor, 1 for camera sensor

should be

sensor = pipeline_profile.get_device().query_sensors()[0]

again, thanks a lot!

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

No branches or pull requests

3 participants