Discussion and Support for the OptiTrack, SmartNav and TrackIR brands by NaturalPoint

Camera OptiTrack with OpenCv framework

by Alexandra » 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 viewtopic.php?f=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[i] = frameBuffer[i];

// Update openCV HighGUI Window

Best Regards
Posts: 5
Joined: Sun Apr 23, 2017 7:33 am

by steven.andrews » Mon Apr 24, 2017 11:14 am

Hello Alexandra,

Thank you for reaching out to us regarding your questions.

Since you are not using an OptiHub, you will need to connect an RCA cable between the two cameras. This will allow the cameras to synchronize so they can work together. ... 0Guide.pdf

Unfortunately, we are not able to help with OpenCV
For information on retrieving synchronized data from the cameras, you can refer to the samples and the documents that are included with our Camera SDK. You are also welcome to look through our online documentation.

Best regards,
Steven Andrews
OptiTrack | Senior Customer Support Engineer
NaturalPoint Employee
NaturalPoint Employee
Posts: 411
Joined: Mon Jan 19, 2015 11:52 am

by Alexandra » Tue Apr 25, 2017 5:34 am

Thank you Steven for your reply

I have one RCA Cable , my teacher told me that i can do synchronisation between them using software "program"

Please if you have any idea , let me knew

thank you

Posts: 5
Joined: Sun Apr 23, 2017 7:33 am

Return to Camera SDK