I am working with VPI.
I run the following code on ORIN, but get an error. I don’t know why. can somebody help me?
VPI_ERROR_INVALID_ARGUMENT: Plane row stride must be greater or equal row length in bytes
int w_img = 480;
int h_img = 270;
VPIImage imgInput = NULL;
VPIImageData imgData;
memset(&imgData, 0, sizeof(imgData));
imgData.bufferType = VPI_IMAGE_BUFFER_HOST_PITCH_LINEAR;
imgData.buffer.pitch.format = VPI_IMAGE_FORMAT_NV12;
imgData.buffer.pitch.numPlanes = 2;
imgData.buffer.pitch.planes[0].width = w_img;
imgData.buffer.pitch.planes[0].height = h_img;
imgData.buffer.pitch.planes[0].pitchBytes = w_img;
imgData.buffer.pitch.planes[0].data = dst.data;
imgData.buffer.pitch.planes[1].width = w_img;
imgData.buffer.pitch.planes[1].height = h_img/2;
imgData.buffer.pitch.planes[1].pitchBytes = w_img;
imgData.buffer.pitch.planes[1].data = dst.data + (w_img*h_img);
CHECK_STATUS(vpiImageCreateWrapper(&imgData, nullptr, 0, &imgInput));
where dst is opencv Mat