Kinect Skeleton Joints to cv::Mat RRS feed

  • General discussion

  • Hello,

    I'm working on a project to recognize human pose by their skeleton using Microsoft Kinect SDK. I want to make a classification with SVM. The training data are in the form of a matrix of 3D points (Skeleton Joints), and each row contains 20 points (20 columns). So I thought to build a vector<vector<Point3f> > and then convert it to cv::mat. 

    I tried this code but it doesn't work:


    vector< vector<Point3f> > vec(1000, vector<Point3f>(20));

    float * Labels = new float[1000];


    Mat labelsMat(1000, 1, CV_32FC1, Labels);

    Mat trainingDataMat(1000, 20, DataType<Point3f>::type,vec);

    CvSVMParams params;
    params.svm_type    = CvSVM::C_SVC;
    params.kernel_type = CvSVM::LINEAR;
    params.term_crit   = cvTermCriteria(CV_TERMCRIT_ITER, 100, 1e-6);

    CvSVM SVM;
    SVM.train(trainingDataMat, labelsMat, Mat(), Mat(), params);


    Any idea? Is there another representation of data (20 Skeleton Joints for each frame) to do the classification?

    Thank you

    Wednesday, June 11, 2014 12:47 PM