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