Skip to content

Commit

Permalink
Mesher for LiveScan has reached Alpha-Status!
Browse files Browse the repository at this point in the history
All functions planned to be implemented in this script are now done.

-Fixed all paths to be compatible with PyInstaller build
-Added logos
-Removed junk files
-Added a first build for Windows x64
  • Loading branch information
Christopher Remde committed Jan 23, 2019
1 parent 58cee47 commit 3700306
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 45,253 deletions.
95 changes: 0 additions & 95 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,99 +102,4 @@ venv.bak/

# mypy
.mypy_cache/
output/meshed000010.obj
output/meshed000020.obj
output/meshed000030.obj
output/meshed000040.obj
output/meshed000050.obj
output/meshed000060.obj
output/meshed000070.obj
output/meshed000080.obj
output/meshed000090.obj
output/meshed000100.obj
output/meshed000110.obj
output/meshed000120.obj
output/meshed000130.obj
output/meshed000140.obj
output/meshed000150.obj
output/meshed000160.obj
output/meshed000170.obj
output/meshed000180.obj
output/meshed000190.obj
output/meshed000200.obj
output/meshed000210.obj
output/meshed000220.obj
output/meshed000230.obj
output/meshed000240.obj
output/meshed000250.obj
output/meshed000260.obj
output/meshed000270.obj
output/meshed000280.obj
output/meshed000290.obj
output/meshed000300.obj
output/meshed000310.obj
output/meshed000320.obj
output/meshed000330.obj
output/meshed000340.obj
output/meshed000350.obj
output/meshed000360.obj
output/meshed000370.obj
output/meshed000380.obj
output/meshed000390.obj
output/meshed000400.obj
output/meshed000410.obj
output/meshed000420.obj
output/meshed000430.obj
output/meshed000440.obj
output/meshed000450.obj
output/meshed000460.obj
output/meshed000470.obj
output/meshed000480.obj
output/meshed000490.obj
output/meshed000500.obj
output/meshed000510.obj
output/meshed000520.obj
output/meshed000530.obj
output/meshed000540.obj
output/meshed000550.obj
output/meshed000560.obj
output/meshed000570.obj
output/meshed000580.obj
output/meshed000590.obj
output/meshed000600.obj
output/meshed000610.obj
output/meshed000620.obj
output/meshed000630.obj
output/meshed000640.obj
output/meshed000650.obj
output/meshed000660.obj
output/meshed000670.obj
output/meshed000680.obj
output/meshed000690.obj
output/meshed000700.obj
output/meshed000710.obj
output/meshed000720.obj
output/meshed000730.obj
output/meshed000740.obj
output/meshed000750.obj
output/meshed000760.obj
output/meshed000770.obj
output/meshed000780.obj
output/meshed000790.obj
output/meshed000800.obj
output/meshed000810.obj
output/meshed000820.obj
output/meshed000830.obj
output/meshed000840.obj
output/meshed000850.obj
output/meshed000860.obj
output/meshed000870.obj
output/meshed000880.obj
output/meshed000890.obj
output/meshed000900.obj
output/meshed000910.obj
output/meshed000920.obj
output/meshed000930.obj
output/meshed000940.obj
output/meshed000950.obj
*.obj
43 changes: 17 additions & 26 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 17 additions & 9 deletions Mesher_Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def show_exception_and_exit(exc_type, exc_value, tb):
sys.exit(-1)

import sys
sys.excepthook = show_exception_and_exit #Stops the windows from immidiatly closing when a crash happens
sys.excepthook = show_exception_and_exit #Stops the windows from immidiatily closing when a crash happens



Expand All @@ -16,14 +16,21 @@ def show_exception_and_exit(exc_type, exc_value, tb):
import json
import xml.etree.ElementTree as ET

working_dir = sys.path[0]
if getattr(sys, 'frozen', False):
# If the application is run as a bundle, the pyInstaller bootloader
# extends the sys module by a flag frozen=True and sets the app
# path into variable _MEIPASS'.
working_dir = sys._MEIPASS
else:
working_dir = os.path.dirname(os.path.abspath(__file__))

# Settings
path_to_meshlab_dir = "C:\Program Files\VCG\MeshLab\\"
path_to_liveScan3D_files: str = "C:\\Users\ChrisSSD\Desktop\TexturePipeLineTest\\"
path_to_mesher_script_template: str = working_dir + "\\mesher_template.mlx"
path_to_vertex_remover_template: str = working_dir + "\\custom_vertex_removal_template.mlx"
path_to_individual_mesher_template: str = working_dir + "\\meshing_individual_frame.mlx"
path_to_individual_vertex_reomver = working_dir + "\\remove_vertices_above_individual_frame.mlx"
path_to_individual_vertex_remover = working_dir + "\\remove_vertices_above_individual_frame.mlx"
path_to_SOR_script: str = working_dir + "\\SOR.mlx"
path_to_output: str = "C:\\Users\ChrisSSD\Desktop\Output\\"

Expand Down Expand Up @@ -164,11 +171,11 @@ def write_custom_mlx_file_template(number_of_cameras):
else:
root.append(mlx_ball_pivoting)

mlx_doc.write("meshing_custom_template.mlx")
mlx_doc.write(working_dir + "\\meshing_custom_template.mlx")


def write_custom_mlx_file_for_each_frame(camera_positions, number_of_cameras):
mlx_custom_doc = ET.parse('meshing_custom_template.mlx') # Get the mlx template
mlx_custom_doc = ET.parse(working_dir + "\\meshing_custom_template.mlx") # Get the mlx template
root = mlx_custom_doc.getroot()

child_counter = 0
Expand All @@ -186,16 +193,16 @@ def write_custom_mlx_file_for_each_frame(camera_positions, number_of_cameras):
root[child_counter + 2].set("value", str(poisson_disk_vertices))
root[child_counter + 4].set("value", str(ball_point_radius))

mlx_custom_doc.write("meshing_individual_frame.mlx")
mlx_custom_doc.write(working_dir + "\\meshing_individual_frame.mlx")


def write_custom_mlx_file_for_vertex_removal(remove_vertices_above):

mlx_custom_doc = ET.parse(working_dir + "\\" + "custom_vertex_removal_template.mlx")
mlx_custom_doc = ET.parse(path_to_vertex_remover_template)
root = mlx_custom_doc.getroot()
root[0][0].set("value", str(remove_vertices_above))

mlx_custom_doc.write("remove_vertices_above_individual_frame.mlx")
mlx_custom_doc.write(working_dir + "\\remove_vertices_above_individual_frame.mlx")



Expand Down Expand Up @@ -468,7 +475,7 @@ def main_loop():
remove_vertices_above_quality_of = get_quality_standard_deviation(cmd_for_meshlabserver_with_output_path[1])
write_custom_mlx_file_for_vertex_removal(remove_vertices_above_quality_of)
cmd_for_meshlabserver_with_output_path = meshlabserver_cmd_promt_creator_single_file("SSPR_with_SO" + temp_filenumber[0] + ".ply",
tempdir, path_to_individual_vertex_reomver, path_to_output, "meshed", ".obj", "")
tempdir, path_to_individual_vertex_remover, path_to_output, "meshed", ".obj", "")
meshlabserver_supervisor(cmd_for_meshlabserver_with_output_path[0], cmd_for_meshlabserver_with_output_path[1])

current_frame_to_process += number_of_depth_sensors
Expand All @@ -484,5 +491,6 @@ def main_loop():
print("No more frames to process! Processed " + (current_frame_to_process / number_of_depth_sensors).__str__() + " frames. Program will perform cleanup & exit shortly")
cleanup_files([], [tempdir])


userInterface()
#main_loop()
Loading

0 comments on commit 3700306

Please sign in to comment.