Subversion Repositories seema-scanner

Rev

Rev 41 | Rev 70 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 jakw 1
#ifndef CODEC_H
2
#define CODEC_H
3
 
4
#include <vector>
5
#include <opencv2/opencv.hpp>
41 jakw 6
#include "SMCalibrationParameters.h"
4 jakw 7
 
36 jakw 8
enum CodingDir {CodingDirNone = 0,
9
               CodingDirHorizontal = 1 << 0,
10
               CodingDirVertical = 1 << 1,
11
               CodingDirBoth = CodingDirHorizontal | CodingDirVertical};
4 jakw 12
 
36 jakw 13
// Base class for all Algorithms
14
class Algorithm {
4 jakw 15
    public:
41 jakw 16
        Algorithm(unsigned int _screenCols, unsigned int _screenRows, CodingDir _dir = CodingDirHorizontal) : N(0), screenCols(_screenCols), screenRows(_screenRows),  dir(_dir){}
17
    virtual ~Algorithm(){}
4 jakw 18
        unsigned int getNPatterns(){return N;}
41 jakw 19
        int getscreenCols(){return screenCols;}
20
        int getscreenRows(){return screenRows;}
36 jakw 21
        CodingDir getDir(){return dir;}
4 jakw 22
        // Encoding
23
        virtual cv::Mat getEncodingPattern(unsigned int depth) = 0;
41 jakw 24
        // Matching
42 jakw 25
        virtual void get3DPoints(SMCalibrationParameters calibration, const std::vector<cv::Mat>& frames0, const std::vector<cv::Mat>& frames1, std::vector<cv::Point3f>& Q, std::vector<cv::Vec3b>& color) = 0;
4 jakw 26
    protected:
27
        unsigned int N;
28
        unsigned int screenCols, screenRows;
36 jakw 29
        CodingDir dir;
4 jakw 30
};
31
 
32
 
33
#endif // CODEC_H