Subversion Repositories seema-scanner

Rev

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

Rev 232 Rev 242
Line 416... Line 416...
416
    // Indicate that the current item is currently reconstructing
416
    // Indicate that the current item is currently reconstructing
417
    item->setTextColor(0, QColor(128, 128, 128));
417
    item->setTextColor(0, QColor(128, 128, 128));
418
    item->setIcon(0, QIcon::fromTheme("system-run"));
418
    item->setIcon(0, QIcon::fromTheme("system-run"));
419
 
419
 
420
    // Reconstruct the frame sequence
420
    // Reconstruct the frame sequence
421
    QMetaObject::invokeMethod(reconstructionWorker, "reconstructPointCloud", Q_ARG(SMFrameSequence, frameSequence));
421
    //QMetaObject::invokeMethod(reconstructionWorker, "reconstructPointCloud", Q_ARG(SMFrameSequence, frameSequence));
422
    frameSequence.reconstructed = true;
422
    frameSequence.reconstructed = true;
423
 
423
 
424
    captureData.push_back(frameSequence);
424
    captureData.push_back(frameSequence);
425
 
425
 
426
}
426
}
Line 514... Line 514...
514
    progressDialog.show();
514
    progressDialog.show();
515
 
515
 
516
    cv::Mat frameBGR;
516
    cv::Mat frameBGR;
517
    for(unsigned int i=0; i<captureData.size(); i++){
517
    for(unsigned int i=0; i<captureData.size(); i++){
518
 
518
 
-
 
519
        QString format;
-
 
520
        if(captureData[i].frames0[0].depth() == CV_32F)
-
 
521
            format = "hdr";
-
 
522
        else
-
 
523
            format = "png";
-
 
524
 
519
        QString seqDirName = QString("%1/sequence_%2").arg(dirName).arg(i);
525
        QString seqDirName = QString("%1/sequence_%2").arg(dirName).arg(i);
520
        if(!QDir().mkdir(seqDirName))
526
        if(!QDir().mkdir(seqDirName))
521
            std::cerr << "Could not create directory " << seqDirName.toStdString() << std::endl;
527
            std::cerr << "Could not create directory " << seqDirName.toStdString() << std::endl;
522
        for(unsigned int j=0; j<captureData[i].frames0.size(); j++){
528
        for(unsigned int j=0; j<captureData[i].frames0.size(); j++){
523
 
529
 
524
            progressDialog.setValue(100.0*i/captureData.size() + 100.0/captureData.size()*j/captureData[i].frames0.size());
530
            progressDialog.setValue(100.0*i/captureData.size() + 100.0/captureData.size()*j/captureData[i].frames0.size());
525
 
531
 
526
            QString fileName0 = QString("%1/frames0_%2.png").arg(seqDirName).arg(j);
532
            QString fileName0 = QString("%1/frames0_%2.%3").arg(seqDirName).arg(j).arg(format);
527
            // Convert Bayer to rgb (png needs BGR order)
533
            // Convert Bayer to rgb (png needs BGR order)
528
            cv::cvtColor(captureData[i].frames0[j], frameBGR, CV_BayerBG2BGR);
534
            cv::cvtColor(captureData[i].frames0[j], frameBGR, CV_BayerBG2BGR);
529
            cv::imwrite(fileName0.toStdString(), frameBGR);
535
            cv::imwrite(fileName0.toStdString(), frameBGR);
530
 
536
 
531
            // Necessary to prevent pileup of video frame signals
537
            // Necessary to prevent pileup of video frame signals
532
            QCoreApplication::processEvents();
538
            QCoreApplication::processEvents();
533
 
539
 
534
            QString fileName1 = QString("%1/frames1_%2.png").arg(seqDirName).arg(j);
540
            QString fileName1 = QString("%1/frames1_%2.%3").arg(seqDirName).arg(j).arg(format);
535
            // Convert Bayer to rgb (png needs BGR order)
541
            // Convert Bayer to rgb (png needs BGR order)
536
            cv::cvtColor(captureData[i].frames1[j], frameBGR, CV_BayerBG2BGR);
542
            cv::cvtColor(captureData[i].frames1[j], frameBGR, CV_BayerBG2BGR);
537
            cv::imwrite(fileName1.toStdString(), frameBGR);
543
            cv::imwrite(fileName1.toStdString(), frameBGR);
538
 
544
 
539
            // Necessary to prevent pileup of video frame signals
545
            // Necessary to prevent pileup of video frame signals