Subversion Repositories seema-scanner

Rev

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

Rev 208 Rev 225
Line 22... Line 22...
22
#include <pcl/features/normal_3d.h>
22
#include <pcl/features/normal_3d.h>
23
#include <pcl/features/normal_3d_omp.h>
23
#include <pcl/features/normal_3d_omp.h>
24
#include <pcl/common/transforms.h>
24
#include <pcl/common/transforms.h>
25
 
25
 
26
 
26
 
27
void SMReconstructionWorker::setup(){
-
 
28
}
-
 
29
 
-
 
30
void SMReconstructionWorker::reconstructPointCloud(const SMFrameSequence &frameSequence){
27
void SMReconstructionWorker::reconstructPointCloud(const SMFrameSequence &frameSequence){
31
 
28
 
32
    QSettings settings;
29
    QSettings settings;
33
 
30
 
34
    // Get current calibration
31
    // Get current calibration
Line 56... Line 53...
56
    else{
53
    else{
57
        std::cerr << "SLScanWorker: invalid codec (Please set codec in preferences): " << codec.toStdString() << std::endl;
54
        std::cerr << "SLScanWorker: invalid codec (Please set codec in preferences): " << codec.toStdString() << std::endl;
58
        return; // otherwise segfault TODO no default?
55
        return; // otherwise segfault TODO no default?
59
    }
56
    }
60
 
57
 
-
 
58
    assert(frameSequence.frames0.size() == algorithm->getNPatterns());
-
 
59
    assert(frameSequence.frames1.size() == algorithm->getNPatterns());
-
 
60
 
61
    time.start();
61
    time.start();
62
 
62
 
63
    // Get 3D Points
63
    // Get 3D Points
64
    std::vector<cv::Point3f> Q;
64
    std::vector<cv::Point3f> Q;
65
    std::vector<cv::Vec3b> color;
65
    std::vector<cv::Vec3b> color;
Line 127... Line 127...
127
    cv::Rodrigues(rot_rvec, R);
127
    cv::Rodrigues(rot_rvec, R);
128
    smPointCloud.R = cv::Matx33f(R);
128
    smPointCloud.R = cv::Matx33f(R);
129
    smPointCloud.T = cv::Vec3f(0.0,0.0,0.0);*/
129
    smPointCloud.T = cv::Vec3f(0.0,0.0,0.0);*/
130
 
130
 
131
    // Emit result
131
    // Emit result
132
    #pragma omp critical (CBRECOupdateUI1)
-
 
133
    {
-
 
134
        emit newPointCloud(smPointCloud);
132
    emit newPointCloud(smPointCloud);
135
        std::cout << "SMReconstructionWorker: " << time.elapsed() << "ms" << std::endl;
133
    std::cout << "SMReconstructionWorker: " << time.elapsed() << "ms" << std::endl;
136
        std::cout << "SMReconstructionWorker: " << smPointCloud.pointCloud->size() << " Points" << std::endl;
134
    std::cout << "SMReconstructionWorker: " << smPointCloud.pointCloud->size() << " Points" << std::endl;
137
    }
135
 
138
}
136
}
139
 
137
 
140
void SMReconstructionWorker::reconstructPointClouds(const std::vector<SMFrameSequence> &frameSequences){
138
void SMReconstructionWorker::reconstructPointClouds(const std::vector<SMFrameSequence> &frameSequences){
-
 
139
 
141
    // Process sequentially
140
    // Process sequentially
142
    #pragma omp parallel for
141
    #pragma omp parallel for
143
    for(unsigned int i=0; i<frameSequences.size(); i++){
142
    for(unsigned int i=0; i<frameSequences.size(); i++){
144
        if(!frameSequences[i].reconstructed) reconstructPointCloud(frameSequences[i]);
143
        if(!frameSequences[i].reconstructed) reconstructPointCloud(frameSequences[i]);
145
    }
144
    }