# C# WPF opencvsharp4 obtaining all camera initial settings

**URL:** <https://forum.opencv.org/t/c-wpf-opencvsharp4-obtaining-all-camera-initial-settings/17806>\
**Category:** Python\
**Tags:** csharp\
**Created:** [May 31, 2024, 3:53am UTC](https://forum.opencv.org/t/c-wpf-opencvsharp4-obtaining-all-camera-initial-settings/17806 "2024-05-31T03:53:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zh\_y](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/zh_y/32/10575_2.png) [@zh\_y](https://forum.opencv.org/u/zh_y)\
**Post date:** [May 31, 2024, 3:53am UTC](https://forum.opencv.org/t/c-wpf-opencvsharp4-obtaining-all-camera-initial-settings/17806/1 "2024-05-31T03:53:44Z")

</div>

```auto
 videoCapture = new VideoCapture(0, VideoCaptureAPIs.DSHOW);
 try
 {
     videoCapture.FrameWidth = 1920;
     videoCapture.FrameHeight = 1080;
     videoCapture.Fps = 30;
     videoCapture.AutoExposure = 1;
     videoCapture.AutoFocus = true;
     videoCapture.BufferSize = 1;
     videoCapture.FourCC = "MJPG";

  //videoCapture.Brightness = 3;
  //videoCapture.Contrast = 172;
  //videoCapture.Exposure = -5;
  //videoCapture.Saturation = 129;
  //videoCapture.Sharpness = 255;
  //videoCapture.Zoom = 104;
  //videoCapture.WhiteBalanceBlueU = 6000;

```

i’m using c# wpf opencvsharp4 for vision test (this is my first time making a vision program). i’m currently using logitech C920e  
and the problem i’m facing is about the changes in setting when the camera gets  
turned on. when the camera first turns on (as i start my app) i tried to fix the camera  
setting values and the settings seem to get fixed, but the camera view still looks different.  
it looks the same a few times but later on it does not look the same.

so I’m wondering if the few camera settings I make are not enough and I want to get all the available camera settings and their range so that I can fix all these values so that I can have same camera setting everytime I open my program.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [May 31, 2024, 10:41am UTC](https://forum.opencv.org/t/c-wpf-opencvsharp4-obtaining-all-camera-initial-settings/17806/2 "2024-05-31T10:41:12Z")

</div>

if you want reproducible results, you should aim to disable auto-anything.

even then, due to manufacturing variability, pictures from two different devices of the same model may look slightly different, e.g. in focus and color.
