Revision history [back]

GpuMat and std::vector

Hi all,

what is the appropriate way to store GpuMats in a container. So far I'm using std::vector<cv::gpu::gpumat> But I'm wondering how the GpuMats are stored in the vector. Does the vector create copies of the matrices on the GPU memory? If so, it's probably not very efficient. What would be the best solution? Would it make more sense to use std::vector<cv::gpumat> or better std::vector < boost::shared_ptr <cv::gpu::gpumat> > ?

Cheers, Andreas

GpuMat and std::vector

Hi all,

what is the appropriate way to store GpuMats in a container. So far I'm using std::vector<cv::gpu::gpumat> But I'm wondering how the GpuMats are stored in the vector. Does the vector create copies of the matrices on the GPU memory? If so, it's probably not very efficient. What would be the best solution? Would it make more sense to use std::vector<cv::gpumat> std::vector<cv::gpu::gpumat*> or better std::vector < boost::shared_ptr <cv::gpu::gpumat> > ?

Cheers, Andreas

 3 No.3 Revision Kirill Kornyakov 2792 ●13 ●25 ●52

GpuMat and std::vector

Hi all,

what is the appropriate way to store GpuMats in a container. So far I'm using std::vector<cv::gpu::gpumat> std::vector<cv::gpu::GpuMat> But I'm wondering how the GpuMats are stored in the vector. Does the vector create copies of the matrices on the GPU memory? If so, it's probably not very efficient. What would be the best solution? Would it make more sense to use std::vector<cv::gpu::gpumat*> std::vector<cv::gpu::GpuMat*> or better std::vector < boost::shared_ptr <cv::gpu::gpumat> > <cv::gpu::GpuMat> > ?

Cheers, Andreas