Efficient conversion from Mat to GpuMat

asked Apr 16 '15

littlie gravatar image

Hi,

I am trying to convert Mat to GpuMat so that I can use GPU for processing.

I tried the following two ways:

GpuMat g; 
Mat m; 
1. g = GpuMat(m) -> takes around 2 ms 
2. g.upload(m)   -> takes roughly 1 ms.

I have around 10 Mat to be converted to GpuMat - the time just adds up, is there a quick and efficient way to do the conversion?

Thanks.

Preview: (hide)