Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV with cuda

Hello, I am working on the TX2.

Actually, I have 5 images (6004*7920). Need to sum each pixel of the five images, in one, to calculate the average. For the first step, I use the function accumulate, i.e :

cv::Mat Image_Process = cv::Mat::zeros(height, width, CV_32FC1); ... cv::accumulate(img1, Image_Process) ; cv::accumulate(img2, Image_Process) ; cv::accumulate(img3, Image_Process) ; cv::accumulate(img4, Image_Process) ; cv::accumulate(img5, Image_Process) ; Image_Process = Image_Process/5 ;

That method is not very efficient ... Each accumulate function takes 50ms. Moreother, could explain why accumulate work only with CV_32FC1 ? (imgX are CV_8UC1)

To accelerate the process, I would like to send those images to the GPU, which will be faster. How can I send those images to GPU ? Furthermore, openCV can work with CUDA. Does accumulate function exist in CUDA ?

Thank you

click to hide/show revision 2
None

updated 2020-03-11 06:08:20 -0600

berak gravatar image

OpenCV with cuda

Hello, I am working on the TX2.

Actually, I have 5 images (6004*7920). Need to sum each pixel of the five images, in one, to calculate the average. For the first step, I use the function accumulate, i.e :

cv::Mat Image_Process = cv::Mat::zeros(height, width, CV_32FC1);
...
cv::accumulate(img1, Image_Process) ;
cv::accumulate(img2, Image_Process) ;
cv::accumulate(img3, Image_Process) ;
cv::accumulate(img4, Image_Process) ;
cv::accumulate(img5, Image_Process) ;
Image_Process = Image_Process/5 ;

;

That method is not very efficient ... Each accumulate function takes 50ms. Moreother, could explain why accumulate work only with CV_32FC1 ? (imgX are CV_8UC1)

To accelerate the process, I would like to send those images to the GPU, which will be faster. How can I send those images to GPU ? Furthermore, openCV can work with CUDA. Does accumulate function exist in CUDA ?

Thank you