Feature access examples include the dumpfeatures, savefeatures and loadfeatures/c_loadfeatures that demonstrate how to list the available features on a camera, output the current camera settings and load camera settings to the camera, respectively.

The dumpfeatures example parses the xml file to extract all available features on the camera by category and their corresponding type, displaying them in the terminal window:

Dumping feature tree :
    Category : Root
            Category : deviceInformation
                     DeviceVendorName : <IString>
                     DeviceFamilyName : <IString>
                     DeviceModelName : <IString>
                     DeviceVersion : <IString>
                     deviceManufacturerPartNumber : <IString>
                     DeviceManufacturerInfo : <IString>
                     DeviceFirmwareVersion : <IString>
                     DeviceID : <IString>
                     DeviceSerialNumber : <IString>
                     deviceMacAddress : <IInteger>

            Category : deviceSensorControl
                     DeviceScanType : <IEnumeration>
                     sensorColorType : <IEnumeration>
                     pixelSizeInput : <IEnumeration>
                     SensorWidth : <IInteger>
                     SensorHeight : <IInteger>
                     acquisitionFrameRateControlMode : <IEnumeration>
                     AcquisitionFrameRateEnable : <IBoolean>
                     AcquisitionFrameRate : <IFloat>

            Category : DigitalIOControl
                     TriggerSelector : <IEnumeration>
                     TriggerMode : <IEnumeration>
                     triggerFrameCount : <IInteger>

The savefeatures and loadfeatures/c_loadfeatures examples export/import feature settings that are streamable (that is, can be uploaded/downloaded in a batch process ) using a simple text file in the following format:

<feature> <value>
<feature> <value>

For example, to save current camera feature settings to a text file (in the current directory), use the following command:

./savefeatures <filename>.txt

 

With multiple cameras, usage is as follows:

savefeatures                    : Output features from camera 0 to stdout.

savefeatures - cam_index        : Output features from camera 'cam_index' to stdout. (Note the hyphen indicating stdout)

savefeatures filename           : Save features from camera 0 to 'filename'.

savefeatures filename cam_index : Save features from camera 'cam_index' to 'filename'.

When loading features, the file need only contain the feature-value pair for those features that need to be modified. For example:

PixelFormat Mono8
OffsetX 0
OffsetY 0
Width 640
Height 480

 

If multiple cameras are connected, the camera index (0 to (number of cameras -1), default = 0) is used to select the required camera.

Note: Not all camera features are streamable; for non-streamable features you must use the GevGetFeatureValue and GevSetFeatureValue functions.

Related Topics

Example Programs