cvFindContours(ad_Img, mem_storage, &first_contour, sizeof(CvContour),0, 2);
用于视频流循环提取图像导致内存不断增加,使用过程中需要释放内存。
其中注意:first_contour->storage不需要release,另外在使用cvmemstorage的过程中如果需要重复利用的,可以用clearmemstorage进行reset,使用完了再release。
还有一点first_contour是存储在mem_storage 上的,即使需要释放first_contour->storage也应该在mem_storage 前面。