Please enable JavaScript to view this site.

IDS peak 2.10.0 / uEye+ firmware 3.34

IDS Peak comfortSDK, genericSDK, IPL, and AFL developer manuals are external documents. Please contact us if you need them.

Fig. 304: AI-assisted image processing in IDS peak (acquisition thread)

Fig. 304: AI-assisted image processing in IDS peak (acquisition thread)

1

Process frame with CNN

peak_inference_result_handle hRes = PEAK_INVALID_HANDLE;
status = peak_Inference_CNN_ProcessFrame(hInference, frame, &hRes);

2

Getting inference results

peak_inference_result_data result = { PEAK_INFERENCE_TYPE_INVALID, PEAK_INVALID_HANDLE, 0, 0 };
status = peak_Inference_Result_Get(hRes, &result);

result.preprocessing_time_us
result.inference_time_us

3

Get general statistics

peak_inference_statistics statistics;
status = peak_Inference_Statistics_Get(hInference, &statistics);

statistics.numInferencesSuccessful
statistics.numInferencesFailed

4a

Classification

if (result.type == PEAK_INFERENCE_TYPE_CLASSIFICATION)

5a

Get number of results

size_t resCount = 0;
status = peak_Inference_Result_Classification_GetList(hRes, NULL, &resCount);

6a

Allocate list for results

peak_inference_result_classification* resList = calloc(resCount, sizeof(peak_inference_result_classification));

7a

Get classification results

status = peak_Inference_Result_Classification_GetList(hRes, resList, &resCount);

8a

Parse all classification results

peak_inference_result_classification* resultList = (peak_inference_result_classification*)resList;

for (size_t i = 0; i < resCount; i++)
{
 resultList[i].label
 resultList[i].score
}

4b

Object detection

if (result.type == PEAK_INFERENCE_TYPE_DETECTION)

5b

Get number of results

size_t resCount = 0;
status = peak_Inference_Result_Detection_GetList(hRes, NULL, &resCount);

6b

Allocate list for results

peak_inference_result_detection* resList = calloc(resCount, sizeof(peak_inference_result_detection));

7b

Get object detection results

status = peak_Inference_Result_Detection_GetList(hRes, resList, &resCount);

8b

Parse all object detection results

peak_inference_result_detection* resultList = (peak_inference_result_detection*)resList;

for (size_t i = 0; i < resCount; i++)
{
 resultList[i].label
 resultList[i].score
 resultList[i].rect.offset.x
 resultList[i].rect.offset.y
 resultList[i].rect.size.width
 resultList[i].rect.size.height
}

9

Free list

free(resList);

10

Release results

status = peak_Inference_Result_Release(hRes);

© 2024 IDS Imaging Development Systems GmbH