opencvsharp icon indicating copy to clipboard operation
opencvsharp copied to clipboard

Autoexposure cannot be set

Open zBugi opened this issue 2 years ago • 2 comments

Summary of your issue

I tried to set the AutoExposure Propertie through _cam.SetCameraPropertie(OpenCvSharp.VideoCaptureProperties.AutoExposure, 0.25); (I tried multiple values but none worked for me :/) but when I call the _cam.GetCameraPropertie(OpenCvSharp.VideoCaptureProperties.AutoExposure); it allways responds with -1 and it results in still manuell mode. Through _cam.SetCameraPropertie(OpenCvSharp.VideoCaptureProperties.Settings,1); I can set the autoexposure the problem is I need to do it directly through code :/

Environment

Write your environment. Windows 10 using the Directshow API

What did you do when you faced the problem?

Example code:

   _cam.SetCameraPropertie(OpenCvSharp.VideoCaptureProperties.Exposure,-12);
  _cam.GetCameraPropertie(OpenCvSharp.VideoCaptureProperties.AutoExposure); // => -1
  _cam.SetCameraPropertie(OpenCvSharp.VideoCaptureProperties.AutoExposure,0.75);
  _cam.GetCameraPropertie(OpenCvSharp.VideoCaptureProperties.AutoExposure); // => -1
  _cam.SetCameraPropertie(OpenCvSharp.VideoCaptureProperties.AutoExposure,0.25);
  _cam.GetCameraPropertie(OpenCvSharp.VideoCaptureProperties.AutoExposure); // => -1
// no change in images even with sleep in between but when i do 
  _cam.SetCameraPropertie(OpenCvSharp.VideoCaptureProperties.Settings, 1);
// => Open a dialog from Directshow then tick AutoExposure => Effect in the images

zBugi avatar Mar 14 '22 16:03 zBugi

It depends on your hardware and API Backend you're using, check your device driver firstly, If it does support that then try setting some other backend via code below var dnnCapture = new VideoCapture(camIndex,VideoCaptureAPIs.MSMF);

AvenSun avatar Mar 18 '22 15:03 AvenSun

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 00:09 stale[bot]