I am mapping an NvBuffer to an opencv as follows:
Mat input_frame;
NvBufferMemMap(input_dmabufs_.back(), 0, NvBufferMem_Read, &pdata);
NvBufferMemSyncForCpu(input_dmabufs_.back(), 0, &pdata);
cv::Mat imgbuf = cv::Mat(input_frame_height_,
input_frame_width_,
CV_8UC4, pdata);
cvtColor(imgbuf, imgbuf, cv::COLOR_RGBA2BGR);
NvBufferMemUnMap(input_dmabufs_.back(), 0, &pdata);
I then do some processing on the frame with opencv.
Now I would like to transform the processed opencv image back to a NvBuffer. How can this be done?