Page 1 of 2
where does the camera assign the object IDs.
Posted: Fri Mar 13, 2009 2:25 am
by xwy8187
Hello, guys,
I am new to Optitrack cameras and I want some help.
The way the V100 camera assigns IDs to the detected objects is not what we want. So we want to modify the code to change it. However, we cannot find the place of assigning the object IDs in the source code. We are now using the grayscale sample. I think it is a simple answer if somebody know the sdk well. Thanks in advance!
Re: where does the camera assign the object IDs.
Posted: Fri Mar 13, 2009 12:29 pm
by beckdo
Ideally, after receiving a frame of data from the OptiTrack SDK, you should copy everything of interest out of the frame object and release it immediately so that it's not tied up by the client. Once you copy the data out of the frame you can do what you will with it. Frames coming from the OptiTrack SDK are essentially read-only.
Re: where does the camera assign the object IDs.
Posted: Sun Mar 15, 2009 1:06 am
by xwy8187
[quote=NaturalPoint - Doug]Ideally, after receiving a frame of data from the OptiTrack SDK, you should copy everything of interest out of the frame object and release it immediately so that it's not tied up by the client. Once you copy the data out of the frame you can do what you will with it. Frames coming from the OptiTrack SDK are essentially read-only. [/quote]
Thank you for your answering!
I think you misunderstood my question.
The camera assigns IDs to the detected objects in a frame. Five detected objects means they have IDs from 0 to 4. Let's say the objects with ID 0 is not detected in the next frame. Normally the camera will reassign 0-3 to the remaining 4 detected objects. However, we don't want this. We want the detected objects with IDs 1-4 reserve their ID number constantly. In other words, no procudure of reassining object IDs. Did you mean this is not possible?
I want to paste two captured images here but I don't know how where is the link.
TIA!
Re: where does the camera assign the object IDs.
Posted: Mon Mar 16, 2009 2:46 pm
by beckdo
Ok, what you're referring to we call 'identification & labeling'. Unfortunately, the cameras can't differentiate one marker from another. As a result, from one frame to the next you'll just get X,Y coordinates for each signature in view. You'll have to come up with some additional rules to differentiate one unique trackable marker from another. You'll want to create an algorithm that possibly differentiates one from another based on it's size or shape.
Re: where does the camera assign the object IDs.
Posted: Fri Mar 20, 2009 11:41 am
by Leo Kee Hao
Will OptiTrack consider including the capability of marker 'identification & labelling' in the software? I believe this is an important feature for a lot of users.
Re: where does the camera assign the object IDs.
Posted: Fri Mar 20, 2009 3:18 pm
by Birch
Our Rigid Body toolkit product provides identification and labeling of markers in 3D space when they are clustered into unique shapes (Rigid Bodies).
http://www.naturalpoint.com/optitrack/p ... ing-tools/
We don't have any sample 2D tracking code available, but you might consider looking into touch-lib. Its an open source suite of code for multi-touch interfaces and should probably have some useful 2D tracking algorithms.
http://www.nuigroup.com/touchlib/
Some OptiTrack customers have also made their TUIO protocol interface code available to the public. This allows OptiTrack cameras to be used with some multi-touch software and libraries.
http://www.future-instruments.net/fr/download.html
Re: where does the camera assign the object IDs.
Posted: Fri Mar 20, 2009 9:52 pm
by Leo Kee Hao
Thanks for your reply. Will OptiTrack eventually be made compatible with C-Motion Visual3D software?
Re: where does the camera assign the object IDs.
Posted: Mon Mar 23, 2009 7:04 pm
by xwy8187
[quote=NaturalPoint - Doug]Ok, what you're referring to we call 'identification & labeling'. Unfortunately, the cameras can't differentiate one marker from another. As a result, from one frame to the next you'll just get X,Y coordinates for each signature in view. You'll have to come up with some additional rules to differentiate one unique trackable marker from another. You'll want to create an algorithm that possibly differentiates one from another based on it's size or shape. [/quote]
Thanks, Can you please tell me briefly how to save the raw frame images to hard disk without image processing?
Re: where does the camera assign the object IDs.
Posted: Tue Mar 24, 2009 1:18 am
by Birch
[quote=Wenyu]
Thanks, Can you please tell me briefly how to save the raw frame images to hard disk without image processing? [/quote]
You can use GetFrameImage() to get a buffer with the raw image data, then you can write that into a file.
For example, here is some code we used to save one frame to a PGM file. It expects pFrame to be a valid camera frame.
Code: Select all
#define IMAGE_WIDTH 640
#define IMAGE_HEIGHT 480
#define BITS_PER_PIXEL 8
#define BUFFER_FRAME_SIZE IMAGE_WIDTH * IMAGE_HEIGHT * (BITS_PER_PIXEL / 8)
#define PGM_HEADER_SIZE 15
unsigned char bufFrameCurrent[BUFFER_FRAME_SIZE];
unsigned char PGMheader[PGM_HEADER_SIZE] = {'P','5',' ', '6','4','0',' ', '4','8','0',' ', '2','5','5',' '};
pCamera->GetFrameImage(pFrame, IMAGE_WIDTH, IMAGE_HEIGHT,IMAGE_WIDTH, BITS_PER_PIXEL, (byte *) bufFrameCurrent);
CString str_FileName;
str_FileName.Format(TEXT("OptiTrack.pgm"));
CFile tImageFile(str_FileName, CFile::modeCreate | CFile::modeWrite);
tImageFile.Write(PGMheader, PGM_HEADER_SIZE);
tImageFile.Write(bufFrameCurrent, BUFFER_FRAME_SIZE);
tImageFile.Close();
Re: where does the camera assign the object IDs.
Posted: Tue Mar 24, 2009 1:30 am
by Birch
[quote=lkhsp]Thanks for your reply. Will OptiTrack eventually be made compatible with C-Motion Visual3D software? [/quote]
It isn't very clear from their website which formats it uses to import data, but some online documents suggest importing can be done via the C3D format. If this is true, then it might be possible to use our ARENA software to capture and then export skeleton marker data to Visual3D.
I would suggest contacting them and expressing your interest in having their software support importing data from our products, and encouraging them to contact us.