My code as follow. When I execute cvCreateCameraCapture(-1) in openCamera, the app ends.
TIP: Abnormal program termination. during startup program exited with code 0X000135
Why? The computer is notebook, and inner-Camera.
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
>
#include<highgui.h>
#include<cv.h>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void openCamera();
void readFrame();
void closeCamera();
void takingPhote();
private:
Ui::MainWindow *ui;
QTimer* timer;
QImage* image;
CvCapture* cam;
IplImage* frame;
};
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
cam = NULL;
timer = new QTimer(this);
image = new QImage;
connect(ui->openCamera, SIGNAL(clicked()), this, SLOT(openCamera()));
}
void MainWindow::openCamera()
{
cam = cvCreateCameraCapture(-1);
// timer->start(33);
// connect(timer, SIGNAL(timeout()), this, SLOT(readFrame()));
}
Adding my previous comment as an answer since it helped you solve the problem: