<s> import pcl <EOL> cloud = pcl . load ( "<STR_LIT>" ) <EOL> print ( cloud . size ) <EOL> fil = cloud . make_passthrough_filter ( ) <EOL> fil . set_filter_field_name ( "<STR_LIT:z>" ) <EOL> fil . set_filter_limits ( <NUM_LIT:0> , <NUM_LIT> ) <EOL> cloud_filtered = fil . filter ( ) <EOL> print ( cloud_filtered . size ) <EOL> seg = cloud_filtered . make_segmenter_normals ( ksearch = <NUM_LIT:50> ) <EOL> seg . set_optimize_coefficients ( True ) <EOL> seg . set_model_type ( pcl . SACMODEL_NORMAL_PLANE ) <EOL> seg . set_normal_distance_weight ( <NUM_LIT:0.1> ) <EOL> seg . set_method_type ( pcl . SAC_RANSAC ) <EOL> seg . set_max_iterations ( <NUM_LIT:100> ) <EOL> seg . set_distance_threshold ( <NUM_LIT> ) <EOL> indices , model = seg . segment ( ) <EOL> print ( model ) <EOL> cloud_plane = cloud_filtered . extract ( indices , negative = False ) <EOL> cloud_plane . to_file ( "<STR_LIT>" ) <EOL> cloud_cyl = cloud_filtered . extract ( indices , negative = True ) <EOL> seg = cloud_cyl . make_segmenter_normals ( ksearch = <NUM_LIT:50> ) <EOL> seg . set_optimize_coefficients ( True ) <EOL> seg . set_model_type ( pcl . SACMODEL_CYLINDER ) <EOL> seg . set_normal_distance_weight ( <NUM_LIT:0.1> ) <EOL> seg . set_method_type ( pcl . SAC_RANSAC ) <EOL> seg . set_max_iterations ( <NUM_LIT> ) <EOL> seg . set_distance_threshold ( <NUM_LIT> ) <EOL> seg . set_radius_limits ( <NUM_LIT:0> , <NUM_LIT:0.1> ) <EOL> indices , model = seg . segment ( ) <EOL> print ( model ) <EOL> cloud_cylinder = cloud_cyl . extract ( indices , negative = False ) <EOL> cloud_cylinder . to_file ( "<STR_LIT>" ) </s>
