def parse_visualsfm_file(
        cls,
        input_visual_fsm_file_name,
        image_dp,
        image_fp_type,
        suppress_distortion_warnings,
        op=None,
    ):
        """Parse a :code:`VisualSfM` (:code:`.nvm`) file."""
        log_report("INFO", "Parse NVM file: " + input_visual_fsm_file_name, op)
        input_file = open(input_visual_fsm_file_name, "r")
        # Documentation of *.NVM data format
        # http://ccwu.me/vsfm/doc.html#nvm

        # In a simple case there is only one model

        # Each reconstructed <model> contains the following
        # <Number of cameras>   <List of cameras>
        # <Number of 3D points> <List of points>

        # Read the first two lines (fixed)
        current_line = (input_file.readline()).rstrip()
        calibration_matrix = cls._parse_fixed_calibration(current_line, op)
        current_line = (input_file.readline()).rstrip()
        assert current_line == ""

        amount_cameras = int((input_file.readline()).rstrip())
        log_report(
            "INFO",
            "Amount Cameras (Images in NVM file): " + str(amount_cameras),
            op,
        )

        cameras = cls._parse_cameras(
            input_file,
            amount_cameras,
            calibration_matrix,
            image_dp,
            image_fp_type,
            suppress_distortion_warnings,
            op,
        )
        current_line = (input_file.readline()).rstrip()
        assert current_line == ""
        current_line = (input_file.readline()).rstrip()
        if current_line.isdigit():
            amount_points = int(current_line)
            log_report(
                "INFO",
                "Amount Sparse Points (Points in NVM file): "
                + str(amount_points),
                op,
            )
            points = cls._parse_nvm_points(input_file, amount_points)
        else:
            points = []

        log_report("INFO", "Parse NVM file: Done", op)
        return cameras, points
Parse a :code:`VisualSfM` (:code:`.nvm`) file.
photogrammetry_importer/file_handlers/visualsfm_file_handler.py