Skip to content

Commit

Permalink
splitStereo.sh can now work regardless of input dimension..
Browse files Browse the repository at this point in the history
  • Loading branch information
AmmarkoV committed May 3, 2022
1 parent bf5d15b commit 3f09834
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/splitStereo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
FROMDATASET="$1"
X=0

# sudo apt-get install imagemagick

if (( $# != 1 )); then
echo "Please run giving the path to download and build"
Expand All @@ -23,9 +24,15 @@ do

if [ -f "colorFrame_0_$XNUM.jpg" ]
then
width=$(identify -format "%w" "colorFrame_0_$XNUM.jpg")> /dev/null
height=$(identify -format "%h" "colorFrame_0_$XNUM.jpg")> /dev/null
halfWidth=$((width / 2))
echo "$width x $height -> 2x $halfWidth x $height"


#First crop second half ( before source file gets rewritten )
convert colorFrame_0_$XNUM.jpg -crop 1280x720+1280+0 colorFrame_1_$XNUM.jpg
convert colorFrame_0_$XNUM.jpg -crop 1280x720+0+0 colorFrame_0_$XNUM.jpg
convert colorFrame_0_$XNUM.jpg -crop "$halfWidth"x$height+$halfWidth+0 colorFrame_1_$XNUM.jpg
convert colorFrame_0_$XNUM.jpg -crop "$halfWidth"x$height+0+0 colorFrame_0_$XNUM.jpg
else
break
fi
Expand Down

0 comments on commit 3f09834

Please sign in to comment.