% demo launcher for Rolling Shutter Motion Deblurring (CVPR '15), not for
% commercial use.
% author: Shuochen Su
% date:   Mar. 14, 2016
% email:  shuochsu@cs.ubc.ca

clear; clc; close all

tmp = round(rand(1)*1000);

opts_mat = {'opts_diner.mat'};

num_test = numel(opts_mat);
optsall = cell(1,num_test);

for i = 1:numel(opts_mat)
    opts = load(opts_mat{i});
    opts = opts.opts;
    opts.testsubdir = sprintf('%s_%02d',datestr(now,30),tmp);
    % set this to 0 unless intending to get a preview of the coeff init
    opts.isfirstcoeffinit = 0;
    % raw_su_kernel.mat and raw_jia_kernel.mat store precomputed kernel
    % from each segment already
    opts.iskernelavailable = 1;
    % choose the init kernel image from either the authors' simple BD
    % method, or Xu and Jia's online software.
    opts.isusingjiakernel = 1;
    optsall{i} = opts;
end

% parpool(8)
% parfor i = 1:num_test
for i = 1:num_test
    main(optsall{i});
end
