CLAMS: cleanup eigen_extensions.h, models can be saved/loaded in binary (*.bin) or ascii (*.txt) formats

This commit is contained in:
matlabbe
2016-10-14 15:24:24 -04:00
parent e13454fe3f
commit 0ce6ef8d8d
6 changed files with 129 additions and 223 deletions

View File

@@ -152,7 +152,7 @@ void DepthCalibrationDialog::saveModel()
{
if(_model && _model->getTrainingSamples())
{
QString path = QFileDialog::getSaveFileName(this, tr("Save distortion model to ..."), _workingDirectory+QDir::separator()+"distortion_model.bin", tr("Distortion model (*.bin)"));
QString path = QFileDialog::getSaveFileName(this, tr("Save distortion model to ..."), _workingDirectory+QDir::separator()+"distortion_model.bin", tr("Distortion model (*.bin *.txt)"));
if(!path.isEmpty())
{
//
@@ -163,7 +163,7 @@ void DepthCalibrationDialog::saveModel()
if(!results.empty())
{
QString name = QString(path).replace(".bin", ".png", Qt::CaseInsensitive);
QString name = QString(path).replace(".bin", ".png", Qt::CaseInsensitive).replace(".txt", ".png", Qt::CaseInsensitive);
cv::imwrite(name.toStdString(), results);
QDesktopServices::openUrl(QUrl::fromLocalFile(name));
}

View File

@@ -361,7 +361,7 @@ void ExportCloudsDialog::selectDistortionModel()
{
dir = _workingDirectory;
}
QString path = QFileDialog::getOpenFileName(this, tr("Select file"), dir, tr("Distortion model (*.bin)"));
QString path = QFileDialog::getOpenFileName(this, tr("Select file"), dir, tr("Distortion model (*.bin *.txt)"));
if(path.size())
{
_ui->lineEdit_distortionModel->setText(path);

View File

@@ -3028,7 +3028,7 @@ void PreferencesDialog::selectSourceDistortionModel()
{
dir = getWorkingDirectory();
}
QString path = QFileDialog::getOpenFileName(this, tr("Select file"), _ui->lineEdit_source_distortionModel->text(), tr("Distortion model (*.bin)"));
QString path = QFileDialog::getOpenFileName(this, tr("Select file"), _ui->lineEdit_source_distortionModel->text(), tr("Distortion model (*.bin *.txt)"));
if(!path.isEmpty())
{
_ui->lineEdit_source_distortionModel->setText(path);