工具/软件:
我正在使用 vx_app_single_cam 应用、但对其进行了修改。 流水线如下所示、当我使用来自 TDa4 的文件运行该应用时、它运行正常。 但当应用程序运行摄像头时、当我想使用输入“x"退出“退出应用程序时、该过程将阻止记录输出。
主要流程:
vx_status app_run_graph (AppObj *obj)
{
Vx_STATUS 状态= Vx_Success;
Vx_Uint32 I;
vx_uint32 frm_loop_cnt;
// vx_uint32 num_refs_out;
STATUS = APP_PARIL_PAIPUUP (OBJ);
/*
应用程序读取并处理相同的图像“frm_loop_cnt"次“次
输出可能会发生变化、因为在 VISS 中、参数会根据 AEWB 结果每帧更新一次
AEWB 结果在 1 帧之后可用、并在 2 帧之后应用
因此、前 2 个输出图像将具有错误的颜色
*/
frm_loop_cnt = obj->num_frams_to_run;
frm_loop_cnt += obj->num_cap_buf;
if (obj->is_interactive )
{
/*在交互模式循环中为 ever */
frm_loop_cnt = 0xFFFFFFFF;
}
#ifdef A72
#if defined (Linux)
appDccUpdatefromFS (obj->sensor_name、obj->sensor_WDR_mode、
obj->node_aewb、0、
obj->node_viss, 0,
obj->node_LDC、0、
obj->context);
#endif
#endif
对于 (i = 0;i < frm_loop_cnt;i++)
{
appPerfPointBegin(&obj->total_perf);
status = app_pipeline_run (obj、i);
appPerfPointEnd (&obj->total_perf);
if ((obj->stop_task)||(status != Vx_success))
{
休息;
}
}
IF (STATUS == Vx_Success)
{
状态= vxWaitGraph (obj->graph);
}
/*关闭管道时取消 buf */
#if 0
for (buf_id=0;buf_id num_CAP_buf-2;buf_id++)
{
APP_printf(“取消捕获#%d...\n“、buf_id);
graph_parameter_num = 0;
vxGraphParameterDequeueDoneRef (obj->graph、graph_parameter_num、(vx_reference*)&out_capture_frames、1、&num_refs_capture);
Graph_parameter_num++;
}
#endif
IF (STATUS == Vx_Success)
{
状态= appStopImageSensor (obj->sensorObj.sensor_name、obj->sensorObj.ch_mask);
}
返回状态;
}
子功能:
vx_status app_pipele_pipeup (AppObj *obj)
{
Vx_STATUS 状态= Vx_Success;
vx_char input_file_name[APP_MAX_FILE_PATH];
if (obj->camera_input_flag)
{
Status = appStartImageSensor (obj->sensorObj.sensor_name、obj->sensorObj.ch_mask);
对于 (int i = 0;i < obj->num_cap_buf;i++)
{
status = vxGraphParameterEnqueueReadyRef (obj->graph、0、(vx_reference *)&(obj->captureObj.raw_image_arr[i])、1);
}
printf(“[APP-MOUDLE]图形输入参数捕获节点排队。\n“);
}
暴露
{
//从目标上的文件输入图像
snprintf (input_file_name、app_MAX_FILE_PATH、“%s/%010d.YUV",“,obj->inputImageObj.input_file_path、obj->inputImageObj.input_file_path、100);
readScalerInput (input_file_name、obj->inputImageObj.input_image_array、app_modules_read_file、0);
status = vxGraphParameterEnqueueReadyRef (obj->graph、0、(vx_reference *)&(obj->inputImageObj.input_image_array)、1);
printf(“[APP-MOUDLE]图形输入参数来自文件的输入图像进入队列。\n“);
}
if (obj->enable_det_label_output)
{
status = vxGraphParameterEnqueueReadyRef (obj->graph、1、(vx_reference *)&(obj->odtidlObj.output_tensor_arr[0])、1);
printf(“[app-modle] graph output parametre odtidl tensor is enqueed.\n“);
}
返回状态;
}
vx_status app_pipeline_run (appObj *obj、vx_uint32 frm_cnt)
{
Vx_STATUS 状态= Vx_Success;
vx_char input_file_name[APP_MAX_FILE_PATH];
静态 vx_uint32 file_index = 0;
// vx_image image_in = NULL;
vx_uint32 num_refs_in;
if (obj->camera_input_flag)
{
status = vxGraphParameterDequeueDoneRef(obj->graph,
0、
(vx_reference *)&(obj->captureObj.raw_image_arr[0])、1、
&num_refs_in);
}
暴露
{
status = vxGraphParameterDequeueDoneRef (obj->graph、0、(vx_reference *)&(obj->inputImageObj.input_image_array)、1、&num_refs_in);
}
if (obj->enable_det_label_output)
{
status = vxGraphParameterDequeueDoneRef (obj->graph、1、(vx_reference *)&(obj->odtidlObj.output_tensor_arr[0])、1、&num_refs_in);
IF (STATUS == Vx_Success)
{
status = app_get_od_lable(“od_label",“,obj->odtidlObj.output_tensor_ar[0]、obj->odtidlObj.output_tensor_ar[0]、obj->drawDetectionObj);
}
}
if(!obj->camera_input_flag)
{
snprintf (input_file_name、app_MAX_FILE_PATH、“%s/%010d.YUV",“,obj->inputImageObj.input_file_path、obj->inputImageObj.input_file_path、file_index + 101);
readScalerInput (input_file_name、obj->inputImageObj.input_image_array、app_modules_read_file、0);
}
// vx_object_array image_arr = vxCreateObjectArray (obj->context、(vx_reference) obj->imgMosaicObj.output_image[0]、0);
// snprintf (YUV_nv12_image_fname_1、MAX_FNAME、“%s%04d.YUV",“,"scaler_1_"、"scaler_1_",“,file_index“file_index)、);
// snprintf (YUV_nv12_image_fname_2、MAX_FNAME、“%s%04d.YUV",“,"scaler_2_"、"scaler_2_",“,file_index“file_index)、);
// snprintf (DOF_RGB、MAX_FNAME、“%s%04d.ppm",“,"dofrgb_1_"、"dofrgb_1_",“,file_index“file_index)、);
// snprintf (DOF_FICILD、MAX_FNAME、“%s%04d.PGM",“,"dofconf_1_"、"dofconf_1_",“,file_index“file_index)、);
//// snprintf(检测,MAX_FNAME、“%s%04d.YUV",“,"detec_1_"、"detec_1_",“,file_index“file_index)、);
// snprintf (pyra_l0、MAX_FNAME、“%s%04d.bmp",“,"bilmot_l0_"、"bilmot_l0_",“,file_index“file_index)、);
// snprintf (pyra_L1、MAX_FNAME、“%s%04d.bmp",“,"pyram_L1_"、"pyram_L1_",“,file_index“file_index)、);
// snprintf (pyra_L2、MAX_FNAME、“%s%04d.bmp",“,"pyram_l2_"、"pyram_l2_",“,file_index“file_index)、);
// snprintf (pyra_L3、MAX_FNAME、“%s%04d.bmp",“,"pyram_l3_"、"pyram_l3_",“,file_index“file_index)、);
// snprintf (post_od_name、MAX_FNAME、“%s%04d",“,"post_od_"、"post_od_",“,file_index“file_index)、);
// snprintf (draw_detection、MAX_FNAME、“%s%04d.YUV",“,"drap_od_"、"drap_od_",“,file_index“file_index)、);
#if 0
//写入金字塔输出
vx_object_array 金字塔_array = NULL;
VX 金字塔;
Pyram_array =(vx_object_array) vxGetReferenceFromDelay (obj->PyramidObj.Pyram_delay、0);
Pyramid =(vx_Pyram)vxGetObjectArrayItem ((vx_object_array) Pyram_array、0);
writePyramidOutput (pyra_l0、金字塔、0);
writePyramidOutput (pyra_L1、金字塔、1);
writePyramidOutput (pyra_L2、金字塔、2);
writePyramidOutput (pyra_L3、金字塔、3);
vxReleasePyramid(&Pyramid);
vxReleaseObjectArray (&bally_array);
#endif
#if 0
writeDofVizRGBOutput (DOF_RGB、obj->dofvizObj.flow_vector_field_img[0]);
writeDofVizConfidenceOutput (DOF_Confidence、obj->dofvizObj.Confidence_img[0]);
#endif
#if 0
writeScalerOutput (YUV_nv12_image_fname_1、obj->scalerObj.output[0].arr);
writeScalerOutput (YUV_nv12_image_fname_2、obj->scalerObj.output[1].arr);
writeScalerOutput (draw_detection, obj->drawDetectionObj.output_image_arr);
#endif
printf(“[frame-count]:%d .\n“、frm_cnt);
/*获取已消耗的输入参考,等待引用可用
*/
/*回收排队的输入和输出引用“loop_cnt"次“次*/
// if (i < frm_loop_cnt)
//{
if (obj->camera_input_flag)
{
status = vxGraphParameterEnqueueReadyRef (obj->graph、0、(vx_reference *)&(obj->captureObj.raw_image_arr[0])、1);
}
暴露
{
status = vxGraphParameterEnqueueReadyRef (obj->graph、0、(vx_reference *)&(obj->inputImageObj.input_image_array)、1);
}
if (obj->enable_det_label_output && status == Vx_Success)
{
status = vxGraphParameterEnqueueReadyRef (obj->graph、1、(vx_reference *)&(obj->odtidlObj.output_tensor_arr[0])、1);
}
//}
file_index++;
返回状态;
}
此致、
郑 CB

