Hello Everyone ,
I recently encountered some issues while using Opencv cuda::class.
I upload 4 images of size 19481096 CV_8UC3 to the GPU for operations such as remap and binarization, and eventually obtain 12 images of size 19481096 CV_8UC1 to be downloaded back to the CPU for further processing.
If I’m not mistaken, the amount of data to be processed should be the same for uploading and downloading.
However, there is a huge difference in the speed of these two operations, with uploading taking about 4-5 ms and downloading taking about 30 ms.
Did I do something wrong?
Any suggestions?
Thanks in advance.
Here is part of my code
img_0.upload(tmp_0 , stream_0);
img_1.upload(tmp_1 , stream_1);
img_2.upload(tmp_2 , stream_2);
img_3.upload(tmp_3 , stream_3);
/*
Do some image processing
*/
mask_blue_0.download(imgThresholded_blue_0 , stream_download_blue_0 );
mask_blue_1.download(imgThresholded_blue_1 , stream_download_blue_1 );
mask_blue_2.download(imgThresholded_blue_2 , stream_download_blue_2 );
mask_blue_3.download(imgThresholded_blue_3 , stream_download_blue_3 );
mask_pink_0.download(imgThresholded_pink_0 , stream_download_pink_0 );
mask_pink_1.download(imgThresholded_pink_1 , stream_download_pink_1 );
mask_pink_2.download(imgThresholded_pink_2 , stream_download_pink_2 );
mask_pink_3.download(imgThresholded_pink_3 , stream_download_pink_3 );
mask_green_0.download(imgThresholded_green_0 , stream_download_green_0 );
mask_green_1.download(imgThresholded_green_1 , stream_download_green_1 );
mask_green_2.download(imgThresholded_green_2 , stream_download_green_2 );
mask_green_3.download(imgThresholded_green_3 , stream_download_green_3 );