Subversion Repositories seema-scanner

Rev

Rev 1 | Rev 20 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 17
Line 1... Line 1...
1
#include "CameraTest.h"
1
#include "Camera.h"
-
 
2
#include "CameraPointGrey.h"
2
#include <QApplication>
3
#include <opencv2/opencv.hpp>
-
 
4
 
-
 
5
int main(int argc, char *argv[]){
-
 
6
 
-
 
7
    std::vector< std::vector<CameraInfo> > camInfo = Camera::GetInterfaceCameraList();
-
 
8
 
-
 
9
    for(int i=0; i<camInfo.size(); i++){
-
 
10
        for(int j=0; j<camInfo[i].size(); j++){
-
 
11
            CameraInfo info = camInfo[i][j];
-
 
12
            std::cout << "(" << i << "," << j << ")" << info.vendor << " " << info.model << " " << info.busID << std::endl;
-
 
13
        }
-
 
14
    }
-
 
15
 
-
 
16
    Camera *cam = Camera::NewCamera(0, 0);
-
 
17
 
-
 
18
    for(int i=0; i<5; i++){
-
 
19
        CameraFrame frame = cam->getSingleFrame();
-
 
20
        cv::Mat frameCV(frame.height, frame.width, CV_8U, frame.memory);
-
 
21
        char filename[10];
-
 
22
        sprintf(filename, "%d.png", i);
-
 
23
        frameCV.convertTo(frameCV, CV_8U);
-
 
24
        cv::imwrite(std::string(filename), frameCV);
-
 
25
    }
3
 
26
 
4
int main(int argc, char *argv[])
-
 
5
{
-
 
6
    QApplication a(argc, argv);
-
 
7
    CameraTest w;
-
 
8
    w.show();
-
 
9
 
27
 
10
    return a.exec();
-
 
11
}
28
}