Saturday, September 3, 2011

OpenCV cvReleaseImage Crashing Problem

Random crashing can occur when you are using the cvQueryFrame function and the cvReleaseImage function together. With the below code implemented you can cause your program to sporadically crash.  The issue lies in releasing the frame.  The capture can be released safely.  Not sure why it does this but it does.

...
frame = cvQueryFrame(capture);
...
cvReleaseCapture&capture);
cvReleaseImage(&frame);
...

1 comment:

  1. I found your stuff through Jon Carrier's site. I wish blogging had been more established when in graduate school- I like to share what I can, and I think better when I am trying to explain something to someone else.

    Good luck with school and beyond. The more I fiddle with openCV the more I like it. Good to find others that are working with it too.

    ReplyDelete