diff --git a/ini/host_stream.ini b/ini/host_stream.ini index 5ce55ab..e164066 100644 --- a/ini/host_stream.ini +++ b/ini/host_stream.ini @@ -19,7 +19,8 @@ GetImageBufMode = 0 # 0: block mode 1: non-block mode RoiEnable = 0 # Enable ROI for nnm detect RoiX = 0 # ROI start x RoiY = 0 # ROI start y -DrawBoxEnable = 0 # draw object bounding box on stream0 (also enables STDC seg overlay) +DrawBoxEnable = 1 # draw object bounding box on stream0 (also enables STDC seg overlay) +SegOverlayEnable = 0 # 0: outline only, 1: also paint per-class colour overlay (requires DrawBoxEnable=1) OnlyPerson = 1 # only draw person bounding box when DrawBoxEnable #(so far for yolo only, JobId = 11) DrawOnResize = 0; # If InferenceStream is 0. This setting needs to be enabled. The box will be drawn on all resize streams. diff --git a/src/host_stream/kdp2_host_stream.c b/src/host_stream/kdp2_host_stream.c index 3b2984b..5a061ba 100644 --- a/src/host_stream/kdp2_host_stream.c +++ b/src/host_stream/kdp2_host_stream.c @@ -99,6 +99,7 @@ float g_fHeightRatio = 1.0; EIS_T g_tEis; unsigned int g_dwDrawBoxType = 0; //! 0: isp primary mask, 1: dma static unsigned int g_dwDrawOnResize = 0; +extern unsigned int g_dwSegOverlayEnable; /* defined in kp_firmware.c */ int g_iTerminate = 0; bool _blRecvRunning = true; @@ -863,8 +864,9 @@ void* kdp2_host_stream_draw_box(void *arg) need_flush = 1; } - /* Paint STDC segmentation colour overlay (50% alpha blend into YM12) */ - if (g_stdc_seg_w > 0) { + /* Paint STDC segmentation colour overlay (50% alpha blend into YM12). + * Requires SegOverlayEnable=1 in host_stream.ini (default 0 = outline only). */ + if (g_dwSegOverlayEnable && g_stdc_seg_w > 0) { stdc_paint_seg_overlay(tWriterSsmBuffer.buffer, &vsrc_ssm_reader_info, dwWidth, dwHeight); need_flush = 1; diff --git a/src/host_stream/kp_firmware.c b/src/host_stream/kp_firmware.c index 0e08879..5bb4c23 100644 --- a/src/host_stream/kp_firmware.c +++ b/src/host_stream/kp_firmware.c @@ -77,6 +77,7 @@ unsigned int g_dwVocEnable = 0; unsigned int g_dwVocPixFmt = 0; unsigned int g_dwOnlyPerson = 0; unsigned int g_dwDrawBoxEnable = 0; +unsigned int g_dwSegOverlayEnable = 0; /* 1: paint per-class colour overlay; 0: outline only */ unsigned int g_verbose_log = 0; /* 0=quiet, 1=per-frame class ratio log (web UI toggle) */ bool _blMainStanby = true; @@ -154,6 +155,7 @@ int loadConfig(HOST_STREAM_INIT_OPT_T* pHostStreamInit) pHostStreamInit->dwOnlyPerson = iniparser_getint(ini, "nnm:OnlyPerson", 0); g_dwOnlyPerson = pHostStreamInit->dwOnlyPerson; g_verbose_log = (unsigned int)iniparser_getint(ini, "nnm:verbose_log", 0); + g_dwSegOverlayEnable = (unsigned int)iniparser_getint(ini, "nnm:SegOverlayEnable", 0); pHostStreamInit->dwDrawOnResize = iniparser_getint(ini, "nnm:DrawOnResize", 0); if (pHostStreamInit->bDrawBoxEnable && (pHostStreamInit->dwInferenceStream == 0) && (pHostStreamInit->dwDrawOnResize == 0)) { pHostStreamInit->dwDrawOnResize = 1;