No effect from setting CAP_PROP_GAIN

asked 2020-11-02 09:41:08 -0600

amateurpirate gravatar image

OS: Windows 10 webcam: brand unknown, cheap, USB other settings: exposure 0.5ms, 1280*720@120

I tried setting CAP_PROP_GAIN with a range of different values, but wasn't able to see any discernible in my recorded videos. They all basically just look black.

I am able to control the gain from Amcap, but the settings don't persist into OpenCV recordings and my data pipeline requires that the videos be captured in OpenCV.

Any help is greatly appreciated!

edit retag flag offensive close merge delete

Comments

1
  • please check the reeturn value from capture.set()
  • try another backend, like VideoCapture(0,CAP_DSHOW) (default is MSMF with recent opencv)
  • with a bit of luck, capture.get(CAP_PROP_SETTINGS) (or was it set() ?) will open a window with the persistant driver settings, and maybe you can access gain from there
berak gravatar imageberak ( 2020-11-02 10:58:34 -0600 )edit

Just adding to this. The way to get that nice settings window to pop up is by running (It is the SET command) capture.set(CAP_PROP_SETTINGS,0); //The number you put here doesn't do anything, it just needs a value there

and the backend HAS to be DSHOW for this to work as of opencv 4.5

blorgggg gravatar imageblorgggg ( 2020-11-05 13:00:35 -0600 )edit