Camera OptiTrack with OpenCv framework

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

Camera OptiTrack with OpenCv framework

Post by Alexandra »

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
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 737
Joined: Mon Jan 19, 2015 11:52 am

Re: Camera OptiTrack with OpenCv framework

Post by steven.andrews »

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.
https://www.optitrack.com/public/docume ... 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.

http://optitrack.com/products/camera-sdk/
http://wiki.optitrack.com/index.php?title=Camera_SDK

Best regards,
Steven
--
Steven Andrews
OptiTrack | Senior Customer Support Engineer
Alexandra
Posts: 5
Joined: Sun Apr 23, 2017 7:33 am

Re: Camera OptiTrack with OpenCv framework

Post by Alexandra »

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

Regards
Alexandra
Post Reply