cars_mesh.tools.point_cloud_io

Tools to manipulate point clouds

Module Contents

Functions

get_offset(arr_max, arr_min)

Compute offset

get_scale(arr_max, arr_min, number_values)

Compute scale

apply_scale_offset(arr, scale, offset[, is_inverse, ...])

Apply a scale and an offset to the input array

o3d2df(→ pandas.DataFrame)

Open3D Point Cloud to pandas DataFrame

las2df(→ pandas.DataFrame)

LAS or LAZ point cloud to pandas DataFrame

pkl2df(→ pandas.DataFrame)

PKL point cloud to pandas DataFrame

ply2df(→ pandas.DataFrame)

PLY point cloud to pandas DataFrame

csv2df(→ pandas.DataFrame)

CSV file to pandas DataFrame

df2las(filepath, df_pcd[, metadata, point_format, version])

This method serializes a pandas DataFrame in .las

df2o3d(→ open3d.geometry.PointCloud)

pandas.DataFrame to Open3D Point Cloud

df2csv(filepath, df_pcd, **kwargs)

pandas DataFrame to csv file

deserialize_point_cloud(→ pandas.DataFrame)

Convert a point cloud to a pandas dataframe

serialize_point_cloud(filepath, df_pcd[, metadata, ...])

Serialize a point cloud to disk in the format asked by the user

change_frame(→ pandas.DataFrame)

Change frame in which the points are expressed

conversion_utm_to_geo(→ numpy.ndarray)

Conversion points from epsg 32631 to epsg 4326

convert_color_to_8bits() → pandas.DataFrame)

Convert the colors of the data to 8 bits. It will preserve the relative

cars_mesh.tools.point_cloud_io.get_offset(arr_max, arr_min)[source]

Compute offset

cars_mesh.tools.point_cloud_io.get_scale(arr_max, arr_min, number_values)[source]

Compute scale

cars_mesh.tools.point_cloud_io.apply_scale_offset(arr: numpy.ndarray, scale: float, offset: float, is_inverse: bool = False, clip_min: float | None = None, clip_max: float | None = None)[source]

Apply a scale and an offset to the input array

Parameters:
  • arr (np.ndarray) – Array to normalize

  • scale (float) – Scaling factor

  • offset (float) – Offset factor

  • is_inverse (bool (default=False)) – Whether to denormalize (‘inverse’) (x = (x’ - o) / s) rather than normalize (x’ = s * x + o)

  • clip_min (float or None (default=None)) – Whether to limit the minimum output value

  • clip_max (float or None (default=None)) – Whether to limit the maximum output value

cars_mesh.tools.point_cloud_io.o3d2df(o3d_pcd: open3d.geometry.PointCloud) pandas.DataFrame[source]

Open3D Point Cloud to pandas DataFrame

cars_mesh.tools.point_cloud_io.las2df(filepath: str) pandas.DataFrame[source]

LAS or LAZ point cloud to pandas DataFrame

cars_mesh.tools.point_cloud_io.pkl2df(filepath: str) pandas.DataFrame[source]

PKL point cloud to pandas DataFrame

cars_mesh.tools.point_cloud_io.ply2df(filepath: str) pandas.DataFrame[source]

PLY point cloud to pandas DataFrame

cars_mesh.tools.point_cloud_io.csv2df(filepath: str) pandas.DataFrame[source]

CSV file to pandas DataFrame

cars_mesh.tools.point_cloud_io.df2las(filepath: str, df_pcd: pandas.DataFrame, metadata: laspy.LasHeader | None = None, point_format: int = 8, version: str = '1.4')[source]

This method serializes a pandas DataFrame in .las

cars_mesh.tools.point_cloud_io.df2o3d(df_pcd: pandas.DataFrame) open3d.geometry.PointCloud[source]

pandas.DataFrame to Open3D Point Cloud

cars_mesh.tools.point_cloud_io.df2csv(filepath: str, df_pcd: pandas.DataFrame, **kwargs)[source]

pandas DataFrame to csv file

cars_mesh.tools.point_cloud_io.deserialize_point_cloud(filepath: str) pandas.DataFrame[source]

Convert a point cloud to a pandas dataframe

cars_mesh.tools.point_cloud_io.serialize_point_cloud(filepath: str, df_pcd: pandas.DataFrame, metadata: laspy.LasHeader | None = None, extension: str = 'las', **kwargs)[source]

Serialize a point cloud to disk in the format asked by the user

cars_mesh.tools.point_cloud_io.change_frame(df_pcd, in_epsg, out_epsg) pandas.DataFrame[source]

Change frame in which the points are expressed

cars_mesh.tools.point_cloud_io.conversion_utm_to_geo(coords: list | tuple | numpy.ndarray, utm_code: int) numpy.ndarray[source]

Conversion points from epsg 32631 to epsg 4326

cars_mesh.tools.point_cloud_io.convert_color_to_8bits(df_pcd: pandas.DataFrame, q_percent: tuple | list | numpy.ndarray = (0, 100)) pandas.DataFrame[source]

Convert the colors of the data to 8 bits. It will preserve the relative colors between the bands (it is a global normalisation, not a by band normalisation).

Parameters:
  • df_pcd (pd.DataFrame) – Point cloud data

  • q_percent (tuple or list or np.ndarray (default=(0, 100))) – Whether to clip the colors to discard outliers. First term is the minimum percentage to take into account, the second term is the maximum. By default, no value is clipped.

Returns:

df_pcd – Point cloud data with colors converted to 8bits

Return type:

pd.DataFrame