Subversion Repositories seema-scanner

Rev

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

Rev 123 Rev 128
Line 434... Line 434...
434
        for(unsigned int j=0; j<captureData[i].frames0.size(); j++){
434
        for(unsigned int j=0; j<captureData[i].frames0.size(); j++){
435
            QString fileName = QString("%1/frames0_%2.png").arg(seqDirName).arg(j);
435
            QString fileName = QString("%1/frames0_%2.png").arg(seqDirName).arg(j);
436
            // Convert Bayer to rgb (png needs BGR order)
436
            // Convert Bayer to rgb (png needs BGR order)
437
            cv::cvtColor(captureData[i].frames0[j], frameBGR, CV_BayerBG2BGR);
437
            cv::cvtColor(captureData[i].frames0[j], frameBGR, CV_BayerBG2BGR);
438
            cv::imwrite(fileName.toStdString(), frameBGR);
438
            cv::imwrite(fileName.toStdString(), frameBGR);
439
            // Necessary to prevent memory pileup?
439
            // Necessary to prevent memory pileup
440
            QCoreApplication::processEvents();
440
            QCoreApplication::processEvents();
441
        }
441
        }
442
        for(unsigned int j=0; j<captureData[i].frames1.size(); j++){
442
        for(unsigned int j=0; j<captureData[i].frames1.size(); j++){
443
            QString fileName = QString("%1/frames1_%2.png").arg(seqDirName).arg(j);
443
            QString fileName = QString("%1/frames1_%2.png").arg(seqDirName).arg(j);
444
            // Convert Bayer to rgb (png needs BGR order)
444
            // Convert Bayer to rgb (png needs BGR order)
445
            cv::cvtColor(captureData[i].frames1[j], frameBGR, CV_BayerBG2BGR);
445
            cv::cvtColor(captureData[i].frames1[j], frameBGR, CV_BayerBG2BGR);
446
            cv::imwrite(fileName.toStdString(), frameBGR);
446
            cv::imwrite(fileName.toStdString(), frameBGR);
447
            // Necessary to prevent memory pileup?
447
            // Necessary to prevent memory pileup
448
            QCoreApplication::processEvents();
448
            QCoreApplication::processEvents();
449
        }
449
        }
450
    }
450
    }
451
}
451
}
452
 
452
 
Line 461... Line 461...
461
 
461
 
462
        QString fileName = QString("%1/frames0_0.png").arg(seqDirName);
462
        QString fileName = QString("%1/frames0_0.png").arg(seqDirName);
463
        // Convert Bayer to rgb (png needs BGR order)
463
        // Convert Bayer to rgb (png needs BGR order)
464
        cv::cvtColor(captureData[i].frames0[0], frameBGR, CV_BayerBG2BGR);
464
        cv::cvtColor(captureData[i].frames0[0], frameBGR, CV_BayerBG2BGR);
465
        cv::imwrite(fileName.toStdString(), frameBGR);
465
        cv::imwrite(fileName.toStdString(), frameBGR);
466
        // Necessary to prevent memory pileup?
466
        // Necessary to prevent memory pileup
467
        QCoreApplication::processEvents();
467
        QCoreApplication::processEvents();
468
 
468
 
469
 
-
 
470
        fileName = QString("%1/frames1_0.png").arg(seqDirName);
469
        fileName = QString("%1/frames1_0.png").arg(seqDirName);
471
        // Convert Bayer to rgb (png needs BGR order)
470
        // Convert Bayer to rgb (png needs BGR order)
472
        cv::cvtColor(captureData[i].frames1[0], frameBGR, CV_BayerBG2BGR);
471
        cv::cvtColor(captureData[i].frames1[0], frameBGR, CV_BayerBG2BGR);
473
        cv::imwrite(fileName.toStdString(), frameBGR);
472
        cv::imwrite(fileName.toStdString(), frameBGR);
474
        // Necessary to prevent memory pileup?
473
        // Necessary to prevent memory pileup
475
        QCoreApplication::processEvents();
474
        QCoreApplication::processEvents();
476
 
475
 
477
    }
476
    }
478
 
477
 
479
}
478
}
Line 539... Line 538...
539
//    QString type = saveDirectoryDialog.selectedNameFilter();
538
//    QString type = saveDirectoryDialog.selectedNameFilter();
540
 
539
 
541
    // save point clouds in ply format
540
    // save point clouds in ply format
542
    for(unsigned int i=0; i<pointCloudData.size(); i++){
541
    for(unsigned int i=0; i<pointCloudData.size(); i++){
543
        QString fileName = QString("%1/pointcloud_%2.ply").arg(directory).arg(i);
542
        QString fileName = QString("%1/pointcloud_%2.ply").arg(directory).arg(i);
544
        pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloudPCL(pointCloudData[i].pointCloud);
543
        pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr pointCloudPCL(pointCloudData[i].pointCloud);
545
        //pcl::io::savePLYFileBinary(fileName.toStdString(), *pointCloudPCL);
544
        //pcl::io::savePLYFileBinary(fileName.toStdString(), *pointCloudPCL);
546
        pcl::PLYWriter w;
545
        pcl::PLYWriter w;
547
        // Write to ply in binary without camera
546
        // Write to ply in binary without camera
548
        w.write<pcl::PointXYZRGB> (fileName.toStdString(), *pointCloudPCL, true, false);
547
        w.write<pcl::PointXYZRGBNormal> (fileName.toStdString(), *pointCloudPCL, true, false);
549
    }
548
    }
550
 
549
 
551
    // save meshlab aln project file
550
    // save meshlab aln project file
552
    std::ofstream s(QString("%1/alignment.aln").arg(directory).toLocal8Bit());
551
    std::ofstream s(QString("%1/alignment.aln").arg(directory).toLocal8Bit());
553
    s << pointCloudData.size() << std::endl;
552
    s << pointCloudData.size() << std::endl;