mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
Updated for AliceVision >=2.4.0 compatibility. Export: added --multiband_contrib option.
This commit is contained in:
@@ -603,6 +603,7 @@ IF(WITH_ALICE_VISION)
|
|||||||
ENDIF(${AliceVision_VERSION} VERSION_LESS_EQUAL "2.2")
|
ENDIF(${AliceVision_VERSION} VERSION_LESS_EQUAL "2.2")
|
||||||
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};/usr/local/lib/cmake/modules")
|
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};/usr/local/lib/cmake/modules")
|
||||||
find_package(Geogram REQUIRED QUIET)
|
find_package(Geogram REQUIRED QUIET)
|
||||||
|
find_package(assimp QUIET)
|
||||||
add_definitions("-DRTABMAP_ALICE_VISION_MAJOR=${AliceVision_VERSION_MAJOR}")
|
add_definitions("-DRTABMAP_ALICE_VISION_MAJOR=${AliceVision_VERSION_MAJOR}")
|
||||||
add_definitions("-DRTABMAP_ALICE_VISION_MINOR=${AliceVision_VERSION_MINOR}")
|
add_definitions("-DRTABMAP_ALICE_VISION_MINOR=${AliceVision_VERSION_MINOR}")
|
||||||
add_definitions("-DRTABMAP_ALICE_VISION_PATCH=${AliceVision_VERSION_PATCH}")
|
add_definitions("-DRTABMAP_ALICE_VISION_PATCH=${AliceVision_VERSION_PATCH}")
|
||||||
|
|||||||
@@ -283,12 +283,13 @@ RTABMAP_DEPRECATED(bool RTABMAP_EXP multiBandTexturing(
|
|||||||
* @param dbDriver Should be set if images and memory are not set.
|
* @param dbDriver Should be set if images and memory are not set.
|
||||||
* @param textureSize Output texture size 1024, 2048, 4096, 8192, 16384.
|
* @param textureSize Output texture size 1024, 2048, 4096, 8192, 16384.
|
||||||
* @param textureDownscale 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.
|
* @param textureDownscale 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.
|
||||||
|
* @param nbContrib number of contributions per frequency band for the multi-band blending (should be 4 values)
|
||||||
* @param textureFormat Output texture format: "png" or "jpg".
|
* @param textureFormat Output texture format: "png" or "jpg".
|
||||||
* @param gains Optional output of {@link #mergeTextures()}.
|
* @param gains Optional output of {@link #mergeTextures()}.
|
||||||
* @param blendingGains Optional output of {@link #mergeTextures()}.
|
* @param blendingGains Optional output of {@link #mergeTextures()}.
|
||||||
* @param contrastValues Optional output of {@link #mergeTextures()}.
|
* @param contrastValues Optional output of {@link #mergeTextures()}.
|
||||||
* @param gainRGB Apply gain compensation on each RGB channels separately, otherwise it is apply equally to all channels.
|
* @param gainRGB Apply gain compensation on each RGB channels separately, otherwise it is apply equally to all channels.
|
||||||
* @param unwrapMethod Method to unwrap input mesh if it does not have UV coordinates Basic (> 600k faces) fast and simple. Can generate multiple atlases LSCM (<= 600k faces): optimize space. Generates one atlas ABF (<= 300k faces): optimize space and stretch. Generates one atlas.
|
* @param unwrapMethod Method to unwrap input mesh if it does not have UV coordinates 0=Basic (> 600k faces) fast and simple. Can generate multiple atlases 2=LSCM (<= 600k faces): optimize space. Generates one atlas 1=ABF (<= 300k faces): optimize space and stretch. Generates one atlas.
|
||||||
* @param fillHoles Fill Texture holes with plausible values True/False.
|
* @param fillHoles Fill Texture holes with plausible values True/False.
|
||||||
* @param padding Texture edge padding size in pixel (0-100).
|
* @param padding Texture edge padding size in pixel (0-100).
|
||||||
* @param bestScoreThreshold 0.0 to disable filtering based on threshold to relative best score (0.0-1.0).
|
* @param bestScoreThreshold 0.0 to disable filtering based on threshold to relative best score (0.0-1.0).
|
||||||
@@ -307,6 +308,7 @@ bool RTABMAP_EXP multiBandTexturing(
|
|||||||
const DBDriver * dbDriver = 0,
|
const DBDriver * dbDriver = 0,
|
||||||
unsigned int textureSize = 8192,
|
unsigned int textureSize = 8192,
|
||||||
unsigned int textureDownscale = 2,
|
unsigned int textureDownscale = 2,
|
||||||
|
const std::string & nbContrib = "1 5 10 0",
|
||||||
const std::string & textureFormat = "jpg",
|
const std::string & textureFormat = "jpg",
|
||||||
const std::map<int, std::map<int, cv::Vec4d> > & gains = std::map<int, std::map<int, cv::Vec4d> >(),
|
const std::map<int, std::map<int, cv::Vec4d> > & gains = std::map<int, std::map<int, cv::Vec4d> >(),
|
||||||
const std::map<int, std::map<int, cv::Mat> > & blendingGains = std::map<int, std::map<int, cv::Mat> >(),
|
const std::map<int, std::map<int, cv::Mat> > & blendingGains = std::map<int, std::map<int, cv::Mat> >(),
|
||||||
|
|||||||
@@ -2244,6 +2244,7 @@ bool multiBandTexturing(
|
|||||||
dbDriver,
|
dbDriver,
|
||||||
textureSize,
|
textureSize,
|
||||||
2,
|
2,
|
||||||
|
"1 5 10 0",
|
||||||
textureFormat,
|
textureFormat,
|
||||||
gains,
|
gains,
|
||||||
blendingGains,
|
blendingGains,
|
||||||
@@ -2263,6 +2264,7 @@ bool multiBandTexturing(
|
|||||||
const DBDriver * dbDriver,
|
const DBDriver * dbDriver,
|
||||||
unsigned int textureSize,
|
unsigned int textureSize,
|
||||||
unsigned int textureDownScale,
|
unsigned int textureDownScale,
|
||||||
|
const std::string & nbContrib,
|
||||||
const std::string & textureFormat,
|
const std::string & textureFormat,
|
||||||
const std::map<int, std::map<int, cv::Vec4d> > & gains,
|
const std::map<int, std::map<int, cv::Vec4d> > & gains,
|
||||||
const std::map<int, std::map<int, cv::Mat> > & blendingGains,
|
const std::map<int, std::map<int, cv::Mat> > & blendingGains,
|
||||||
@@ -2312,11 +2314,26 @@ bool multiBandTexturing(
|
|||||||
#endif
|
#endif
|
||||||
texturing.texParams.textureSide = textureSize;
|
texturing.texParams.textureSide = textureSize;
|
||||||
texturing.texParams.downscale = textureDownScale;
|
texturing.texParams.downscale = textureDownScale;
|
||||||
|
std::vector<int> multiBandNbContrib;
|
||||||
|
std::list<std::string> values = uSplit(nbContrib, ' ');
|
||||||
|
for(std::list<std::string>::iterator iter=values.begin(); iter!=values.end(); ++iter)
|
||||||
|
{
|
||||||
|
multiBandNbContrib.push_back(uStr2Int(*iter));
|
||||||
|
}
|
||||||
|
if(multiBandNbContrib.size() != 4)
|
||||||
|
{
|
||||||
|
UERROR("multiband: Wrong number of nb of contribution (vaue=\"%s\", should be 4), using default values instead.", nbContrib.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
texturing.texParams.multiBandNbContrib = multiBandNbContrib;
|
||||||
|
}
|
||||||
texturing.texParams.padding = padding;
|
texturing.texParams.padding = padding;
|
||||||
texturing.texParams.fillHoles = fillHoles;
|
texturing.texParams.fillHoles = fillHoles;
|
||||||
texturing.texParams.bestScoreThreshold = bestScoreThreshold;
|
texturing.texParams.bestScoreThreshold = bestScoreThreshold;
|
||||||
texturing.texParams.angleHardThreshold = angleHardThreshold;
|
texturing.texParams.angleHardThreshold = angleHardThreshold;
|
||||||
texturing.texParams.forceVisibleByAllVertices = forceVisibleByAllVertices;
|
texturing.texParams.forceVisibleByAllVertices = forceVisibleByAllVertices;
|
||||||
|
texturing.texParams.visibilityRemappingMethod = mesh::EVisibilityRemappingMethod::Pull;
|
||||||
|
|
||||||
|
|
||||||
for(size_t i=0;i<cloud2.size();++i)
|
for(size_t i=0;i<cloud2.size();++i)
|
||||||
@@ -2479,13 +2496,20 @@ bool multiBandTexturing(
|
|||||||
imageRoi = output;
|
imageRoi = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
Transform t = iter->second * model.localTransform();
|
Transform t = (iter->second * model.localTransform()).inverse();
|
||||||
Eigen::Matrix<double, 3, 4> m = (t.inverse()).toEigen3d().matrix().block<3,4>(0, 0);
|
Eigen::Matrix<double, 3, 4> m = t.toEigen3d().matrix().block<3,4>(0, 0);
|
||||||
sfmData::CameraPose pose(geometry::Pose3(m), true);
|
sfmData::CameraPose pose(geometry::Pose3(m), true);
|
||||||
sfmData.setAbsolutePose((IndexT)viewId, pose);
|
sfmData.setAbsolutePose((IndexT)viewId, pose);
|
||||||
|
|
||||||
|
UDEBUG("%d %d %f %f %f %f", imageSize.width, imageSize.height, model.fx(), model.fy(), model.cx(), model.cy());
|
||||||
std::shared_ptr<camera::IntrinsicBase> camPtr = std::make_shared<camera::Pinhole>(
|
std::shared_ptr<camera::IntrinsicBase> camPtr = std::make_shared<camera::Pinhole>(
|
||||||
|
#if RTABMAP_ALICE_VISION_MAJOR > 2 || (RTABMAP_ALICE_VISION_MAJOR==2 && RTABMAP_ALICE_VISION_MINOR>=4)
|
||||||
|
//https://github.com/alicevision/AliceVision/commit/9fab5c79a1c65595fe5c5001267e1c5212bc93f0#diff-b0c0a3c30de50be8e4ed283dfe4c8ae4a9bc861aa9a83bd8bfda8182e9d67c08
|
||||||
|
// [all] the camera principal point is now defined as an offset relative to the image center
|
||||||
|
imageSize.width, imageSize.height, model.fx(), model.fy(), model.cx() - double(imageSize.width) * 0.5, model.cy() - double(imageSize.height) * 0.5);
|
||||||
|
#else
|
||||||
imageSize.width, imageSize.height, model.fx(), model.cx(), model.cy());
|
imageSize.width, imageSize.height, model.fx(), model.cx(), model.cy());
|
||||||
|
#endif
|
||||||
sfmData.intrinsics.insert(std::make_pair((IndexT)viewId, camPtr));
|
sfmData.intrinsics.insert(std::make_pair((IndexT)viewId, camPtr));
|
||||||
|
|
||||||
std::string imagePath = tmpImageDirectory+uFormat("/%d.jpg", viewId);
|
std::string imagePath = tmpImageDirectory+uFormat("/%d.jpg", viewId);
|
||||||
@@ -2507,14 +2531,18 @@ bool multiBandTexturing(
|
|||||||
|
|
||||||
mvsUtils::MultiViewParams mp(sfmData);
|
mvsUtils::MultiViewParams mp(sfmData);
|
||||||
|
|
||||||
UINFO("Unwrapping...");
|
UINFO("Unwrapping (method=%d=%s)...", unwrapMethod, mesh::EUnwrapMethod_enumToString((mesh::EUnwrapMethod)unwrapMethod).c_str());
|
||||||
texturing.unwrap(mp, (mesh::EUnwrapMethod)unwrapMethod);
|
texturing.unwrap(mp, (mesh::EUnwrapMethod)unwrapMethod);
|
||||||
UINFO("Unwrapping done. %fs", timer.ticks());
|
UINFO("Unwrapping done. %fs", timer.ticks());
|
||||||
|
|
||||||
// save final obj file
|
// save final obj file
|
||||||
std::string baseName = uSplit(UFile::getName(outputOBJPath), '.').front();
|
std::string baseName = uSplit(UFile::getName(outputOBJPath), '.').front();
|
||||||
|
#if RTABMAP_ALICE_VISION_MAJOR > 2 || (RTABMAP_ALICE_VISION_MAJOR==2 && RTABMAP_ALICE_VISION_MINOR>=4)
|
||||||
|
texturing.saveAs(outputDirectory, baseName, aliceVision::mesh::EFileType::OBJ, imageIO::EImageFileType::PNG);
|
||||||
|
#else
|
||||||
texturing.saveAsOBJ(outputDirectory, baseName);
|
texturing.saveAsOBJ(outputDirectory, baseName);
|
||||||
UINFO("Saved %s. %fs", outputOBJPath, timer.ticks());
|
#endif
|
||||||
|
UINFO("Saved %s. %fs", outputOBJPath.c_str(), timer.ticks());
|
||||||
|
|
||||||
// generate textures
|
// generate textures
|
||||||
UINFO("Generating textures...");
|
UINFO("Generating textures...");
|
||||||
@@ -2576,7 +2604,9 @@ bool multiBandTexturing(
|
|||||||
UINFO("Rename/convert textures... done. %fs", timer.ticks());
|
UINFO("Rename/convert textures... done. %fs", timer.ticks());
|
||||||
|
|
||||||
#if RTABMAP_ALICE_VISION_MAJOR > 2 || (RTABMAP_ALICE_VISION_MAJOR==2 && RTABMAP_ALICE_VISION_MINOR>=3)
|
#if RTABMAP_ALICE_VISION_MAJOR > 2 || (RTABMAP_ALICE_VISION_MAJOR==2 && RTABMAP_ALICE_VISION_MINOR>=3)
|
||||||
|
UINFO("Cleanup sfmdata...");
|
||||||
sfmData.clear();
|
sfmData.clear();
|
||||||
|
UINFO("Cleanup sfmdata... done. %fs", timer.ticks());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ ExportCloudsDialog::ExportCloudsDialog(QWidget *parent) :
|
|||||||
connect(_ui->checkBox_multiband, SIGNAL(stateChanged(int)), 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->checkBox_multiband, SIGNAL(stateChanged(int)), this, SLOT(updateReconstructionFlavor()));
|
||||||
connect(_ui->spinBox_multiband_downscale, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
|
connect(_ui->spinBox_multiband_downscale, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
|
||||||
|
connect(_ui->lineEdit_multiband_nbcontrib, SIGNAL(textChanged(const QString &)), this, SIGNAL(configChanged()));
|
||||||
connect(_ui->comboBox_multiband_unwrap, SIGNAL(currentIndexChanged(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->checkBox_multiband_fillholes, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
|
||||||
connect(_ui->spinBox_multiband_padding, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
|
connect(_ui->spinBox_multiband_padding, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
|
||||||
@@ -450,6 +451,7 @@ void ExportCloudsDialog::saveSettings(QSettings & settings, const QString & grou
|
|||||||
settings.setValue("mesh_textureBlendingDecimation", _ui->comboBox_blendingDecimation->currentIndex());
|
settings.setValue("mesh_textureBlendingDecimation", _ui->comboBox_blendingDecimation->currentIndex());
|
||||||
settings.setValue("mesh_textureMultiband", _ui->checkBox_multiband->isChecked());
|
settings.setValue("mesh_textureMultiband", _ui->checkBox_multiband->isChecked());
|
||||||
settings.setValue("mesh_textureMultibandDownScale", _ui->spinBox_multiband_downscale->value());
|
settings.setValue("mesh_textureMultibandDownScale", _ui->spinBox_multiband_downscale->value());
|
||||||
|
settings.setValue("mesh_textureMultibandNbContrib", _ui->lineEdit_multiband_nbcontrib->text());
|
||||||
settings.setValue("mesh_textureMultibandUnwrap", _ui->comboBox_multiband_unwrap->currentIndex());
|
settings.setValue("mesh_textureMultibandUnwrap", _ui->comboBox_multiband_unwrap->currentIndex());
|
||||||
settings.setValue("mesh_textureMultibandFillHoles", _ui->checkBox_multiband_fillholes->isChecked());
|
settings.setValue("mesh_textureMultibandFillHoles", _ui->checkBox_multiband_fillholes->isChecked());
|
||||||
settings.setValue("mesh_textureMultibandPadding", _ui->spinBox_multiband_padding->value());
|
settings.setValue("mesh_textureMultibandPadding", _ui->spinBox_multiband_padding->value());
|
||||||
@@ -624,6 +626,7 @@ void ExportCloudsDialog::loadSettings(QSettings & settings, const QString & grou
|
|||||||
_ui->comboBox_blendingDecimation->setCurrentIndex(settings.value("mesh_textureBlendingDecimation", _ui->comboBox_blendingDecimation->currentIndex()).toInt());
|
_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->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->spinBox_multiband_downscale->setValue(settings.value("mesh_textureMultibandDownScale", _ui->spinBox_multiband_downscale->value()).toInt());
|
||||||
|
_ui->lineEdit_multiband_nbcontrib->setText(settings.value("mesh_textureMultibandNbContrib", _ui->lineEdit_multiband_nbcontrib->text()).toString());
|
||||||
_ui->comboBox_multiband_unwrap->setCurrentIndex(settings.value("mesh_textureMultibandUnwrap", _ui->comboBox_multiband_unwrap->currentIndex()).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->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->spinBox_multiband_padding->setValue(settings.value("mesh_textureMultibandPadding", _ui->spinBox_multiband_padding->value()).toInt());
|
||||||
@@ -789,6 +792,7 @@ void ExportCloudsDialog::restoreDefaults()
|
|||||||
_ui->comboBox_blendingDecimation->setCurrentIndex(0);
|
_ui->comboBox_blendingDecimation->setCurrentIndex(0);
|
||||||
_ui->checkBox_multiband->setChecked(false);
|
_ui->checkBox_multiband->setChecked(false);
|
||||||
_ui->spinBox_multiband_downscale->setValue(2);
|
_ui->spinBox_multiband_downscale->setValue(2);
|
||||||
|
_ui->lineEdit_multiband_nbcontrib->setText("1 5 10 0");
|
||||||
_ui->comboBox_multiband_unwrap->setCurrentIndex(0);
|
_ui->comboBox_multiband_unwrap->setCurrentIndex(0);
|
||||||
_ui->checkBox_multiband_fillholes->setChecked(false);
|
_ui->checkBox_multiband_fillholes->setChecked(false);
|
||||||
_ui->spinBox_multiband_padding->setValue(5);
|
_ui->spinBox_multiband_padding->setValue(5);
|
||||||
@@ -4476,6 +4480,7 @@ void ExportCloudsDialog::saveTextureMeshes(
|
|||||||
_dbDriver,
|
_dbDriver,
|
||||||
textureSize,
|
textureSize,
|
||||||
_ui->spinBox_multiband_downscale->value(),
|
_ui->spinBox_multiband_downscale->value(),
|
||||||
|
_ui->lineEdit_multiband_nbcontrib->text().toStdString(),
|
||||||
_ui->comboBox_meshingTextureFormat->currentText().toStdString(),
|
_ui->comboBox_meshingTextureFormat->currentText().toStdString(),
|
||||||
gains,
|
gains,
|
||||||
blendingGains,
|
blendingGains,
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-3479</y>
|
<y>-3537</y>
|
||||||
<width>998</width>
|
<width>998</width>
|
||||||
<height>5642</height>
|
<height>5673</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||||
@@ -2770,17 +2770,36 @@ By Node ID and Camera Index: NodeID*10+CameraIndex</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="4" column="1">
|
||||||
<widget class="QCheckBox" name="checkBox_multiband_fillholes">
|
<widget class="QLabel" name="label_52">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="label_50">
|
<widget class="QLabel" name="label_50">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Unwrap method. Method to unwrap input mesh if it does not have UV coordinates Basic (> 600k faces) fast and simple. Can generate multiple atlases LSCM (<= 600k faces): optimize space. Generates one atlas ABF (<= 300k faces): optimize space and stretch. Generates one atlas.</string>
|
<string>Unwrap method: 0=basic (default, >600k faces, fast), 1=ABF (<=300k faces, generate 1 atlas), 2=LSCM (<=600k faces, optimize space).</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" 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>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -2800,20 +2819,26 @@ By Node ID and Camera Index: NodeID*10+CameraIndex</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_52">
|
<widget class="QComboBox" name="comboBox_multiband_unwrap">
|
||||||
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Texture edge padding size in pixel.</string>
|
<string>Basic</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
</item>
|
||||||
<bool>true</bool>
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ABF</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textInteractionFlags">
|
</item>
|
||||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>LSCM</string>
|
||||||
</property>
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QLabel" name="label_54">
|
<widget class="QLabel" name="label_54">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Angle hard threshold. 0 to disable angle hard threshold filtering.</string>
|
<string>Angle hard threshold. 0 to disable angle hard threshold filtering.</string>
|
||||||
@@ -2826,20 +2851,7 @@ By Node ID and Camera Index: NodeID*10+CameraIndex</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="1">
|
||||||
<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">
|
<widget class="QLabel" name="label_53">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Best score threshold. 0 to disable filtering based on threshold to relative best score.</string>
|
<string>Best score threshold. 0 to disable filtering based on threshold to relative best score.</string>
|
||||||
@@ -2852,7 +2864,14 @@ By Node ID and Camera Index: NodeID*10+CameraIndex</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="7" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBox_multiband_forcevisible">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_multiband_bestscore">
|
<widget class="QDoubleSpinBox" name="doubleSpinBox_multiband_bestscore">
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>1.000000000000000</double>
|
<double>1.000000000000000</double>
|
||||||
@@ -2863,16 +2882,26 @@ By Node ID and Camera Index: NodeID*10+CameraIndex</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QSpinBox" name="spinBox_multiband_padding">
|
<widget class="QCheckBox" name="checkBox_multiband_fillholes">
|
||||||
<property name="maximum">
|
<property name="text">
|
||||||
<number>100</number>
|
<string/>
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="6" 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="3" column="1">
|
||||||
<widget class="QLabel" name="label_51">
|
<widget class="QLabel" name="label_51">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Fill Texture holes with plausible values.</string>
|
<string>Fill Texture holes with plausible values.</string>
|
||||||
@@ -2885,29 +2914,20 @@ By Node ID and Camera Index: NodeID*10+CameraIndex</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QComboBox" name="comboBox_multiband_unwrap">
|
<widget class="QSpinBox" name="spinBox_multiband_padding">
|
||||||
<item>
|
<property name="maximum">
|
||||||
<property name="text">
|
<number>100</number>
|
||||||
<string>Basic</string>
|
|
||||||
</property>
|
</property>
|
||||||
</item>
|
<property name="value">
|
||||||
<item>
|
<number>5</number>
|
||||||
<property name="text">
|
|
||||||
<string>LSCM</string>
|
|
||||||
</property>
|
</property>
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>ABF</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="label_55">
|
<widget class="QLabel" name="label_56">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Force visible by all vertices. Triangle visibility is based on the union of vertices visibility.</string>
|
<string>Number of contributions per frequency band for the multi-band blending. Should be 4 values.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -2917,10 +2937,10 @@ By Node ID and Camera Index: NodeID*10+CameraIndex</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="checkBox_multiband_forcevisible">
|
<widget class="QLineEdit" name="lineEdit_multiband_nbcontrib">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string>1 5 10 0</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ void showUsage()
|
|||||||
" --mesh Create a mesh.\n"
|
" --mesh Create a mesh.\n"
|
||||||
" --texture Create a mesh with texture.\n"
|
" --texture Create a mesh with texture.\n"
|
||||||
" --texture_size # Texture size 1024, 2048, 4096, 8192, 16384 (default 8192).\n"
|
" --texture_size # Texture size 1024, 2048, 4096, 8192, 16384 (default 8192).\n"
|
||||||
" --texture_count # Maximum textures generated (default 1).\n"
|
" --texture_count # Maximum textures generated (default 1). Ignored by --multiband option (adjust --multiband_contrib instead).\n"
|
||||||
" --texture_range # Maximum camera range for texturing a polygon (default 0 meters: no limit).\n"
|
" --texture_range # Maximum camera range for texturing a polygon (default 0 meters: no limit).\n"
|
||||||
" --texture_depth_error # Maximum depth error between reprojected mesh and depth image to texture a face (-1=disabled, 0=edge length is used, default=0).\n"
|
" --texture_depth_error # Maximum depth error between reprojected mesh and depth image to texture a face (-1=disabled, 0=edge length is used, default=0).\n"
|
||||||
" --texture_d2c Distance to camera policy.\n"
|
" --texture_d2c Distance to camera policy.\n"
|
||||||
@@ -91,7 +91,8 @@ void showUsage()
|
|||||||
" --high_gain # High brightness gain 0-100 (default 10).\n"
|
" --high_gain # High brightness gain 0-100 (default 10).\n"
|
||||||
" --multiband Enable multiband texturing (AliceVision dependency required).\n"
|
" --multiband Enable multiband texturing (AliceVision dependency required).\n"
|
||||||
" --multiband_downscale # Downscaling reduce the texture quality but speed up the computation time (default 2).\n"
|
" --multiband_downscale # Downscaling reduce the texture quality but speed up the computation time (default 2).\n"
|
||||||
" --multiband_unwrap # Method to unwrap input mesh: 0=basic (default, >600k faces, fast), 1=LSCM (<=600k faces, optimize space), 2=ABF (<=300k faces, generate 1 atlas).\n"
|
" --multiband_contrib \"# # # # \" Number of contributions per frequency band for the multi-band blending, should be 4 values! (default \"1 5 10 0\").\n"
|
||||||
|
" --multiband_unwrap # Method to unwrap input mesh: 0=basic (default, >600k faces, fast), 1=ABF (<=300k faces, generate 1 atlas), 2=LSCM (<=600k faces, optimize space).\n"
|
||||||
" --multiband_fillholes Fill Texture holes with plausible values.\n"
|
" --multiband_fillholes Fill Texture holes with plausible values.\n"
|
||||||
" --multiband_padding # Texture edge padding size in pixel (0-100) (default 5).\n"
|
" --multiband_padding # Texture edge padding size in pixel (0-100) (default 5).\n"
|
||||||
" --multiband_scorethr # 0 to disable filtering based on threshold to relative best score (0.0-1.0). (default 0.1).\n"
|
" --multiband_scorethr # 0 to disable filtering based on threshold to relative best score (0.0-1.0). (default 0.1).\n"
|
||||||
@@ -153,6 +154,7 @@ int main(int argc, char * argv[])
|
|||||||
bool distanceToCamPolicy = false;
|
bool distanceToCamPolicy = false;
|
||||||
bool multiband = false;
|
bool multiband = false;
|
||||||
int multibandDownScale = 2;
|
int multibandDownScale = 2;
|
||||||
|
std::string multibandNbContrib = "1 5 10 0";
|
||||||
int multibandUnwrap = 0;
|
int multibandUnwrap = 0;
|
||||||
bool multibandFillHoles = false;
|
bool multibandFillHoles = false;
|
||||||
int multibandPadding = 5;
|
int multibandPadding = 5;
|
||||||
@@ -373,6 +375,23 @@ int main(int argc, char * argv[])
|
|||||||
showUsage();
|
showUsage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(std::strcmp(argv[i], "--multiband_contrib") == 0)
|
||||||
|
{
|
||||||
|
++i;
|
||||||
|
if(i<argc-1)
|
||||||
|
{
|
||||||
|
if(uSplit(argv[i], ' ').size() != 4)
|
||||||
|
{
|
||||||
|
printf("--multiband_contrib has wrong format! value=\"%s\"\n", argv[i]);
|
||||||
|
showUsage();
|
||||||
|
}
|
||||||
|
multibandNbContrib = argv[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
showUsage();
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(std::strcmp(argv[i], "--multiband_unwrap") == 0)
|
else if(std::strcmp(argv[i], "--multiband_unwrap") == 0)
|
||||||
{
|
{
|
||||||
++i;
|
++i;
|
||||||
@@ -1424,7 +1443,7 @@ int main(int argc, char * argv[])
|
|||||||
printf("MultiBand texturing (size=%d, downscale=%d, unwrap method=%s, fill holes=%s, padding=%d, best score thr=%f, angle thr=%f, force visible=%s)... \"%s\"\n",
|
printf("MultiBand texturing (size=%d, downscale=%d, unwrap method=%s, fill holes=%s, padding=%d, best score thr=%f, angle thr=%f, force visible=%s)... \"%s\"\n",
|
||||||
textureSize,
|
textureSize,
|
||||||
multibandDownScale,
|
multibandDownScale,
|
||||||
multibandUnwrap==2?"ABF":multibandUnwrap==1?"LSCM":"Basic",
|
multibandUnwrap==1?"ABF":multibandUnwrap==2?"LSCM":"Basic",
|
||||||
multibandFillHoles?"true":"false",
|
multibandFillHoles?"true":"false",
|
||||||
multibandPadding,
|
multibandPadding,
|
||||||
multibandBestScoreThr,
|
multibandBestScoreThr,
|
||||||
@@ -1442,6 +1461,7 @@ int main(int argc, char * argv[])
|
|||||||
0,
|
0,
|
||||||
textureSize,
|
textureSize,
|
||||||
multibandDownScale,
|
multibandDownScale,
|
||||||
|
multibandNbContrib,
|
||||||
"jpg",
|
"jpg",
|
||||||
gains,
|
gains,
|
||||||
blendingGains,
|
blendingGains,
|
||||||
|
|||||||
Reference in New Issue
Block a user