OpenCV释放内存?

时间:2011-11-12 22:23:20

标签: c++ image memory opencv

如果我收到视频输入,我需要一个图像来捕捉一帧。是否需要在每次循环后释放图像?

IplImage* frame = 0;
while (1)
{
    frame = cvQueryFrame (camera);
    cvShowImage ("Window", frame);
    //would I need to add a cvReleaseImage (&frame) here?
}

1 个答案:

答案 0 :(得分:1)

不,你不需要释放图像帧但是当while循环终止时你需要释放相机; cvReleaseCapture(&camera);