I hope to make ROI so I did test by using NvOSD_LineParams
I think it’s hard to make ROI I want and everytime this line blinks if I used NvOSD_LineParams in Jetson Nano, not Jetson AGX Xavier
so I hope to make ROI Plugin (Element) by using openCV
now I am making new PlugIn so now refer to dsexmple PlugIn source
everytime I tried to insert my putText or drawContours into dsexample
my deepstream I made is not working propery but it’s working well if not define JETSON_NANO
How do I insert line or text not using NvOSD_TextParams and NvOSD_RectParams and NvOSD_LineParams ?
because I don’t want to use Rectangle
static GstFlowReturn
get_converted_mat (GstDsExample * dsexample, NvBufSurface *input_buf, gint idx,
NvOSD_RectParams * crop_rect_params, gdouble & ratio, gint input_width,
gint input_height)
...............
// Cache the mapped data for CPU access
NvBufSurfaceSyncForCpu (dsexample->inter_buf, 0, 0);
// Use openCV to remove padding and convert RGBA to BGR. Can be skipped if
// algorithm can handle padded RGBA data.
in_mat =
cv::Mat (dsexample->processing_height, dsexample->processing_width,
CV_8UC4, dsexample->inter_buf->surfaceList[0].mappedAddr.addr[0],
dsexample->inter_buf->surfaceList[0].pitch);
#if defined(JETSON_NANO) // installed /opt/nvidia/deepstream/deepstream-4.0/lib/gst-plugins/ after build this plugin
{
using namespace std;
using namespace cv;
string label = "Testing Text Rendering";
cv::Point center;
double font_scale = 0.5;
Scalar font_color(0, 0, 255);
int line_thickness = 2;
int font=FONT_HERSHEY_SCRIPT_SIMPLEX;
center.x = 10;
center.y = 40;
cv::putText(in_mat,
label,
center,
font,
font_scale,
font_color,
line_thickness);
}
#endif
cv::cvtColor (in_mat, *dsexample->cvmat, CV_RGBA2BGR);
if (NvBufSurfaceUnMap (dsexample->inter_buf, 0, 0)){
goto error;
}