Opencv+cuda Memory leak Error

Source: Internet
Author: User
Tags microsoft c

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 (&copy_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 will
Iplimage *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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.