Items with no label
3335 Discussions

how to turn off auto_exposure and set a exposure value on D415

GLin21
Beginner
2,588 Views

I am using the python wrapper for a project, where I want to set the enable_auto_exposure first so that the camera can adjust to the proper exposure value, then disable the setting and confirm to use the adjusted exposure. However, it does not work. It seems like the auto_exposure only adjust something else but actually not tuning the exposure value.

could someone show me the example code ?

0 Kudos
3 Replies
MartyG
Honored Contributor III
929 Views

There was another discussion where somebody was turning off auto-exposure and using manual exposure. You may be able to adapt their code to achieve your goal.

For example, you could first disable automatic exposure with sensor.set_option(RS2_OPTION_ENABLE_AUTO_EXPOSURE, false);

Then get the current exposure (the last value set before auto-exposure was disabled):

sensor.get_option(RS2_OPTION_EXPOSURE);

And make a custom-named manual exposure variable (such as the new_exposure used in that linked-to case) equal to the current exposure value above. Something like this structure:

new_exposure = sensor.get_option(RS2_OPTION_EXPOSURE)

And set the exposure manually using that custom variable:

sensor.set_option(RS2_OPTION_EXPOSURE, new_exposure);

0 Kudos
RZ1
Beginner
929 Views

Hi

I have problem to set the exposure sensor.get_option(RS2_OPTION_EXPOSURE).

in order to do that i have to install pysensor via pip which give an error.

Thanks for help

Collecting PySensors

Using cached https://files.pythonhosted.org/packages/4e/11/c17454160e80a60587adcb511b760a6ddf8b2d60683bb0edd85919199adf/PySensors-0.0.3.tar.gz

Complete output from command python setup.py egg_info:

Traceback (most recent call last):

File "", line 1, in

File "c:\users\appdata\local\temp\pip-install-fhhqvm\PySensors\setup.py", line 4, in

import sensors

File "sensors\__init__.py", line 19, in

SENSORS_LIB = CDLL(LIB_FILENAME)

File "c:\users\appdata\local\continuum\anaconda2\lib\ctypes\__init__.py", line 366, in __init__

self._handle = _dlopen(self._name, mode)

TypeError: expected string or Unicode object, NoneType found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in c:\users\appdata\local\temp\pip-install-fhhqvm\PySensors\

0 Kudos
MartyG
Honored Contributor III
929 Views

Hi rzz96,

I see you have received a response from Dorodnic, the RealSense SDK Manager, on your GitHub version of this question. Dorodnic is best placed to give an answer to this subject. Please follow up with him on the GitHub if you have further questions on this subject. Thanks!

0 Kudos
Reply