cpu: imx8qxp
kernel ver: linux 5.4.70
opencv library : involved
I am implementing the camera image processing function with opencv. For details, it converts the image to a specific location.
To implement such a function, use the opencv warpaffine function, and use g2d_buffer to
We are passing the camera image to opencv cv::Mat .
By the way, only in the opencv warpaffine function, it takes about 300ms of time.
I use g2d_buffer to avoid memory copy, but it may be because the usage is not correct,
It seems that there may be other causes.
Below is the code.
/* memory alloc g2d_buffer */
buf->g2d = g2d_alloc(1920*1080*2, 0);
imgstb->image_buffer[index].vaddr = buf->g2d->buf_vaddr;
imgstb->cvMat.frame.data = (uchar *)((unsigned long)imgstb->image_buffer[INDEX].vaddr);
imgstb->cvMat.rot = cv::getRotationMatrix2D(cv::Point(imgstb->cvMat.frame.cols/2, imgstb->cvMat.frame.rows/2), -15/*-delt_r*/, 1 );
cv::warpAffine(imgstb->cvMat.frame, imgstb->cvMat.frame, imgstb->cvMat.rot, imgstb->cvMat.frame.size());
Questions
: Is there a way to check if the actual g2d_buffer is working properly?
: Is there any way to increase the processing speed of opencv function in imx8qxp?
: I know that opencv runs on the cpu by default for nxp cpu. To make this happen on the gpu
What should I do?
Thank you for reading