This group contains all functions which belong images sources and cameras. More...
Functions | |
| void | activateCamera (int index) |
| Activate capturing on a camera. | |
| BSTR | getCameraName (int index) |
| Retrieve the name of a camera. | |
| float | getCameraParameter (BSTR parameter) |
| Returns a specific camera parameter of the currently active camera. | |
| BSTR | getCameraParametersFile () |
| Returns the path to the camera parameters file which was loaded before via loadCameraParameters(). | |
| double | getCameraTimestampAdjustment () |
| Returns the timestamp adjustment value of the images. | |
| int | getCanVideoSeek () |
| Check if the currently loaded video file is capable of performing a seek operation. | |
| BSTR | getCurrentCameraFormat () |
| Get the current format for the running video camera. | |
| double | getCurrentVideoPos () |
| Get the current read position (in seconds) within the currently loaded video. | |
| float | getMinMaxCameraParameter (BSTR parameter, long isMin) |
| Returns a the allowed minimum and maximum for a specific camera parameter of the currently active camera. | |
| int | getNumberOfCamsAvailable () |
| Get the number of cameras available on the system. | |
| int | getPixelsizeImageSourceX () |
| Get width of source image/video/camera in pixels. | |
| int | getPixelsizeImageSourceY () |
| Get height of source image/video/camera in pixels. | |
| BSTR | getSupportedCameraFormats () |
| Get the supported formats for the running video camera. | |
| double | getVideoDuration () |
| Get the duration of the currently loaded video file stream (in seconds). | |
| long | loadCameraParameters (BSTR parameterFile) |
| Load a camera parameter file which specifies the camera settings. | |
| void | pauseImageSource (long pause) |
| Pause / unpause image source. | |
| void | saveScreenshot (BSTR path) |
| Save a screenshot to the given file. | |
| void | saveScreenshotHighRes (BSTR path) |
| Save a screenshot to the given file. | |
| void | seekVideo (double SeekToInSecs) |
| Seek to particular position within the currently loaded video file. | |
| long | setCameraFormat (BSTR cameraFormat) |
| Sets a camera format for the running video camera. | |
| long | setCameraParameter (BSTR parameter, float value) |
| Sets a specific camera parameter of the currently active camera. | |
| void | setCameraTimestampAdjustment (double timestampAdjustment) |
| Adjusts the timestamps of the images of the respective active image source (video, still image, camera). | |
| void | setImageSource (BSTR source) |
| Set image source to video or still image by giving a path name. | |
| void | setVideoLoopMode (long loop) |
| Specify if loaded videos should be looped. | |
| void | showPinPropertiesOnActivatedCamera () |
| Show pin properties of current of the currently activated (DirectShow) camera. | |
| void | showPropertiesOnActivatedCamera () |
| Show general property page of the currently activated (DirectShow) camera. | |
| void | startVideo () |
| Start rendering the video stream of the currently loaded video file (if it was stopped before). | |
| void | stopVideo () |
| Stop rendering the video stream of the currently loaded video file. | |
This group contains all functions which belong images sources and cameras.
| void activateCamera | ( | int | index | ) | |
Activate capturing on a camera.
Use this to start capturing on the given camera. Capturing will try to set the resolution from _AR_Settings (videosize_width and videosize_height) with RGB8 and 15 fps. If you put 0,0 in _AR_Settings.xml, the latest values from the camera (regarding resolution, framerate and color format) will be taken. This can be helpfull if you need to configure the camera from another application and then want to take theese changes into effect (e.g. with the SmartView application for AVT cameras). Note, that this does not work for all cameras as they have to remember state. If the camera (or the driver) does not remember state, the default values will be taken.
| index | The index of the camera to activate (zero based). |
| BSTR getCameraName | ( | int | index | ) | |
Retrieve the name of a camera.
Use the index obtained from getNumberOfCamsAvailable() to retrieve friendly names of the devices.
| index | Index of the camera (zero based). |
| float getCameraParameter | ( | BSTR | parameter | ) | |
Returns a specific camera parameter of the currently active camera.
Use this method to retrieve a specific camera parameter. Currently only AVT cameras support this feature (except Cam_FlipMode). The following parameters are available (for an explanation see setCameraParameter()):
| parameter | The parameter to retrieve. |
| BSTR getCameraParametersFile | ( | ) | |
Returns the path to the camera parameters file which was loaded before via loadCameraParameters().
Note that as soon as you change camera parameters (e.g. via setCameraFormat()) this method will return an empty string (as the camera settings have changed and might differ now from the settings loaded before).
| double getCameraTimestampAdjustment | ( | ) | |
Returns the timestamp adjustment value of the images.
Note, that for a proper synchronization, the SyncOnImageMode should be used.
| int getCanVideoSeek | ( | ) | |
Check if the currently loaded video file is capable of performing a seek operation.
Certain files do not exhibit this feature, e.g. wma streaming files cannot seek.
| BSTR getCurrentCameraFormat | ( | ) | |
Get the current format for the running video camera.
| double getCurrentVideoPos | ( | ) | |
Get the current read position (in seconds) within the currently loaded video.
If the video file is paused or stopped, the current position is the point at which playback will resume.
| float getMinMaxCameraParameter | ( | BSTR | parameter, |
| long | isMin | ||
| ) | |
Returns a the allowed minimum and maximum for a specific camera parameter of the currently active camera.
Use this method to retrieve the allowed min and max values for a specific camera parameter. Currently only AVT cameras support this feature (except Cam_FlipMode). The following parameters are available (for an explanation see setCameraParameter()):
| parameter | The parameter to retrieve. |
| isMin | If set the minimum value will be retrieved otherwise the maximum value. |
| int getNumberOfCamsAvailable | ( | ) | |
Get the number of cameras available on the system.
This function takes a look at the devices plugged into the system and recognizes changes. It should be called everytime a camera is plugged / unplugged into the system.
| int getPixelsizeImageSourceX | ( | ) | |
Get width of source image/video/camera in pixels.
| int getPixelsizeImageSourceY | ( | ) | |
Get height of source image/video/camera in pixels.
| BSTR getSupportedCameraFormats | ( | ) | |
Get the supported formats for the running video camera.
Note, that in case of DirectShow cameras, the list may not contain all possible resolutions and framerates, as, depending on the DirectShow driver/capture filter, resolution and framerate may be altered in discrete steps from a minimum up to a maximum value. For DirectShow cameras it is best to use showPinPropertiesOnActivatedCamera() to show and alter the formats supported by the camera.
| double getVideoDuration | ( | ) | |
Get the duration of the currently loaded video file stream (in seconds).
Use this to determine the duration of a video file stream.
| long loadCameraParameters | ( | BSTR | parameterFile | ) | |
Load a camera parameter file which specifies the camera settings.
Use this method, to load a settings file for currently activated camera. Currently only AVT and IDS cameras support this feature by loading an XML file that was previously saved with AVT SmartView or the according IDS tool. Further note, that calling this function will stop all currently connected cameras. The visualization camera will automatically be restarted afterwards. Currently this feature does NOT work, when you use metaio IR tracking.
NOTE for IDS cameras: At the moment loading the settings file only works if you remove anything from the .ini file that relates to camera resolution (Width, Height property) and the Colormode property. This seems to be a bug in the DirectShow driver of IDS.
Note, that for loading camera calibrations use the methods loadStandardCameraCalibration() or loadExtendedCameraCalibration().
| parameterFile | The path to the parameter file. |
| void pauseImageSource | ( | long | pause | ) | |
Pause / unpause image source.
Using this you can pause and later unpause the current image source. This works for video files and cameras.
| pause | 1 to pause, 0 to resume. |
| void saveScreenshot | ( | BSTR | path | ) | |
Save a screenshot to the given file.
You can take a screenshot of the currently displayed image. The screenshot will have the dimensions of the current output window.
| path | Path to file where the screenshot should be saved to including extension (.bmp or .jpg) |
| void saveScreenshotHighRes | ( | BSTR | path | ) | |
Save a screenshot to the given file.
You can take a screenshot of the currently displayed image. The screenshot will have the maximum possible dimensions.
| path | Path to file where the screenshot should be saved to including extension (.bmp or .jpg) |
| void seekVideo | ( | double | SeekToInSecs | ) | |
Seek to particular position within the currently loaded video file.
| SeekToInSecs | Time to seek to in seconds e.g. 1.4, 0.5, 15.0 etc. |
| long setCameraFormat | ( | BSTR | cameraFormat | ) | |
Sets a camera format for the running video camera.
Such a format string may be retrieved from getSupportedCameraFormats() or derived manually. Note, that this method is currently the only way to set a Format 7 (mode 0) video mode for AVT cameras (besides the configuration via _AR_Settings.xml). A Format 7 video mode will be set internally automatically if you specify a non standard format (e.g. "Y8_800x800_20FPS"). Note, that when using a calibration file, you MUST calibrate for the full resolution (e.g. 1280x1024) as Format 7 will be achieved via region of interest based cropping of the full resolution image. The full resolution can be obtained e.g. via AVT's SmartView application. You need to set the calibration after setting the camera format.
| cameraFormat | A string representing the desired foramt as "RGB_640x480_15FPS". |
| long setCameraParameter | ( | BSTR | parameter, |
| float | value | ||
| ) | |
Sets a specific camera parameter of the currently active camera.
Use this method to set a specific camera parameter. Currently only AVT cameras support this feature (except the parameter Cam_FlipMode). The following parameters are available:
Note that you can also use loadCameraParameters() to load camera specific settings for AVT cameras, which is the recommended way as the camera parameters won't be stored in a scene file in contrast to the camera parameters file. Only the values that are not stored in a camera parameter file:
Further note on ROIs: Note that currently settings ROIs is only possible if you have selected a Format 7 mode 0 video format (see setCameraFormat()).
| parameter | The parameter to change. |
| value | The value of the parameter. |
| void setCameraTimestampAdjustment | ( | double | timestampAdjustment | ) | |
Adjusts the timestamps of the images of the respective active image source (video, still image, camera).
The timestamp of the images of the currently active camera is adjusted by the given value. Thus, you can e.g. shift the timestamp back and forth in time which might be needed to allow proper synchronization of camera images and tracking data. This is e.g. the case when synchronizing with IR tracking or FARO tracking. Generally, every arriving image from a camera gets the timestamp of it's arrival in the system. But this timestamp usually does not correspond to the timestamp when image was actually taken in the camera. So by giving a (negative) timestamp adjustment you can correct this behaviour.
Note, that for a proper synchronization, the SyncOnImageMode should be used. Further note, that this value will be set generally and will persisit even when you switch to another camera.
| timestampAdjustment | Adjustment in milliseconds (positive or negative) which will be added to the timestamp of the images. |
| void setImageSource | ( | BSTR | source | ) | |
Set image source to video or still image by giving a path name.
This method is used to set the image source for display and (optical) tracking. The image source can be any string representing a fully qualified path to a video file or a still image e.g. "c:\image\1.jpg" or "c:\video\video1.avi". Also URL paths are allowed like http://192.168.100.1/myImage.jpg.
| source | A fully qualified path to a video or image file. |
| void setVideoLoopMode | ( | long | loop | ) | |
Specify if loaded videos should be looped.
The video stream can be made to play back in a continous loop or just once. Using this function, you can choose between these two modes.
| loop | 1 to enable looping, 0 for single shot mode. |
| void showPinPropertiesOnActivatedCamera | ( | ) | |
Show pin properties of current of the currently activated (DirectShow) camera.
The pin properties are mainly image formats (e.g. RGB, YUV etc.) and image size (320x240, 640x480 etc). After setting these parameters, one must close this property page. The camera will automatically re-connect and apply any changes that were made.
| void showPropertiesOnActivatedCamera | ( | ) | |
Show general property page of the currently activated (DirectShow) camera.
The general properties are the ones provided by the camera driver, e.g. brightness/contrast/sharpness/white balance/refresh rate. Using this function, you can open a properties page and adjust these values accordingly.
| void startVideo | ( | ) | |
Start rendering the video stream of the currently loaded video file (if it was stopped before).
Use this to start rendering the video stream.
| void stopVideo | ( | ) | |
Stop rendering the video stream of the currently loaded video file.
The file read pointer is moved to start of the video. I.e. the video will resume playback from the beginning when resumed.
| Unifeye SDK v. 4.0 | 2011 |