About opencv performance low in iMX8qxp

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

About opencv performance low in iMX8qxp

1,397 次查看
yibhan
Contributor III

 

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

 

0 项奖励
回复
2 回复数

1,389 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello yibhan,

You should try the latest BSP 5.15, is give you better perfomance in Opencv and in GPU in general, per you error it looks like you have not activated the GPU, while the GPU is enable by default.

Regards

0 项奖励
回复

1,378 次查看
yibhan
Contributor III

Hi,

Thank you for answering, 

I have other questions:

1. When using g2d api, is there any way to check if it is working correctly?

2. As the opencv api is used, the overall peformance is low. Is there any other way to improve this other than upgrading to bsp 5.15?

 

0 项奖励
回复