Added more options for multiband texturing

This commit is contained in:
matlabbe
2021-08-16 13:14:02 -04:00
parent 6fb553a5e7
commit ed68fe777b
5 changed files with 436 additions and 21 deletions

View File

@@ -230,6 +230,15 @@ ExportCloudsDialog::ExportCloudsDialog(QWidget *parent) :
connect(_ui->doubleSpinBox_cameraFilterVel, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(_ui->doubleSpinBox_cameraFilterVelRad, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(_ui->doubleSpinBox_laplacianVariance, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(_ui->checkBox_multiband, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(_ui->checkBox_multiband, SIGNAL(stateChanged(int)), this, SLOT(updateReconstructionFlavor()));
connect(_ui->spinBox_multiband_downscale, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
connect(_ui->comboBox_multiband_unwrap, SIGNAL(currentIndexChanged(int)), this, SIGNAL(configChanged()));
connect(_ui->checkBox_multiband_fillholes, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(_ui->spinBox_multiband_padding, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
connect(_ui->doubleSpinBox_multiband_bestscore, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(_ui->doubleSpinBox_multiband_angle, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(_ui->checkBox_multiband_forcevisible, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(_ui->checkBox_poisson_outputPolygons, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(_ui->checkBox_poisson_manifold, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
@@ -440,6 +449,13 @@ void ExportCloudsDialog::saveSettings(QSettings & settings, const QString & grou
settings.setValue("mesh_textureBlending", _ui->checkBox_blending->isChecked());
settings.setValue("mesh_textureBlendingDecimation", _ui->comboBox_blendingDecimation->currentIndex());
settings.setValue("mesh_textureMultiband", _ui->checkBox_multiband->isChecked());
settings.setValue("mesh_textureMultibandDownScale", _ui->spinBox_multiband_downscale->value());
settings.setValue("mesh_textureMultibandUnwrap", _ui->comboBox_multiband_unwrap->currentIndex());
settings.setValue("mesh_textureMultibandFillHoles", _ui->checkBox_multiband_fillholes->isChecked());
settings.setValue("mesh_textureMultibandPadding", _ui->spinBox_multiband_padding->value());
settings.setValue("mesh_textureMultibandBestScoreThr", _ui->doubleSpinBox_multiband_bestscore->value());
settings.setValue("mesh_textureMultibandAngleHardThr", _ui->doubleSpinBox_multiband_angle->value());
settings.setValue("mesh_textureMultibandForceVisible", _ui->checkBox_multiband_forcevisible->isChecked());
settings.setValue("mesh_angle_tolerance", _ui->doubleSpinBox_mesh_angleTolerance->value());
@@ -607,6 +623,13 @@ void ExportCloudsDialog::loadSettings(QSettings & settings, const QString & grou
_ui->checkBox_blending->setChecked(settings.value("mesh_textureBlending", _ui->checkBox_blending->isChecked()).toBool());
_ui->comboBox_blendingDecimation->setCurrentIndex(settings.value("mesh_textureBlendingDecimation", _ui->comboBox_blendingDecimation->currentIndex()).toInt());
_ui->checkBox_multiband->setChecked(settings.value("mesh_textureMultiband", _ui->checkBox_multiband->isChecked()).toBool());
_ui->spinBox_multiband_downscale->setValue(settings.value("mesh_textureMultibandDownScale", _ui->spinBox_multiband_downscale->value()).toInt());
_ui->comboBox_multiband_unwrap->setCurrentIndex(settings.value("mesh_textureMultibandUnwrap", _ui->comboBox_multiband_unwrap->currentIndex()).toInt());
_ui->checkBox_multiband_fillholes->setChecked(settings.value("mesh_textureMultibandFillHoles", _ui->checkBox_multiband_fillholes->isChecked()).toBool());
_ui->spinBox_multiband_padding->setValue(settings.value("mesh_textureMultibandPadding", _ui->spinBox_multiband_padding->value()).toInt());
_ui->doubleSpinBox_multiband_bestscore->setValue(settings.value("mesh_textureMultibandBestScoreThr", _ui->doubleSpinBox_multiband_bestscore->value()).toDouble());
_ui->doubleSpinBox_multiband_angle->setValue(settings.value("mesh_textureMultibandAngleHardThr", _ui->doubleSpinBox_multiband_angle->value()).toDouble());
_ui->checkBox_multiband_forcevisible->setChecked(settings.value("mesh_textureMultibandForceVisible", _ui->checkBox_multiband_forcevisible->isChecked()).toBool());
_ui->doubleSpinBox_mesh_angleTolerance->setValue(settings.value("mesh_angle_tolerance", _ui->doubleSpinBox_mesh_angleTolerance->value()).toDouble());
_ui->checkBox_mesh_quad->setChecked(settings.value("mesh_quad", _ui->checkBox_mesh_quad->isChecked()).toBool());
@@ -745,7 +768,7 @@ void ExportCloudsDialog::restoreDefaults()
_ui->checkBox_textureMapping->setChecked(false);
_ui->comboBox_meshingTextureFormat->setCurrentIndex(0);
_ui->comboBox_meshingTextureSize->setCurrentIndex(5); // 4096
_ui->comboBox_meshingTextureSize->setCurrentIndex(6); // 8192
_ui->spinBox_mesh_maxTextures->setValue(1);
_ui->doubleSpinBox_meshingTextureMaxDistance->setValue(3.0);
_ui->doubleSpinBox_meshingTextureMaxDepthError->setValue(0.0);
@@ -765,6 +788,14 @@ void ExportCloudsDialog::restoreDefaults()
_ui->checkBox_blending->setChecked(true);
_ui->comboBox_blendingDecimation->setCurrentIndex(0);
_ui->checkBox_multiband->setChecked(false);
_ui->spinBox_multiband_downscale->setValue(2);
_ui->comboBox_multiband_unwrap->setCurrentIndex(0);
_ui->checkBox_multiband_fillholes->setChecked(false);
_ui->spinBox_multiband_padding->setValue(5);
_ui->doubleSpinBox_multiband_bestscore->setValue(0.1);
_ui->doubleSpinBox_multiband_angle->setValue(90.0);
_ui->checkBox_multiband_forcevisible->setChecked(false);
_ui->doubleSpinBox_mesh_angleTolerance->setValue(15.0);
_ui->checkBox_mesh_quad->setChecked(false);
@@ -891,6 +922,7 @@ void ExportCloudsDialog::updateReconstructionFlavor()
_ui->groupBox_subtraction->setVisible(_ui->checkBox_subtraction->isChecked());
_ui->groupBox_textureMapping->setVisible(_ui->checkBox_textureMapping->isChecked());
_ui->groupBox_cameraFilter->setVisible(_ui->checkBox_cameraFilter->isChecked());
_ui->groupBox_multiband->setVisible(_ui->checkBox_multiband->isChecked());
// dense texturing options
if(_ui->checkBox_meshing->isChecked())
@@ -3713,7 +3745,6 @@ std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr, pcl::Indic
float h = _ui->doubleSpinBox_footprintHeight->value();
float w = _ui->doubleSpinBox_footprintWidth->value();
float l = _ui->doubleSpinBox_footprintLength->value();
int before= indices->size();
indices = util3d::cropBox(
cloud,
indices,
@@ -4444,10 +4475,18 @@ void ExportCloudsDialog::saveTextureMeshes(
0,
_dbDriver,
textureSize,
_ui->spinBox_multiband_downscale->value(),
_ui->comboBox_meshingTextureFormat->currentText().toStdString(),
gains,
blendingGains,
contrastValues);
contrastValues,
true,
_ui->comboBox_multiband_unwrap->currentIndex(),
_ui->checkBox_multiband_fillholes->isChecked(),
_ui->spinBox_multiband_padding->value(),
_ui->doubleSpinBox_multiband_bestscore->value(),
_ui->doubleSpinBox_multiband_angle->value(),
_ui->checkBox_multiband_forcevisible->isChecked());
if(success)
{
_progressDialog->incrementStep();

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>814</width>
<height>680</height>
<width>1032</width>
<height>869</height>
</rect>
</property>
<property name="windowTitle">
@@ -23,9 +23,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-1225</y>
<width>780</width>
<height>5739</height>
<y>-3479</y>
<width>998</width>
<height>5642</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
@@ -2751,6 +2751,182 @@ By Node ID and Camera Index: NodeID*10+CameraIndex</string>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_multiband">
<property name="title">
<string>MultiBand Texturing</string>
</property>
<layout class="QGridLayout" name="gridLayout_22" columnstretch="0,1">
<item row="0" column="1">
<widget class="QLabel" name="label_49">
<property name="text">
<string>Downscaling to 4 or 8 will reduce the texture quality but speed up the computation time. Set Texture Downscale to 1 instead of 2 to get the maximum possible resolution with the resolution of your images. The output texture size will be divided by this value, e.g., with texture size of 8192 and downscale value of 2, the output will be 4096.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBox_multiband_fillholes">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_50">
<property name="text">
<string>Unwrap method. Method to unwrap input mesh if it does not have UV coordinates Basic (&gt; 600k faces) fast and simple. Can generate multiple atlases LSCM (&lt;= 600k faces): optimize space. Generates one atlas ABF (&lt;= 300k faces): optimize space and stretch. Generates one atlas.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QSpinBox" name="spinBox_multiband_downscale">
<property name="maximum">
<number>16</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_52">
<property name="text">
<string>Texture edge padding size in pixel.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_54">
<property name="text">
<string>Angle hard threshold. 0 to disable angle hard threshold filtering.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QDoubleSpinBox" name="doubleSpinBox_multiband_angle">
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>180.000000000000000</double>
</property>
<property name="value">
<double>90.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_53">
<property name="text">
<string>Best score threshold. 0 to disable filtering based on threshold to relative best score.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QDoubleSpinBox" name="doubleSpinBox_multiband_bestscore">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QSpinBox" name="spinBox_multiband_padding">
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_51">
<property name="text">
<string>Fill Texture holes with plausible values.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QComboBox" name="comboBox_multiband_unwrap">
<item>
<property name="text">
<string>Basic</string>
</property>
</item>
<item>
<property name="text">
<string>LSCM</string>
</property>
</item>
<item>
<property name="text">
<string>ABF</string>
</property>
</item>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_55">
<property name="text">
<string>Force visible by all vertices. Triangle visibility is based on the union of vertices visibility.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBox_multiband_forcevisible">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>