I am pretty sure my code is ok. I used OpenCv3.0.0.
'cap' opens but 'cap.read' returns false.
The webcam (logitech sphere) works through guvcview after I used the ppa to get the latest version. The same webcam works with opencv 2.4.8 on a different machine, but essentially same lubuntu setup.
I tried going back to OpenCv 2.4.8 but it did not change anything. Still cannot read frames from camera.
Any clues would be appreciated....
#include "opencv2/highgui/highgui.hpp"
using namespace cv;
void MainWindow::on_pushButton_clicked()
{
VideoCapture cap(0);
//cap.open(0);
if (cap.isOpened()) // if not success, exit program
{
while(true) {
Mat image;
if (cap.read(image)) {
imshow("Image", image);
}
int c = cvWaitKey(40);
}
}
}