shareloc.geofunctions.triangulation =================================== .. py:module:: shareloc.geofunctions.triangulation .. autoapi-nested-parse:: This module contains triangulation methods. Functions --------- .. autoapisummary:: shareloc.geofunctions.triangulation.sensor_triangulation shareloc.geofunctions.triangulation.distance_point_los shareloc.geofunctions.triangulation.n_view_distance shareloc.geofunctions.triangulation.los_triangulation shareloc.geofunctions.triangulation.n_view_triangulation shareloc.geofunctions.triangulation.transform_disp_to_matches shareloc.geofunctions.triangulation.epipolar_triangulation Module Contents --------------- .. py:function:: sensor_triangulation(matches, geometrical_model_left, geometrical_model_right, left_min_max=None, right_min_max=None, residues=False, fill_nan=False) triangulation in sensor geometry according to the formula: .. math:: x = \left(\sum_i I-\hat v_i \hat v_i^\top\right)^{-1} \left(\sum_i (I-\hat v_i \hat v_i^\top) s_i\right) Delvit J.M. et al. "The geometric supersite of Salon de Provence", ISPRS Congress Paris, 2006. :param matches: matches in sensor coordinates Nx[row (left), col (left), row (right), col (right)] :type matches: np.array :param geometrical_model_left: left image geometrical model :type geometrical_model_left: GeomodelTemplate :param geometrical_model_right: right image geometrical model :type geometrical_model_right: GeomodelTemplate :param left_min_max: left min/max for los creation, if None model min/max will be used :type left_min_max: list :param right_min_max: right min/max for los creation, if None model min/max will be used :type right_min_max: list :param residues: calculates residues (distance in meters between los and 3D points) :type residues: boolean :param fill_nan: fill numpy.nan values with lon and lat offset if true (same as OTB/OSSIM), nan is returned otherwise :type fill_nan: boolean :return: intersections in cartesian crs, intersections in wgs84 crs and optionnaly residues :rtype: (numpy.array,numpy,array,numpy.array) .. py:function:: distance_point_los(los, points) distance between points and LOS norm of cross product between vector defined by LOS sis and point and LOS vis :param los: line of sight :type los: shareloc.los :param points: 3D points :type points: numpy.array :return: distance :rtype: numpy.array .. py:function:: n_view_distance(sis, vis, points) distance between points and LOS norm of cross product between vector defined by LOS sis and point and LOS vis :param sis: LOS hat, numpy np.ndarray of size (nb_points,nb_views,3) :param vis: LOS viewing vector, np.ndarray of size (nb_points,nb_views,3) :param points: 3D points :return: distance .. py:function:: los_triangulation(left_los, right_los) LOS triangulation :param left_los: left los :type left_los: shareloc.los :param right_los: right los :type right_los: shareloc.los :return: intersections in cartesian crs :rtype: numpy.array .. py:function:: n_view_triangulation(sis, vis) n view triangulation for nb_points mapping :param sis: LOS hat as numpy np.ndarray of size (nb_points,nb_views,3) :param vis: LOS viewing vector np.ndarray of size (nb_points,nb_views,3) :return: triangulation as a np.ndarray of size (nb_points,3) .. py:function:: transform_disp_to_matches(disp, mask=None) transform disparity map to matches :param disp: disparity xarray :type disp: xarray :param mask: mask :type mask: numpy.array :return: epipolar matches and logical non masked values :rtype: list of numpy.arrray .. py:function:: epipolar_triangulation(matches, mask, matches_type, geometrical_model_left, geometrical_model_right, grid_left, grid_right, left_min_max=None, right_min_max=None, residues=False, fill_nan=False, is_displacement_grid=False, interpolator='linear') epipolar triangulation :param matches: matches :type matches: dependent of disp or sift :param mask: mask for disparity (see transform_disp_to_matches) :type mask: numpy.array :param matches_type: 'disp' or 'sift' :type matches_type: str :param geometrical_model_left: left image geometrical model :type geometrical_model_left: GeomodelTemplate :param geometrical_model_right: right image geometrical model :type geometrical_model_right: GeomodelTemplate :param grid_left: left rectification grid filename :type grid_left: str :param grid_right: right rectification grid filename :type grid_right: str :param left_min_max: left min/max for los creation, if None model min/max will be used :type left_min_max: list :param right_min_max: right min/max for los creation, if None model min/max will be used :type right_min_max: list :param residues: calculates residues (distance in meters) :type residues: boolean :param fill_nan: fill numpy.nan values with lon and lat offset if true (same as OTB/OSSIM), nan is returned otherwise :type fill_nan: boolean :param is_displacement_grid: True if grids are displacement grids :type is_displacement_grid: bool :param interpolator: grid interpolator :type interpolator: str :return: intersections in cartesian crs :rtype: numpy.array