文档什么都没说...但是这个,但是cvCapture是一个C类型。
" 注意
In C API, when you finished working with video, release
CvCapture structure with cvReleaseCapture(), or
use Ptr<CvCapture> that calls cvReleaseCapture() automa
tically in the destructor."
我认为 VideoCapture 是一个对象,但不是吗?
最佳答案
VideoCapture 的析构函数是
VideoCapture::~VideoCapture()
{
cap.release();
}
所以没有必要释放它。
如果你想释放而不破坏调用 VideoCapture 对象上的 release() 方法的对象,你会得到相同的效果:
void VideoCapture::release()
{
cap.release();
}
关于c++ - 使用 OpenCV C++ 接口(interface),我是否需要释放使用 VideoCapture(int 设备?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20049081/