title: Saving Detected Objects Individually from Point Cloud with RANSAC and DBSCAN
body: <p><strong>Hello,
  I am trying to detect objects from point cloud data using RANSAC and DBSCAN algorithms. I need to save these detected objects as separate files and then produce their solid models. But I was not able to save the objects. I'm new to python and I don't know much about what to do, if you can help I'd appreciate it.</strong></p>
  <pre><code>import open3d as o3d
  import numpy as np
  
  import matplotlib.pyplot as plt
  import time 
  import pandas as pd
  start = time.time()
  
   
  pcd = o3d.io.read_point_cloud(&quot;D:\\Bitirme_Veri\\mini.pcd&quot;)
  plane_model, inliers = pcd.segment_plane(distance_threshold=0.05, ransac_n=3, num_iterations=1000)
  inlier_cloud = pcd.select_by_index(inliers)
  outlier_cloud = pcd.select_by_index(inliers, invert=True)
  inlier_cloud.paint_uniform_color([1, 0, 0])
  o3d.visualization.draw_geometries([inlier_cloud, outlier_cloud])
  o3d.io.write_point_cloud(&quot;D:\\bitirme2\\Sonuçlar\\sonuc1.pcd&quot;, outlier_cloud, write_ascii=True, compressed=True, print_progress=False)
  #DBSCAN
  labels = np.array(outlier_cloud.cluster_dbscan(eps=0.05, min_points=5))
  max_label = labels.max()
  colors = plt.get_cmap(&quot;tab20&quot;)(labels / (max_label 
  if max_label &gt; 0 else 1))
  colors[labels &lt; 0] = 0
  
  inlier_cloud.colors = o3d.utility.Vector3dVector(colors[:, :3])
  colors = plt.get_cmap(&quot;tab10&quot;)(labels / (max_label if max_label &gt; 0 else 1))
  colors[labels &lt; 0] = 0
  o3d.visualization.draw_geometries([outlier_cloud])
  end = time.time()
  print(f&quot;süre: { end-start:.3f}&quot;)
  o3d.io.write_point_cloud(&quot;D:\\bitirme2\\Sonuçlar\\Bolge2v3.pcd&quot;, outlier_cloud, write_ascii=True, compressed=True, print_progress=False)
  </code></pre>