Automatisierte CloudCompare Verarbeitung
This commit is contained in:
52
cloudcompare_workflow.py
Normal file
52
cloudcompare_workflow.py
Normal file
@@ -0,0 +1,52 @@
|
||||
#-------------------------------------------------------------------------
|
||||
# automatischer Workflow für die Vorverarbeitung einer las-Datei mit CloudCompare
|
||||
#
|
||||
# Arbeitsschritte:
|
||||
# 1. Subsample - Punktdichte verringern
|
||||
# 2. SOR - Statistical Outlier Removal - Ausreißer eliminieren
|
||||
# 3. NOISE FILTER - Isolierte Punkte/Inseln entfernen
|
||||
#
|
||||
# zur Benutzung muss die Variable "cloudComprePath" korrekt gesetzt werden!
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
import subprocess
|
||||
from tkinter import Tk
|
||||
from tkinter.filedialog import askopenfilename
|
||||
|
||||
# die Punktwolken Datei, die verarbeitet wird bestimmen
|
||||
Tk().withdraw()
|
||||
filename = askopenfilename()
|
||||
print("Datei: " + filename)
|
||||
|
||||
# Name der Ausgabedatei
|
||||
outname = filename.rsplit('/', 1)[-1].rsplit('.', 1)[0] + "_processed.laz"
|
||||
outname = outname.replace(" ", "_")
|
||||
|
||||
# Wo ist CloudCompare auf diesem Rechner gespeichert?
|
||||
cloudComprePath = "C:\Program Files\CloudCompare\CloudCompare.exe"
|
||||
|
||||
|
||||
#----- Variablen für die Verarbeitungstools -----
|
||||
|
||||
# minimale Distanz zwischen zwei Punkten (in Meter)
|
||||
subSampleDistance = "0.01"
|
||||
# Ausreißer eliminieren - Anzahl der betrachteten Nachbarpunkte
|
||||
sorPointCount = "20"
|
||||
# Radius
|
||||
noiseRadius = "0.02"
|
||||
|
||||
# Verarbeitungsbefehl
|
||||
command = [
|
||||
cloudComprePath,
|
||||
"-O", filename,
|
||||
"-SS", "SPATIAL", subSampleDistance,
|
||||
"-SOR", sorPointCount, "2",
|
||||
"-NOISE", "RADIUS", noiseRadius, "REL", "1.0", "RIP",
|
||||
"-C_EXPORT_FMT", "LAS",
|
||||
"-SAVE_CLOUDS", "FILE", outname
|
||||
]
|
||||
|
||||
subprocess.run(command)
|
||||
|
||||
print("Verarbeitung fertig - Datei exportiert")
|
||||
input("")
|
||||
Reference in New Issue
Block a user