complete information .
• Hardware Platform (Jetson / GPU) Jetson NX
• DeepStream Version 6.1.1
• JetPack Version (valid for Jetson only) 5.02
• TensorRT Version 8.4.15
I want to set the preprocess roi-params adaptive to variable images.
so, firstly I need to access a gray fram from gstbuffer.
in this function:
/* Process entire frames in the batched buffer. */
static GstFlowReturn
gst_nvdspreprocess_on_frame (GstNvDsPreProcess * nvdspreprocess, GstBuffer * inbuf,
NvBufSurface * in_surf)
{…
NvBufSurfaceMap (in_surf, i, 0, NVBUF_MAP_READ);
// sync mapped data for CPU access
NvBufSurfaceSyncForCpu (in_surf, i, 0);
cv::Mat nv12_frame(h0 * 3 / 2, w0, CV_8UC1, in_surf->surfaceList[i].mappedAddr.addr[0]);
// Convert NV12 frame to grayscale
cv::Mat gray_frame;
cv::cvtColor(nv12_frame, gray_frame, cv::COLOR_YUV2GRAY_NV12);
…
after running, I found the result is not correct.
Please tell me what’s the problem.
Thank you.