I am using the OpenCV T-API to get my OpenCV stuff executed on the GPU, if available. I have a function that gets memory buffer, I read that into a Mat, convert it to a cv::UMat
and perform my changes. This works pretty good, the processing speeds up by a factor of 3 to 10, depends on what processing I do. This helped me a lot, since I want to change a camera Image in real-time and it raised my FPS count significantly.
However, I need to get the data back into memory for it to be displayed on screen, so I need to copy the data back to memory, and I was shocked how slow that is. It actually takes 15 times longer that copying the image into the UMat. I am using the cv::UMat::getMat()
method in cv::UMat
, is there any other way that would speed this up?
Also, I need to write the image data into to a specific memory address. When I use cv::UMat::getMat()
, a new cv::Mat
is created, together with the data buffer and I have to copy the data to the desired address. Is there a way to write the data directly from the cv::UMat
to the address?
Would it be faster if I used OpenCL directly instead of using the OpenCV transparent API?