def parse_opensfm_file(
        input_opensfm_fp,
        image_dp,
        image_fp_type,
        reconstruction_idx,
        suppress_distortion_warnings=False,
        op=None,
    ):
        """Parse a :code:`OpenSfM` (:code:`.json`) file."""

        log_report("INFO", "parse_opensfm_file: ...", op)
        log_report("INFO", "input_opensfm_fp: " + input_opensfm_fp, op)
        input_file = open(input_opensfm_fp, "r")
        json_data = json.load(input_file)
        reconstruction_data = json_data[reconstruction_idx]
        if len(json_data) > 1:
            log_report(
                "WARNING",
                "OpenSfM file contains multiple reconstructions. Only "
                + f" reconstruction with index {reconstruction_idx} is"
                + " imported.",
                op,
            )

        cams = OpenSfMJSONFileHandler._parse_cameras(
            reconstruction_data,
            image_dp,
            image_fp_type,
            suppress_distortion_warnings,
            op,
        )
        points = OpenSfMJSONFileHandler._parse_points(reconstruction_data, op)
        log_report("INFO", "parse_opensfm_file: Done", op)
        return cams, points
Parse a :code:`OpenSfM` (:code:`.json`) file.
photogrammetry_importer/file_handlers/opensfm_json_file_handler.py