设为首页 加入收藏

TOP

基于Qt的图像采集系统【附源码】
2014-11-24 02:48:10 来源: 作者: 【 】 浏览:1
Tags:基于 图像 采集 系统 源码

Point Gray Camera


型号:FL3-U3-13S2C-CS


Sony IMX035 CMOS, 1/3", 3.63 m
Rolling Shutter
1328x1048 at 120 FPS


USB3.0



Windows 7 64bit


Qt 5.1


驱动:FlyCapture v2.5 Release 4 - Windows 64bit



将相机直接接到电脑的USB3.0接口上就可以了。



调用摄像头拍照,并在窗口中显示结果拍照结果。



开发的过程中主要是参考官方的文档,在sdk安装的文件夹里就有。


本文源码下载:


下载在Linux公社的1号FTP服务器里,下载地址:


用户名:www.6688.cc


在 2013年LinuxIDC.com\9月\基于Qt的图像采集系统【附源码】


下载方法见 http://www.linuxidc.net/thread-1187-1-1.html


代码结构


很简单,就一个类。


基于Qt的图像采集系统



首先要在.pro文件中包含头文件和库


INCLUDEPATH += "C:/Program Files/Point Grey Research/FlyCapture2/include"


LIBS += "C:\Program Files\Point Grey Research\FlyCapture2\lib64\FlyCapture2.lib"


main.cpp


#include "mainwindow.h"
#include


int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}


初始化一个MainWindow,然后显示,没什么好说的。



mainwindows.h


#ifndef MAINWINDOW_H
#define MAINWINDOW_H


#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
using namespace FlyCapture2;
class MainWindow : public QMainWindow
{
Q_OBJECT

public:
MainWindow(QWidget *parent = 0);
void printCameraInfo();
~MainWindow();
private:
QLabel *imageLabel;
QMenu *operationMenu;
QMenu *aboutMenu;
QMenu *cameraMenu;
QAction *startAction;
QAction *stopAction;
QAction *aboutAction;
QAction *cameraInfoAction;
QLabel *msgLabel;
QLabel *about;


void createActions();
void createMenus();
void printError(Error e);
void getCameraInfo();


PGRGuid guid;
Error error;
Camera cam;
CameraInfo camInfo;


public slots:
void slotAbout();
int slotStart();
void slotStop();
void slotShowCameraInfo();


};


#endif // MAINWINDOW_H


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C++多态性及虚函数 下一篇Java多线程向数据库写入数据

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: