In order to capture with 100fps we decided to use TT2.0 in our products (instead of OptiTrack). The TT2.0 software itself seems to work great, and the single camera tracking algorithm will make it just perfect.
The single camera mode (accessible in TT2.0 software in "Camera Investigation" option) is exactly what I want, with options such as "video type" and exposure settings. You can change these settings with "Right Click" in TT2.0 software.
I am interested to know how I can change some camera parameters such as video type and exposure settings using TT2.0 API. The include file "NPTrackingTools.h" does not specify how.
Ok here is the code that I have so far:
Code: Select all
int main()
{
int windowWidth = 640;
int windowHeight = 480;
long cameraCount = 0;
unsigned int frameCounter = 0;
TT_Initialize();
cameraCount = TT_CameraCount();
if(cameraCount>0)
{
if (!ptc_open("TT Sample", windowWidth, windowHeight)) return 1;
while(!TimeToClose)
{
MSG msg;
if( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
{
if(GetMessage( &msg, NULL, 0, 0 ) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
TT_CameraFrameBuffer(0, windowWidth, windowHeight, 0, 1, frameBuffer);
// display the frame data
ptc_update(frameBuffer);
Sleep(10);
}
}
TT_Shutdown();
ExitProcess(1);
}
Code: Select all
void SetGray(BITMAPINFO_8bpp & bmi)
{
memset(bmi.bmiColors, 0, sizeof(bmi.bmiColors));
for (int i=0; i<256; i++)
{
bmi.bmiColors[ i ].rgbRed = i;
bmi.bmiColors[ i ].rgbGreen = i;
bmi.bmiColors[ i ].rgbBlue = i;
}
}
SetGray(bi); // as defined in previous post.
bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = 8;
bi.bmiHeader.biCompression = BI_RGB;
bi.bmiHeader.biSizeImage = ((((surface_width * 8) + 31) & ~31) >> 3) * surface_height;
bi.bmiHeader.biWidth = surface_width;
bi.bmiHeader.biHeight = -surface_height; // note well
bi.bmiHeader.biClrUsed = 256;
bi.bmiHeader.biClrImportant = 256;