Tool/software:
Hello TI experts,
I'm implementing a custom tidl application referring to app_tidl_od_cam & app_tidl_od demo applications.
The application receives nv12 images captured from another application which runs alongside.
The pipeline is as below
Received NV12 image -> Scaler Node --> (Output1) TIDL Node -> DrawDetections Node -> Mosaic Node -> Display Node
| |
--> (Output2) ------------------
And the display is very weired, it looks like somehow the DrawDetection Node processes buffers with wrong index.
If I change the flow as the input of DrawDetection Node goes directly to Display Node, the display works find.
Received NV12 image -> Scaler Node --> (Output1) TIDL Node -> DrawDetections Node -> Mosaic Node
|
--> (Output2) ----------------> Display Node
So I guess the output of scaler is okay, but somewhere in DrawDetection Node might have problem.
Here is the relevant code snippit below. (used kernel module APIs from vision_apps/modules and app_tidl_od_cam)
static vx_status app_init(AppObj *obj)
{
vx_status status = VX_SUCCESS;
/* Create OpenVx Context */
obj->context = vxCreateContext();
status = vxGetStatus((vx_reference) obj->context);
if(status == VX_SUCCESS)
{
tivxHwaLoadKernels(obj->context);
tivxImgProcLoadKernels(obj->context);
tivxTIDLLoadKernels(obj->context);
tivxVideoIOLoadKernels(obj->context);
}
/* Initialize modules */
app_init_scaler(obj->context, &obj->scalerObj, "scaler_obj", 1, 2);
app_init_tidl(obj->context, &obj->tidlObj, "tidl_obj", 1);
app_update_pre_proc(obj->context, &obj->preProcObj, obj->tidlObj.config, 1);
app_init_pre_proc(obj->context, &obj->preProcObj, "pre_proc_obj");
app_update_draw_detections(&obj->drawDetectionsObj, obj->tidlObj.config);
app_init_draw_detections(obj->context, &obj->drawDetectionsObj, "draw_detections_obj", 1);
app_init_img_mosaic(obj->context, &obj->imgMosaicObj, "img_mosaic_obj", 4);
app_init_display(obj->context, &obj->displayObj, "display_obj");
return status;
}
static vx_status app_create_graph(AppObj *obj)
{
vx_status status = VX_SUCCESS;
vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[2];
vx_int32 graph_parameter_index;
obj->graph = vxCreateGraph(obj->context);
status = vxGetStatus((vx_reference)obj->graph);
vxSetReferenceName((vx_reference)obj->graph, "app_tidl_od_cam_graph");
app_create_graph_scaler_single(obj->context, obj->graph, &obj->scalerObj, obj->imgs[0]);
app_create_graph_pre_proc(obj->graph, &obj->preProcObj, obj->scalerObj.output[0].arr);
app_create_graph_tidl(obj->context, obj->graph, &obj->tidlObj, obj->preProcObj.output_tensor_arr);
status = app_create_graph_draw_detections(obj->graph, &obj->drawDetectionsObj, obj->tidlObj.output_tensor_arr[0], obj->scalerObj.output[1].arr);
obj->draw_detect_output_img = (vx_image)vxGetObjectArrayItem((vx_object_array)obj->drawDetectionsObj.output_image_arr, 0);
vx_int32 idx = 0;
obj->imgMosaicObj.input_arr[idx++] = obj->drawDetectionsObj.output_image_arr;
obj->imgMosaicObj.num_inputs = idx;
app_create_graph_img_mosaic(obj->graph, &obj->imgMosaicObj, NULL);
//obj->display_image = (vx_image)vxGetObjectArrayItem(obj->scalerObj.output[1].arr, 0);
obj->display_image = obj->draw_detect_output_img;
//obj->display_image = obj->imgMosaicObj.output_image[0];
status = app_create_graph_display(obj->graph, &obj->displayObj, obj->display_image);
if(status == VX_SUCCESS)
{
graph_parameter_index = 0;
add_graph_parameter_by_node_index(obj->graph, obj->scalerObj.node, 0);
obj->scalerObj.graph_parameter_index = graph_parameter_index;
graph_parameters_queue_params_list[graph_parameter_index].graph_parameter_index = graph_parameter_index;
graph_parameters_queue_params_list[graph_parameter_index].refs_list_size = obj->imgs_num;
graph_parameters_queue_params_list[graph_parameter_index].refs_list = (vx_reference*)&obj->imgs[0];
graph_parameter_index++;
vxSetGraphScheduleConfig(obj->graph,
VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO,
graph_parameter_index,
graph_parameters_queue_params_list);
tivxSetGraphPipelineDepth(obj->graph, APP_PIPELINE_DEPTH);
tivxSetGraphPipelineDepth(obj->graph, 5);
tivxSetNodeParameterNumBufByIndex(obj->scalerObj.node, 1, 4);
tivxSetNodeParameterNumBufByIndex(obj->scalerObj.node, 2, 4);
printf("Pipeline params setup done!\n");
}
return status;
}
Could you please let me know what causes the problem?
Regards,
Juhyun