Converting cvMat to GpuMat gives segmentation fault
I am converting "cv_img = cv::Mat(ptrGrabResult->GetHeight(),ptrGrabResult->GetWidth(), CV_8UC3,(uint8_t*)image.GetBuffer());" into GpuMat using "d_frame= GpuMat(cv_img);"
where d_frame is declared as cv::cuda::GpuMat d_frame;
at the conversion im getting segmentation fault. please suggest a solution . I referred the following linkStackoverflow, OpencvQ&A
is there any chance, your "image" object goes out of scope, before you try to copy to GpuMat ?
(can you show a bit more code around that ?)
image is a continuous video frame
the cv::Mat constructor you're using does not copy pixels, only the pointer to it. (which might get invalid).
you might need to clone() the Mat.
added code here
Image data that Mat cv_img holds have got rows =958 and coulmns = 1278. is this beyond the limit for GpuMat ?