cars_mesh.tools.point_cloud_io ============================== .. py:module:: cars_mesh.tools.point_cloud_io .. autoapi-nested-parse:: Tools to manipulate point clouds Functions --------- .. autoapisummary:: cars_mesh.tools.point_cloud_io.get_offset cars_mesh.tools.point_cloud_io.get_scale cars_mesh.tools.point_cloud_io.apply_scale_offset cars_mesh.tools.point_cloud_io.o3d2df cars_mesh.tools.point_cloud_io.las2df cars_mesh.tools.point_cloud_io.pkl2df cars_mesh.tools.point_cloud_io.ply2df cars_mesh.tools.point_cloud_io.csv2df cars_mesh.tools.point_cloud_io.df2las cars_mesh.tools.point_cloud_io.df2o3d cars_mesh.tools.point_cloud_io.df2csv cars_mesh.tools.point_cloud_io.deserialize_point_cloud cars_mesh.tools.point_cloud_io.serialize_point_cloud cars_mesh.tools.point_cloud_io.change_frame cars_mesh.tools.point_cloud_io.conversion_utm_to_geo cars_mesh.tools.point_cloud_io.convert_color_to_8bits Module Contents --------------- .. py:function:: get_offset(arr_max, arr_min) Compute offset .. py:function:: get_scale(arr_max, arr_min, number_values) Compute scale .. py:function:: apply_scale_offset(arr: numpy.ndarray, scale: float, offset: float, is_inverse: bool = False, clip_min: Union[float, None] = None, clip_max: Union[float, None] = None) Apply a scale and an offset to the input array :param arr: Array to normalize :type arr: np.ndarray :param scale: Scaling factor :type scale: float :param offset: Offset factor :type offset: float :param is_inverse: Whether to denormalize ('inverse') (x = (x' - o) / s) rather than normalize (x' = s * x + o) :type is_inverse: bool (default=False) :param clip_min: Whether to limit the minimum output value :type clip_min: float or None (default=None) :param clip_max: Whether to limit the maximum output value :type clip_max: float or None (default=None) .. py:function:: o3d2df(o3d_pcd: open3d.geometry.PointCloud) -> pandas.DataFrame Open3D Point Cloud to pandas DataFrame .. py:function:: las2df(filepath: str) -> pandas.DataFrame LAS or LAZ point cloud to pandas DataFrame .. py:function:: pkl2df(filepath: str) -> pandas.DataFrame PKL point cloud to pandas DataFrame .. py:function:: ply2df(filepath: str) -> pandas.DataFrame PLY point cloud to pandas DataFrame .. py:function:: csv2df(filepath: str) -> pandas.DataFrame CSV file to pandas DataFrame .. py:function:: df2las(filepath: str, df_pcd: pandas.DataFrame, metadata: Union[laspy.LasHeader, None] = None, point_format: int = 8, version: str = '1.4') This method serializes a pandas DataFrame in .las .. py:function:: df2o3d(df_pcd: pandas.DataFrame) -> open3d.geometry.PointCloud pandas.DataFrame to Open3D Point Cloud .. py:function:: df2csv(filepath: str, df_pcd: pandas.DataFrame, **kwargs) pandas DataFrame to csv file .. py:function:: deserialize_point_cloud(filepath: str) -> pandas.DataFrame Convert a point cloud to a pandas dataframe .. py:function:: serialize_point_cloud(filepath: str, df_pcd: pandas.DataFrame, metadata: Union[laspy.LasHeader, None] = None, extension: str = 'las', **kwargs) Serialize a point cloud to disk in the format asked by the user .. py:function:: change_frame(df_pcd, in_epsg, out_epsg) -> pandas.DataFrame Change frame in which the points are expressed .. py:function:: conversion_utm_to_geo(coords: Union[list, tuple, numpy.ndarray], utm_code: int) -> numpy.ndarray Conversion points from epsg 32631 to epsg 4326 .. py:function:: convert_color_to_8bits(df_pcd: pandas.DataFrame, q_percent: Union[tuple, list, numpy.ndarray] = (0, 100)) -> pandas.DataFrame 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). :param df_pcd: Point cloud data :type df_pcd: pd.DataFrame :param q_percent: 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. :type q_percent: tuple or list or np.ndarray (default=(0, 100)) :returns: **df_pcd** -- Point cloud data with colors converted to 8bits :rtype: pd.DataFrame