From c256a87920940e7afe1773a9850e00c1d4f9b8bf Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 26 Apr 2021 11:12:33 -0400 Subject: [PATCH] Removed VTK, odm_cleanmesh module --- SuperBuild/cmake/External-OpenMVS.cmake | 2 +- licenses/license.md | 1 - modules/CMakeLists.txt | 1 - modules/odm_cleanmesh/CMakeLists.txt | 19 -- modules/odm_cleanmesh/src/CmdLineParser.h | 106 ------- modules/odm_cleanmesh/src/CmdLineParser.inl | 300 -------------------- modules/odm_cleanmesh/src/Logger.h | 33 --- modules/odm_cleanmesh/src/main.cpp | 114 -------- modules/odm_orthophoto/CMakeLists.txt | 1 - opendm/context.py | 1 + opendm/mesh.py | 26 +- snap/snapcraft.yaml | 2 - 12 files changed, 16 insertions(+), 590 deletions(-) delete mode 100644 modules/odm_cleanmesh/CMakeLists.txt delete mode 100644 modules/odm_cleanmesh/src/CmdLineParser.h delete mode 100644 modules/odm_cleanmesh/src/CmdLineParser.inl delete mode 100644 modules/odm_cleanmesh/src/Logger.h delete mode 100644 modules/odm_cleanmesh/src/main.cpp diff --git a/SuperBuild/cmake/External-OpenMVS.cmake b/SuperBuild/cmake/External-OpenMVS.cmake index c4bf3677..fec75ba9 100644 --- a/SuperBuild/cmake/External-OpenMVS.cmake +++ b/SuperBuild/cmake/External-OpenMVS.cmake @@ -20,7 +20,7 @@ ExternalProject_Add(${_proj_name} #--Download step-------------- DOWNLOAD_DIR ${SB_DOWNLOAD_DIR} GIT_REPOSITORY https://github.com/OpenDroneMap/openMVS - GIT_TAG 247 + GIT_TAG 2411 #--Update/Patch step---------- UPDATE_COMMAND "" #--Configure step------------- diff --git a/licenses/license.md b/licenses/license.md index 8648350f..11357853 100644 --- a/licenses/license.md +++ b/licenses/license.md @@ -19,7 +19,6 @@ Licensing for portions of OpenDroneMap are as follows: * Flann - BSD2 - http://opensource.org/licenses/bsd-license.php * Eigen - MPL2 - http://www.mozilla.org/MPL/2.0 * Qhull - http://www.qhull.org/COPYING.txt - * vtk5 - BSD - http://www.vtk.org/VTK/project/license.html * libext - https://github.com/OpenDroneMap/OpenDroneMap/blob/gh-pages/licenses/libext_copyright.txt * libx11 - https://github.com/OpenDroneMap/OpenDroneMap/blob/gh-pages/licenses/libx11_copyright.txt * MVS Texturing - BSD - https://github.com/nmoehrle/mvs-texturing/blob/master/LICENSE.txt diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 484900c9..5c372a95 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -5,4 +5,3 @@ endif() # Add ODM sub-modules add_subdirectory(odm_orthophoto) -add_subdirectory(odm_cleanmesh) diff --git a/modules/odm_cleanmesh/CMakeLists.txt b/modules/odm_cleanmesh/CMakeLists.txt deleted file mode 100644 index af97ab51..00000000 --- a/modules/odm_cleanmesh/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -project(odm_cleanmesh) -cmake_minimum_required(VERSION 2.8) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}) - -set (CMAKE_CXX_STANDARD 11) -find_package(VTK REQUIRED) -include(${VTK_USE_FILE}) - -# Add compiler options. -add_definitions(-Wall -Wextra) - -# Add source directory -aux_source_directory("./src" SRC_LIST) - -# Add exectuteable -add_executable(${PROJECT_NAME} ${SRC_LIST}) - -target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES}) diff --git a/modules/odm_cleanmesh/src/CmdLineParser.h b/modules/odm_cleanmesh/src/CmdLineParser.h deleted file mode 100644 index a1fbd0e3..00000000 --- a/modules/odm_cleanmesh/src/CmdLineParser.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright (c) 2006, Michael Kazhdan and Matthew Bolitho -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. Redistributions in binary form must reproduce -the above copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the distribution. - -Neither the name of the Johns Hopkins University nor the names of its contributors -may be used to endorse or promote products derived from this software without specific -prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. -*/ - -#ifndef CMD_LINE_PARSER_INCLUDED -#define CMD_LINE_PARSER_INCLUDED - -#include -#include -#include -#include -#include - -#ifdef WIN32 -int strcasecmp( const char* c1 , const char* c2 ); -#endif // WIN32 - -class cmdLineReadable -{ -public: - bool set; - char *name; - cmdLineReadable( const char *name ); - virtual ~cmdLineReadable( void ); - virtual int read( char** argv , int argc ); - virtual void writeValue( char* str ) const; -}; - -template< class Type > void cmdLineWriteValue( Type t , char* str ); -template< class Type > void cmdLineCleanUp( Type* t ); -template< class Type > Type cmdLineInitialize( void ); -template< class Type > Type cmdLineCopy( Type t ); -template< class Type > Type cmdLineStringToType( const char* str ); - -template< class Type > -class cmdLineParameter : public cmdLineReadable -{ -public: - Type value; - cmdLineParameter( const char *name ); - cmdLineParameter( const char *name , Type v ); - ~cmdLineParameter( void ); - int read( char** argv , int argc ); - void writeValue( char* str ) const; - bool expectsArg( void ) const { return true; } -}; - -template< class Type , int Dim > -class cmdLineParameterArray : public cmdLineReadable -{ -public: - Type values[Dim]; - cmdLineParameterArray( const char *name, const Type* v=NULL ); - ~cmdLineParameterArray( void ); - int read( char** argv , int argc ); - void writeValue( char* str ) const; - bool expectsArg( void ) const { return true; } -}; - -template< class Type > -class cmdLineParameters : public cmdLineReadable -{ -public: - int count; - Type *values; - cmdLineParameters( const char* name ); - ~cmdLineParameters( void ); - int read( char** argv , int argc ); - void writeValue( char* str ) const; - bool expectsArg( void ) const { return true; } -}; - -void cmdLineParse( int argc , char **argv, cmdLineReadable** params ); -char* FileExtension( char* fileName ); -char* LocalFileName( char* fileName ); -char* DirectoryName( char* fileName ); -char* GetFileExtension( const char* fileName ); -char* GetLocalFileName( const char* fileName ); -char** ReadWords( const char* fileName , int& cnt ); - -#include "CmdLineParser.inl" -#endif // CMD_LINE_PARSER_INCLUDED diff --git a/modules/odm_cleanmesh/src/CmdLineParser.inl b/modules/odm_cleanmesh/src/CmdLineParser.inl deleted file mode 100644 index 84574a57..00000000 --- a/modules/odm_cleanmesh/src/CmdLineParser.inl +++ /dev/null @@ -1,300 +0,0 @@ -/* -*- C++ -*- -Copyright (c) 2006, Michael Kazhdan and Matthew Bolitho -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. Redistributions in binary form must reproduce -the above copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the distribution. - -Neither the name of the Johns Hopkins University nor the names of its contributors -may be used to endorse or promote products derived from this software without specific -prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. -*/ - -#include -#include - -#if defined( WIN32 ) || defined( _WIN64 ) -inline int strcasecmp( const char* c1 , const char* c2 ){ return _stricmp( c1 , c2 ); } -#endif // WIN32 || _WIN64 - -template< > void cmdLineCleanUp< int >( int* t ){ *t = 0; } -template< > void cmdLineCleanUp< float >( float* t ){ *t = 0; } -template< > void cmdLineCleanUp< double >( double* t ){ *t = 0; } -template< > void cmdLineCleanUp< char* >( char** t ){ if( *t ) free( *t ) ; *t = NULL; } -template< > int cmdLineInitialize< int >( void ){ return 0; } -template< > float cmdLineInitialize< float >( void ){ return 0.f; } -template< > double cmdLineInitialize< double >( void ){ return 0.; } -template< > char* cmdLineInitialize< char* >( void ){ return NULL; } -template< > void cmdLineWriteValue< int >( int t , char* str ){ sprintf( str , "%d" , t ); } -template< > void cmdLineWriteValue< float >( float t , char* str ){ sprintf( str , "%f" , t ); } -template< > void cmdLineWriteValue< double >( double t , char* str ){ sprintf( str , "%f" , t ); } -template< > void cmdLineWriteValue< char* >( char* t , char* str ){ if( t ) sprintf( str , "%s" , t ) ; else str[0]=0; } -template< > int cmdLineCopy( int t ){ return t; } -template< > float cmdLineCopy( float t ){ return t; } -template< > double cmdLineCopy( double t ){ return t; } -#if defined( WIN32 ) || defined( _WIN64 ) -template< > char* cmdLineCopy( char* t ){ return _strdup( t ); } -#else // !WIN32 && !_WIN64 -template< > char* cmdLineCopy( char* t ){ return strdup( t ); } -#endif // WIN32 || _WIN64 -template< > int cmdLineStringToType( const char* str ){ return atoi( str ); } -template< > float cmdLineStringToType( const char* str ){ return float( atof( str ) ); } -template< > double cmdLineStringToType( const char* str ){ return double( atof( str ) ); } -#if defined( WIN32 ) || defined( _WIN64 ) -template< > char* cmdLineStringToType( const char* str ){ return _strdup( str ); } -#else // !WIN32 && !_WIN64 -template< > char* cmdLineStringToType( const char* str ){ return strdup( str ); } -#endif // WIN32 || _WIN64 - - -///////////////////// -// cmdLineReadable // -///////////////////// -#if defined( WIN32 ) || defined( _WIN64 ) -inline cmdLineReadable::cmdLineReadable( const char *name ) : set(false) { this->name = _strdup( name ); } -#else // !WIN32 && !_WIN64 -inline cmdLineReadable::cmdLineReadable( const char *name ) : set(false) { this->name = strdup( name ); } -#endif // WIN32 || _WIN64 - -inline cmdLineReadable::~cmdLineReadable( void ){ if( name ) free( name ) ; name = NULL; } -inline int cmdLineReadable::read( char** , int ){ set = true ; return 0; } -inline void cmdLineReadable::writeValue( char* str ) const { str[0] = 0; } - -////////////////////// -// cmdLineParameter // -////////////////////// -template< class Type > cmdLineParameter< Type >::~cmdLineParameter( void ) { cmdLineCleanUp( &value ); } -template< class Type > cmdLineParameter< Type >::cmdLineParameter( const char *name ) : cmdLineReadable( name ){ value = cmdLineInitialize< Type >(); } -template< class Type > cmdLineParameter< Type >::cmdLineParameter( const char *name , Type v ) : cmdLineReadable( name ){ value = cmdLineCopy< Type >( v ); } -template< class Type > -int cmdLineParameter< Type >::read( char** argv , int argc ) -{ - if( argc>0 ) - { - cmdLineCleanUp< Type >( &value ) , value = cmdLineStringToType< Type >( argv[0] ); - set = true; - return 1; - } - else return 0; -} -template< class Type > -void cmdLineParameter< Type >::writeValue( char* str ) const { cmdLineWriteValue< Type >( value , str ); } - - -/////////////////////////// -// cmdLineParameterArray // -/////////////////////////// -template< class Type , int Dim > -cmdLineParameterArray< Type , Dim >::cmdLineParameterArray( const char *name , const Type* v ) : cmdLineReadable( name ) -{ - if( v ) for( int i=0 ; i( v[i] ); - else for( int i=0 ; i(); -} -template< class Type , int Dim > -cmdLineParameterArray< Type , Dim >::~cmdLineParameterArray( void ){ for( int i=0 ; i( values+i ); } -template< class Type , int Dim > -int cmdLineParameterArray< Type , Dim >::read( char** argv , int argc ) -{ - if( argc>=Dim ) - { - for( int i=0 ; i( values+i ) , values[i] = cmdLineStringToType< Type >( argv[i] ); - set = true; - return Dim; - } - else return 0; -} -template< class Type , int Dim > -void cmdLineParameterArray< Type , Dim >::writeValue( char* str ) const -{ - char* temp=str; - for( int i=0 ; i( values[i] , temp ); - temp = str+strlen( str ); - } -} -/////////////////////// -// cmdLineParameters // -/////////////////////// -template< class Type > -cmdLineParameters< Type >::cmdLineParameters( const char* name ) : cmdLineReadable( name ) , values(NULL) , count(0) { } -template< class Type > -cmdLineParameters< Type >::~cmdLineParameters( void ) -{ - if( values ) delete[] values; - values = NULL; - count = 0; -} -template< class Type > -int cmdLineParameters< Type >::read( char** argv , int argc ) -{ - if( values ) delete[] values; - values = NULL; - - if( argc>0 ) - { - count = atoi(argv[0]); - if( count <= 0 || argc <= count ) return 1; - values = new Type[count]; - if( !values ) return 0; - for( int i=0 ; i( argv[i+1] ); - set = true; - return count+1; - } - else return 0; -} -template< class Type > -void cmdLineParameters< Type >::writeValue( char* str ) const -{ - char* temp=str; - for( int i=0 ; i( values[i] , temp ); - temp = str+strlen( str ); - } -} - - -inline char* FileExtension( char* fileName ) -{ - char* temp = fileName; - for( unsigned int i=0 ; i=0 ; i-- ) - if( fileName[i] =='\\' ) - { - fileName[i] = 0; - return fileName; - } - fileName[0] = 0; - return fileName; -} - -inline void cmdLineParse( int argc , char **argv , cmdLineReadable** params ) -{ - while( argc>0 ) - { - if( argv[0][0]=='-' ) - { - cmdLineReadable* readable=NULL; - for( int i=0 ; params[i]!=NULL && readable==NULL ; i++ ) if( !strcasecmp( params[i]->name , argv[0]+1 ) ) readable = params[i]; - if( readable ) - { - int j = readable->read( argv+1 , argc-1 ); - argv += j , argc -= j; - } - else - { - fprintf( stderr , "[WARNING] Invalid option: %s\n" , argv[0] ); - for( int i=0 ; params[i]!=NULL ; i++ ) printf( "\t-%s\n" , params[i]->name ); - } - } - else fprintf( stderr , "[WARNING] Parameter name should be of the form -: %s\n" , argv[0] ); - ++argv , --argc; - } -} - -inline char** ReadWords(const char* fileName,int& cnt) -{ - char** names; - char temp[500]; - FILE* fp; - - fp=fopen(fileName,"r"); - if(!fp){return NULL;} - cnt=0; - while(fscanf(fp," %s ",temp)==1){cnt++;} - fclose(fp); - - names=new char*[cnt]; - if(!names){return NULL;} - - fp=fopen(fileName,"r"); - if(!fp){ - delete[] names; - cnt=0; - return NULL; - } - cnt=0; - while(fscanf(fp," %s ",temp)==1){ - names[cnt]=new char[strlen(temp)+1]; - if(!names){ - for(int j=0;j -#include -#include "CmdLineParser.h" - -struct Logger{ - bool verbose; - const char* outputFile; - - Logger(){ - this->verbose = false; - this->outputFile = NULL; - } - - void operator() ( const char* format , ... ) - { - if( outputFile ) - { - FILE* fp = fopen( outputFile , "a" ); - va_list args; - va_start( args , format ); - vfprintf( fp , format , args ); - fclose( fp ); - va_end( args ); - } - if( verbose ) - { - va_list args; - va_start( args , format ); - vprintf( format , args ); - va_end( args ); - } - } -}; diff --git a/modules/odm_cleanmesh/src/main.cpp b/modules/odm_cleanmesh/src/main.cpp deleted file mode 100644 index c5251c0f..00000000 --- a/modules/odm_cleanmesh/src/main.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "CmdLineParser.h" -#include "Logger.h" - -Logger logWriter; - -cmdLineParameter< char* > - InputFile( "inputFile" ) , - OutputFile( "outputFile" ); -cmdLineParameter< int > - DecimateMesh( "decimateMesh" ); -cmdLineReadable - RemoveIslands( "removeIslands" ) , - Verbose( "verbose" ); - -cmdLineReadable* params[] = { - &InputFile , &OutputFile , &DecimateMesh, &RemoveIslands, &Verbose , - NULL -}; - -void help(char *ex){ - std::cout << "Usage: " << ex << std::endl - << "\t -" << InputFile.name << " " << std::endl - << "\t -" << OutputFile.name << " " << std::endl - << "\t [-" << DecimateMesh.name << " ]" << std::endl - << "\t [-" << RemoveIslands.name << "]" << std::endl - - << "\t [-" << Verbose.name << "]" << std::endl; - exit(EXIT_FAILURE); -} - - -void logArgs(cmdLineReadable* params[], Logger& logWriter){ - logWriter("Running with parameters:\n"); - char str[1024]; - for( int i=0 ; params[i] ; i++ ){ - if( params[i]->set ){ - params[i]->writeValue( str ); - if( strlen( str ) ) logWriter( "\t--%s %s\n" , params[i]->name , str ); - else logWriter( "\t--%s\n" , params[i]->name ); - } - } -} - - -int main(int argc, char **argv) { - cmdLineParse( argc-1 , &argv[1] , params ); - if( !InputFile.set || !OutputFile.set ) help(argv[0]); - if( !RemoveIslands.set && !DecimateMesh.set ) help (argv[0]); - - - logWriter.verbose = Verbose.set; - // logWriter.outputFile = "odm_cleanmesh_log.txt"; - logArgs(params, logWriter); - - vtkSmartPointer reader = - vtkSmartPointer::New(); - reader->SetFileName ( InputFile.value ); - reader->Update(); - - vtkPolyData *nextOutput = reader->GetOutput(); - - vtkSmartPointer connectivityFilter = - vtkSmartPointer::New(); - connectivityFilter->SetExtractionModeToLargestRegion(); - - vtkSmartPointer decimationFilter = - vtkSmartPointer::New(); - - if (RemoveIslands.set){ - logWriter("Removing islands\n"); - connectivityFilter->SetInputData(nextOutput); - connectivityFilter->Update(); - nextOutput = connectivityFilter->GetOutput(); - } - - if (DecimateMesh.set){ - logWriter("Decimating mesh\n"); - - int vertexCount = nextOutput->GetNumberOfPoints(); - logWriter("Current vertex count: %d\n", vertexCount); - logWriter("Wanted vertex count: %d\n", DecimateMesh.value); - - if (vertexCount > DecimateMesh.value){ - double targetReduction = 1.0 - static_cast(DecimateMesh.value) / static_cast(vertexCount); - logWriter("Target reduction set to %f\n", targetReduction); - decimationFilter->SetTargetReduction(targetReduction); - decimationFilter->SetInputData(nextOutput); - decimationFilter->Update(); - nextOutput = decimationFilter->GetOutput(); - }else{ - logWriter("Skipping decimation\n"); - } - } - - logWriter("Saving cleaned mesh to file... \n"); - - vtkSmartPointer plyWriter = - vtkSmartPointer::New(); - plyWriter->SetFileName(OutputFile.value); - plyWriter->SetFileTypeToBinary(); - plyWriter->SetInputData(nextOutput); - plyWriter->Write(); - - logWriter("OK\n"); -} diff --git a/modules/odm_orthophoto/CMakeLists.txt b/modules/odm_orthophoto/CMakeLists.txt index 68e18ec0..6c8f20e0 100644 --- a/modules/odm_orthophoto/CMakeLists.txt +++ b/modules/odm_orthophoto/CMakeLists.txt @@ -9,7 +9,6 @@ set(OPENCV_DIR "OPENCV_DIR-NOTFOUND" CACHE "OPENCV_DIR" "Path to the OPENCV inst add_definitions(-Wall -Wextra) # Find pcl at the location specified by PCL_DIR -find_package(VTK 6.0 REQUIRED) find_package(PCL 1.8 HINTS "${PCL_DIR}/share/pcl-1.8" REQUIRED) find_package(GDAL REQUIRED) include_directories(${GDAL_INCLUDE_DIR}) diff --git a/opendm/context.py b/opendm/context.py index 387686c2..f050234e 100644 --- a/opendm/context.py +++ b/opendm/context.py @@ -36,6 +36,7 @@ mvstex_path = os.path.join(superbuild_path, "install/bin/texrecon") # openmvs paths omvs_densify_path = os.path.join(superbuild_path, "install/bin/OpenMVS/DensifyPointCloud") +omvs_reconstructmesh_path = os.path.join(superbuild_path, "install/bin/OpenMVS/ReconstructMesh") # define txt2las path txt2las_path = os.path.join(superbuild_path, 'src/las-tools/bin') diff --git a/opendm/mesh.py b/opendm/mesh.py index f8bb51da..05b5fabd 100644 --- a/opendm/mesh.py +++ b/opendm/mesh.py @@ -117,17 +117,18 @@ def dem_to_mesh_gridded(inGeotiff, outMesh, maxVertexCount, verbose=False, maxCo # Cleanup and reduce vertex count if necessary # (as dem2mesh cannot guarantee that we'll have the target vertex count) cleanupArgs = { - 'bin': context.odm_modules_path, + 'reconstructmesh': context.omvs_reconstructmesh_path, 'outfile': outMesh, 'infile': outMeshDirty, - 'max_vertex': maxVertexCount, + 'max_faces': maxVertexCount * 2, 'verbose': '-verbose' if verbose else '' } - system.run('{bin}/odm_cleanmesh -inputFile {infile} ' - '-outputFile {outfile} ' - '-removeIslands ' - '-decimateMesh {max_vertex} {verbose} '.format(**cleanupArgs)) + system.run('{reconstructmesh} --mesh-file "{infile}" ' + '-o "{outfile}" ' + '--remove-spikes 0 --remove-spurious 0 --smooth 0 ' + '--target-face-num {max_faces} ' + '{verbose} '.format(**cleanupArgs)) # Delete intermediate results os.remove(outMeshDirty) @@ -170,17 +171,18 @@ def screened_poisson_reconstruction(inPointCloud, outMesh, depth = 8, samples = # Cleanup and reduce vertex count if necessary cleanupArgs = { - 'bin': context.odm_modules_path, + 'reconstructmesh': context.omvs_reconstructmesh_path, 'outfile': outMesh, 'infile': outMeshDirty, - 'max_vertex': maxVertexCount, + 'max_faces': maxVertexCount * 2, 'verbose': '-verbose' if verbose else '' } - system.run('{bin}/odm_cleanmesh -inputFile {infile} ' - '-outputFile {outfile} ' - '-removeIslands ' - '-decimateMesh {max_vertex} {verbose} '.format(**cleanupArgs)) + system.run('{reconstructmesh} --mesh-file "{infile}" ' + '-o "{outfile}" ' + '--remove-spikes 0 --remove-spurious 0 --smooth 0 ' + '--target-face-num {max_faces} ' + '{verbose} '.format(**cleanupArgs)) # Delete intermediate results os.remove(outMeshDirty) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 478f803f..37359d88 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -93,7 +93,6 @@ parts: - libswscale-dev - libtbb-dev - libtiff-dev - - libvtk6-dev - libxext-dev - proj-bin stage-packages: @@ -109,7 +108,6 @@ parts: - libswscale5 - libtbb2 - libtiff5 - - libvtk6.3 - libwebpdemux2 - libxext6