Code Monkey home page Code Monkey logo

jiangbing123 / videoimucapture-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidgillsjo/videoimucapture-android

0.0 0.0 0.0 3.63 MB

Android application for capture of Video, IMU data and Camera data useful in SLAM and Structure from Motion research. Differs between Optical Image Stabilization (OIS) and Digital Video Stabilization (DVS) and can provide OIS data if the device supports it.

License: GNU General Public License v3.0

Java 89.62% Shell 0.26% Python 9.37% Dockerfile 0.58% MATLAB 0.18%

videoimucapture-android's Introduction

VideoIMUCapture-Android

Android application for capturing video and IMU data useful for 3D reconstruction using SLAM and Structure from Motion techniques.

Description

This Android application is a data collection tool for researchers working with Simultaneous Localization and Mapping (SLAM) and Structure from Motion (SfM).

It records Camera Frames at ~30Hz and Inertia Measurement Unit (IMU) data at ~100Hz synchronized to the same clock, given that the Android device supports it. The camera frames are stored to a H.264/MP4 video file and the frame meta data together with IMU data is stored in a protobuf3 file.

A major problem with modern smartphones and 3D reconstruction is that all have Optical Image Stabilization (OIS), which means different camera parameters for each frame. Furthermore, on many Android devices it cannot be disabled and a rare few actually supply the data of the lens movement. VideoIMUCapture shows a clear warning if you have this feature on during recording and includes settings for both Optical Image Stabilization and Digital Video Stabilization (DVS).

This code is forked from mobile-sensor-ar-logger which in turn is based on the grafika project. For the video capture it uses the Camera2 API.

Features

  • Captures camera frames at ~30Hz to H.264/MP4.
  • Captures IMU data at ~100Hz.
  • Synchronized clock, assuming the device supports it.
  • Stores IMU data and all frame meta data in a protobuf file, check recording.proto to see what data is included.
  • Display warning if OIS or DVS is enabled since this affects the camera parameters.
  • Settings menu for configuring video resolution, OIS, DVS, Auto focus and Auto exposure.

Install

To install on your Android device go to the Release page from your Android device browser and download the latest .apk file. You will need to give your browser permission to install the application, but Android should guide you through the necessary steps.

Calibration

To use the data for 3D reconstruction you will need to calibrate the IMU and Camera, see Calibration README for help.

Read Protobuf File

Examples on python scripts reading the protobuf file can be found the the calibration folder, for example data2statistics.py. You need protoc to compile a python module first, this is already done in the calibration docker image. You may compile it yourself like this

#Go to git repo
cd <some_path>/VideoIMUCapture-Android

#Install protoc
wget -nv "https://github.com/protocolbuffers/protobuf/releases/download/v3.13.0/protoc-3.13.0-linux-x86_64.zip" -O protoc.zip &&\  
sudo unzip protoc.zip -d /usr/local &&\
rm protoc.zip

# Build module - Alternative  1
# Add to pythonpath
mkdir proto_python 
protoc --python_out=proto_python protobuf/recording.proto
export PYTHONPATH="$(pwd)/proto_python:${PYTHONPATH}"

# Build module - Alternative  2
# Just place the parser in your own project.
protoc --python_out=<your_project_dir> protobuf/recording.proto

# Other Python dependencies
pip3 install protobuf pyquaternion

#Run script
python3 calibration/data2statistics.py <datafolder>/<datetime>/video_meta.pb3

Feedback

If you find any bugs or have feature requests, please create an issue on this Github page.

videoimucapture-android's People

Contributors

davidgillsjo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.