Giter Club home page Giter Club logo

depth2hha's Introduction

Depth2HHA

Introduction

First, I want to thank s-gupta for his excellent work. Actually, I got some inspiration from his code and fixed some problems in it.

This repo is used to convert Depth images into HHA images. HHA is an encoding method which extract the information in the depth image which was proposed in Learning Rich Features from RGB-D Images for Object Detection and Segmentation. In this repo, I use NYU Depth V2 dataset as an example.


All we need is:

  1. A depth image
  2. A raw-depth image


Usage

1. Modify main.m

depth_image_root = './depth'       % dir where depth images are in.
rawdepth_image_root = './rawdepth'       % dir where raw depth images are in.
hha_image_root = './hha'

saveHHA(['img_', mat2str(5000+i)], matrix, depth_image_root, D, RD);

depth_image_root is the directory of where depth images are in, and rawdepth_image_root is the directory of where raw depth images are in. The path of HHA can be defined by yourself by modifying parameters of saveHHA(imName, C, outDir, D, RD).

imName : name of HHA.

C : camera matrix

outDir : root of HHA images

D and RD : depth and raw-depth images. The raw-depth images are just used as masks, which you can understand from the corresponding code.

2. Modify saveHHA.m

Look at this line.

D = double(D)/1000;        % The unit of the element inside D is 'centimeter'

Here, D is the depth image. You may confused about the number '1000'. Because when I save the depth data as 'png', I multiply it with 1000. We all know that float number can not be saved as png or jpg, so I scale it. Anyway, after this line, the unit of the element in D should be 'meter'. It's up to you how to convert it.

3. Others

  • You can directly run main.m to use this repo.
  • You can use data that s-gupta supplies:
wget http://www.cs.berkeley.edu/~sgupta/eccv14/eccv14-data.tgz
tar -xf eccv14-data.tgz

Results

Pictures below are RGB, Depth, Raw-depth, HHA in turn.

depth2hha's People

Contributors

charlescxk avatar

Watchers

 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.