You can download gpu_descriptors
to CPU memory using gpu::GpuMat
memeber function download()
, as follows:
Mat cpu_descriptors;
gpu_descriptors.download(cpu_descriptors);
However, the descriptors may be stored differently on the GPU than on CPU, that is cpu_descriptors
may not be exactly the same as descriptors
computed in your code above. But you can give it a try.
Edit
There doesn't seem to be a method to download descriptors to CPU memory in vector<float>
format for gpu::HOGDescriptor
. As a side note, I know that you can download descriptors for gpu::SURF_GPU
feature detector, using it's member function
void downloadDescriptors(const GpuMat& descriptorsGPU,
vector<float>& descriptors);
which is exactly what you want. But, unfortunately, for some reason this function doesn't exist for cv::gpu::HOGDescriptor
. You can attempt to figure out how the data is stored in vector<float>
type of descriptors and then try to convert from Mat
to vector<float>
format.