Hi,
My L4t info:
R35 (release), REVISION: 4.1, GCID: 33958178, BOARD: t186ref, EABI: aarch64, DATE: Tue Aug 1 19:57:35 UTC 2023
VPI: NV_VPI_VERSION_STRING “2.3.9”
Recently, I experimented with using VPI for distortion correction,and it works. But I found that most of the time was spent on color space conversion. After did some test with VPI, i have some doubt about color convert with VPI.
I read a png file(1920*1080), and test convert the BGRA format mat to VPI_IMAGE_FORMAT_NV12_ER。
I ran CUDA and VIC 10 times respectively,and it takes longer than I expected.
Please give me some help, why it is so slow?
Run with VPI_BACKEND_VIC:
Run with VPI_BACKEND_CUDA:
VPIImage vimg = nullptr;
CHECK_STATUS(vpiStreamCreate(VPI_BACKEND_CUDA, &stream));
CHECK_STATUS(vpiImageCreate(width, height, VPI_IMAGE_FORMAT_NV12_ER, 0, &tmpIn));
// run this method, loop 10 times
void testConvertImageFormat(cv::Mat &cvImage) {
if (vimg == nullptr)
{
// Now create a VPIImage that wraps it.
CHECK_STATUS(vpiImageCreateWrapperOpenCVMat(cvImage, VPI_IMAGE_FORMAT_BGRA8, 0, &vimg));
}
else
{
CHECK_STATUS(vpiImageSetWrappedOpenCVMat(vimg, cvImage));
}
CHECK_STATUS(vpiSubmitConvertImageFormat(stream, VPI_BACKEND_CUDA, vimg, tmpIn, NULL));
CHECK_STATUS(vpiStreamSync(stream));