Fixing scripts with new capture and recorder.
This commit is contained in:
parent
db5b5fceda
commit
312d9e9608
4 changed files with 42 additions and 77 deletions
|
@ -60,7 +60,7 @@ namespace Utilities
|
||||||
// TODO block copy, move etc.
|
// TODO block copy, move etc.
|
||||||
|
|
||||||
// Opening based on command line arguments
|
// Opening based on command line arguments
|
||||||
bool Open(std::vector<std::string> arguments);
|
bool Open(std::vector<std::string>& arguments);
|
||||||
|
|
||||||
// Direct opening
|
// Direct opening
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ std::cout << "Warning: " << stream << std::endl
|
||||||
#define ERROR_STREAM( stream ) \
|
#define ERROR_STREAM( stream ) \
|
||||||
std::cout << "Error: " << stream << std::endl
|
std::cout << "Error: " << stream << std::endl
|
||||||
|
|
||||||
bool SequenceCapture::Open(std::vector<std::string> arguments)
|
bool SequenceCapture::Open(std::vector<std::string>& arguments)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Consuming the input arguments
|
// Consuming the input arguments
|
||||||
|
|
|
@ -10,50 +10,27 @@ end
|
||||||
output_dir = 'experiments/biwi_out';
|
output_dir = 'experiments/biwi_out';
|
||||||
|
|
||||||
dbSeqDir = dir([rootDir biwiDir]);
|
dbSeqDir = dir([rootDir biwiDir]);
|
||||||
|
dbSeqDir = dbSeqDir(3:end);
|
||||||
|
|
||||||
output_dir = cat(2, output_dir, '/');
|
output_dir = cat(2, output_dir, '/');
|
||||||
|
|
||||||
offset = 0;
|
command = sprintf('%s -inroot "%s" -out_dir "%s" -fx 505 -fy 505 -cx 320 -cy 240 -pose -vis-track ', executable, rootDir, output_dir);
|
||||||
|
|
||||||
r = 1 + offset;
|
|
||||||
|
|
||||||
numTogether = 25;
|
|
||||||
|
|
||||||
|
|
||||||
for i=3 + offset:numTogether:numel(dbSeqDir)
|
|
||||||
|
|
||||||
|
|
||||||
command = executable;
|
|
||||||
|
|
||||||
command = cat(2, command, [' -inroot ' '"' rootDir '"']);
|
|
||||||
|
|
||||||
% deal with edge cases
|
if(verbose)
|
||||||
if(numTogether + i > numel(dbSeqDir))
|
command = cat(2, command, [' -tracked ' outputVideo]);
|
||||||
numTogether = numel(dbSeqDir) - i + 1;
|
end
|
||||||
end
|
|
||||||
|
|
||||||
for n=0:numTogether-1
|
if(any(strcmp('model', varargin)))
|
||||||
|
command = cat(2, command, [' -mloc "', varargin{find(strcmp('model', varargin))+1}, '"']);
|
||||||
inputFile = [biwiDir dbSeqDir(i+n).name '/colour.avi'];
|
|
||||||
|
|
||||||
command = cat(2, command, [' -f "' inputFile '" -of "' output_dir '"']);
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
command = cat(2, command, [' -fx 505 -fy 505 -cx 320 -cy 240 -pose -vis-track ']);
|
|
||||||
|
|
||||||
if(verbose)
|
|
||||||
command = cat(2, command, [' -tracked ' outputVideo]);
|
|
||||||
end
|
|
||||||
|
|
||||||
if(any(strcmp('model', varargin)))
|
|
||||||
command = cat(2, command, [' -mloc "', varargin{find(strcmp('model', varargin))+1}, '"']);
|
|
||||||
end
|
|
||||||
|
|
||||||
r = r+1;
|
|
||||||
if(isunix)
|
|
||||||
unix(command, '-echo')
|
|
||||||
else
|
|
||||||
dos(command);
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for i=1:numel(dbSeqDir)
|
||||||
|
inputFile = [biwiDir dbSeqDir(i).name '/colour.avi'];
|
||||||
|
command = cat(2, command, sprintf(' -f "%s" ', inputFile));
|
||||||
|
end
|
||||||
|
|
||||||
|
if(isunix)
|
||||||
|
unix(command, '-echo')
|
||||||
|
else
|
||||||
|
dos(command);
|
||||||
|
end
|
|
@ -10,39 +10,27 @@ function [output_dir] = run_bu_experiment(bu_dir, verbose, varargin)
|
||||||
|
|
||||||
buFiles = dir([bu_dir '*.avi']);
|
buFiles = dir([bu_dir '*.avi']);
|
||||||
|
|
||||||
numTogether = 25;
|
% Only outputing the pose (-pose)
|
||||||
|
command = sprintf('%s -inroot "%s" -out_dir "%s" -fx 500 -fy 500 -cx 160 -cy 120 -pose -vis-track ', executable, bu_dir, output_dir);
|
||||||
for i=1:numTogether:numel(buFiles)
|
|
||||||
|
|
||||||
command = executable;
|
for i=1:numel(buFiles)
|
||||||
command = cat(2, command, [' -inroot ' '"' bu_dir '/"']);
|
inputFile = [buFiles(i).name];
|
||||||
|
command = cat(2, command, sprintf(' -f "%s" ', inputFile));
|
||||||
% deal with edge cases
|
|
||||||
if(numTogether + i > numel(buFiles))
|
|
||||||
numTogether = numel(buFiles) - i + 1;
|
|
||||||
end
|
|
||||||
|
|
||||||
for n=0:numTogether-1
|
|
||||||
inputFile = [buFiles(n+i).name];
|
|
||||||
command = cat(2, command, [' -f "' inputFile '" -of "' output_dir '"']);
|
|
||||||
end
|
|
||||||
|
|
||||||
% Only outputing the pose (-pose)
|
|
||||||
command = cat(2, command, ' -fx 500 -fy 500 -cx 160 -cy 120 -pose -vis-track ');
|
|
||||||
|
|
||||||
if(verbose)
|
|
||||||
command = cat(2, command, [' -tracked ' outputVideo]);
|
|
||||||
end
|
|
||||||
|
|
||||||
if(any(strcmp('model', varargin)))
|
|
||||||
command = cat(2, command, [' -mloc "', varargin{find(strcmp('model', varargin))+1}, '"']);
|
|
||||||
end
|
|
||||||
|
|
||||||
if(isunix)
|
|
||||||
unix(command, '-echo')
|
|
||||||
else
|
|
||||||
dos(command);
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if(verbose)
|
||||||
|
command = cat(2, command, [' -tracked ' outputVideo]);
|
||||||
|
end
|
||||||
|
|
||||||
|
if(any(strcmp('model', varargin)))
|
||||||
|
command = cat(2, command, [' -mloc "', varargin{find(strcmp('model', varargin))+1}, '"']);
|
||||||
|
end
|
||||||
|
|
||||||
|
if(isunix)
|
||||||
|
unix(command, '-echo')
|
||||||
|
else
|
||||||
|
dos(command);
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
Loading…
Reference in a new issue