Skip to content

Instantly share code, notes, and snippets.

@mitakeck
Last active December 28, 2015 13:48
Show Gist options
  • Save mitakeck/d3afb1423e11ea5050ba to your computer and use it in GitHub Desktop.
Save mitakeck/d3afb1423e11ea5050ba to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
# OpenCV runnning without GUI
echo "make dir"
mkdir /tmp/`echo $2`
echo "compiling $1"
if [[ $1 == *.cpp ]]
then
g++ -ggdb `pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `pkg-config --libs opencv`;
else
echo "Please compile only *.cpp file"
fi
echo "Output file => ${1%.*}"
echo "Run..."
echo $USER
echo "${1%.*} $2"
xvfb-run --server-args="-screen 0, 1024x768x24" ./`echo ${1%.*} $2`
echo "convert to animation gif"
gm convert /tmp/`echo $2`/*.bmp /tmp/`echo $2`/animation.gif
echo "remove tmp images"
# rm -r /tmp/`echo $2`
echo "End"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment