Skip to content

Commit

Permalink
- Fix GeometricFiltering install
Browse files Browse the repository at this point in the history
- Add new executable to compute pairs
- Remove filtering from ComputeMatches
- Remove choice of pairs mode in ComputeMatches
- Update pipelines to reflect the new use [pairsGenerator -> ComputeMatches -> GeometricFilter]
  • Loading branch information
rperrot committed Mar 6, 2019
1 parent 2d8e295 commit 86ee88f
Show file tree
Hide file tree
Showing 5 changed files with 346 additions and 350 deletions.
31 changes: 23 additions & 8 deletions src/software/SfM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ target_link_libraries(openMVG_main_ListMatchingPairs
${STLPLUS_LIBRARY}
)

add_executable( openMVG_main_PairsGenerator main_PairsGenerator.cpp )
target_link_libraries( openMVG_main_PairsGenerator
PRIVATE
openMVG_features
openMVG_multiview
openMVG_sfm
openMVG_system
${STLPLUS_LIBRARY}
)

add_executable(openMVG_main_ComputeMatches main_ComputeMatches.cpp)
target_link_libraries(openMVG_main_ComputeMatches
PRIVATE
Expand Down Expand Up @@ -95,14 +105,19 @@ target_link_libraries(openMVG_main_MatchesToTracks
)

# Installation rules
set_property(TARGET openMVG_main_ComputeFeatures PROPERTY FOLDER OpenMVG/software)
install(TARGETS openMVG_main_ComputeFeatures DESTINATION bin/)
set_property(TARGET openMVG_main_ListMatchingPairs PROPERTY FOLDER OpenMVG/software)
install(TARGETS openMVG_main_ListMatchingPairs DESTINATION bin/)
set_property(TARGET openMVG_main_ComputeMatches PROPERTY FOLDER OpenMVG/software)
install(TARGETS openMVG_main_ComputeMatches DESTINATION bin/)
set_property(TARGET openMVG_main_MatchesToTracks PROPERTY FOLDER OpenMVG/software)
install(TARGETS openMVG_main_MatchesToTracks DESTINATION bin/)
set_property( TARGET openMVG_main_ListMatchingPairs PROPERTY FOLDER OpenMVG/software )
set_property( TARGET openMVG_main_ComputeFeatures PROPERTY FOLDER OpenMVG/software )
set_property( TARGET openMVG_main_PairsGenerator PROPERTY FOLDER OpenMVG/software )
set_property( TARGET openMVG_main_ComputeMatches PROPERTY FOLDER OpenMVG/software )
set_property( TARGET openMVG_main_GeometricFilter PROPERTY FOLDER OpenMVG/software )
set_property( TARGET openMVG_main_MatchesToTracks PROPERTY FOLDER OpenMVG/software )

install( TARGETS openMVG_main_ListMatchingPairs DESTINATION bin/ )
install( TARGETS openMVG_main_ComputeFeatures DESTINATION bin/ )
install( TARGETS openMVG_main_PairsGenerator DESTINATION bin/ )
install( TARGETS openMVG_main_ComputeMatches DESTINATION bin/ )
install( TARGETS openMVG_main_GeometricFilter DESTINATION bin/ )
install( TARGETS openMVG_main_MatchesToTracks DESTINATION bin/ )

###
# SfM Pipelines
Expand Down
18 changes: 13 additions & 5 deletions src/software/SfM/SfM_GlobalPipeline.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,32 @@ print ("2. Compute features")
pFeatures = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeFeatures"), "-i", matches_dir+"/sfm_data.json", "-o", matches_dir, "-m", "SIFT"] )
pFeatures.wait()

print ("3. Compute matches")
pMatches = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeMatches"), "-i", matches_dir+"/sfm_data.json", "-o", matches_dir, "-g", "e"] )
print ("3. Compute matching pairs")
pPairs = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_PairsGenerator"), "-i", matches_dir+"/sfm_data.json", "-o" , matches_dir + "/pairs.bin" ] )
pPairs.wait()

print ("4. Compute matches")
pMatches = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeMatches"), "-i", matches_dir+"/sfm_data.json", "-p", matches_dir+ "/pairs.bin", "-o", matches_dir + "/matches.putative.bin" ] )
pMatches.wait()

print ("5. Filter matches" )
pFiltering = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_GeometricFilter"), "-i", matches_dir+"/sfm_data.json", "-m", matches_dir+"/matches.putative.bin" , "-g" , "e" , "-o" , matches_dir+"/matches.e.bin" ] )
pFiltering.wait()

# Create the reconstruction if not present
if not os.path.exists(reconstruction_dir):
os.mkdir(reconstruction_dir)

print ("4. Do Global reconstruction")
print ("6. Do Global reconstruction")
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_GlobalSfM"), "-i", matches_dir+"/sfm_data.json", "-m", matches_dir, "-o", reconstruction_dir] )
pRecons.wait()

print ("5. Colorize Structure")
print ("7. Colorize Structure")
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeSfM_DataColor"), "-i", reconstruction_dir+"/sfm_data.bin", "-o", os.path.join(reconstruction_dir,"colorized.ply")] )
pRecons.wait()

# optional, compute final valid structure from the known camera poses
print ("6. Structure from Known Poses (robust triangulation)")
print ("8. Structure from Known Poses (robust triangulation)")
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeStructureFromKnownPoses"), "-i", reconstruction_dir+"/sfm_data.bin", "-m", matches_dir, "-f", os.path.join(matches_dir, "matches.e.bin"), "-o", os.path.join(reconstruction_dir,"robust.bin")] )
pRecons.wait()

Expand Down
18 changes: 13 additions & 5 deletions src/software/SfM/SfM_SequentialPipeline.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,32 @@ print ("2. Compute features")
pFeatures = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeFeatures"), "-i", matches_dir+"/sfm_data.json", "-o", matches_dir, "-m", "SIFT"] )
pFeatures.wait()

print ("3. Compute matches")
pMatches = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeMatches"), "-i", matches_dir+"/sfm_data.json", "-o", matches_dir] )
print ("3. Compute matching pairs")
pPairs = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_PairsGenerator"), "-i", matches_dir+"/sfm_data.json", "-o" , matches_dir + "/pairs.bin" ] )
pPairs.wait()

print ("4. Compute matches")
pMatches = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeMatches"), "-i", matches_dir+"/sfm_data.json", "-p", matches_dir+ "/pairs.bin", "-o", matches_dir + "/matches.putative.bin" ] )
pMatches.wait()

print ("5. Filter matches" )
pFiltering = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_GeometricFilter"), "-i", matches_dir+"/sfm_data.json", "-m", matches_dir+"/matches.putative.bin" , "-g" , "f" , "-o" , matches_dir+"/matches.f.bin" ] )
pFiltering.wait()

# Create the reconstruction if not present
if not os.path.exists(reconstruction_dir):
os.mkdir(reconstruction_dir)

print ("4. Do Sequential/Incremental reconstruction")
print ("6. Do Sequential/Incremental reconstruction")
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_IncrementalSfM"), "-i", matches_dir+"/sfm_data.json", "-m", matches_dir, "-o", reconstruction_dir] )
pRecons.wait()

print ("5. Colorize Structure")
print ("7. Colorize Structure")
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeSfM_DataColor"), "-i", reconstruction_dir+"/sfm_data.bin", "-o", os.path.join(reconstruction_dir,"colorized.ply")] )
pRecons.wait()

# optional, compute final valid structure from the known camera poses
print ("6. Structure from Known Poses (robust triangulation)")
print ("8. Structure from Known Poses (robust triangulation)")
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeStructureFromKnownPoses"), "-i", reconstruction_dir+"/sfm_data.bin", "-m", matches_dir, "-f", os.path.join(matches_dir, "matches.f.bin"), "-o", os.path.join(reconstruction_dir,"robust.bin")] )
pRecons.wait()

Expand Down
Loading

0 comments on commit 86ee88f

Please sign in to comment.