Giter Site home page Giter Site logo

k4a_mkv2image's Introduction

k4a_mkv2image

This is convert tool that works on cross-platform (Windows, Linux) for Azure Kinect.
This tool converts all data of each stream types (Color, Depth, Infrared) that contained in mkv file to image file.

Modifications

The project has been adapted to work with ETH3D/badslam and the exported datasets should now be compatible with the ETH SLAM Datasets format. The directory for color images is called "rgb" instead of "color" and text files for rgb, depth and calibration have been added. To prepare datasets for badslam use the following commands:

k4arecorder -c 720p -r 30 my_file.mkv												# starts recording until ctrl+c is pressed
k4a_mkv2image -i="my_file.mkv" -t=true -s=false -d=true                         	# creates a directory "my_file" with depth/rgb files.
python associate.py my_file/rgb.txt my_file/depth.txt > my_file/associated.txt		# associates rgb and depth frames. The python script can be found in the badslam docs

Then run badslam on the dataset. You might have to tune some settings like: "Maximum depth to use" -> 5, "Use photometric residuals" -> off (?), "Keyframe interval" -> lower a bit (but not too low!),

Sample

Command

k4a_mkv2image -i="./file.mkv" -s=true -d=true

Output

Image files are output in the following folder structure.
Image file name is "<file_index>_<device_timestamp>.jpg".
The file index is sequencial number for output images. The unit of device timestamp is microseconds.

k4a_mkv2image.exe
file.mkv
file
  |-rgb
  |   |-000000_00000000000.jpg
  |   |-000001_00000000033.jpg
  |   |-000002_00000000066.jpg
  |
  |-depth
  |   |-000000_00000000000.png
  |   |-000001_00000000033.png
  |   |-000002_00000000066.png
  |
  |-infrared
  |   |-000000_00000000000.jpg
  |   |-000001_00000000033.jpg
  |   |-000002_00000000066.jpg
  |-rgb.txt
  |-depth.txt
  |-calibration.txt

Option

option description
-i input mkv file path. (requered)
-s enable depth scaling. false is raw 16bit image. (bool)
-t enable transform depth to color camera. false is not transform. (bool)
-q jpeg encoding quality for infrared. [0-100]
-d display each images on window. false is not display. (bool)

Environment

  • Visual Studio 2017/2019 / GCC 7.4 / Clang 6.0 (require <filesystem> supported)
  • Azure Kinect Sensor SDK v1.3.0 (or later)
  • OpenCV 4.1.2 (or later)
  • CMake 3.15.4 (latest release is preferred)
  • Intel Thread Building Blocks (latest release is preferred)

* This tool requires Intel TBB only on Linux.

License

Copyright © 2019 Tsukasa SUGIURA
Distributed under the MIT License.

Contact

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.