From 87da70d3136a7ac133f970696d1b07e131711a00 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 9 Mar 2020 15:48:24 +0000 Subject: [PATCH] odm_orthophoto float32 support Former-commit-id: ea6092fdec5f7dbe9fa962f794f043fe027a6371 --- SuperBuild/CMakeLists.txt | 2 +- SuperBuild/cmake/External-MvsTexturing.cmake | 2 +- SuperBuild/cmake/External-OpenSfM.cmake | 2 +- modules/odm_orthophoto/src/OdmOrthoPhoto.cpp | 12 +++++++++++- opendm/config.py | 5 +++++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index 88019902..adfc53f2 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -129,7 +129,7 @@ endforeach() externalproject_add(mve GIT_REPOSITORY https://github.com/OpenDroneMap/mve.git - GIT_TAG 098 + GIT_TAG 099 UPDATE_COMMAND "" SOURCE_DIR ${SB_SOURCE_DIR}/elibs/mve CONFIGURE_COMMAND "" diff --git a/SuperBuild/cmake/External-MvsTexturing.cmake b/SuperBuild/cmake/External-MvsTexturing.cmake index 6dd6aa56..8c43d330 100644 --- a/SuperBuild/cmake/External-MvsTexturing.cmake +++ b/SuperBuild/cmake/External-MvsTexturing.cmake @@ -9,7 +9,7 @@ ExternalProject_Add(${_proj_name} #--Download step-------------- DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}/${_proj_name} GIT_REPOSITORY https://github.com/OpenDroneMap/mvs-texturing - GIT_TAG master + GIT_TAG 099 #--Update/Patch step---------- UPDATE_COMMAND "" #--Configure step------------- diff --git a/SuperBuild/cmake/External-OpenSfM.cmake b/SuperBuild/cmake/External-OpenSfM.cmake index d5ffe330..70bf1035 100644 --- a/SuperBuild/cmake/External-OpenSfM.cmake +++ b/SuperBuild/cmake/External-OpenSfM.cmake @@ -9,7 +9,7 @@ ExternalProject_Add(${_proj_name} #--Download step-------------- DOWNLOAD_DIR ${SB_DOWNLOAD_DIR} GIT_REPOSITORY https://github.com/OpenDroneMap/OpenSfM/ - GIT_TAG 098 + GIT_TAG 099 #--Update/Patch step---------- UPDATE_COMMAND git submodule update --init --recursive #--Configure step------------- diff --git a/modules/odm_orthophoto/src/OdmOrthoPhoto.cpp b/modules/odm_orthophoto/src/OdmOrthoPhoto.cpp index 2f7fa218..9abe834d 100644 --- a/modules/odm_orthophoto/src/OdmOrthoPhoto.cpp +++ b/modules/odm_orthophoto/src/OdmOrthoPhoto.cpp @@ -246,7 +246,9 @@ void OdmOrthoPhoto::saveTIFF(const std::string &filename, GDALDataType dataType) } // Alpha - if (dataType == GDT_UInt16){ + if (dataType == GDT_Float32){ + finalizeAlphaBand(); + }else if (dataType == GDT_UInt16){ finalizeAlphaBand(); }else if (dataType == GDT_Byte){ finalizeAlphaBand(); @@ -504,6 +506,10 @@ void OdmOrthoPhoto::createOrthoPhoto() log_ << "Texture depth: 16bit\n"; initBands(texture.channels()); if (primary) initAlphaBand(); + }else if (textureDepth == CV_32F){ + log_ << "Texture depth: 32bit (float)\n"; + initBands(texture.channels()); + if (primary) initAlphaBand(); }else{ std::cerr << "Unsupported bit depth value: " << textureDepth; exit(1); @@ -537,6 +543,8 @@ void OdmOrthoPhoto::createOrthoPhoto() drawTexturedTriangle(texture, polygon, meshCloud, uvs, faceIndex+faceOff); }else if (textureDepth == CV_16U){ drawTexturedTriangle(texture, polygon, meshCloud, uvs, faceIndex+faceOff); + }else if (textureDepth == CV_32F){ + drawTexturedTriangle(texture, polygon, meshCloud, uvs, faceIndex+faceOff); } } faceOff += faces.size(); @@ -555,6 +563,8 @@ void OdmOrthoPhoto::createOrthoPhoto() saveTIFF(outputFile_, GDT_Byte); }else if (textureDepth == CV_16U){ saveTIFF(outputFile_, GDT_UInt16); + }else if (textureDepth == CV_32F){ + saveTIFF(outputFile_, GDT_Float32); }else{ std::cerr << "Unsupported bit depth value: " << textureDepth; exit(1); diff --git a/opendm/config.py b/opendm/config.py index 00d943bd..a7deb393 100644 --- a/opendm/config.py +++ b/opendm/config.py @@ -645,5 +645,10 @@ def config(): except exceptions.NodeConnectionError as e: log.ODM_ERROR("Cluster node seems to be offline: %s" % str(e)) sys.exit(1) + + if args.radiometric_calibration != "none" and not args.texturing_skip_global_seam_leveling: + log.ODM_WARNING("--radiometric-calibration is set, disabling texturing global seam leveling") + args.texturing_skip_global_seam_leveling = True + return args