ultramango / gear360pano

Simple script to create equirectangular panorama by stitching images from Samsung Gear 360
MIT License
225 stars 55 forks source link
ffmpeg hugin image-stitching linux panorama stitching video video-stitching windows

About

Simple script to create equirectangular panoramic photos or videos from Samsung Gear 360. It supports generation 1 (SM-C200) and 2 (2017 or SM-R210).

Samsung Gear 360

Latest Changes

Latest Changes:

Usage

Requirements

Requirements:

Installation

Linux

Use your distributions' package manager to install Hugin. Example for Ubuntu:

apt-get install hugin

Do the same for ffmpeg if you want video stitching, it is usually installed by default on many Linux distributions.

multiblend is a bit more tricky. In most cases you will have to manually compile it and install. After unpacking read build.txt... or do this:

unzip multiblendX.Y.Z.zip
cd multiblend
g++ -msse2 -O3 -ltiff -ltiffxx -ljpeg -lpng multiblend.cpp -o multiblend
# If that fails try this instead (older g++):
# g++ -msse2 -O3 multiblend.cpp -o multiblend -ltiff -ltiffxx -ljpeg -lpng
sudo cp multiblend /usr/local/bin

Package exists for Arch Linux.

GNU Parallel is needed if using -p option (greatly speeds-up processing). It is a standard package that can be installed using your package manager, example:

apt-get install parallel

Finally: clone or download zip of this project then unpack it somewhere.

One liner to install it in current directory under gear360pano (no .git dir):

mkdir -p gear360pano && wget -qO- https://github.com/ultramango/gear360pano/archive/master.zip | bsdtar -xvf- -C gear360pano -s'|[^/]*/||' > /dev/null 2>&1 && find gear360pano -iname "*.sh" -exec chmod a+x {} \; && echo '\nDone'

Windows

Install Hugin in the default location (it's hardcoded in script), both 32 and 64-bit versions will work.

For video stitching install/unzip ffmpeg in c:\program files\ffmpeg (there should be a subdirectory bin there with ffmpeg.exe binary).

For multiblend support you need to unpack it into Hugin bin directory: c:\program files\hugin\bin.

Clone or download zip of this project then unpack it somewhere.

Usage

Photos

Open console or command line (Win key + R then cmd.exe), go to directory where you cloned/unpacked this project.

Usage (example for Linux, for Windows use gear360pano.cmd):

gear360pano.sh *.JPG

# For Linux and GNU Parallel
ls -1 path/to/files/*.JPG | parallel --load 99% --noswap --memfree 500M --bar ./gear360pano.sh {}

Output (example for Linux, for Windows use gear360pano.cmd):

$./gear360pano.sh 360_0010.JPG
Processing file: 360_0010.JPG
Processing input images (nona)
nona: using graphics card: NVIDIA Corporation GeForce GTX 1080/PCIe/SSE2
Stitching input images
enblend: warning: option "--gpu" has no effect in this enblend binary,
enblend: warning: because enblend was compiled without support for OpenCL
enblend: info: loading next image: /tmp/tmp.b7JjFwkWAV/out0000.tif 1/1
enblend: info: loading next image: /tmp/tmp.b7JjFwkWAV/out0001.tif 1/1
enblend: info: writing final output
enblend: warning: must fall back to export image without alpha channel
Setting EXIF data (exiftool)
Processing took: 10 s
Processed files are in /somedir/gear360pano/html/data

This will produce a panorama files in html\data directory (default), this can be changed with -o (Linux) or /o (Windows) paramter.

List of switches (Windows in brackets):

Script has some simple error checking routines but don't expect it will handle all bad situations.

Few remarks (does not apply for the videos):

Videos

For videos (example for Linux):

./gear360video.sh video.mp4

This should produce video_pano.mp4 in html/data directory (default), output file can be given as a second argument (but not full path, see -o parameter).

List of switches (Linux):

What is/might be wrong (loose notes about the script):

Tutorial

This video shows how to create an initial (no proper stitching) panorama file from one double fisheye photos:

Panorama from double fisheye photo

Links

Links:

TODOs

Few TODOs: