Support Support Home » APIs » XiAPI » XiAPI Offline Processing

XiAPI Offline Processing

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

Architecture

Application calls processing functions which are implemented in API library, such as unpacking or RAW color processing (de-bayering). All processing functions can be called independently to currently opened camera.

Functionality

Offline processing converts transport or RAW formats into other image data formats. 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 API_context for later processing
    • xiGetParamString XI_PRM_API_CONTEXT_LIST
  • Open offline processing
  • Set the API_context to processing
    • xiProcSetParam 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 - xiProcSample.cpp
Defect Correction in offline processing - xiProcSample_DefectCorr.cpp - supported with newer camera families (xiC, xiB, xiX, xiT) which can save and load defect lists.

Interface

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

// Open processing instance
XI_RETURN xiProcOpen(xiProcessingHandle_t* h);

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

// Set unprocessed image to processing chain
XI_RETURN xiProcPushImage(xiProcessingHandle_t h, unsigned char* first_pixel);

// Set unprocessed XI_IMG image to processing chain
XI_RETURN xiProcPushXiImg(xiProcessingHandle_t h, XI_IMG * xi_image);

// Gets next processed image from processing chain
XI_RETURN xiProcPullImage(xiProcessingHandle_t h, int timeout_ms, XI_IMG* new_image);

// Closes instance for Image Processing entity
XI_RETURN xiProcClose(xiProcessingHandle_t h);

Result codes

Functions return 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.