Opencv Copy Mat Data

I am trying to copy the data in a cv cuda gpumat to a uint8 t variable which is to be used in a kernel.
Opencv copy mat data. This post is about how to copy mat data to vector and copy vector data to mat. I researched with ptr and at methods available in opencv apis but i could not get proper data. Opencv data type change copy vector to mat mat to vector. I would like to have direct conversion from mat to array if available if not to vector.
Recently i have troubles finding opencv functions to convert from mat to array. Both the images will point to the same memory block. Returns element type similar to cv mat depth cvmat type. The umat instance should be kept alive during the use of the handle to prevent the buffer to be returned to the opencv buffer pool.
Returns deep copy of the matrix i e. The class mat tp is a thin template wrapper on top of the mat class. So the data layout in mat is fully compatible with cvmat iplimage and cvmatnd types from opencv 1 x. This is a key mechanism in opencv 2 that is accomplished by having the cv mat class implement reference counting and shallow copy.
It is also compatible with the majority of dense array types from the standard toolkits and sdks such as numpy ndarray win32 independent device bitmaps and others that is with any array that uses steps or strides to compute the. I am novice in opencv. Note don t forget to delete cv mat cv matvector and r the mat you get from matvector when you don t want to use them any more. But it has more applications for convolution operation zero padding etc.
Nor this class nor mat has any virtual methods. It does not have any extra data fields. The data is copied. Making borders for images padding if you want to create a border around the image something like a photo frame you can use cv copymakeborder function.
The gpumat contains an image data of resolution 752x480 and of type cv 8uc1.