aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormutantturkey <mutantturke@gmail.com>2012-06-11 16:26:06 -0400
committermutantturkey <mutantturke@gmail.com>2012-06-11 16:26:06 -0400
commitb4e24f80fb798e9a26f40aa214c1966db90982f3 (patch)
treec37d1e73154164bb84f85a0b4b3d0abcaccb31d7
parentfd3c9eaa574b80ef196787453ad9abbd44fe2839 (diff)
updates
-rw-r--r--batch-process3
-rwxr-xr-xprocess-video-beta28
2 files changed, 15 insertions, 16 deletions
diff --git a/batch-process b/batch-process
new file mode 100644
index 0000000..829303e
--- /dev/null
+++ b/batch-process
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+
diff --git a/process-video-beta b/process-video-beta
index 8c7fa53..17d95b9 100755
--- a/process-video-beta
+++ b/process-video-beta
@@ -42,7 +42,7 @@ stage_4=
server_list=
-while getopts "ht:n:l:d:v:S:V1234:" OPTION
+while getopts "ht:n:l:d:v:S:V1234" OPTION
do
case $OPTION in
h)
@@ -140,7 +140,7 @@ i=$set_number
# check for the server list
if [[ -z $server_list ]]; then
log "no server specified, using localhost"
- $server_list=":"
+ server_list=":"
fi
@@ -156,25 +156,22 @@ for num in $(seq $set_number $last_set); do
mkdir $output_dir/Final/$set_type$num/ -pv
mkdir $output_dir/Filtered/$set_type$num/final -pv
done
-
+
+while read crop; do
+ crop_list=$crop_list" $crop"
+done < $crop_file
log "set_list $set_list"
# Stage 1: extract all of the pngs with Mplayer
if [[ $stage_1 -eq 1 ]]; then
-echo "Stage 1: Extracting Cropped PNGs"
-
-while read crop; do
+ echo "Stage 1: Extracting Cropped PNGs"
- setname=$set_type$i
+ echo "$crop_list"
+ echo "$set_list"
- mplayer -quiet -vo png:prefix=$setname"_":outdir=$output_dir/Cropped/$setname -nosound -vf crop=$crop -speed 12 $video_file & </dev/null
-
- i=$(( $i + 1 ))
-
-done < $crop_file
-wait
+ parallel -v --progress --xapply -j 1 -S $server_list mplayer -quiet -vo png:prefix={1}"_":outdir=$output_dir/Cropped/{1} -nosound -vf crop={2} -speed 12 $video_file ::: $set_list ::: $crop_list
fi
@@ -182,7 +179,7 @@ fi
if [[ $stage_2 -eq 1 ]]; then
echo "Stage 2: Deriving Backgrounds"
- echo $set_list | parallel -v -j +0 -S derivebackground.py <(find $output_dir"/Cropped/"{}"/"*) $output_dir/Masks/{}/Background.png
+ parallel --xapply -v -j +0 -S $server_list -q "derivebackground.py <(find $output_dir"/Cropped/"{}"/"*) $output_dir/Masks/{}/Background.png" ::: $set_list
fi
@@ -194,7 +191,6 @@ while read crop; do
setname=$set_type$i
-
echo "Stage 3: Generating Masks"
cd $output_dir/Cropped/$setname
@@ -202,7 +198,7 @@ while read crop; do
#parallel -i convert -composite -compose Difference {} $output_dir/Masks/$setname/Background.png -contrast-stretch 90%x%0% -threshold 30% $output_dir/Masks/$setname/Masks/{} -- *.png
find `pwd`/*.png | parallel -v -j +0 -S $server_list convert \\\( -composite -compose Difference $output_dir/Masks/$setname/Background.png {} \\\) \\\( -contrast-stretch 90%x0% \\\) \\\( -threshold 30% \\\) $output_dir/Masks/$setname/Masks/{/}
-# Filtering Stage
+ # Filtering Stage
cd $output_dir
#parallel -i FlyTrackingIterativeFilter {} 15 $output_dir/Masks/$setname/Masks/ $output_dir/Filtered/$setname/ -- $( ls $output_dir/Masks/$setname/Masks/ )