User Manual

- 38 -
roi_conf1.roi_id = 0;
roi_conf1.left_top_x = 10;
roi_conf1.left_top_y = 10;
roi_conf1.right_bottom_x = 30;
roi_conf1.right_bottom_y = 20;
HPS3D_SetROIRegion(&handle, roi_conf1);
roi_conf2.roi_id = 2;
roi_conf2.left_top_x = 40;
roi_conf2.left_top_y = 30;
roi_conf2.right_bottom_x = 80;
roi_conf2.right_bottom_y = 50;
HPS3D_SetROIRegion(&handle, roi_conf2);
/*set ROI enable*/
HPS3D_SetROIEnable(&handle, 0, true);
HPS3D_SetROIEnable(&handle, 2, true);
/*set ROI threshold enable*/
HPS3D_SetROIThresholdEnable(&handle, 0, 2, true);
HPS3D_SetROIThresholdEnable(&handle, 2, 1, true);
/*set ROI threshold config*/
hysteresis_conf1.threshold_value = 20;
hysteresis_conf1.hysteresis = 100;
hysteresis_conf1.positive = true;
HPS3D_SetROIThresholdConf(&handle, 0, 2, 60, hysteresis_conf1);
hysteresis_conf2.threshold_value = 30;
hysteresis_conf2.hysteresis = 200;
hysteresis_conf2.positive = false;
HPS3D_SetROIThresholdConf(&handle, 2, 1, 70, hysteresis_conf2);
/*get ROI config param*/
HPS3D_GetROIConfById(&handle, 0, &roi_conf1);
HPS3D_GetROIConfById(&handle, 2, &roi_conf2);
/*roi_id = 0, threshold_id = 2*/
printf
("roi_conf1.roi_id = %d\n", roi_conf1.roi_id);
printf
("roi_conf1.enable = %d\n", roi_conf1.enable);
printf
("roi_conf1.left_top_x = %d\n", roi_conf1.left_top_x);
printf
("roi_conf1.left_top_y = %d\n", roi_conf1.left_top_y);
printf
("roi_conf1.right_bottom_x = %d\n", roi_conf1.right_bottom_x);
printf
("roi_conf1.right_bottom_y = %d\n", roi_conf1.right_bottom_y);