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

Changing RGB Options in MATLAB Wrapper #7102

Closed
bauder96 opened this issue Aug 13, 2020 · 3 comments
Closed

Changing RGB Options in MATLAB Wrapper #7102

bauder96 opened this issue Aug 13, 2020 · 3 comments

Comments

@bauder96
Copy link


Required Info
Camera Model D415
Firmware Version 05.12.06.00
Operating System & Version Windows 10
Kernel Version (Linux Only) N/A
Platform PC
SDK Version
Language MATLAB
Segment

Issue Description

Good afternoon,

I am using the MATLAB wrapper to control and take in data from my D415. I am currently taking in a frame from the RGB camera, however the image is too dark to see anything. It is the same as when I use the RealSense Viewer and turn auto-exposure off. So, I am trying to change the options of the RGB camera. However, I cannot figure out how to do this. Here is my method:

dev = profile.get_device();
sensor = dev.first('SENSOR NAME');
sensor.set_option(realsense.option.enable_auto_exposure,0);
sensor.set_option(realsense.option.exposure,156);

The problem is, the only sensor types in the wrapper appear to be "sensor", "roi_sensor", "depth_sensor", and "depth_stereo_sensor". So when I run this, the exposure of the camera remains unchanged.

Does anyone have a solution?

Thanks!

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 13, 2020

Hi @bauder96 The best scripting reference that I could find for setting sensor options in the MATLAB wrapper is information provided by a RealSense team member in the link below:

#3358 (comment)

Edit: in the script in the link above, there may be a typo error, where:

if d_sensor.supports_option(optionemitter_enabled)

should be:

if d_sensor.supports_option(option.emitter_enabled)

Regarding differentiating between accessing the RGB and depth exposure settings: in regular C++ at least, my memory is that the same instruction is used for both, but you define whether you are targeting the depth or color auto-exposure in the sensor.set_option part of the code:

#3224 (comment)

color_sensor was in turn defined by the instruction rs2::sensor color_sensor;

#2637

image

Apologies if the above information is not as clear as it could be. I am adapting knowledge from regular non-MATLAB wrapper C++.

@bauder96
Copy link
Author

Hi Marty,

Thanks for your help. I did end up finding a solution (sort of). I am able to edit the settings of the RGB sensor. However, enabling auto exposure does not fix the dark image issue, so I had to set it manually. Not sure why auto exposure is not working. Here is my solution:
pipe = realsense.pipeline();
profile = pipe.start();
dev = profile.get_device();
sensors = dev.query_sensors();
sname = sensors{1}{2}.get_info(realsense.camera_info.name);
disp(sname);
sensors{1}{2}.set_option(realsense.option.enable_auto_exposure,0);
sensors{1}{2}.set_option(realsense.option.exposure,500);

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 13, 2020

Hi @bauder96 Great news that you made progress!

When auto-exposure is active, you may be able to increase brightness using a setting called Mean Intensity Set Point. Increasing the value should increase brightness.

You can test this in the RealSense Viewer program by expanding open the Advanced Controls section of the Viewer's options side panel whilst auto-exposure is enabled and expanding open its AE Control sub-category. Then increase the default value of Mean Intensity Set Point in that setting.

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

2 participants