def preprocess()

in preprocess.py [0:0]


def preprocess(args):

    # output folder
    if args.output is None:
        if os.path.isfile(args.input):
            input_folder, input_file = os.path.split(args.input)
            input_name, input_extension = os.path.splitext(input_file)
            args.output = os.path.join(input_folder, input_name)
        else:
            args.output = args.input
    create_folder(args.output)

    # video extraction
    if os.path.isfile(args.input):
        video_preprocessing(args)
        args.input = args.output

    if args.calibrate_lens_distortion:
        lens_distortion_calibration(args)
    else:
        # undistort input images with previously computed lens distortion parameters
        if args.undistort_with_calibration_file is not None:
            undistort(args)

        # get camera poses by running colmap
        from llff_preprocessing import gen_poses

        gen_poses(args.input, args.colmap_matching)