fmvpsenior
fmvpsenior

Reputation: 197

cvReleaseImage with cvqueryframe

I'm grabbing a frame from an avi video.

img1 = cvQueryFrame( capture );   
cvReleaseImage( &img1 );

When I try to release the grabbed frame img1, I get

"An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in "

How can I release the memory allocated for img1?

Upvotes: 1

Views: 1210

Answers (1)

go4sri
go4sri

Reputation: 1490

You do not! The user is not allowed to release the memory. See here. Also, img1 may be NULL. So, you should check if it is a valid image or not - before using it.

Upvotes: 1

Related Questions