Page 1 of 1

c# sdk - setting camera options

Posted: Tue Mar 10, 2009 9:13 am
by hogdog
hi, i'm a newbie to the sdk and i'm trying to build a very simple application that does single point tracking in c#.

I have succesfully built the app to check for the camera and start it. And output the top ranked objects x and y position.
I have succesfully built in the ability to change the threshold and exposure on the camera. But now i would like to set the options to do with object mass (min,max ,out of range). i have looked at the API documentation and the VB samples as well as the c# samples.

In the c# samples you get a set of declarations such as:

Code: Select all

private const int NP_OPTION_VIDEO_TYPE = 48;
private const int NP_OPTION_NUMERIC_DISPLAY_ON = 71;
private const int NP_OPTION_NUMERIC_DISPLAY_OFF = 72;
private const int NP_OPTION_FETCH_RLE = 73;
private const int NP_OPTION_FETCH_GRAYSCALE = 74;
private const int NP_OPTION_FRAME_DECIMATION = 52;
could some one please point me in the direction of where i might find out what the values being assigned are reffrenced to, I.E.

Code: Select all

private const int NP_OPTION_VIDEO_TYPE = 48;
.... why is video type set to 48?

or could someone please tell me what values i need to assign when declaring the :

NP_OPTION_OBJECT_MASS_MIN, NP_OPTION_OBJECT_MASS_MAX, NP_OPTION_OBJECT_MASS_IDEAL, NP_OPTION_OBJECT_MASS_WEIGHT.

I know in VB there is an enumeration call but i dont code in VB and never have and have just started in c# and cant see the equivilant call in any of the c# samples. so assumed it was taken care of in a diffrent manner I.E. with the declaration of an "int".

any help would be greatly appreciated.

Re: c# sdk - setting camera options

Posted: Tue Mar 10, 2009 12:21 pm
by beckdo
These definitions are the values of the commands themselves, not what they are set to. These commands are used in conjunction with the SetOption command. They are enumerated in OptiTrack.h.

For a simple application that tracks markers, you won't need to concern yourself with these details or the SetOption command.

You should be able to start a camera and start reading frames of 2D marker data directly.

Re: c# sdk - setting camera options

Posted: Tue Mar 10, 2009 3:30 pm
by hogdog
thanks for the info, should be able to accomplish whats needed.
the reason i need to be able to adjust these settings is that i'm tracking an IR LED array in an enviroment that has other potential IR sources and would like to be able to adjust these settings in our GUI to help give our LED array the best chance of being ranked No.1.

we only need 2D tracking on a single camera and have created a program which will give out the tracking data needed.

we are now endevoring to add functionality to combat the problem of other IR sources.