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 7009019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:48:34+00:00 2026-05-27T21:48:34+00:00

I am working on a 3D model reconstruction application with Kinect sensor. I use

  • 0

I am working on a 3D model reconstruction application with Kinect sensor. I use Microsoft SDK to get depth data, I want to calculate the location of each point in the real-world. I have read several articles about it and I have implemented several depth-calibration methods but all of them do not work in my application. the closest calibration was http://openkinect.org/wiki/Imaging_Information
but my result in Meshlab was not acceptable.
I calculate depth value by this method:

    private double GetDistance(byte firstByte, byte secondByte)
    {
        double distance = (double)(firstByte >> 3 | secondByte << 5);
        return distance;
    }

and then I used below methods to calculate distance of real-world

    public static float RawDepthToMeters(int depthValue)
    {
        if (depthValue < 2047)
        {
            return (float)(0.1 / ((double)depthValue * -0.0030711016 + 3.3309495161));
        }
        return 0.0f;
    }

    public static Point3D DepthToWorld(int x, int y, int depthValue)
    {
        const double fx_d = 5.9421434211923247e+02;
        const double fy_d = 5.9104053696870778e+02;
        const double cx_d = 3.3930780975300314e+02;
        const double cy_d = 2.4273913761751615e+02;

        double depth = RawDepthToMeters(depthValue);
        Point3D result = new Point3D((float)((x - cx_d) * depth / fx_d),
                        (float)((y - cy_d) * depth / fy_d), (float)(depth));
                return result;
    }

these methods did not work well and generated scene was not correct. then I used below method, the result is better than previous method but it is not acceptable yet.

    public static Point3D DepthToWorld(int x, int y, int depthValue)
    {
        const int w = 640;
        const int h = 480;
        int minDistance = -10;
        double scaleFactor = 0.0021;
        Point3D result = new Point3D((x - w / 2) * (depthValue + minDistance) *     scaleFactor * (w/h),
(y - h / 2) * (depthValue + minDistance) * scaleFactor,depthValue);    
        return result;
    } 

I was wondering if you let me know how can I calculate real-world position based on my depth pixel values calculating by my method.

  • 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-27T21:48:35+00:00Added an answer on May 27, 2026 at 9:48 pm

    The getDistance() function you’re using to calculate real depth is referred to kinect player detection. So check that you are opening your kinect stream accordingly or maybe you should get only the raw depth data

    Runtime nui = Runtime.Kinects[0] ;
    nui.Initialize(RuntimeOptions.UseDepth);
    nui.DepthStream.Open(
       ImageStreamType.Depth, 
       2, 
       ImageResolution.Resolution320x240, 
       ImageType.Depth);
    

    and then compute depth by simply bitshifting second byte by 8:

    Distance (0,0) = (int)(Bits[0] | Bits[1] << 8);

    The first calibration methods should work ok even if you could do a little improvement
    using a better approximation given by Stéphane Magnenat:

    distance = 0.1236 * tan(rawDisparity / 2842.5 + 1.1863) in meters

    If you really need more accurate calibration values you should really calibrate your kinect using for example a tool such as the matlab kinect calibration:

    http://sourceforge.net/projects/kinectcalib/

    And double check obtained values with the ones you are currently using provided by Nicolas Burrus.

    EDIT

    Reading your question again I noticed that you are using Microsoft SDK, so the values
    that are returned from kinect sensor are already real distances in mm. You do not need to use the RawDepthToMeters() function, it should be used only with non official sdk.

    The hardware creates a depth map, that it is a non linear function of disparity values, and it has 11 bits of precision. The kinect sdk driver convert out of the box this disparity values to mm and rounds it to an integer. MS Kinect SDK has 800mm to 4000mm depth range.

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

Sidebar

Related Questions

Through jQuery and the use of an ajax get I have a working model
Working in a symfony model, I want to override a function and call the
I have a working LINQ to SQL model. I want to be able to
I'm working on a WPF application and is using the Model-View-ViewModel pattern. The application
I'm trying to get an abstract model working in Django and I hit a
I've read about how to get validation of my MVC Model working. It's pretty
I am working in a model-driven environment, where Java code is generated from a
I'm working with a small model in Entity Framework 4.0. I'd like to have
i am working on a simple web app which has a user model and
I'm working on a project that has a rich object model with various sets

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.