Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6788793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:31:39+00:00 2026-05-26T17:31:39+00:00

I just started learning about Kinect through some quick start videos and was trying

  • 0

I just started learning about Kinect through some quick start videos and was trying out the code to work with depth data.

However, I am not able to understand how the distance is being calculated using bit-shifting and various other formulas that are being employed to calculate other stuff too while working with this depth data.

http://channel9.msdn.com/Series/KinectSDKQuickstarts/Working-with-Depth-Data

Are these the particulars which are Kinect-specifics explained in the documentation etc.? Any help would be appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:31:39+00:00Added an answer on May 26, 2026 at 5:31 pm

    Pixel depth

    When you don’t have the kinect set up to detect players, it is a simply array of bytes, with two bytes representing a single depth measurement.

    So, just like in a 16 bit color image, each sixteen bits represent a depth rather than a color.

    If the array were for a hypothetical 2×2 pixel depth image, you might see: [0x12 0x34 0x56 0x78 0x91 0x23 0x45 0x67] which would represent the following four pixels:

    AB
    CD
    

    A = 0x34 << 8 + 0x12
    B = 0x78 << 8 + 0x56
    C = 0x23 << 8 + 0x91
    D = 0x67 << 8 + 0x45

    The << 8 simply moves that byte into the upper 8 bits of a 16 bit number. It’s the same as multiplying it by 256. The whole 16 bit numbers become 0x3412, 0x7856, 0x2391, 0x6745. You could instead do A = 0x34 * 256 + 0x12. In simpler terms, it’s like saying I have 329 items and 456 thousands of items. If I have that total of items, I can multiply the 456 by 1,000, and add it to the 329 to get the total number of items. The kinect has broken the whole number up into two pieces, and you simply have to add them together. I could "shift" the 456 over to the left by 3 zero digits, which is the same as multiplying by 1,000. It would then be 456000. So the shift and the multiplication are the same thing for whole amounts of 10. In computers, whole amounts of 2 are the same – 8 bits is 256, so multiplying by 256 is the same as shifting left by 8.

    And that would be your four pixel depth image – each resulting 16 bit number represents the depth at that pixel.

    Player depth

    When you select to show player data it becomes a little more interesting. The bottom three bits of the whole 16 bit number tell you the player that number is part of.

    To simplify things, ignore the complicated method they use to get the remaining 13 bits of depth data, and just do the above, and steal the lower three bits:

    A = 0x34 << 8 + 0x12
    B = 0x78 << 8 + 0x56
    C = 0x23 << 8 + 0x91
    D = 0x67 << 8 + 0x45

    Ap = A % 8
    Bp = B % 8
    Cp = C % 8
    Dp = D % 8

    A = A / 8
    B = B / 8
    C = C / 8
    D = D / 8

    Now the pixel A has player Ap and depth A. The % gets the remainder of the division – so take A, divide it by 8, and the remainder is the player number. The result of the division is the depth, the remainder is the player, so A now contains the depth since we got rid of the player by A=A/8.

    If you don’t need player support, at least at the beginning of your development, skip this and just use the first method. If you do need player support, though, this is one of many ways to get it. There are faster methods, but the compiler usually turns the above division and remainder (modulus) operations into more efficient bitwise logic operations so you don’t need to worry about it, generally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started learning Erlang and am trying out some Project Euler problems
I've just started learning about thread safety. This is making me code a lot
Just started learning NServiceBus and trying to understand the concept. When it talks about
I have just started learning about Java server faces and successfully tested out my
I'm just getting started with learning about Unit testing (and TDD in general). My
I just started learning C but I don't understand this part of the code.
I´ve just started learning GWT and I´m trying to implement http://gwt.google.com/samples/Showcase/Showcase.html#!CwFileUpload and but failing
I just started learning Common Lisp a few days ago, and I'm trying to
I just started learning C++ (coming from Java ) and am having some serious
I've just started learning Lisp and I can't figure out how to compile and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.