runAsyncQueueBase64
Description
Asynchronous engine module execution API, results are delivered via queue returned
runAsyncQueueBase64()
|
- Parameters
-
Name Type Description obj void* 'ArgoEngineApi' object pointer
callback C_RESULT_CALLBACK Callback function pointer to receive engine module execution results
requestId char* Request ID (value for request identification)
imgWidth int Image width
imgHeight int Image height
colorSpace int Image color type (RGB 0, RGBA 1, BGR 2, BGRA 3, YUV 4, GRAY 5)
imgData char* String with image pixel data encoded in base64
requestOptionJsonStr char* Json format string for setting options of engine module queried by getOpenApiOption
- Return Value
void *: Returns queue object to input execution results
Example
- Use OpenCV library
- Use sample 'ocr1.png'
- For runAsyncQueueBase64 API, encode 'dataMat' to base64 and input for use
cv::Mat temp = cv::imread("ocr1.png", cv::IMREAD_COLOR);
char *dataMat = (char *)temp.data;
void * resultQueue = runAsyncQueue(obj,
(char *)openApiName.c_str(),
(char *)requestId.c_str(),
temp.cols,
temp.rows,
2,
dataMat,
(char *)requestOptionJsonStr.c_str());
char *resultJsonStr = nullptr;
int resultSize = waitResult(resultQueue, &resultJsonStr);
std::string resultJson(resultJsonStr, resultSize);
releaseQueue(resultQueue);