Ask Your Question

Revision history [back]

What Modification in the code by Microsoft Kinect D2D sample has to be made to connect it with openCV?

I got this code from a site..... cvSetData(img,(BYTE) pBuffer, img->widthStep); Mat &m = Mat(img); Mat &hsv = Mat(); vector<mat> mv = vector<mat>(3,Mat(cvSize(640,480),CV_8UC1)); cvtColor(m,hsv,CV_BGR2HSV); cvtColor(hsv,m,CV_HSV2BGR);/// IplImage iplimg(m); cvNamedWindow("rgb",1); cvShowImage("rgb",&iplimg);

But here it is not told how to initialize the "img".... Help!!

click to hide/show revision 2
No.2 Revision

updated 2014-06-12 05:15:39 -0600

berak gravatar image

What Modification in the code by Microsoft Kinect D2D sample has to be made to connect it with openCV?

I got this code from a site..... cvSetData(img,(BYTE) site.....

cvSetData(img,(BYTE*) pBuffer, img->widthStep);
 Mat &m = Mat(img);
 Mat &hsv = Mat();
    vector<mat> vector<Mat> mv = vector<mat>(3,Mat(cvSize(640,480),CV_8UC1));
    vector<Mat>(3,Mat(cvSize(640,480),CV_8UC1));
cvtColor(m,hsv,CV_BGR2HSV);
    cvtColor(hsv,m,CV_HSV2BGR);///
    cvtColor(hsv,m,CV_HSV2BGR);//*/
IplImage iplimg(m);
 cvNamedWindow("rgb",1);
    cvShowImage("rgb",&iplimg);

cvShowImage("rgb",&iplimg);

But here it is not told how to initialize the "img".... Help!!