Ask Your Question
0

Recycling Calibration Data for Skeleton Tracking

asked 2011-08-02 01:37:27 -0500

qdocehf gravatar image

updated 2011-08-02 06:03:52 -0500

I have heard many people mention that they are saving the calibration data from a user and applying it to new users, in order to avoid the calibration pose. Where can I find the code that people are using to do this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-08-02 06:16:42 -0500

daaango gravatar image

updated 2011-08-02 06:19:12 -0500

You can google around for it, but here are the functions:

XnStatus SaveCalibrationData( XnUserID user, XnUInt32 nSlot )
XnStatus LoadCalibrationData( XnUserID user, XnUInt32 nSlot )

and here they are in action:

XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().SaveCalibrationData(nId, saveSlot);
    if (nRetVal == XN_STATUS_OK){
        printf("Calibration data has been saved!\n");
    else 
        printf("Saving calibration data has failed!\n");

XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().LoadCalibrationData(nId, loadSlot);
        if (nRetVal == XN_STATUS_OK)
        {
            g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
            g_UserGenerator.GetSkeletonCap().StartTracking(nId);
        }

There's also a SaveCalibrationDataToFile but I haven't figured out a way to get it to work yet... Unless you can save it to a file, the user will have to calibration at least once because SaveCalibrationData only saves to memory from my understanding.

An example of the SaveCalibrationDataToFile can be found in the OpenNI github samples, specifically here: http://https://github.com/OpenNI/OpenNI/blob/master/Samples/NiUserTracker/main.cpp

edit flag offensive delete link more

Comments

Should I copy this code and paste it in openni_tracker.cpp?
qdocehf gravatar image qdocehf  ( 2011-08-02 06:25:31 -0500 )edit
Well you're going to have to go around and understand the tracker code, but what you could do is put the SaveCalibrationData part into the "XN_CALLBACK_TYPE UserCalibration_CalibrationEnd", which is when a user is calibrated and it starts tracking. For the LoadCalibrationData, it dependsonyourneeds
daaango gravatar image daaango  ( 2011-08-02 07:10:56 -0500 )edit
Also, when I use LoadCalibrationData, how well does the data line up with the new user? Are all of the joints in the correct positions, or is it only likely that one or two will be?
qdocehf gravatar image qdocehf  ( 2011-08-02 07:33:57 -0500 )edit
So far, I've only tried it with myself and my calibration, but when it loads calibration for me, from what I remember, its completely accurate. I have yet to do any extensive testing though...
daaango gravatar image daaango  ( 2011-08-02 07:39:47 -0500 )edit
Where is the code for the implementation for these functions? I don't think the current version of ROS has them, so I would need to add them.
qdocehf gravatar image qdocehf  ( 2011-08-03 01:15:49 -0500 )edit
The current version has SaveCalibrationData and LoadCalibrationData. As for the DataToFile ones, I'm not exactly sure on their status
daaango gravatar image daaango  ( 2011-08-03 06:13:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-08-02 01:37:27 -0500

Seen: 418 times

Last updated: Aug 02 '11