TrackIR 4 imagermmFocalLength

Post Reply
icanflysohigh
Posts: 7
Joined: Sun Apr 06, 2008 6:33 pm

TrackIR 4 imagermmFocalLength

Post by icanflysohigh »

OptiTrack API
Version: 1.81
For SDK Version 1.1.034

"4.1.5.1.9 INPVector2:: get_imagerMMFocalLength
Returns the focal length of the lens used with the imager in millimeters.
TrackIR3/SmartNAV3/OptiTrack FLEX:3 stock lens = 3.7mm
TrackIR4 stock lens = 2.45mm
OptiTrack FLEX:C120 stock lens= 2.6mm"

This function returns 3.7mm for a TrackIR 4 but the documentation says it should be 2.45mm. Is this function reliable? Are there TrackIR 4 units with 3.7mm lenses?
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: TrackIR 4 imagermmFocalLength

Post by Birch »

In the OptiTrack SDK the default Focal Length value of INPVector is only set for TrackIR 3 cameras. Use the supplied values to override it.
icanflysohigh
Posts: 7
Joined: Sun Apr 06, 2008 6:33 pm

Re: TrackIR 4 imagermmFocalLength

Post by icanflysohigh »

So INPVector is returning a default focal length, independent of the camera type? In which case Optitrack needs to be able to identify between cameras. But there is no mention of TrackIR 4 in the INPCamera Model enumeration, the Revision mentions a 'TrackIR Pro' and 'TrackIR Basic' but to my knowledge both the TrackIR 3 and TrackIR 4 are 'Pro'. Any ideas?

Does the imagerMMWidth function return correct values for the camera in use?
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: TrackIR 4 imagermmFocalLength

Post by Birch »

Please also note that the INPVector3 functionality you are using is not officially supported, see this post for more information.
http://forum.naturalpoint.com/forum/ubb ... #Post30181

--

Use GetOption() and NP_OPTION_HARDWARE_REVISION to tell the difference between TrackIR 3 and 4.


TRACKIR3_PIXELWIDTH = 355
TRACKIR3_PIXELHEIGHT = 290
TRACKIR3_IMAGERWIDTH = 2.2
TRACKIR3_IMAGERHEIGHT = 1.8
TRACKIR3_FOCALLENGTH = 3.70

TRACKIR4_PIXELWIDTH = 355
TRACKIR4_PIXELHEIGHT = 290
TRACKIR4_IMAGERWIDTH = 2.2
TRACKIR4_IMAGERHEIGHT = 1.8
TRACKIR4_FOCALLENGTH = 2.45

C120_PIXELWIDTH = 355
C120_PIXELHEIGHT = 290
C120_IMAGERWIDTH = 2.2
C120_IMAGERHEIGHT = 1.8
C120_FOCALLENGTH = 2.6

V100_PIXELWIDTH = 640
V100_PIXELHEIGHT = 480
V100_IMAGERWIDTH = 3.84
V100_IMAGERHEIGHT = 2.88
V100_FOCALLENGTH = 4.5

SMARTNAV4_PIXELWIDTH = 640
SMARTNAV4_PIXELHEIGHT = 480
SMARTNAV4_IMAGERWIDTH = 3.84
SMARTNAV4_IMAGERHEIGHT = 2.88
SMARTNAV4_FOCALLENGTH = 4.9

TRACKIR5_PIXELWIDTH = 640;
TRACKIR5_PIXELHEIGHT = 480;
TRACKIR5_IMAGERWIDTH = 3.84;
TRACKIR5_IMAGERHEIGHT = 2.88;
TRACKIR5_FOCALLENGTH = 3.99;
icanflysohigh
Posts: 7
Joined: Sun Apr 06, 2008 6:33 pm

Re: TrackIR 4 imagermmFocalLength

Post by icanflysohigh »

Thanks for those numbers, I appreciate it (it would also be nice if they came in the header file ;)).

I'm not using INPVector functionality, I incorrectly assumed that it was able to report the camera lens and imager specifications. I guess if this ability were available it would be via INPCamera.

TrackIR 4 returns:
Model: NP_HW_MODEL_TRACKIR
Revision: NP_HW_REVISION_TRACKIR_PRO
I'm not sure what a TrackIR 3 would return though. Would its Revision be NP_HW_REVISION_TRACKIR_BASIC?
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: TrackIR 4 imagermmFocalLength

Post by Birch »

The model type defines are for use with get_Model() and get_Revision(), but not for use with NP_OPTION_HARDWARE_REVISION. It refers to the physical hardware generation.

For NP_OPTION_HARDWARE_REVISION the following would apply :

Code: Select all

#define TRACKIR_3       4
#define TRACKIR_4       5
#define OPTITRACK_C120  6
#define OPTITRACK_V100  7
#define SMARTNAV_4      8
#define TRACKIR_5       9
Post Reply