Subversion Repositories seema-scanner

Rev

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

Rev 100 Rev 103
Line 52... Line 52...
52
 
52
 
53
void SMReconstructionWorker::reconstructPointCloud(SMFrameSequence frameSequence){
53
void SMReconstructionWorker::reconstructPointCloud(SMFrameSequence frameSequence){
54
 
54
 
55
    time.start();
55
    time.start();
56
 
56
 
57
    // Decompress frames
-
 
58
    int nFrames = frameSequence.compressedFrames0.size();
-
 
59
    std::vector<cv::Mat> frames0(nFrames), frames1(nFrames);
-
 
60
    for(int i=0; i<nFrames; i++){
-
 
61
        cv::imdecode(frameSequence.compressedFrames0[i], CV_LOAD_IMAGE_COLOR, &frames0[i]);
-
 
62
        cv::imdecode(frameSequence.compressedFrames1[i], CV_LOAD_IMAGE_COLOR, &frames1[i]);
-
 
63
    }
-
 
64
 
-
 
65
    // Get 3D Points
57
    // Get 3D Points
66
    std::vector<cv::Point3f> Q;
58
    std::vector<cv::Point3f> Q;
67
    std::vector<cv::Vec3b> color;
59
    std::vector<cv::Vec3b> color;
68
    algorithm->get3DPoints(calibration, frames0, frames1, Q, color);
60
    algorithm->get3DPoints(calibration, frameSequence.frames0, frameSequence.frames1, Q, color);
69
 
61
 
70
    // Convert point cloud to PCL format
62
    // Convert point cloud to PCL format
71
    pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloudPCL(new pcl::PointCloud<pcl::PointXYZRGB>);
63
    pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloudPCL(new pcl::PointCloud<pcl::PointXYZRGB>);
72
 
64
 
73
    pointCloudPCL->width = Q.size();
65
    pointCloudPCL->width = Q.size();