Subversion Repositories seema-scanner

Rev

Rev 227 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 227 Rev 242
1
 
1
 
2
#ifndef SMCaptureWorker_H
2
#ifndef SMCaptureWorker_H
3
#define SMCaptureWorker_H
3
#define SMCaptureWorker_H
4
 
4
 
5
#include "SMTypes.h"
5
#include "SMTypes.h"
6
#include "ProjectorOpenGL.h"
6
#include "ProjectorOpenGL.h"
7
#include "Camera.h"
7
#include "Camera.h"
8
#include "RotationStage.h"
8
#include "RotationStage.h"
9
#include "Algorithm.h"
9
#include "Algorithm.h"
10
 
10
 
11
#include <QObject>
11
#include <QObject>
12
#include <opencv2/opencv.hpp>
12
#include <opencv2/opencv.hpp>
13
 
13
 
14
enum mode {
14
enum mode {
15
    modeIdle,
15
    modeIdle,
16
    modeSMCalibrationSet,
16
    modeSMCalibrationSet,
17
    modeFrameSequence
17
    modeFrameSequence
18
};
18
};
19
 
19
 
20
class SMCaptureWorker : public QObject{
20
class SMCaptureWorker : public QObject{
21
    Q_OBJECT
21
    Q_OBJECT
22
 
22
 
23
    public:
23
    public:
24
        SMCaptureWorker(): setupSuccessful(0), working(0), focusingPattern(0), projector(nullptr), camera0(nullptr), camera1(nullptr), rotationStage(nullptr), algorithm(nullptr){}
24
        SMCaptureWorker(): setupSuccessful(0), working(0), focusingPattern(0), projector(nullptr), camera0(nullptr), camera1(nullptr), rotationStage(nullptr), algorithm(nullptr){}
25
        ~SMCaptureWorker(){}
25
        ~SMCaptureWorker(){}
26
    public slots:
26
    public slots:
27
        void setup();
27
        void setup();
28
        void doWork();
28
        void doWork();
29
        void rotateTo(float angle);
29
        void rotateTo(float angle);
30
        void acquireCalibrationSet(float angle);
30
        void acquireCalibrationSet(float angle);
31
        void acquireCalibrationSets(std::vector<float> angles);
31
        void acquireCalibrationSets(std::vector<float> angles);
32
        void acquireFrameSequence(float angle);
32
        void acquireFrameSequence(float angle);
33
        void acquireFrameSequences(std::vector<float> angles);
33
        void acquireFrameSequences(std::vector<float> angles);
34
        void abort();
34
        void abort();
35
        void stopWork();
35
        void stopWork();
36
        void setProjectFocusingPattern(bool _focusingPattern){focusingPattern = _focusingPattern;}
36
        void setProjectFocusingPattern(bool _focusingPattern){focusingPattern = _focusingPattern;}
37
    signals:
37
    signals:
38
        void newFrame(unsigned int camID, cv::Mat frame);
38
        void newFrame(unsigned int camID, cv::Mat frame);
39
        void newCalibrationSet(SMCalibrationSet frameSet);
39
        void newCalibrationSet(SMCalibrationSet frameSet);
40
        void newFrameSequence(SMFrameSequence frameSequence);
40
        void newFrameSequence(SMFrameSequence frameSequence);
41
        void rotatedTo(float angle);
41
        void rotatedTo(float angle);
42
        void busy();
42
        void busy();
43
        void done();
43
        void done();
44
        void finished();
44
        void finished();
45
    private:
45
    private:
-
 
46
        void acquireFrameSequenceLDR(SMFrameSequence &frameSequence);
-
 
47
        void acquireFrameSequenceHDR(SMFrameSequence &frameSequence);
46
        bool setupSuccessful;
48
        bool setupSuccessful;
47
        bool working;
49
        bool working;
48
        bool focusingPattern;
50
        bool focusingPattern;
49
        int delay;
51
        int delay;
50
        int stackingCalibration;
52
        int stackingCalibration;
51
        int stackingAcquisition;
53
        int stackingAcquisition;
52
        QString codec;
54
        QString codec;
53
        std::unique_ptr<Projector> projector;
55
        std::unique_ptr<Projector> projector;
54
        std::unique_ptr<Camera> camera0;
56
        std::unique_ptr<Camera> camera0;
55
        std::unique_ptr<Camera> camera1;
57
        std::unique_ptr<Camera> camera1;
56
        std::unique_ptr<RotationStage> rotationStage;
58
        std::unique_ptr<RotationStage> rotationStage;
57
        std::unique_ptr<Algorithm> algorithm;
59
        std::unique_ptr<Algorithm> algorithm;
58
};
60
};
59
 
61
 
60
#endif // SMCaptureWorker_H
62
#endif // SMCaptureWorker_H
61
 
63