Hello,
I have a C++ code in which a helper function is called having four arguments of one value each, the first argument being a reference of the type GpuMat. Most of these arguments are passed to the second helper function as arguments, which is called from the first helper function, and its first argument is accepted as a reference to some other type, DevMem2Df, in this second helper function. From this second helper function, a kernel function is called. The code compiles fine, runs fine.
To make lesser number of calls to the kernel function, the first helper function needs to be taken out of the loop, in which, it is called, thereby the second, and thereby to the actual kernel function.
For this, I need to gather all values of the first argument into a vector. So, I have a vector of the type GpuMat. But in the second helper function, if I try to create a reference to the vector of a different data type, it throws an error saying,
“error: invalid initialization of reference of type const std::vector<cv::gpu::DevMem2D_ >& from expression of type const std::vectorcv::gpu::GpuMat”
I do not understand how to get over this problem. Please help.