In the written template, the error is as follows when copying the image data using OpenCV:
Unhandled exception at 0x74dec42d in Xxxx_cuda.exe:
Microsoft C + + exception:cv::exception at memory location 0x0017f878.
Navigate to Error in:
Cvreleaseimage (©_y), that is, the release of image data is the time, the occurrence of illegal memory read and write;
Template<class t>void grad_y (const iplimage *img, Iplimage *grad, const iplimage *mask) { Iplimage *copy_y = CV Cloneimage (IMG); int h = img->height;int W = img->width;int channel = Img->nchannels;cvzero (grad); for (int i=1; i
After reviewing the literature, many people encounter similar problems, the conclusion is OPENCV itself bug;Strangely, I willIplimage *copy_y = Cvcloneimage (IMG);
instead:Iplimage *copy_y =null;copy_y = Cvcloneimage (IMG);
Problem solved, after many tests, the bug will not be reproduced, baffled its solution;
Opencv+cuda Memory leak Error