Class VideoCapture set() method on property Videoio.CAP_AUTO_WB

I used Class VideoCapture set() method to set many properties such as CAP_PROP_SHARPNESS, CAP_PROP_GAMA, CAP_PROP_BRIGHTNESS, CAP_PROP_AUTO_EXPOSURE, … They seemed all working fine in both my Ubuntu and Windows 10 PCs. However, when I tried to turn Auto White Balance on/off using set(Videoio.CAP_AUTO_WB, 1/0), it worked in Ubuntu but not Windows 10. I think my Windows 10 backend is master_winpack-bindings-win64-vc14-static. Does it support this property? I used UsbTreeView.exe in Windows10 PC and I can see both “White Balance Component” and “White Balance Component, Auto” shown as “yes” (which means the camera supports these features). I’m using opencv v4.5.1 and use Eclipse as my IDE in both Ubuntu and Windows 10 PCs.

windows10 API can be DSHOW or CAP_VFW …
read tutorial here about api

Each API is an user contribution. Then some api are complete and some are not finished. Feel free to add your contribution to opencv that’s opensource :slight_smile: :slight_smile:

@laurent.berger , I had tried both DSHOW and CAP_VFW when I call With DSHOW, I only can see a green screen of my frame. With CAP_VFW, the open() failed. BTW, I just realized the opencv uses MSMF as the backend

MSMF is the “new” thing after DSHOW. quite comparable in principle. not sure what they do differently.

is only defined for v4l

So, openCV only supports auto white balance switch for linux, not windows 10?

consider trying other constants that seem suitable

look at these files to see what’s implemented (or looks to be implemented):

use microsoft documentation to determine if you’d like to use a property that hasn’t been implemented. that would be the first step to improving the code.

Thanks. I checked both files. I couldn’t find any CAP_AUTO_WB in neither file. OpenCV only supports this auto white balance control in the linux. :frowning_face:
Thanks for the help.

so propose a change: open an issue on github. seems like it doesn’t miss much.

Thanks crackwitz. I just filed OpenCV Class VideoCapture doesn't support get/set Videoio.CAP_PROP_AUTO_WB in Windows 10 but Linux (Ubuntu) · Issue #19621 · opencv/opencv · GitHub as you suggested. Hopefully someone would implement this quickly.

Unfortunately, it got marked as a dup…

hm, that’s unfortunate and I disagree with the tagging/decision.

it’s there now though, and it won’t be deleted. the tags just make it “harder” to find.

there’s always a chance that someone will find it and work on it. it might even be you. I believe it doesn’t take much to fix this issue. I’ve seen some code in the dshow/msmf file that talks about “procAmp” and setting some other property to auto. that might work for white balance too.