Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
Closed
Labels
Milestone
Description
- OpenCV => 4.5.0
- Operating System / Platform => Linux, Windows
- Compiler => any C++
Detailed description
In image preprocessing and postprocessing tasks for neural networks, the transpose operation is often used, for example, from theNumPy library:img.transpose(1, 2, 0). Unfortunately, when we work in C++, we have no way to repeat this operation using OpenCV in one step. As a workaround, I use reshaping and memory copying, which reduces performance a lot.
I think it is possible to implement this since this ability already exists inhttps://docs.opencv.org/master/d2/d3c/classcv_1_1dnn_1_1PermuteLayer.html
Steps to reproduce
cv::Mat frame = cv::imread(img_path);cv::cuda::GpuMatgpu_frame(frame), result;cv::cuda::transpose(gpu_frame, result);
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc