• Stars
    star
    113
  • Rank 301,404 (Top 7 %)
  • Language
    C
  • License
    MIT License
  • Created about 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Convert 'dual-fisheye' 360 image material to equirectangular mapping

Dual Fisheye to Equirectangular Projection Mapping

Many '360°' camera's, such as the dokicam, consist of 2 fish-eye camera's.

Why DIY?

Those camera's typically come with desktop software or apps to manipulate the images and for example share to facebook.

It's fun to explore doing this without relying on the official software.

Storage

The dokicam stores its photos and videos on its memory card in JPG and MP4 format, easily accessible via USB storage without even removing the card.

Projection conversion

Those images and video's show the 'double fish-eye' nature of the device. Services like Facebook, however require 360° imagery to be mapped using the Equirectangular Projection. This can be achieved with ffmpeg using 2 'mapping files' for your image type.

Mapping generation

I did not find a suitable mapping for my camera online. However I did find projection.c by Floris Sluiter which could generate such mapping files for single-fisheye sources, and modified it to support double-fisheye.

Compile the generator code:

gcc -o projection projection.c -lm

Create mapping files for video and photo's:

./projection -x xmap_dokicam_video.pgm -y ymap_dokicam_video.pgm -h 1440 -w 2880 -r 1440 -c 2880 -b 35 -m samsung_gear_360
./projection -x xmap_dokicam.pgm -y ymap_dokicam.pgm -h 2048 -w 4096 -r 2048 -c 4096 -b 75 -m samsung_gear_360

Usage

Once you have created (or downloaded) the mapping files, use them with ffmpeg:

ffmpeg -i photo.jpg -i xmap_dokicam.pgm -i ymap_dokicam.pgm -filter_complex remap out.jpg
ffmpeg -i movie.mp4 -i xmap_dokicam_video.pgm -i ymap_dokicam_video.pgm -filter_complex remap out.mp4

For images, add exif metadata to help e.g. Facebook understand this is 360:

exiftool -ProjectionType="equirectangular" out.jpg

For videos, use Google's Spatial Metadata Injector with the following options: Image

Quality

The method used for mapping is a rather crude pixel-by-pixel conversion. You can clearly see the 'stitch' where the two images are joined together. You can probably achieve much better results with software that actually 'blends' together the images, like hugin, but that's also a bit more complicated ;).

More Repositories

1

nethogs

Linux 'net top' tool
C++
2,761
star
2

notion

Tiling tabbed window manager
C
267
star
3

realtimeconfigquickscan

Linux configuration checker for systems to be used for real-time audio
Perl
257
star
4

sfarkxtc

Basic sfArk decompressor
C++
92
star
5

sfArkLib

Original library for SoundFont compression
C++
83
star
6

connbeat

Agent exposing connection-related information, based on the Elastic Beats framework
Go
55
star
7

beats-output-http

HTTP output producer for the Elastic Beats framework
Go
44
star
8

zshprof

zsh script profiling
OCaml
40
star
9

sbt-reproducible-builds

Make your published artifacts bit-by-bit reproducible, and compare with other certifications
Scala
31
star
10

serverless-wiki

A wiki that tries to require as little logic on the server as possible
Python
18
star
11

todo-backend-akka

www.todobackend.com implementation based on scala, akka-http and akka-persistence
Scala
16
star
12

xrandr

xrandr improvements
C
10
star
13

todo-backend-ocaml

OCaml
9
star
14

reszoom

Chrome extension to automatically adjust page zoom settings based on screen resolution
JavaScript
9
star
15

learnyouacity

Game to teach yourself where the streets of a city are, web/OSM-based
JavaScript
9
star
16

akka-http-backpressure

Slides and code for reactive streams, backpressure, akka streams and akka http talk
Java
6
star
17

ewd

Presenting Edsger W. Dijkstra's writings in a more appealing way
HTML
6
star
18

akka-grpc-intro-video

Scala
6
star
19

unsfark

DEPRECATED - use https://github.com/raboof/sfArkXTm to uncompress sfArk files instead
C
4
star
20

auditcalltree

Dispatcher for the Linux auditd that shows the process hierarchy leading up to the process performing the audited action.
C
4
star
21

akka-grpc-http-video

Scala
4
star
22

scala-icalendar

icalendar (RFC5545) library for scala
Scala
4
star
23

xfce4-panel

from git://git.xfce.org/xfce/xfce4-panel
C
4
star
24

debbugs

Debian BTS
Perl
3
star
25

notion-doc

Documentation for the 'notion' project
TeX
3
star
26

SHA2017Game

Game played at SHA2017 using the electronic badge
Python
3
star
27

jack_interposer

Library to check at run-time whether an application makes non-RT-safe calls inside JACK's process() callback
C
3
star
28

alsa-midi-latency-test

alsa midi latency test
C
3
star
29

reproducible-builds-jvm-stripper

Library to make your JVM artifacts byte-for-byte reproducible.
Java
2
star
30

AlgoScore

graphical environment for algorithmic composition
C
2
star
31

supybot

Python
2
star
32

xf86-video-nouveau

xorg nouveau nvidia driver
C
2
star
33

spray-json-on-scala3

Using spray-json from a scala3 project
Scala
1
star
34

xmltv2ical

Automatically exported from code.google.com/p/xmltv2ical
Scala
1
star
35

linux-debugging-tools-zine-print

Preparing Julia Evans' "Linux debugging tools you'll love" zine for print
Makefile
1
star
36

fitnesse-meetup-slimtables

Examples for using various FitNesse SliM table types
Java
1
star
37

github-ticker.js

JavaScript
1
star
38

treeview

Display a plaintext tree (like output from xwininfo -tree, lsusb -v, lspci -v, etc) in an easy-to-browse manner
Haskell
1
star
39

nix-TSDZ2-Smart-EBike-1

Nix derivation for building TSDZ2-Smart-EBike-1
Nix
1
star
40

vormenstoof

silly language
Scala
1
star
41

ectrace

Trace a Scala ExecutionContext
Scala
1
star
42

leveldb-http

Expose LevelDB through a HTTP interface
JavaScript
1
star
43

hacker-hotel-reproducible-builds-talk

Slides for the Reproducible Builds talk at Hacker Hotel 2019
CSS
1
star
44

cloudflow-grpc-experiment

experimenting with using cloudflow and gRPC together
Scala
1
star
45

akka-blocking-dispatcher

demo code for blocking dispatcher instructions
Scala
1
star
46

mastodon-bot-nix

resources to help package mastodon-bot into a nixos image
Makefile
1
star
47

pitch-match-ear-trainer

'pitch match' ear trainer game
Elm
1
star
48

akka-actor-metrics

Scala
1
star
49

reproduce-akka-http-2851

(so far failed) attempt to reproduce https://github.com/akka/akka-http/pull/2851
Scala
1
star