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

VideoCapture bug with Acer Switch 5 tablet #12514

Open
Andyjk1406 opened this issue Sep 12, 2018 · 0 comments
Open

VideoCapture bug with Acer Switch 5 tablet #12514

Andyjk1406 opened this issue Sep 12, 2018 · 0 comments

Comments

@Andyjk1406
Copy link

Andyjk1406 commented Sep 12, 2018

System information (version)
  • OpenCV = 3.4.1
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2015
Detailed description

Camera capture on Acer Switch 5 tablet appears to work, but if I try to manually focus the camera (using the onscreen menu) it actually just applies some kind of sharpen/blur, not focus.
The Windows Camera app allows a very close (macro) focus with the tablet camera, but OpenCV is unable to reproduce this.
It is as if the parameter OpenCV thinks is focus, is actually something completely different

Steps to reproduce
#include "opencv2/opencv.hpp"
#include <iostream>
 
using namespace std;
using namespace cv;
 
int main(){
 
  // Create a VideoCapture object and open the input file
  // If the input is the web camera, pass 0 instead of the video file name
  VideoCapture cap(0); 
    
  // Check if camera opened successfully
  if(!cap.isOpened()){
    cout << "Error opening video stream or file" << endl;
    return -1;
  }

cap.set(CV_CAP_PROP_SETTINGS,1); // To display the settings
// Now if the user tries to adjust the focus, something other than focus happens!
// If I leave it on auto-focus I can focus very close up so autofocus still works
// If I switch off autofocus and try to focus using the slider, I cannot focus 
// I suspect the parameter being changed by OpenCV is NOT focus, even though it thinks it is
// (Note. I do think the parameter being changed by the auto-focus on/off check box is correct - it switches off auto focus)
     
  while(1){
 
    Mat frame;
    // Capture frame-by-frame
    cap >> frame;
  
    // If the frame is empty, break immediately
    if (frame.empty())
      break;
 
    // Display the resulting frame
    imshow( "Frame", frame );
 
    // Press  ESC on keyboard to exit
    char c=(char)waitKey(25);
    if(c==27)
      break;
  }
  
  // When everything done, release the video capture object
  cap.release();
 
  // Closes all the frames
  destroyAllWindows();
     
  return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants