![]() |
OpenCV 4.12.0
开源计算机视觉
|
使用NVIDIA光流硬件和光流SDK 1.0计算两幅图像之间光流向量的类。 更多...
#include <opencv2/cudaoptflow.hpp>
公共类型 | |
| 枚举 | NVIDIA_OF_PERF_LEVEL { NV_OF_PERF_LEVEL_UNDEFINED , NV_OF_PERF_LEVEL_SLOW = 5 , NV_OF_PERF_LEVEL_MEDIUM = 10 , NV_OF_PERF_LEVEL_FAST = 20 , NV_OF_PERF_LEVEL_MAX } |
公共成员函数 | |
| virtual void | upSampler (InputArray flow, cv::Size imageSize, int gridSize, InputOutputArray upsampledFlow)=0 |
| NVIDIA光流硬件以 gridSize 粒度生成流向量,该粒度可通过函数 getGridSize() 查询。Upsampler() 辅助函数使用最近邻上采样方法将硬件生成的流向量转换为密集表示(每个像素1个流向量)。 | |
从 cv::cuda::NvidiaHWOpticalFlow 继承的公共成员函数 | |
| virtual void | calc (InputArray inputImage, InputArray referenceImage, InputOutputArray flow, Stream &stream=Stream::Null(), InputArray hint=cv::noArray(), OutputArray cost=cv::noArray())=0 |
| 使用NVIDIA光流SDK计算光流。 | |
| virtual void | collectGarbage ()=0 |
| 释放所有缓冲区、上下文和设备指针。 | |
| virtual int | getGridSize () const =0 |
| 根据硬件能力返回输出缓冲区的网格大小。 | |
从 cv::Algorithm 继承的公共成员函数 | |
| Algorithm () | |
| virtual | ~Algorithm () |
| virtual void | clear () |
| 清除算法状态。 | |
| virtual bool | empty () const |
| 如果 算法 为空(例如,在最开始或读取失败后),则返回 true。 | |
| virtual String | getDefaultName () const |
| virtual void | read (const FileNode &fn) |
| 从文件存储中读取算法参数。 | |
| virtual void | save (const String &filename) const |
| void | write (const Ptr< FileStorage > &fs, const String &name=String()) const |
| virtual void | write (FileStorage &fs) const |
| 将算法参数存储到文件存储中。 | |
| void | write (FileStorage &fs, const String &name) const |
静态公共成员函数 | |
| static Ptr< NvidiaOpticalFlow_1_0 > | create (cv::Size imageSize, cv::cuda::NvidiaOpticalFlow_1_0::NVIDIA_OF_PERF_LEVEL perfPreset=cv::cuda::NvidiaOpticalFlow_1_0::NV_OF_PERF_LEVEL_SLOW, bool enableTemporalHints=false, bool enableExternalHints=false, bool enableCostBuffer=false, int gpuId=0, Stream &inputStream=Stream::Null(), Stream &outputStream=Stream::Null()) |
| 实例化NVIDIA光流。 | |
从 cv::Algorithm 继承的静态公共成员函数 | |
| template<typename _Tp > | |
| static Ptr< _Tp > | load (const String &filename, const String &objname=String()) |
| 从文件中加载算法。 | |
| template<typename _Tp > | |
| static Ptr< _Tp > | loadFromString (const String &strModel, const String &objname=String()) |
| 从字符串加载算法。 | |
| template<typename _Tp > | |
| static Ptr< _Tp > | read (const FileNode &fn) |
| 从文件节点读取算法。 | |
其他继承成员 | |
从 cv::Algorithm 继承的保护成员函数 | |
| void | writeFormat (FileStorage &fs) const |
使用NVIDIA光流硬件和光流SDK 1.0计算两幅图像之间光流向量的类。
|
static |
实例化NVIDIA光流。
| imageSize | 输入图像的像素尺寸。 |
| perfPreset | 可选参数。有关预设的详细信息,请参阅 NV OF SDK 文档。默认为 NV_OF_PERF_LEVEL_SLOW。 |
| enableTemporalHints | 可选参数。用于启用时间提示的标志。当设置为 true 时,硬件使用对 calc() 的上一次调用中生成的流向量作为对当前 calc() 调用的内部提示。在计算连续视频帧之间的流向量时很有用。默认为 false。 |
| enableExternalHints | 可选参数。用于启用将外部提示缓冲区传递给 calc() 的标志。默认为 false。 |
| enableCostBuffer | 可选参数。用于启用从 calc() 输出成本缓冲区的标志。默认为 false。 |
| gpuId | 可选参数,用于选择计算光流的GPU ID。在多GPU系统中很有用。默认为 0。 |
| inputStream | 光流算法可以选择性地在输入缓冲区上进行CUDA预处理。输入CUDA流可用于与OF硬件引擎流水线和同步CUDA预处理任务。如果未设置输入流,执行函数将使用默认流(即NULL流); |
| outputStream | 光流算法可以选择性地在输出流向量上进行CUDA后处理。输出CUDA流可用于与OF硬件引擎流水线和同步CUDA后处理任务。如果未设置输出流,执行函数将使用默认流(即NULL流); |
|
纯虚函数 |
NVIDIA光流硬件以 gridSize 粒度生成流向量,该粒度可通过函数 getGridSize() 查询。Upsampler() 辅助函数使用最近邻上采样方法将硬件生成的流向量转换为密集表示(每个像素1个流向量)。
| flow | 类型为 CV_16FC2 的缓冲区,包含由 calc() 生成的流向量。 |
| imageSize | 生成这些流向量的输入图像的像素尺寸。 |
| gridSize | calc() 函数返回的光流向量的粒度。可以使用 getGridSize() 查询。 |
| upsampledFlow | 类型为 CV_32FC2 的缓冲区,包含上采样后的流向量,每个流向量对应1个像素,采用pitch-linear布局。 |