Convenient function for using the vlSDK in a simple manner. The vlSDK wrapper uses the C-Interface and prepares the interface in that way, that it is easy accessable by a macOS or iOS application. Please have a look into the tutorials and examples. More...
#import <vlSDK/vlSDK_Apple.h>
Inherits NSObject.
Instance Methods | |
(BOOL) | - addRawModelWithStruct:andData: |
Add a certain model with raw data (BETA) You can inject model(s) with raw triangles and normals into the visionlib and use them for tracking. More... | |
(void) | - applyInitPoseCorrectionWithAxis:andAngle: |
Apply initial pose correction In some cases a initial pose can be corrected by passing axis angle. More... | |
(void) | - configureExtrinsicCameraInverted: |
Treating camera poses Define how the callbacks extrinsic data should be treated. Enabling this option is recommended when working with OpenGL or Metal rendering systems. Like this you can easily directly pass the matrix of onExtrinsic: and onIntrinsic: to the rendering engine. Call this function right after calling the init. More... | |
(void) | - dealloc |
Shut down everything Shut down everything... Please be sure to not call anything in the sdk while calling dealloc. | |
(BOOL) | - disableDebugImage |
Disable debug images. More... | |
(BOOL) | - enableDebugImage |
Enable debug images You might enable receiving of ONE debug image along with the actual view image. In more complex applications this can help debugging. Enable the debug image which will call onGetDebugImageBufferWithWidth and companion methods if implemented in the delegate. More... | |
(void) | - getAttributeRequest: |
Request an Attribute Request an attribute from the actual running pipeline This only works, when the actual pipe has the attribute. More... | |
(NSString *_Nullable) | - getDeviceType |
Get type of device The vlSDK can use different image sources. When loading a .vl file a certain image source will be initialized. (e.g. camera, image sequence etc...) This function will allow you to receive the actual configured image source name (device). More... | |
(void) | - getInitPose |
Trigger to receive an initial pose Trigger to receive an initial pose-. | |
(void) | - getInitPoseCorrectionWithAxis:andAngle: |
Retreive actuall initial pose correction In some cases a initial pose can be corrected by passing axis angle. With this function you can receive the actual configured axis angle representation. More... | |
(BOOL) | - getLastExtrinsic: |
Receive last extrinsic data Receives a matrix with the last valid extrinsic data. More... | |
(NSImage *_Nullable) | - getLastImage |
(macOS) Get last image as NSImage Get the most actual camera image. It is not recommended polling this function for receiving a realtime stream of the image. | |
(NSString *_Nullable) | - getTrackerType |
Get type of tracker The vlSDK uses different pipes for different purposes. When loading a .vl file a certain pipe will be initialized. (e.g. modelTracker, posterTracker etc...) This function will allow you to receive the actual configured pipe name. More... | |
(id _Nonnull) | - initTrackerWithURI:andDelegate: |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate. More... | |
(id _Nonnull) | - initTrackerWithURI:andDelegate:withOptions: |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate. More... | |
(id _Nonnull) | - initTrackerWithURI:andLicenseData:andDelegate: |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate. More... | |
(id _Nonnull) | - initTrackerWithURI:andLicenseData:andDelegate:withOptions: |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate. More... | |
(id _Nonnull) | - initTrackerWithURI:andLicensePath:andDelegate: |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate. More... | |
(id _Nonnull) | - initTrackerWithURI:andLicensePath:andDelegate:withOptions: |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate. More... | |
(BOOL) | - isPaused |
Query pause state Ask the SDK if it is paused right now. If you have been calling pause: More... | |
(void) | - pause: |
Set pause state Set the actual state to pause. More... | |
(void) | - process |
Process one frame This method initiates the processing of the command queue and initiates the resolution of the delegates methode in the same thread as called. More... | |
(void) | - pushJsonAndBinaryCommand:andData: |
(void) | - pushJsonCommand: |
(void) | - readInitData: |
Load recorded init templates from uri While tracking using the modelTracker pipeline init templates are recorded for allowing to reinitialize the scene. It can be useful loading these templates during runtime from an uri. More... | |
(void) | - readLineModelData: |
(void) | - removeModel: |
Remove a certain model with a name uri (BETA) Use name:YOUROBJECTNAME or id:YOUROBJECTID . This will in return call onModelRemoved. More... | |
(void) | - requestModelData:withOptions: |
Request model data of the object (BETA) THIS IS STILL BETA AND IS MATTER OF CHANGE. More... | |
(void) | - requestModelProperties |
Request actual scene model properties (BETA) Will call onModelProperties on the delegate. More... | |
(void) | - resetHard |
Do a hard reset A hard reset enables the actual poster or model tracker pipe to get back to its initial pose. It also releases all recorded features helping for reinitialization and stabilization. Use this for starting over with the tracking as nothing happend before. | |
(void) | - resetInitData |
Reset all init data You might remove statically loaded initialization data. Data which has currently already be recorded will not be deleted. You may call a resetHard in order to remove these as well. More... | |
(void) | - resetSoft |
Do a soft reset A soft reset enables the actual poster or model tracker pipe to get back to its initial pose. | |
(void) | - run |
Run the tracking pipeline Run the tracking pipeline when it has been loaded. | |
(void) | - setAttributeCommand:withFloatValue: |
Set Attribute Set a certain attribute in the pipeline This only works, when the actual pipe has the attribute. More... | |
(void) | - setAttributeCommand:withStringValue: |
Set Attribute Set a certain attribute in the pipeline This only works, when the actual pipe has the attribute. More... | |
(void) | - setCalibrationCommand: |
Send a calibration command Send a calibration command as stated in the documentation. This only works, when the actual pipe is a camera calibration. More... | |
(void) | - setFPS: |
Set the frames per second to be processed internally. Set frames per second to process. A value of 0 will make the vlSDK run as fast as it can (not recommended). More... | |
(void) | - setInitPose:andQ: |
Set initial pose with quaternion and translation Set initial pose in openGL/Metal coordinate system from translation and quaternions. More... | |
(void) | - setInitPoseFromMatrix: |
Set initial pose with a matrix Set initial pose in openGL/Metal coordinate system from a model view matrix. More... | |
(void) | - setLogLevel: |
Setting the log level for debugging Set the log level for logging of the visionLib. It is strongly recommended only using the log if you experience rare problems. More... | |
(void) | - setModel:property:state: |
Sets a boolean property of a model (BETA) You might enable/disable, occlude an objects using this function. The general calling mechanism is providing a nameURI which looks like this name:YOUROBJECTNAME . Possible properties are enabled , occluder More... | |
(void) | - setNearPlane:andFarPlane: |
Set the near and far plane. Setting the near and far plane will influence the generated intrinsic data (projection matrix) passed to the delegate. You should set this to a useful value, since it defines the frustum. If you cannot see your rendering, please start here! More... | |
(void) | - shutDown |
Shut down everything Shut down everything... Please be sure to not call anything in the sdk while calling dealloc. | |
(void) | - start |
(void) | - step |
Step one frame Usually this methode is not needed when running real time applications. Anyway you might step single frames using this function. | |
(void) | - stop |
Stop the tracking pipeline Stop the tracking pipeline. | |
(void) | - windowResized: |
(macOS only) Set the screen extends of the rendering area to be used. This function should usually be called by a macOS application when a window resize happens. | |
(void) | - writeCalibrationDB: |
Write the actual camera calibration to some URI Writes the actual camera calibration to a given URI. This only works, when the actual pipe is a camera calibration. More... | |
(void) | - writeInitData: |
Write recorded init templates to uri While tracking using the modelTracker pipeline init templates are recorded for allowing to reinitialize the scene. It can be useful saving these templates using this function to an uri. More... | |
(void) | - writeLineModelData: |
Convenient function for using the vlSDK in a simple manner. The vlSDK wrapper uses the C-Interface and prepares the interface in that way, that it is easy accessable by a macOS or iOS application. Please have a look into the tutorials and examples.
- (BOOL) addRawModelWithStruct: | (NSString *_Nonnull) | struc | |
andData: | (NSData *_Nonnull) | data | |
Add a certain model with raw data (BETA) You can inject model(s) with raw triangles and normals into the visionlib and use them for tracking.
The string to be passed might look like this:
The binary structure might have this format: [vertex Nx3xfloat][triangleIndices: MxUint32][normals: Ox3xfloat]
The function will call onRawModelAdded:withError: NOTE This structure might still change.
- (void) applyInitPoseCorrectionWithAxis: | (float *_Nonnull) | axis | |
andAngle: | (float) | angle | |
Apply initial pose correction In some cases a initial pose can be corrected by passing axis angle.
axis | An array of 3 float values representin the axis |
angle | A float value representing the angle in radians |
- (void) configureExtrinsicCameraInverted: | (BOOL) | invert |
Treating camera poses Define how the callbacks extrinsic data should be treated. Enabling this option is recommended when working with OpenGL or Metal rendering systems. Like this you can easily directly pass the matrix of onExtrinsic: and onIntrinsic: to the rendering engine. Call this function right after calling the init.
invert | Set this to true in order to invert the camera pose automatically for you. |
- (BOOL) disableDebugImage |
Disable debug images.
- (BOOL) enableDebugImage |
Enable debug images You might enable receiving of ONE debug image along with the actual view image. In more complex applications this can help debugging. Enable the debug image which will call onGetDebugImageBufferWithWidth and companion methods if implemented in the delegate.
- (void) getAttributeRequest: | (NSString *_Nonnull) | attribute |
Request an Attribute Request an attribute from the actual running pipeline This only works, when the actual pipe has the attribute.
command | An NSString holding the attributename. |
- (NSString * _Nullable) getDeviceType |
Get type of device The vlSDK can use different image sources. When loading a .vl file a certain image source will be initialized. (e.g. camera, image sequence etc...) This function will allow you to receive the actual configured image source name (device).
- (void) getInitPoseCorrectionWithAxis: | (float *_Nonnull) | axis | |
andAngle: | (float *_Nonnull) | angle | |
Retreive actuall initial pose correction In some cases a initial pose can be corrected by passing axis angle. With this function you can receive the actual configured axis angle representation.
axis | An array of 3 float values that will be filled |
angle | A float pointer to a value representing the angle in radians |
- (BOOL) getLastExtrinsic: | (float *_Nonnull) | m |
Receive last extrinsic data Receives a matrix with the last valid extrinsic data.
m | Fills an array with expected 16 float values |
- (NSString * _Nullable) getTrackerType |
Get type of tracker The vlSDK uses different pipes for different purposes. When loading a .vl file a certain pipe will be initialized. (e.g. modelTracker, posterTracker etc...) This function will allow you to receive the actual configured pipe name.
- (id _Nonnull) initTrackerWithURI: | (NSString *_Nonnull) | uri | |
andDelegate: | ((deprecated("Use functions that also set licensePath or licenseData"))) | __attribute | |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate.
uri | A valid URI pointing to .vl configuration file. |
delegate | Pass a vlFrameListenerInterface |
- (id _Nonnull) initTrackerWithURI: | (NSString *_Nonnull) | uri | |
andDelegate: | (_Nullable id) | delegate | |
withOptions: | ((deprecated("Use functions that also set licensePath or licenseData"))) | __attribute | |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate.
uri | A valid URI pointing to .vl configuration file. |
delegate | Pass a vlFrameListenerInterface |
options | A dictionary with the following potential options: cameraDatabaseURI: An uri holding your custom cameraCalibration database. targetFPS: An unsigned integer holding the frames per seconds to be used for updates. |
- (id _Nonnull) initTrackerWithURI: | (NSString *_Nonnull) | uri | |
andLicenseData: | (NSString *_Nonnull) | licenseData | |
andDelegate: | (id _Nullable) | delegate | |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate.
uri | A valid URI pointing to .vl configuration file. |
licenseData | The content of a license file. |
delegate | Pass a vlFrameListenerInterface |
- (id _Nonnull) initTrackerWithURI: | (NSString *_Nonnull) | uri | |
andLicenseData: | (NSString *_Nonnull) | licenseData | |
andDelegate: | (_Nullable id) | delegate | |
withOptions: | (NSDictionary *_Nullable) | options | |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate.
uri | A valid URI pointing to .vl configuration file. |
licenseData | The content of a license file. |
delegate | Pass a vlFrameListenerInterface |
options | A dictionary with the following potential options: cameraDatabaseURI: An uri holding your custom cameraCalibration database. targetFPS: An unsigned integer holding the frames per seconds to be used for updates. |
- (id _Nonnull) initTrackerWithURI: | (NSString *_Nonnull) | uri | |
andLicensePath: | (NSString *_Nonnull) | licensePath | |
andDelegate: | (id _Nullable) | delegate | |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate.
uri | A valid URI pointing to .vl configuration file. |
licensePath | A valid URI pointing to license file. |
delegate | Pass a vlFrameListenerInterface |
- (id _Nonnull) initTrackerWithURI: | (NSString *_Nonnull) | uri | |
andLicensePath: | (NSString *_Nonnull) | licensePath | |
andDelegate: | (_Nullable id) | delegate | |
withOptions: | (NSDictionary *_Nullable) | options | |
Initialize a new tracker Initialize a new tracker with a given URI and the given delegate.
uri | A valid URI pointing to .vl configuration file. |
licensePath | A valid URI pointing to license file. |
delegate | Pass a vlFrameListenerInterface |
options | A dictionary with the following potential options: cameraDatabaseURI: An uri holding your custom cameraCalibration database. targetFPS: An unsigned integer holding the frames per seconds to be used for updates. |
- (BOOL) isPaused |
Query pause state Ask the SDK if it is paused right now. If you have been calling pause:
- (void) pause: | (BOOL) | enable |
Set pause state Set the actual state to pause.
enable | pause or not |
- (void) process |
Process one frame This method initiates the processing of the command queue and initiates the resolution of the delegates methode in the same thread as called.
A common practice is calling this function during the renderloop allowing your delegate methods to be called.
- (void) readInitData: | (NSString *_Nonnull) | uri |
Load recorded init templates from uri While tracking using the modelTracker pipeline init templates are recorded for allowing to reinitialize the scene. It can be useful loading these templates during runtime from an uri.
Currently the format must be a filename with an ending .binz.
- (void) removeModel: | (NSString *_Nonnull) | nameURI |
Remove a certain model with a name uri (BETA) Use name:YOUROBJECTNAME
or id:YOUROBJECTID
. This will in return call onModelRemoved.
- (void) requestModelData: | (NSString *_Nonnull) | name | |
withOptions: | (NSString *_Nonnull) | options | |
Request model data of the object (BETA) THIS IS STILL BETA AND IS MATTER OF CHANGE.
- (void) requestModelProperties |
Request actual scene model properties (BETA) Will call onModelProperties on the delegate.
- (void) resetInitData |
Reset all init data You might remove statically loaded initialization data. Data which has currently already be recorded will not be deleted. You may call a resetHard in order to remove these as well.
- (void) setAttributeCommand: | (NSString *_Nonnull) | attribute | |
withFloatValue: | (float) | value | |
Set Attribute Set a certain attribute in the pipeline This only works, when the actual pipe has the attribute.
command | A NSString holding the attributename. |
value | A float value. |
- (void) setAttributeCommand: | (NSString *_Nonnull) | attribute | |
withStringValue: | (NSString *_Nonnull) | value | |
Set Attribute Set a certain attribute in the pipeline This only works, when the actual pipe has the attribute.
command | An NSString holding the attributename. |
value | A string value. Note: Also float values can be set and will be converted when needed. |
- (void) setCalibrationCommand: | (NSString *_Nonnull) | command |
Send a calibration command Send a calibration command as stated in the documentation. This only works, when the actual pipe is a camera calibration.
command | An NSString holding the command. |
- (void) setFPS: | (unsigned int) | fps |
Set the frames per second to be processed internally. Set frames per second to process. A value of 0 will make the vlSDK run as fast as it can (not recommended).
fps | integer holding the frames per second to run with. |
- (void) setInitPose: | (float *_Nonnull) | t | |
andQ: | (float *_Nonnull) | q | |
Set initial pose with quaternion and translation Set initial pose in openGL/Metal coordinate system from translation and quaternions.
t | Translation vector |
q | Quaternion holding the rotation |
- (void) setInitPoseFromMatrix: | (float *_Nonnull) | m |
Set initial pose with a matrix Set initial pose in openGL/Metal coordinate system from a model view matrix.
m | A matrix holding 16 elements |
- (void) setLogLevel: | (int) | level |
Setting the log level for debugging Set the log level for logging of the visionLib. It is strongly recommended only using the log if you experience rare problems.
The | loglevel can be a number from 0-5, while 0 means LOG and 5 is mostly debug. |
- (void) setModel: | (NSString *_Nonnull) | name | |
property: | (NSString *_Nonnull) | property | |
state: | (bool) | enable | |
Sets a boolean property of a model (BETA) You might enable/disable, occlude an objects using this function. The general calling mechanism is providing a nameURI which looks like this name:YOUROBJECTNAME
. Possible properties are enabled
, occluder
- (void) setNearPlane: | (float) | near | |
andFarPlane: | (float) | far | |
Set the near and far plane. Setting the near and far plane will influence the generated intrinsic data (projection matrix) passed to the delegate. You should set this to a useful value, since it defines the frustum. If you cannot see your rendering, please start here!
near | Near value as float |
near | Far value as float |
- (void) writeCalibrationDB: | (NSString *_Nonnull) | uri |
Write the actual camera calibration to some URI Writes the actual camera calibration to a given URI. This only works, when the actual pipe is a camera calibration.
command | An NSString holding uri to write to. |
- (void) writeInitData: | (NSString *_Nonnull) | uri |
Write recorded init templates to uri While tracking using the modelTracker pipeline init templates are recorded for allowing to reinitialize the scene. It can be useful saving these templates using this function to an uri.
If an empty string is passed, the uri will be local_storage_dir:/VisionLib/InitData_XXXXX.binz, while XXXX depicts a timestamp. You can load the init data as well using either the initDataURI parameter in the tracking configuration file or passing the filename using url parameters, when loading the .vl file.
If you pass a full filename, with .binz at the end. You can explicitly save the init data under this filename. This is the recommended way. You can load the init data again using the loadInitData function