 
IDS Peak comfortSDK, genericSDK, IPL, and AFL developer manuals are external documents. Please contact us if you need them.
Fig. 327: AI-assisted image processing in IDS peak (acquisition thread)
| 1 | Process frame with CNN | peak_inference_result_handle hRes = PEAK_INVALID_HANDLE; | 
|---|---|---|
| 2 | Getting inference results | peak_inference_result_data result = { PEAK_INFERENCE_TYPE_INVALID, PEAK_INVALID_HANDLE, 0, 0 }; ► result.preprocessing_time_us | 
| 3 | Get general statistics | peak_inference_statistics statistics; ► statistics.numInferencesSuccessful | 
| 4a | Classification | if (result.type == PEAK_INFERENCE_TYPE_CLASSIFICATION) | 
| 5a | Get number of results | size_t resCount = 0; | 
| 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++) | 
| 4b | Object detection | if (result.type == PEAK_INFERENCE_TYPE_DETECTION | 
| 5b | Get number of results | size_t resCount = 0; | 
| 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++) | 
| 9 | Free list | free(resList); | 
| 10 | Release results | status = peak_Inference_Result_Release(hRes); |