Subversion Repositories seema-scanner

Rev

Rev 97 | Rev 100 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 97 Rev 99
Line 1... Line 1...
1
#include "SMCaptureWorker.h"
1
#include "SMCaptureWorker.h"
2
 
2
 
3
#include "AlgorithmGrayCode.h"
3
#include "AlgorithmGrayCode.h"
4
#include "AlgorithmGrayCodeHQ.h"
4
#include "AlgorithmGrayCodeHorzVert.h"
5
#include "AlgorithmPhaseShift.h"
5
#include "AlgorithmPhaseShift.h"
6
 
6
 
7
#include <QCoreApplication>
7
#include <QCoreApplication>
8
#include <QTime>
8
#include <QTime>
9
#include <QSettings>
9
#include <QSettings>
Line 50... Line 50...
50
    // Create Algorithm
50
    // Create Algorithm
51
    codec = settings.value("algorithm", "GrayCode").toString();
51
    codec = settings.value("algorithm", "GrayCode").toString();
52
    if(codec == "GrayCode")
52
    if(codec == "GrayCode")
53
        algorithm = new AlgorithmGrayCode(screenCols, screenRows);
53
        algorithm = new AlgorithmGrayCode(screenCols, screenRows);
54
    else if(codec == "GrayCodeHQ")
54
    else if(codec == "GrayCodeHQ")
55
        algorithm = new AlgorithmGrayCodeHQ(screenCols, screenRows);
55
        algorithm = new AlgorithmGrayCodeHorzVert(screenCols, screenRows);
56
    else if(codec == "PhaseShift")
56
    else if(codec == "PhaseShift")
57
        algorithm = new AlgorithmPhaseShift(screenCols, screenRows);
57
        algorithm = new AlgorithmPhaseShift(screenCols, screenRows);
58
    else
58
    else
59
        std::cerr << "SMCaptureWorker: invalid codec " << codec.toStdString() << std::endl;
59
        std::cerr << "SMCaptureWorker: invalid codec " << codec.toStdString() << std::endl;
60
 
60
 
Line 196... Line 196...
196
 
196
 
197
        // trigger cameras
197
        // trigger cameras
198
        camera0->trigger();
198
        camera0->trigger();
199
        camera1->trigger();
199
        camera1->trigger();
200
 
200
 
-
 
201
        cv::Mat frameCV;
-
 
202
        std::vector<char> compressedFrameCV;
-
 
203
 
201
        // retrieve frames
204
        // retrieve frames
202
        frame = camera0->getFrame();
205
        frame = camera0->getFrame();
203
        cv::Mat frameCV;
-
 
204
        frameCV  = cv::Mat(frame.height, frame.width, CV_8UC3, frame.memory);
206
        frameCV  = cv::Mat(frame.height, frame.width, CV_8UC3, frame.memory);
205
        frameCV = frameCV.clone();
207
        frameCV = frameCV.clone();
-
 
208
        cv::imencode("png", frameCV, compressedFrameCV);
206
 
209
 
207
        emit newFrame(0, frameCV);
210
        emit newFrame(0, frameCV);
208
        frameSequence.frames0.push_back(frameCV);
211
        frameSequence.compressedFrames0.push_back(compressedFrameCV);
209
 
212
 
210
        frame = camera1->getFrame();
213
        frame = camera1->getFrame();
211
        frameCV  = cv::Mat(frame.height, frame.width, CV_8UC3, frame.memory);
214
        frameCV  = cv::Mat(frame.height, frame.width, CV_8UC3, frame.memory);
212
        frameCV = frameCV.clone();
215
        frameCV = frameCV.clone();
-
 
216
        cv::imencode("png", frameCV, compressedFrameCV);
213
 
217
 
214
        emit newFrame(1, frameCV);
218
        emit newFrame(1, frameCV);
215
        frameSequence.frames1.push_back(frameCV);
219
        frameSequence.compressedFrames1.push_back(compressedFrameCV);
216
 
220
 
217
    }
221
    }
218
 
222
 
219
    frameSequence.rotationAngle = rotationStage->getAngle();
223
    frameSequence.rotationAngle = rotationStage->getAngle();
220
    frameSequence.codec = codec;
224
    frameSequence.codec = codec;