Best way to plot multiples Rectangles / Error drawing multiples rectangles

I’m triyng to plot 20 rectangles in deepstream_app_main.c in function overlay_graphics and i received this error: $libnvosd (209):(ERROR) : Unsupported border width

Please,could you explain how draw rectangles dynamically?

My code:

NvOSD_RectParams rect_params = &display_meta->rect_params;

/
Plot 20 Rects /
for ( int j=0; j < 20; j++ )
{
rect_params[j].left = j
10;
rect_params[j].top = j*5;
rect_params[j].width = 10;
rect_params[j].height = 10;
rect_params[j].border_width = 2;
rect_params[j].border_color = (NvOSD_ColorParams){0.0, 1.0, 0.0, 1.0};
display_meta->num_rects ++;
}

Thank you !!!

HI
After change your code a little and test with sample sources/apps/sample_apps/deepstream-infer-tensor-meta-test/deepstream_infer_tensor_meta_test.cpp:: osd_sink_pad_buffer_probe, it run well, you can change yours accordingly
with deepstream-app

NvOSD_RectParams rect_params = display_meta->rect_params;

/
Plot 10 Rects /
for ( int j=0; j < 10; j++ )
{
rect_params[j].left = j
10;
rect_params[j].top = j*5;
rect_params[j].width = 10;
rect_params[j].height = 10;
rect_params[j].border_width = 2;
rect_params[j].border_color = (NvOSD_ColorParams){0.0, 1.0, 0.0, 1.0};
display_meta->num_rects ++;
}

Thanks for you reply !!

Im tried on /sources/apps/sample_apps/deepstream-app/deepstram_app_main.c

line 608, after draws

NvOSD_RectParams rect_params = display_meta->rect_params;

/
Plot 20 Rects /
for ( int j=0; j < 20; j++ )
{
rect_params[j].left = j
10;
rect_params[j].top = j*5;
rect_params[j].width = 10;
rect_params[j].height = 10;
rect_params[j].border_width = 2;
rect_params[j].border_color = (NvOSD_ColorParams){0.0, 1.0, 0.0, 1.0};
display_meta->num_rects ++;
}

when i use more than 16 rects the application crash and the return is:
Segmentation fault (core dumped)

How i can debug this error?

thanks!

Can you paste your deepstram_app_main.c for a local repro? and Did you just modify this file, right?

I has modified other files, but i tested with original files and application crash again.
The application works fine when the number of rectangles is less than 16!
I has tested so much and i think this is a bug!

This error has passed in you test?

thank you very much !!!

HI
Sorry for a late reply, User can draw maximum upto 16 rectangles for 1 “display_meta”. If user wants to draw more than 16 then needs to acquire additional “display_meta” and add remaining rectangles to it.

Thank you very much, its works !!! :)