C API Documentation
This is the API Documentation for the C Interface of dnkvw.
IDnkvwHandle dnkvw_createContext();
This method creates a new dnkvw context. It is needed for all operations in this library. Do not forget to free it after you are done with it.
Returns:
- the newly created context
void dnkvw_freeContext(IDnkvwHandle* context);
This method deinitializes and frees a dnkw context. If you use C NEVER use ‘free()’ to free an existing context. Only use this method to free a context.
Parameters:
contexta pointer to an initialized context
void dnkvw_setLogLevel(IDnkvwHandle context, int logLevel);
Set the log level.
Parameters:
contextan initialized dnkvw contextlogLevelthe log level
Logging defaults:
- Debug: Dnkvw = Verbose
- Release: Dnkvw = Warning
void dnkvw_setInternalLogLevel(IDnkvwHandle context, int internalLogLevel);
Set the internal log level. Not intended for production use.
Parameters:
contextan initialized dnkvw contextinternalLogLevelthe log level
Logging defaults:
- Debug: Internal = Silent
- Release: Internal = Silent
int dnkvw_selectHaarTracker(IDnkvwHandle context);
Use Haar tracking. Overwrites previously selected tracker.
Parameters:
contextan initialized dnkvw context
Returns:
1if the selection was successful,0if not
int dnkvw_selectDnnTracker(IDnkvwHandle context);
Use DNN tracking. Overwrites previously selected tracker.
Parameters:
contextan initialized dnkvw context
Returns:
1if the selection was successful,0if not
int dnkvw_startTracking(IDnkvwHandle context, int cameraId);
Starts the tracking.
Parameters:
contextan initialized dnkvw contextcameraIdthe Id of the camera to be uses for tracking
Returns:
1if the tracking could be started successfully. A0value may indicate a problem with the camera.
void dnkvw_stopTracking(IDnkvwHandle context);
Stops the tracking. This function may block.
Parameters:
contextan initialized dnkvw context
void dnkvw_stopTrackingAsync(IDnkvwHandle context);
Stops the tracking as soon as possible without blocking.
Parameters:
contextan initialized dnkvw context
void dnkvw_configureFrustum(IDnkvwHandle context, float aspectRatio, float nearPlane);
Configures the viewing frustum according to the parameters.
Parameters:
contextan initialized dnkvw contextaspectRatiothe aspect rationearPlanethe near plane
void dnkvw_calibrate(IDnkvwHandle context);
Runs a short calibration routine. The user should sit or stand as centered as possible before this function is called. The position of the user will be used as the new center until a new calibration is started.
This method should be called shortly after the start of the tracking to correct perspective problems caused by a wrong starting center.
Parameters:
contextan initialized dnkvw context
void dnkvw_loadFrustum(IDnkvwHandle context, float* left, float* right, float* top, float* bottom);
Get the last frustum. The viewing frustum is the volume that may appear on the screen. It is described by a near plane, a far plane and the distances of the left, right, top and bottom plane based on the near plane. This function returns only the left, right, top and bottom values. The near and far plane can be set independently.
These values can be used to calculate the projection matrix. This is normally done by your 3D graphics framework. Look at our demos for some case specific examples.
For more information see https://en.wikipedia.org/wiki/Viewing_frustum
Parameters:
contextan initialized dnkvw contextlefta pointer to a float where the left result can be savedrighta pointer to a float where the right result can be savedtopa pointer to a float where the top result can be savedbottoma pointer to a float where the bottom result can be saved
void dnkvw_loadEyeOffset(IDnkvwHandle context, float* x, float* y, float* z);
Get the last calculated eye offset.
Parameters:
contextan initialized dnkvw contextxa pointer to a float where the X result can be savedya pointer to a float where the Y result can be savedza pointer to a float where the Z result can be saved
void dnkvw_loadFps(IDnkvwHandle context, float* fps);
Get the last FPS value.
Parameters:
contextan initialized dnkvw contextfpsa pointer to a float where the result can be saved
void dnkvw_debugCameraInput(IDnkvwHandle context, int cameraId);
Debugging function to test the camera input. Should not be called while the tracking thread is running. This function may block. Don’t use this in production code.
Parameters:
contextan initialized dnkvw contextcameraIdId of the camera to use for tracking
void dnkvw_debugCameraFace(IDnkvwHandle context, int cameraId);
Debugging function to test the face detection.
Should not be called while the tracking thread is running.
This function may block.
Don’t use this in production code.
Parameters:
contextan initialized dnkvw contextcameraIdId of the camera to use for tracking