u0 = np.zeros((ny, nx, nF[0]))
v0 = np.zeros((ny, nx, nF[0]))
for i in range(nF[0].astype(int)):
    u0[:, :, i] = i / 5.
    v0[:, :, i] = 2 * i / 5.

#Initialize data
us = np.zeros((ny, nx, np.sum(nF)))
vs = np.zeros((ny, nx, np.sum(nF)))
us[:, :, 0:nF[0]] = u0
vs[:, :, 0:nF[0]] = v0

#Load in optic flow data
vidx = 1
#Load MFSF data
u1 = np.zeros((ny, nx, nF[vidx]))
v1 = np.zeros((ny, nx, nF[vidx]))
for i in range(nF[0].astype(int)):
    v1[:, :, i] = -i / 5.
#Make a Stitcher
thestitch = Stitcher(u1, v1)
self = thestitch
(u, v) = thestitch.run(u0, v0)

us[:, :, np.sum(nF[0:vidx]):np.sum(nF[0:vidx + 1])] = u
vs[:, :, np.sum(nF[0:vidx]):np.sum(nF[0:vidx + 1])] = v

#Save output matrix
#mdict = {'u':us, 'v':vs, 'parmsOF':params, 'info':info}
#savemat(args.fn_out, mdict)
Exemple #2
0
    # aligner.init()

    if args.transform:
        aligner.step2()

# init stitcher

if args.stitch:

    stitcher.INPUT_DIR = config.INPUT_DIR_STITCHER
    stitcher.OUTPUT_DIR = config.OUTPUT_DIR_STITCHER

    input_images_stitcher = [["stitcher_test/1.jpg", "stitcher_test/2.jpg"]]

    stitcher.init()
    stitcher.run(input_images_stitcher)

# init stacker

if not args.align and not args.transform and not args.stitch:

    # expand all paths
    for directory in config.DIRS_TO_EXPAND_STACKER:
        variable = getattr(config, directory)
        if variable is None:
            print("warning: variable {} empty. not expanded".format(directory))
            continue
        setattr(config, directory, path_check_and_expand(variable))

    for directory in config.DIRS_TO_CREATE_STACKER:
        variable = getattr(config, directory)
Exemple #3
0
    # aligner.init()

    if args.transform:
        aligner.step2()

# init stitcher

if args.stitch:

    stitcher.INPUT_DIR                      = config.INPUT_DIR_STITCHER
    stitcher.OUTPUT_DIR                     = config.OUTPUT_DIR_STITCHER

    input_images_stitcher = [["stitcher_test/01.jpg", "stitcher_test/02.jpg"]]

    stitcher.init()
    stitcher.run(input_images_stitcher)

# init stacker

if not args.align and not args.transform and not args.stitch:

    # expand all paths
    for directory in config.DIRS_TO_EXPAND_STACKER:
        variable = getattr(config, directory)
        if variable is None:
            print("warning: variable {} empty. not expanded".format(directory))
            continue
        setattr(config, directory, path_check_and_expand(variable))

    for directory in config.DIRS_TO_CREATE_STACKER:
        variable = getattr(config, directory)