在opencv中,什么是视频攻击器
In OpenCV what is the VideoCapture destructor
在videocapture ::文档中的链接中%3AREAD#VIDEOCAPTURE-REELE
它说这条线
"这些方法是通过随后的视频仪式自动调用的:: open()和通过视频攻击器。"
我希望有人能告诉我视频关注灾难源是我谷歌搜索的内容,但没有确切的答案...我敢肯定,它在某些通常的视频仪功能下自动称呼它,但是如果有人可以告诉我什么完全是,当它完全被调用和在源中,我将最感激=)。
这很容易。一旦对象离开范围,攻击器就会被调用。
{ // the capture only lives inside those brackets
VideoCapture cap;
if ( cap.open() )
{
//... do some work
}
} // here it will release itself
如果您尝试自己的课程,也许会变得更加明显:
class MyClass
{
public:
MyClass() { cerr << "created MyClass" << endl; } // constructor
~MyClass() { cerr << "destroyed MyClass" << endl; } // destructor
};
void foo()
{ // scope starts
MyClass mc;
int z=17;
z *= 3;
cerr << z << endl;
} // scope ends, mc will get destroyed.
int main()
{
return foo();
}
destructor是类的方法,当类的实例脱离范围或使用delete
关键字发布的内存时,称为类型。Destructor有一个名称,该名称从~
。
在这种特殊情况下,如果方法~VideoCapture
,则在以下情况下称为:
// One case
{
VideoCapture vc;
} // <- here ~VideoCapture called as it goes out of scope
// Another one
VideoCapture *vc = new VideoCapture();
delete vc; //<- here ~VideoCapture called as it is being deleted
// One more
{
std:unique_ptr<VideoCapture> vc = std::make_unique<VideoCapture>();
} // <- here ~VideoCapture called as its handler goes out of scope
相关文章:
- 如何在c++中录制具有精确帧时间戳的视频
- C++Brute Force攻击函数不会返回结果
- 如何在QT中的自定义视频小工具t上绘制矩形
- 如何使用OpenCV-C++编写*.mp4视频?
- 开放 CV 中的动态内存分配,用于视频处理
- 错误:(-210:不支持的格式或格式组合)功能'create'中的硬件视频解码器不支持视频源
- OpenCV QT,显示视频的帧(不使用while循环)
- FFmpeg——使用硬件加速进行视频解码
- 在 openCV 中手动停止视频
- 强制Qt相机视频格式
- 在macOS Mojave上尝试OpenCV视频捕获时"Abort Trap: 6"
- 应用程序在打开的简历中捕获视频后没有响应
- 使用 IMFSinkWriter 编码的视频的播放速度会根据宽度而变化
- 如何在 c++ 中通过 http 发送大型视频文件?
- 在 QLabel 中显示视频
- PostgresSQL - SQL Ready 语句与字符串转义,防止 SQL 注入攻击
- OpenGL 调试上下文警告 -"将使用视频内存作为缓冲区异议的来源
- 这个工厂类在这个C++视频中的意义何在?
- 如何使用Qt在新窗口中显示视频帧
- 在opencv中,什么是视频攻击器