c - How Copy frame to farme -
What is a duplicate in a frame in the second frame in a frame that is not a memory management problem
For example:
iplimage * frame = NULL; Iplimage * Temp_frame = NULL; While (1) {frame = cvQueryFrame (capture); If (! Frame) break; Temp_frame = cvcloneimage (frame); CvreleaseImage (& amp; Temp_frame); CvreleaseImage (& frame); } Error:
Unassisted exception on 0x75b39673 in Open cv.exe: Microsoft C ++ Exception: Exception 0x0015f250 on cv :: memory location.
Please help.
iplimage * frame = null; Iplimage * Temp_frame = NULL; While (1) {frame = cvQueryFrame (capture); If (! Frame) break; If (! Temp_frame) // only temp_frame creates temp_frame = cvCreateImage (cvGetSize (frame), frame-> depth, frame-> nChannels); Cvcp (frame, temp_frame, tap); // cvQueryFrame () do not release the return! // I believe this is crashing your application // cvreleaseImage (& frame); } // Since the size of "frame" will not change, there is no need to create / release // temp_frame on every move of the loop. So we release it at the end: cvReleaseImage (& amp; Temp_frame);
Comments
Post a Comment