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

OpenCV Class VideoCapture doesn't support get/set Videoio.CAP_PROP_AUTO_WB in Windows 10 but Linux (Ubuntu) #19621

Closed
kellanmom opened this issue Feb 25, 2021 · 3 comments
Labels
category: videoio(camera) duplicate question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org

Comments

@kellanmom
Copy link

kellanmom commented Feb 25, 2021

System information (version)
  • OpenCV => 4.5.1 release version
  • Operating System / Platform => Windows10 64 Bit
  • installed through exe; I didn't compiled
    -->
Detailed description
Steps to reproduce
// java code example
	VideoCapture capture = new VideoCapture();
    capture.open(0);
if (this.capture.isOpened())
{
         System.out.println("get backend name: " + capture.getBackendName());
         System.out.println("Camera Auto White Balance = " +  capture.get(Videoio.CAP_PROP_AUTO_WB));
         
         boolean b = capture.set(Videoio.CAP_PROP_AUTO_WB, 1);
         if (b)
              System.out.println("Successfully turn Auto White Balance ON");
         else
              System.out.println("Failed to turn Auto White Balance ON");
         System.out.println("Camera Auto White Balance = " +  capture.get(Videoio.CAP_PROP_AUTO_WB));

         b = capture.set(Videoio.CAP_PROP_AUTO_WB, 0);
         if (b)
              System.out.println("Successfully turn Auto White Balance OFF");
         else
              System.out.println("Failed to turn Auto White Balance OFF");
         System.out.println("Camera Auto White Balance = " +  capture.get(Videoio.CAP_PROP_AUTO_WB));
    }
Issue submission checklist

Output of above java code would be as below:

get backend name: MSMF
Camera Auto White Balance = -1.0
Failed to turn Auto White Balance ON
Camera Auto White Balance = -1.0
Failed to turn Auto White Balance OFF
Camera Auto White Balance = -1.0

I searched below pages and didn't find much regarding to this issue.

[heavy_check_mark ] I report the issue, it's not a question
[ heavy_check_mark ] I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution
[ heavy_check_mark ] I updated to latest OpenCV version and the issue is still there
[ heavy_check_mark ] There is reproducer code and related data files: videos, images, onnx, etc
@alalek
Copy link
Member

alalek commented Feb 25, 2021

Almost all videoio properties are optional and may have backend-specific implementation.
Refer to documentation.

@kellanmom
Copy link
Author

I didn't build opencv myself but use release version 4.5.1 exe to install on my Windows 10. Many properties work well through backen MSMF, such as brightness, contrast, ... even Auto Exposure on/off. I did look at cap_msmf.cpp and didn't see CAP_PROP_AUTO_WB in either CvCapture_MSMF::getProperty or CvCapture_MSMF::setProperty
I saw you marked this issue as duplicate. May I know the link of the same issue? I would like to track it. Thanks!

@alalek
Copy link
Member

alalek commented Feb 25, 2021

This is a duplicate question.

Refer to to documentation page and check this note:

Each backend supports devices properties (cv::VideoCaptureProperties) in a different way or might not support any property at all.

asmorkalov pushed a commit that referenced this issue Mar 21, 2023
…WHITE_BALANCE_BLUE_U_support_in_CAP_DSHOW

Support VideoCapture CAP_PROP_AUTO_WB and CV_CAP_PROP_WHITE_BALANCE_BLUE_U for DShow

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [OK] I agree to contribute to the project under Apache 2 License.
- [OK] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [OK] The PR is proposed to the proper branch
- [OK] There is a reference to the original bug report and related work
#19621
#21408

### Before apply this pull request console output.

before AWB setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: -1

after AWB disable setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: -1

after AWB enable setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: -1

after Manual WB(and Disable AWB) setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: -1

### After apply this pull request console output.

before AWB setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: 0

after AWB disable setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 4000
CAP_PROP_AUTO_WB: 0

after AWB enable setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 4000
CAP_PROP_AUTO_WB: 1

after Manual WB(and Disable AWB) setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: 0

### Test Code
[OpenCvVideoCapTest.zip](https://github.com/opencv/opencv/files/10825399/OpenCvVideoCapTest.zip)
hanliutong pushed a commit to hanliutong/opencv that referenced this issue Mar 27, 2023
…_PROP_WHITE_BALANCE_BLUE_U_support_in_CAP_DSHOW

Support VideoCapture CAP_PROP_AUTO_WB and CV_CAP_PROP_WHITE_BALANCE_BLUE_U for DShow

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [OK] I agree to contribute to the project under Apache 2 License.
- [OK] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [OK] The PR is proposed to the proper branch
- [OK] There is a reference to the original bug report and related work
opencv#19621
opencv#21408

### Before apply this pull request console output.

before AWB setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: -1

after AWB disable setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: -1

after AWB enable setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: -1

after Manual WB(and Disable AWB) setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: -1

### After apply this pull request console output.

before AWB setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: 0

after AWB disable setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 4000
CAP_PROP_AUTO_WB: 0

after AWB enable setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 4000
CAP_PROP_AUTO_WB: 1

after Manual WB(and Disable AWB) setting
CAP_PROP_WHITE_BALANCE_BLUE_U: 2000
CAP_PROP_AUTO_WB: 0

### Test Code
[OpenCvVideoCapTest.zip](https://github.com/opencv/opencv/files/10825399/OpenCvVideoCapTest.zip)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: videoio(camera) duplicate question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org
Projects
None yet
Development

No branches or pull requests

2 participants