Support Support Home » Vision Libraries » OpenCV » XiApiPlusOcv Offline Processing

XiApiPlusOcv Offline Processing

XiApiPlusOcv allows to process already captured images from camera those are stored in memory or loaded from disk.

Architecture

Processing methods are implemented in xiAPIplus_ImageProcessing class from xiApiPlusOcv. All processing functions can be called independently to currently opened camera.

Functionality

Offline processing converts transport formats or RAW8 formats into XI_RAW8, XI_RAW16, XI_RGB24, XI_RGB32. It supports unpacking, debayering, Crop and Shift image processing blocks. See image data flow

Workflow

Typical application workflow is:
  • Get images from camera while storing them to some media
  • Get and store camera context list for later processing
    • cam.GetApiContextList()
  • Create instance of xiAPIplus_ImageProcessing
  • Set the camera context list to processing
    • processing.SetParam XI_PRM_API_CONTEXT_LIST
  • Eventually modify some parameters to tune up processing
  • For each captured image:
    • Push image
    • Pull image

Sample

Source code for capturing 10 frames then processing 10 captured frames is available for download - xiApiPlusOcv_OfflineProc.cpp

Interface

There are the following 5 functions, which allow to control Offline Processing.

// Open processing instance
xiAPIplus_ImageProcessing processing;

// Set the parameter to processing
// Same parameters can be set like in SetParam.
// Example: XI_PRM_WB_KR for Red channel correction
processing.SetParam(const char* prm, void* val, DWORD size, XI_PRM_TYPE type);

// Set unprocessed image to processing chain
processing.PushImage(unsigned char* first_pixel);

// Get next processed image from processing chain
processing.PullImage();
processing.GetImage(xiAPIplus_Image* ret_image);

Result codes

Functions can throw error codes of xiAPI (0..999) combined with specific codes of Processing (1000-1999).
List of specific Image Processing codes:

Result code Meaning
1001 Invalid argument detected (out of range).
1002 Implementation is not yet done.
1003 This value is not supported.
1004 Using of unknown parameter
1005 Input buffer is not allocated
1006 Output buffer is not allocated
1007 Output buffer allocation error
1008 There are no processors in chain
1009 Some requirement is not met.
1010 Processors chain is full.
1011 Processor is not initialized yet.
1012 Processor generates error.
1013 Unknown data format.
1014 Unknown color filter array pattern type.

Availability

Offline processing is available since release V4_01_76.