Camera OptiTrack with OpenCv framework
Posted: Mon Apr 24, 2017 8:22 am
Hey community
I wan't get the images from 2 camera at the same time and both of them is connected by Usb cable (I don't use the OptiHub)
How can I do synchro between them ?
I found this code here https://forums.naturalpoint.com/viewtop ... =37&t=5939
i wan't try it but i don't knew how , i have OpenCv and i use visual studio 2015
I guess that something missed like includes..?
Please help me to fix it on OpenCv, i have no idea about it i'm beginner
[ Code]
// openCV frame
IplImage* cvFrame = cvCreateImage(cvSize(355,290),IPL_DEPTH_8U,1);
unsigned char *data = (unsigned char *)(cvFrame->imageData);
static unsigned char frameBuffer[355*290];
// Get the frame from camera (using OptiTrack API)
camera->GetFrameImage(frame, 355, 290, 355, 8, (byte *) frameBuffer);
// Convert OptiTrack Frame object to OpenCV Frame object
for (int i=0; i<355*290;i++)
{
data = frameBuffer;
}
// Update openCV HighGUI Window
cvShowImage("openCVWin",cvFrame);
Best Regards
Alexandra
I wan't get the images from 2 camera at the same time and both of them is connected by Usb cable (I don't use the OptiHub)
How can I do synchro between them ?
I found this code here https://forums.naturalpoint.com/viewtop ... =37&t=5939
i wan't try it but i don't knew how , i have OpenCv and i use visual studio 2015
I guess that something missed like includes..?
Please help me to fix it on OpenCv, i have no idea about it i'm beginner
[ Code]
// openCV frame
IplImage* cvFrame = cvCreateImage(cvSize(355,290),IPL_DEPTH_8U,1);
unsigned char *data = (unsigned char *)(cvFrame->imageData);
static unsigned char frameBuffer[355*290];
// Get the frame from camera (using OptiTrack API)
camera->GetFrameImage(frame, 355, 290, 355, 8, (byte *) frameBuffer);
// Convert OptiTrack Frame object to OpenCV Frame object
for (int i=0; i<355*290;i++)
{
data = frameBuffer;
}
// Update openCV HighGUI Window
cvShowImage("openCVWin",cvFrame);
Best Regards
Alexandra