cars.applications.triangulation.pc_transform ============================================ .. py:module:: cars.applications.triangulation.pc_transform .. autoapi-nested-parse:: This module is responsible for the transition between triangulation and rasterization steps Functions --------- .. autoapisummary:: cars.applications.triangulation.pc_transform.filter_cloud_with_mask cars.applications.triangulation.pc_transform.compute_terrain_msk cars.applications.triangulation.pc_transform.create_point_cloud_index cars.applications.triangulation.pc_transform.add_information_to_cloud cars.applications.triangulation.pc_transform.get_color_type cars.applications.triangulation.pc_transform.filter_cloud cars.applications.triangulation.pc_transform.depth_map_dataset_to_dataframe Module Contents --------------- .. py:function:: filter_cloud_with_mask(crop_cloud, crop_terrain_tile_data_msk) Delete masked points with terrain tile mask :param crop_cloud: the point cloud :param crop_terrain_tile_data_msk: terrain tile mask .. py:function:: compute_terrain_msk(dsm_epsg, xmin, xmax, ymin, ymax, margin, epsg, point_cloud, full_x, full_y) Compute terrain tile msk bounds If the point clouds are not in the same referential as the roi, it is converted using the dsm_epsg :param dsm_epsg: epsg code for the CRS of the final output raster :param xmin: xmin of the rasterization grid (if None, the whole clouds are combined) :param xmax: xmax of the rasterization grid (if None, the whole clouds are combined) :param ymin: ymin of the rasterization grid (if None, the whole clouds are combined) :param ymax: ymax of the rasterization grid (if None, the whole clouds are combined) :param margin: Margin added for each tile, in meter or degree. (default value: 0) :param epsg: epsg code of the input cloud :param point_cloud: the point cloud :param full_x: point_cloud[X] :param full_y: point_cloud[Y] .. py:function:: create_point_cloud_index(cloud_sample) Create point cloud index from cloud list keys and color inputs .. py:function:: add_information_to_cloud(input_cloud, cloud_indexes, bbox, target_cloud, input_array, output_column) Add color information for a current cloud_list item :param cloud: source point cloud dataset :type cloud: xr.Dataset :param cloud_indexes: list of band data to extract :type cloud_indexes: list[str] :param bbox: bbox of interest :type bbox: list[int] :param crop_cloud: target flatten point cloud :type crop_cloud: np.array[columns, points] :param input_array: index of input to extract from cloud :type input_array: str :param output_column: index of crop_cloud to fill :type input_array: str .. py:function:: get_color_type(clouds) Get color type of the tiles and if the same type. :param cloud_list: list of clouds :type cloud_list: xarray Dataset :return: color type of the tiles list :rtype: str .. py:function:: filter_cloud(cloud: pandas.DataFrame, index_elt_to_remove: List[int], filtered_elt_pos: bool = False) -> Tuple[pandas.DataFrame, Union[None, pandas.DataFrame]] Filter all points of the cloud DataFrame which index is in the index_elt_to_remove list. If filtered_elt_pos is set to True, the information of the removed elements positions in their original epipolar images are returned. To do so the cloud DataFrame has to be build with the 'with_coords' option activated. :param cloud: combined cloud as returned by the create_combined_cloud function :param index_elt_to_remove: indexes of lines to filter in the cloud DataFrame :param filtered_elt_pos: if filtered_elt_pos is set to True, the removed points positions in their original epipolar images are returned, otherwise it is set to None :return: Tuple composed of the filtered cloud DataFrame and the filtered elements epipolar position information (or None for the latter if filtered_elt_pos is set to False or if the cloud Dataframe has not been build with with_coords option) .. py:function:: depth_map_dataset_to_dataframe(cloud_dataset: xarray.Dataset, dsm_epsg: int, xmin: float = None, xmax: float = None, ymin: int = None, ymax: int = None, margin: float = 0, with_coords: bool = False) -> Tuple[pandas.DataFrame, int] Combine a list of clouds (and their colors) into a pandas dataframe structured with the following labels: - if no colors in input and no mask data present in cloud_list datasets: labels=[cst.X, cst.Y, cst.Z] The combined cloud has x, y, z columns - if no colors in input and mask data present in cloud_list datasets: labels=[cst.X, cst.Y, cst.Z, cst.POINT_CLOUD_MSK] The mask values are added to the dataframe. - if colors are set in input and mask data are present in the cloud_list datasets: labels=[cst.X, cst.Y, cst.Z, cst.POINT_CLOUD_MSK, cst.POINT_CLOUD_CLR_KEY_ROOT+"0", cst.POINT_CLOUD_CLR_KEY_ROOT+"1", cst.POINT_CLOUD_CLR_KEY_ROOT+"2"] Color channels information are added to the dataframe. - if colors in input, mask data present in the cloud_list datasets and the with_coords option is activated: labels=[cst.X, cst.Y, cst.Z, cst.POINT_CLOUD_MSK, cst.POINT_CLOUD_CLR_KEY_ROOT+"0", cst.POINT_CLOUD_CLR_KEY_ROOT+"1", cst.POINT_CLOUD_CLR_KEY_ROOT+"2" cst.POINT_CLOUD_COORD_EPI_GEOM_I, cst.POINT_CLOUD_COORD_EPI_GEOM_J, cst.POINT_CLOUD_ID_IM_EPI] The pixel position of the xyz point in the original epipolar image (coord_epi_geom_i, coord_epi_geom_j) are added to the dataframe along with the index of its original cloud in the cloud_list input. - if confidence intervals on Z in input, then [cst.Z_INF, cst.Z_SUP] are also added to the labels :param dsm_epsg: epsg code for the CRS of the final output raster :param xmin: xmin of the rasterization grid (if None, the whole clouds are combined) :param xmax: xmax of the rasterization grid (if None, the whole clouds are combined) :param ymin: ymin of the rasterization grid (if None, the whole clouds are combined) :param ymax: ymax of the rasterization grid (if None, the whole clouds are combined) :param margin: Margin added for each tile, in meter or degree. (default value: 0) :param with_coords: Option enabling the adding to the combined cloud of information of each point to retrieve their positions in the original epipolar images :return: Tuple formed with the combined clouds and color in a single pandas dataframe and the epsg code