-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathscript.pl
More file actions
executable file
·73 lines (60 loc) · 2.33 KB
/
Copy pathscript.pl
File metadata and controls
executable file
·73 lines (60 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/perl
use Path::Class;
# Motion Console Script
#
# Author: Oliver Wilkie
#
# This is a script for running batch processing on a video testing all possible parameters
# It is worth ensuring the $output_dir exists prior to running the script
# Each result is stored in a seperate sub-folder and contains a text file with the command
# that was used to generate the output.
# It must be run from the same directory as the MotionConsole executable
#
# Options
$input_video = '/homes/osw09/Motion/Examples/Heart/one-channels-short.mov';
$output_dir = '/vol/bitbucket/osw09/HeartResults/';
@cropCornerX = (35,26,10);
@cropCornerY = (135,109,62);
@cropWidth = (88,133,285);
@cropHeight = (80,121,171);
@featureDetectionMethods = ('goodtt','goodtth','sift','surf','fast');
@featureWindowSizes = (0,50,100,200);
$manual_dir = '/homes/osw09/Motion/Examples/Heart/HeartManualMarkings';
@salientTracking = (0,1);
@gravitateToCenter = (0,1);
# Main Program
mkdir($output_dir);
$count = 1;
foreach $cropIndex (0..$#cropCornerX) {
$cropCorner = $cropCornerX[$cropIndex] . ',' . $cropCornerY[$cropIndex];
$cropSize = $cropWidth[$cropIndex] . ',' . $cropHeight[$cropIndex];
foreach $fdmethod (@featureDetectionMethods) {
foreach $fdwindow (@featureWindowSizes) {
# Do it with Salient Turned off
$dir = $output_dir . $count;
mkdir($dir);
$dirHandle = dir($dir);
$file = $dirHandle->file("info.txt");
$file_handle = $file->openw();
$command = "./MotionConsole -I $input_video -O $dir/output.avi -C $cropCorner -S $cropSize -F $fdmethod -W $fdwindow -D";
$file_handle->print($command);
$rc = system($command);
if ($rc & 127) { die "signal death" }
$count += 1;
# Do it with Salient Turned on
foreach $gravitate ($gravitateToCenter) {
$dir = $output_dir . $count;
mkdir($dir);
$dirHandle = dir($dir);
$file = $dirHandle->file("info.txt");
$file_handle = $file->openw();
$command = "./MotionConsole -I $input_video -O $dir/output.avi -C $cropCorner -S $cropSize -F $fdmethod -W $fdwindow --salient-path-tracking -M $manual_dir -G $gravitate -D";
$file_handle->print($command);
$rc = system($command);
if ($rc & 127) { die "signal death" }
$count += 1;
}
}
}
}
mkdir($output_dir);