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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:34:19+00:00 2026-06-11T17:34:19+00:00

This fragment of code was taken from OpenNI sample called NiUserTracker //… some codes…

  • 0

This fragment of code was taken from OpenNI sample called NiUserTracker

//... some codes...

#define XN_CALIBRATION_FILE_NAME "UserCalibration.bin"

// Save calibration to file
void SaveCalibration()
{
    XnUserID aUserIDs[20] = {0};
    XnUInt16 nUsers = 20;
    g_UserGenerator.GetUsers(aUserIDs, nUsers);
    for (int i = 0; i < nUsers; ++i)
    {
        // Find a user who is already calibrated
        if (g_UserGenerator.GetSkeletonCap().IsCalibrated(aUserIDs[i]))
        {
            // Save user's calibration to file
            g_UserGenerator.GetSkeletonCap().SaveCalibrationDataToFile(aUserIDs[i], XN_CALIBRATION_FILE_NAME);
            break;
        }
    }
}

//... some codes ...
//... some codes ...

 void glutKeyboard (unsigned char key, int x, int y)
{
    switch (key)
    {
        case 27:
            CleanupExit();

        //... some codes...

        case 'S':
            SaveCalibration();
            break;
        case 'L':
            LoadCalibration();
            break;
        }
    }

When I press Shift+s or S (with caps lock on), it does not generate the “UserCalibration.bin.” I searched my hard drive entirely, and no such file was found. Afterwards, I disable the “read-only” property from OpenNI folder.
The console, when I execute NiUserTracker.exe, does not report any error.

I am most happy with its on-line calibration, which takes a moment to calibrate, I thought this process can be made quicker by loading a user-calibrated file.

Could some point me in the right direction, why I am unable to generate this “UserCalibration.bin” file? I am using Win7 64 bit with 64 bit OpenNI, and Visual Studio 2010 Ultimate (provided by our University for research purpose).

Greatly appreciated.

Regards,
ikel

  • 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-06-11T17:34:21+00:00Added an answer on June 11, 2026 at 5:34 pm

    I just did a quick test with two different configurations:

    1. osx 10.6.8 with OpenNI dev 64bit (OpenNI1.5.2.7,Nite1.5.2.7,avin2 SensorKinect5.0.5.2 )
    2. WinXP SP3 with OpenNI dev 32bit (OpenNI1.5.4.0,Nite1.5.2.21,avin2 SensorKinect5.1.2.1)

    It doesn’t look like a permission’s issue. I’ve modified the SaveCalibration function a bit:

    // Save calibration to file
    void SaveCalibration()
    {
        XnUserID aUserIDs[20] = {0};
        XnUInt16 nUsers = 20;
        g_UserGenerator.GetUsers(aUserIDs, nUsers);
        for (int i = 0; i < nUsers; ++i)
        {
            // Find a user who is already calibrated
            if (g_UserGenerator.GetSkeletonCap().IsCalibrated(aUserIDs[i]))
            {
                // Save user's calibration to file
                            XnStatus saveStatus = g_UserGenerator.GetSkeletonCap().SaveCalibrationDataToFile(aUserIDs[i], XN_CALIBRATION_FILE_NAME);
                            std::cout << "saveStatus: " << saveStatus << std::endl;
                            if(saveStatus == XN_STATUS_OK) std::cout << "calibration saved to file" << std::endl;
                            if(saveStatus == XN_STATUS_NOT_IMPLEMENTED) std::cout << "not implemented, calibration wasn't saved" << std::endl;
                break;
            }
        }
    }
    

    I’ve got STATUS_OK on osx, but XN_STATUS_NOT_IMPLEMENTED (value 65550) on Windows. I’ve found an interesting post on the OpenNI group. I’m not 100% sure, but it sounds like
    SaveCalibrationDataToFile might be deprecated in newer versions. This would sort of make sense since the psi(Ψ) pose is no longer required for calibration.

    Try to revert to an older version. The OpenNI configuration I use on osx works (saves calibration file but this version also can track skeleton without requiring the psi(Ψ) pose).

    HTH

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

Sidebar

Related Questions

When I run this code fragment, neither side is taken. if (Boolean.class.isAssignableFrom(boolean.class)) { uLog.error(Boolean
In this code fragment, which constructor is actually called? Vector v = getVector(); Vector
This is a code fragment from my controller [HttpPost] public ActionResult Cancel(string id,FormCollection collection)
The code below is more or less taken from the example MPMoviePlayerController sample code.
This is the fragment of code inserted with ajax: <form> <label for = task-name>Name</label>
For the following code fragment. /*This program demonstartes how a virtual table pointer *
I suspect this code fragment in the controller should be responsible for that. But
I have this fragment of code: SmsDataClassesDataContext dc = new SmsDataClassesDataContext(); // Get the
I'm trying to make this fragment work: Version History --------------- These are the versions
I have a Fragment with ImageView . How I can show this Fragment on

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.