Git Product home page Git Product logo

kinradar's Introduction

kinradar

Part of a collection of Kinect hacks and tools by Mike Bourgeous.

kinradar displays a colored ASCII-art radar-like distance view, simulating an overhead and/or side view of the room. The intensity of each ASCII-art pixel is determined by the strength of the reflected signal at that distance (i.e. the number of depth samples falling within that pixel's corresponding 3D volume). The considered vertical area of the image can be restricted.

A depth sample's corresponding location in 3D space is calculated by assuming a 70 degree horizontal field of view, resulting in the following formula for X:

x_world = (320 - x_image) * tan(35) * z / 320

Requirements

You will need libfreenect from the OpenKinect project to compile kinradar.

Compiling and Running

$ make

# Show a basic radar display
$ ./kinradar

# Show a high-res display
$ xterm -fs 6 -fa 'Bitstream Vera Sans Mono' -geometry 257x92 -e ./kinradar -g 256 -G 88

Command-line Options

Usage: ./kinradar [-gG divisions] [-yY pixels] [-zZ distance] [-hv]
Use any of:
        g - Set horizontal grid divisions
        G - Set vertical grid divisions
        y - Set top of active area in screen pixels (inclusive) (0-479)
        Y - Set bottom of active area in screen pixels (exclusive) (0-480)
        z - Set near clipping plane in meters (default 0.5)
        Z - Set far clipping plane in meters (default 6.0)
        h - Show horizontal (overhead) view only
        v - Show vertical (side) view only
Press Ctrl-C (or send SIGINT) to quit.

Sample Output

kinradar looks a lot better at larger sizes (at least 96 wide) and when in motion. The static image here doesn't do it justice, nor can you see the colors.

$ ./kinradar -Z 7 -h
kinradar.c:151: depth():	time: 1576792434 frame: 1255 top: 0 bottom: 480
kinradar.c:153: depth():	popmax: 6808 out: 11%
                                     /    \
                                   /        \
                                  /         +\.
                                 / %88.      +\
                                /+888-+        \
                               / 8+888          \
                              /                  \
                             /             -88888%\
                           /        +8888888888- .  \
                          /--.    -.                 \
                         /...                         \
                        / .                            \
                       /  -                             \
                      /                                  \
                    /                                      \
                   /                                        \
                  /                                          \.
                 /                                           .\
                /-.                                          .8\
               /    .---.                                     8 \
              /-%+%+-...-888%                             .. .8   \
            /..++++%+--.    +         ..8%%%+%888%%8%++++--.  +    \
           /     .          %           ---++-+--+++-+++%%+   -.    \
          /                 .                                  -     \
         /                  ..                                 .      \
        /                                                      ..      \
       /                                                                 \
     /                                                          .         \
    /                                                                      \
   /                                                             .          \
  /                                                              ..          \
 /                         -.  ...                                            \

Copyright

(C)2011 Mike Bourgeous, licensed under GPLv2 or later

kinradar's People

Stargazers

 avatar

Watchers

 avatar  avatar  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.