In my programs so far I have been using
cv::Mat h_image = cv::imread(dirname+image_filenames[ni], cv::IMREAD_GRAYSCALE);
However, (correct me if I am wrong) I suspect that imread allocates space in the memory and put the image here.
I need now to read an image into an already allocated space of memory
void *unified_ptr;
cudaMallocManaged(&unified_ptr, frameByteSize);
cv::Mat h_image(height, width, CV_8UC1, unified_ptr);
Is there a way that I can read an image into this h_image
variable?