Draw using NvOsd for custom parser

Spec:
DeepStream 4.0 (Docker)
GPU: 2080Ti

I would like to draw some simple lines using dummy data (that I kept in custom parser function). I want to know which function in NvOsd I have to change for drawing and where is this source cpp file. How to get those dummy data in nvosd?

Hi,
You may refer to sources/apps/sample_apps/deepstream-infer-tensor-meta-test/deepstream_infer_tensor_meta_test.cpp::osd_sink_pad_buffer_probe for how to get metadata, and below code could draw lines on the buffer,

NvOSD_LineParams *line_params  = display_meta->line_params;
display_meta->num_lines = 2;
line_params[0].x1 = 30;
line_params[0].y1 = 50;
line_params[0].x2 = 150;
line_params[0].y2 = 150;
line_params[1].x1 = 50;
line_params[1].y1 =  110;
line_params[1].x2 = 150;
line_params[1].y2 = 150;
line_params[0].line_width = 2;
line_params[0].line_color = (NvOSD_ColorParams){1.0, 0.0, 0.0, 0.5};
line_params[1].line_width = 2;
line_params[1].line_color = (NvOSD_ColorParams){1.0, 0.0, 0.0, 0.5};
1 Like