Subversion Repositories seema-scanner

Rev

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

Rev 128 Rev 137
Line 19... Line 19...
19
#include <pcl/features/normal_3d.h>
19
#include <pcl/features/normal_3d.h>
20
 
20
 
21
 
21
 
22
void SMReconstructionWorker::setup(){
22
void SMReconstructionWorker::setup(){
23
 
23
 
-
 
24
 
-
 
25
}
-
 
26
 
-
 
27
void SMReconstructionWorker::reconstructPointCloud(SMFrameSequence frameSequence){
-
 
28
 
24
    QSettings settings;
29
    QSettings settings;
25
 
30
 
26
    // Get current calibration
31
    // Get current calibration
27
    calibration = settings.value("calibration/parameters").value<SMCalibrationParameters>();
32
    calibration = settings.value("calibration/parameters").value<SMCalibrationParameters>();
28
 
33
 
29
    // Create Algorithm
34
    // Create Algorithm
-
 
35
    QString codec = frameSequence.codec;
30
    int resX = settings.value("projector/resX").toInt();
36
    int resX = settings.value("projector/resX").toInt();
31
    int resY = settings.value("projector/resY").toInt();
37
    int resY = settings.value("projector/resY").toInt();
32
    QString codec = settings.value("algorithm", "GrayCode").toString();
-
 
-
 
38
 
33
    if(codec == "GrayCode")
39
    if(codec == "GrayCode")
34
        algorithm = new AlgorithmGrayCode(resX, resY);
40
        algorithm = new AlgorithmGrayCode(resX, resY);
35
    else if(codec == "GrayCodeHorzVert")
41
    else if(codec == "GrayCodeHorzVert")
36
        algorithm = new AlgorithmGrayCodeHorzVert(resX, resY);
42
        algorithm = new AlgorithmGrayCodeHorzVert(resX, resY);
37
    else if(codec == "PhaseShiftTwoFreq")
43
    else if(codec == "PhaseShiftTwoFreq")
Line 41... Line 47...
41
    else if(codec == "LineShift")
47
    else if(codec == "LineShift")
42
        algorithm = new AlgorithmLineShift(resX, resY);
48
        algorithm = new AlgorithmLineShift(resX, resY);
43
    else
49
    else
44
        std::cerr << "SLScanWorker: invalid codec " << codec.toStdString() << std::endl;
50
        std::cerr << "SLScanWorker: invalid codec " << codec.toStdString() << std::endl;
45
 
51
 
46
 
-
 
47
//    // Precompute lens correction maps
-
 
48
//    cv::Mat eye = cv::Mat::eye(3, 3, CV_32F);
-
 
49
//    cv::initUndistortRectifyMap(calibration.K0, calibration.k0, eye, calibration.K0, cv::Size(calibration.frameWidth, calibration.frameHeight), CV_32FC1, lensMap0Horz, lensMap0Vert);
-
 
50
//    cv::initUndistortRectifyMap(calibration.K0, calibration.k0, eye, calibration.K0, cv::Size(calibration.frameWidth, calibration.frameHeight), CV_32FC1, lensMap1Horz, lensMap1Vert);
-
 
51
 
-
 
52
    //cv::Mat mapHorz, mapVert;
-
 
53
    //cv::normalize(lensMap0Horz, mapHorz, 0, 255, cv::NORM_MINMAX, CV_8U);
-
 
54
    //cv::normalize(lensMap0Vert, mapVert, 0, 255, cv::NORM_MINMAX, CV_8U);
-
 
55
    //cv::imwrite("mapHorz.png", mapHorz);
-
 
56
    //cv::imwrite("mapVert.png", mapVert);
-
 
57
}
-
 
58
 
-
 
59
void SMReconstructionWorker::reconstructPointCloud(SMFrameSequence frameSequence){
-
 
60
 
-
 
61
    time.start();
52
    time.start();
62
 
53
 
63
    // Get 3D Points
54
    // Get 3D Points
64
    std::vector<cv::Point3f> Q;
55
    std::vector<cv::Point3f> Q;
65
    std::vector<cv::Vec3b> color;
56
    std::vector<cv::Vec3b> color;