Go to Cart
HomeSupportAPIsXiAPINET → XiAPINET Offline Processing

XiAPI.NET Offline Processing

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

Architecture

The application creates the xiProc class and uses processing functions that are implemented in the API .NET library.
All processing functions can be called independently to currently opened camera.

Workflow

Typical application workflow is:

  • Get images from the camera while storing them to some media
  • Get and store API_context for later processing
    • GetParamString API_CONTEXT_LIST
  • Create an instance of the xiProc object
  • Set the camera context list to processing
    • ProcSetParam 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 - Sample-offline-processing.zip

Interface

These are the functions that allow to control the Offline Processing.

// Open processing instance
void ProcOpen();

// Set the parameter to processing
// Same parameters can be set like in the SetParam xiCam class.
void ProcSetParam(string prm, string val);
void ProcSetParamInt(string prm, int val);
void ProcSetParamFloat(string prm, float val);

// Get the parameter from processing
// Same parameters can be get like in the GetParam xiCam class.
string ProcGetParam(string prm);
int ProcGetParamInt(string prm);
float ProcGetParamFloat(string prm);

// Set unprocessed image to processing chain
void ProcPushXiImg(XI_IMG image);
void ProcPushImage(XI_IMG image);

// Gets next processed image from processing chain
void ProcPullImageInternal(out XI_IMG img, int timeout)
void ProcPullImage(out Bitmap image, int timeout)
void ProcPullImage(out BitmapSource image, int timeout)
void ProcPullImage(out WriteableBitmap image, int timeout)
void ProcPullImage(out byte[] img_arr, int timeout)

// Closes instance for Image Processing entity
void ProcClose();

Result codes

Functions can throw instances of the xiExc class that contains the error code
and message. Error codes are combined from xiAPI.NET (0..999) and
xiProc (1000-1999). List of specific offline 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 the 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_13_10.