Hello,
I'm trying to mesh my dense cloud after classifying it, and only mesh the points within the "ground" class.
According to what I found on the forums, here's the list of existing classes.
Created = 0,
Unclassified = 1,
Ground = 2,
LowVegetation = 3,
MediumVegetation = 4,
HighVegetation = 5,
Building = 6,
LowPoint = 7,
ModelKeyPoint = 8,
Water = 9,
OverlapPoints = 12
My code is the following:
import os, PhotoScan
doc = PhotoScan.app.document
chunk = doc.addChunk()
type_chunk = ['Green']
for chunk in doc.chunks:
# Build Dense Cloud
chunk.buildDenseCloud(quality=PhotoScan.MediumQuality,
filter=PhotoScan.AggressiveFiltering)
# Classify Point Cloud or not depending on chunk type
if not any(type_chunk in chunk.label for type_chunk in type_chunk):
doc.chunk.dense_cloud.classifyGroundPoints(max_angle = 15.0,
max_distance = 0.3, cell_size = 1.0)
else:
continue
print("""--------------------- DPC OK ----------------""")
# Build Mesh, then Smooth Mesh depending on chunk type
if not any(type_chunk in chunk.label for type_chunk in type_chunk):
chunk.buildModel(surface = PhotoScan.HeightField,
interpolation = PhotoScan.EnabledInterpolation,
face_count = PhotoScan.MediumFaceCount, classes = 2)
chunk.smoothModel(passes = 50)
else:
chunk.buildModel(surface = PhotoScan.HeightField,
interpolation = PhotoScan.EnabledInterpolation,
face_count = PhotoScan.MediumFaceCount)
chunk.smoothModel(passes = 100)
I get the following error when running it:
2017-02-27 09:35:28 File "C:/PFE_CAPRA/Scripts/170227/AOI_Process_PartII.py", line 84, in <module>
2017-02-27 09:35:28 face_count = PhotoScan.MediumFaceCount, classes = 2)
2017-02-27 09:35:28 TypeError: classes should be a list of int
Any help is appreciated.
Best regards.