Beispiel #1
0
def image_matches_from_file(filepath: str) -> np.array:
    """
    Read the image matches
     [keypoint_id_image1, keypoint_id_image2, score]

    :param filepath: path to the file
    :return: matches
    """
    return array_from_file(filepath, dtype=np.float64, dsize=3)
Beispiel #2
0
def image_descriptors_from_file(filepath: str, dtype: Type,
                                dsize: int) -> np.array:
    """
    Read the image descriptors

    :param filepath: path to the file
    :param dtype: data type
    :param dsize: number of data per keypoint
    :return: the image descriptors
    """
    return array_from_file(filepath, dtype, dsize)
Beispiel #3
0
def image_global_features_from_file(filepath: str, dtype: Type,
                                    dsize: int) -> np.array:
    """
    Read the image global features

    :param filepath: path to the file
    :param dtype: data type
    :param dsize: number of data per keypoint
    :return: the global features
    """
    return array_from_file(filepath, dtype, dsize)
Beispiel #4
0
def records_depth_from_file(filepath: str, size: Tuple[int, int]) -> np.array:
    """
    Load the depth map from binary file to a numpy array.

    :param filepath: path to the file
    :param size: [width, height]
    :return: the depth map as a numpy array
    """
    assert isinstance(size, tuple) and len(size) == 2
    dtype = kapture.RecordsDepth.dtype
    dsize = int(size[0] * size[1])
    bitmap = array_from_file(filepath, dtype, dsize)
    bitmap = bitmap.reshape((size[1], size[0]))
    return bitmap