Metashape version 2.0.2
OS Win 10
Hello,
I would like to classify ground points using Metashape python script, but I am having difficulty finding the correct syntax.
This is what I have tried so far;
# chunk.PointCloud.classifyPoints(Unclassified,Ground)
# PointCloud.classifyPoints(Unclassified,Ground)
# chunk.PointCloud.classifyGroundPoints(max_angle=15.0,max_distance=1.0,cell_size=50.0,erosion_radius=0.0)
# chunk.classifyPoints(Unclassified,Ground)
# chunk.classifyGroundPoints(max_angle=15.0,max_distance=1.0,cell_size=50.0,erosion_radius=0.0)
# chunk.DepthMapsData.classifyPoints(Unclassified,Ground)
# chunk.dense_cloud.classifyPoints(source = Metashape.PointClass.Created, target = [Metashape.PointClass.Ground], confidence=0.01)
# chunk.PointCloudData.classifyPoints(source = Metashape.PointClass.Created, target = [Metashape.PointClass.Ground], confidence=0.01)
chunk.classifyPoints(source = Metashape.PointCloudData, target = [Metashape.PointClass.Ground], confidence=0.01)
This is a workflow that I am using and would like to insert a classification component (I have included the failed lines of classification);
print('Match Photos')
chunk.matchPhotos(\
downscale=v_accuracy,\
generic_preselection=False,\
reference_preselection=True,\
guided_matching=False,\
filter_mask=False,\
keypoint_limit=v_keypoints,\
tiepoint_limit=v_tiepoints\
)
doc.save()
print('Align Cameras')
chunk.alignCameras()
doc.save()
print('Optimise Cameras')
chunk.optimizeCameras(\
fit_f=True,fit_cx=True,\
fit_cy=True,fit_b1=True,\
fit_b2=True,fit_k1=True,\
fit_k2=True,fit_k3=True,\
fit_k4=False,fit_p1=True,\
fit_p2=True,fit_p3=False,\
fit_p4=False,adaptive_fitting=True,\
tiepoint_covariance=True\
)
doc.save()
print('Build Depth Maps')
chunk.buildDepthMaps(downscale=v_quality, filter_mode=v_filter)
doc.save()
print('Build Point Cloud')
chunk.buildPointCloud(\
source_data=Metashape.DepthMapsData\
, point_colors=True\
)
doc.save()
print('Classify Point Cloud')
# chunk.PointCloud.classifyPoints(Unclassified,Ground)
# PointCloud.classifyPoints(Unclassified,Ground)
# chunk.PointCloud.classifyGroundPoints(max_angle=15.0,max_distance=1.0,cell_size=50.0,erosion_radius=0.0)
# chunk.classifyPoints(Unclassified,Ground)
# chunk.classifyGroundPoints(max_angle=15.0,max_distance=1.0,cell_size=50.0,erosion_radius=0.0)
# chunk.DepthMapsData.classifyPoints(Unclassified,Ground)
# chunk.dense_cloud.classifyPoints(source = Metashape.PointClass.Created, target = [Metashape.PointClass.Ground], confidence=0.01)
# chunk.PointCloudData.classifyPoints(source = Metashape.PointClass.Created, target = [Metashape.PointClass.Ground], confidence=0.01)
chunk.classifyPoints(source = Metashape.PointCloudData, target = [Metashape.PointClass.Ground], confidence=0.01)
doc.save()
print('Export Point Cloud')
chunk.exportPointCloud(\
output_path + "/_RGB_POINT_CLOUD/input.laz"\
, crs=v_crs_to\
, source_data=Metashape.PointCloudData\
, save_point_color=True\
, save_point_classification=True\
, format=Metashape.PointCloudFormatLAZ\
)
doc.save()
Thank You
Ben