使用 OpenCV C++ 界面是否需要释放使用 VideoCapture 创建的相机捕获(int 设备?
Using OpenCV C++ interface do i need to release camera capture created with VideoCapture(int device?)
文档什么也没说...但是这个,但 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()
{
cap.release();
}
所以没有必要释放它。
如果你想在不破坏在 VideoCapture 对象上调用 release() 方法的对象的情况下释放,你会得到同样的效果:
void VideoCapture::release()
{
cap.release();
}
相关文章:
- 如何创建一个CMake变量,除非显式重写,否则使用默认值
- 使用std::multimap迭代器创建std::list
- 在全局变量中保存类的实例以重新创建类(创建"backup")
- 使用CMake创建QML插件
- 如何在c++中为模板函数实例创建快捷方式
- 在C++中,是否可以基于给定的标识符创建基类的新实例,反之亦然
- 创建一个函数以在输入为负数或零时输出字符串.第一次执行用户定义的函数
- OpenCV EqualizeHist()从彩色图像创建黑白图像
- 试图在visual studio上用C++创建一个桌面应用程序
- 使用OpenCV为使用GENICAM API和C++的各种相机创建程序
- 如何使C++代码更快:使用 CFile 从相机数据创建.csv文件
- 使用相机的初始数据创建d3d11Texture2D
- 使用OpenGL 3.3和Qt 5.6创建相机
- 使用 OpenCV C++ 界面是否需要释放使用 VideoCapture 创建的相机捕获(int 设备?
- 创建一个围绕对象 OpenGL C++旋转的相机
- 如何创建用于从(WiFi)相机接收视频流的应用程序
- 我如何创建avi从相机使用directshow
- Opencv从相机数据创建mat
- 如何创建具有缩放功能的动态观察相机
- 如何在不关心相机的 glew 中创建叠加菜单?