Subversion Repositories seema-scanner

Rev

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

Rev 113 Rev 115
Line 444... Line 444...
444
            QCoreApplication::processEvents();
444
            QCoreApplication::processEvents();
445
        }
445
        }
446
    }
446
    }
447
}
447
}
448
 
448
 
-
 
449
void SMScanner::on_actionExport_White_Frames_triggered(){
-
 
450
 
-
 
451
    cv::Mat frameBGR;
-
 
452
    QString dirName = QFileDialog::getExistingDirectory(this, "Export frame sequences", QString());
-
 
453
    for(unsigned int i=0; i<captureData.size(); i++){
-
 
454
        QString seqDirName = QString("%1/sequence_%2").arg(dirName).arg(i);
-
 
455
        if(!QDir().mkdir(seqDirName))
-
 
456
            std::cerr << "Could not create directory " << seqDirName.toStdString() << std::endl;
-
 
457
 
-
 
458
        QString fileName = QString("%1/frames0_0.png").arg(seqDirName);
-
 
459
        // Convert Bayer to rgb (png needs BGR order)
-
 
460
        cv::cvtColor(captureData[i].frames0[0], frameBGR, CV_BayerBG2BGR);
-
 
461
        cv::imwrite(fileName.toStdString(), frameBGR);
-
 
462
        // Necessary to prevent memory pileup?
-
 
463
        QCoreApplication::processEvents();
-
 
464
 
-
 
465
 
-
 
466
        fileName = QString("%1/frames1_0.png").arg(seqDirName);
-
 
467
        // Convert Bayer to rgb (png needs BGR order)
-
 
468
        cv::cvtColor(captureData[i].frames1[0], frameBGR, CV_BayerBG2BGR);
-
 
469
        cv::imwrite(fileName.toStdString(), frameBGR);
-
 
470
        // Necessary to prevent memory pileup?
-
 
471
        QCoreApplication::processEvents();
-
 
472
 
-
 
473
    }
-
 
474
 
-
 
475
}
-
 
476
 
449
void SMScanner::on_reconstructButton_clicked(){
477
void SMScanner::on_reconstructButton_clicked(){
450
 
478
 
451
    // Set up reconstruction thread
479
    // Set up reconstruction thread
452
    reconstructionWorker = new SMReconstructionWorker;
480
    reconstructionWorker = new SMReconstructionWorker;
453
    reconstructionWorkerThread = new QThread(this);
481
    reconstructionWorkerThread = new QThread(this);
Line 567... Line 595...
567
    if(res == QMessageBox::Ok){
595
    if(res == QMessageBox::Ok){
568
        captureData.clear();
596
        captureData.clear();
569
        ui->captureTreeWidget->clear();
597
        ui->captureTreeWidget->clear();
570
    }
598
    }
571
}
599
}
-
 
600
 
-
 
601