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 camera settings programmatically in C# #1747

Closed
blairlc opened this issue May 22, 2018 · 3 comments
Closed

How to change camera settings programmatically in C# #1747

blairlc opened this issue May 22, 2018 · 3 comments
Assignees

Comments

@blairlc
Copy link

blairlc commented May 22, 2018

Required Info
Camera Model D415
Firmware Version 05.08.15.00
Operating System & Version Win 10
Platform PC
SDK Version 2.11.1

Issue Description

I am trying to change the camera settings such as exposure programmatically using the C# wrapper. I saw this explanation which points to the API how-to, but I was not able to find the same methods in the C# version of the Device class.

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
@blairlc
Please refer to the code snippet below :PipelineProfile profile = pipeline.Start(cfg);

Pipeline pipeline = new Pipeline();

var cfg = new Config();
cfg.EnableStream(Stream.Depth, 640, 480);
cfg.EnableStream(Stream.Color, Format.Rgb8);
PipelineProfile profile = pipeline.Start(cfg);Sensor sensor = profile.Device.Sensors[0];

foreach(Sensor.CameraOption opt in sensor.Options)
{
    if (opt.Key == Option.LaserPower && opt.Supported)
    {
         Console.WriteLine("\nLaser Power before change{0}", opt.Value);
         opt.Value = opt.Value + opt.Step;
         Console.WriteLine("\nLaser Power after change{0}", opt.Value);
     }
}

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
@blairlc
Does the code answer your question? Can the ticket be closed?

@blairlc
Copy link
Author

blairlc commented Jun 8, 2018

Yes, I was able to figure out what I needed from that. Thanks.

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