Мой код, как следует. Когда я выполняю cvCreateCameraCapture(-1)
в openCamera
, приложение заканчивается.
СОВЕТ: ненормальное завершение программы. во время запуска программы выход с кодом 0X000135
Почему? Компьютер ноутбук и внутренняя камера.
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()));
}