![]() |
OpenCV 4.12.0
开源计算机视觉
|
命名空间 | |
| 命名空间 | accessor |
| 命名空间 | details |
类型定义 | |
| typedef std::map< std::string, std::vector< LayerFactory::Constructor > > | LayerFactory_Impl |
| typedef std::vector< int > | MatShape |
枚举 | |
| 枚举 | Backend { DNN_BACKEND_DEFAULT = 0 , DNN_BACKEND_HALIDE , DNN_BACKEND_INFERENCE_ENGINE , DNN_BACKEND_OPENCV , DNN_BACKEND_VKCOM , DNN_BACKEND_CUDA , DNN_BACKEND_WEBNN , DNN_BACKEND_TIMVX , DNN_BACKEND_CANN } |
| 层支持的计算后端枚举。更多... | |
| 枚举 | DataLayout { DNN_LAYOUT_UNKNOWN = 0 , DNN_LAYOUT_ND = 1 , DNN_LAYOUT_NCHW = 2 , DNN_LAYOUT_NCDHW = 3 , DNN_LAYOUT_NHWC = 4 , DNN_LAYOUT_NDHWC = 5 , DNN_LAYOUT_PLANAR = 6 } |
| 用于模型推理的数据布局枚举。更多... | |
| 枚举 | ImagePaddingMode { DNN_PMODE_NULL = 0 , DNN_PMODE_CROP_CENTER = 1 , DNN_PMODE_LETTERBOX = 2 } |
图像处理模式枚举。为了方便 dnn 模型预处理要求的专业化。例如,letter box 常用于 Yolo 系列模型。更多... | |
| enum class | SoftNMSMethod { SoftNMSMethod::SOFTNMS_LINEAR = 1 , SoftNMSMethod::SOFTNMS_GAUSSIAN = 2 } |
| Soft NMS 方法枚举。更多... | |
| 枚举 | Target { DNN_TARGET_CPU = 0 , DNN_TARGET_OPENCL , DNN_TARGET_OPENCL_FP16 , DNN_TARGET_MYRIAD , DNN_TARGET_VULKAN , DNN_TARGET_FPGA , DNN_TARGET_CUDA , DNN_TARGET_CUDA_FP16 , DNN_TARGET_HDDL , DNN_TARGET_NPU , DNN_TARGET_CPU_FP16 } |
| 计算目标设备枚举。更多... | |
函数 | |
| Mat | blobFromImage (InputArray image, double scalefactor=1.0, const Size &size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false, int ddepth=CV_32F) |
从图像创建四维 blob。可选地从中心调整 image 大小并裁剪,减去 mean 值,通过 scalefactor 缩放值,交换蓝色和红色通道。 | |
| void | blobFromImage (InputArray image, OutputArray blob, double scalefactor=1.0, const Size &size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false, int ddepth=CV_32F) |
| 从图像创建4维Blob。 | |
| Mat | blobFromImages (InputArrayOfArrays images, double scalefactor=1.0, Size size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false, int ddepth=CV_32F) |
从一系列图像创建四维 blob。可选地从中心调整 images 大小并裁剪,减去 mean 值,通过 scalefactor 缩放值,交换蓝色和红色通道。 | |
| void | blobFromImages (InputArrayOfArrays images, OutputArray blob, double scalefactor=1.0, Size size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false, int ddepth=CV_32F) |
| 从系列图像创建4维Blob。 | |
| Mat | blobFromImagesWithParams (InputArrayOfArrays images, const Image2BlobParams ¶m=Image2BlobParams()) |
| 使用给定参数从一系列图像创建四维 blob。 | |
| void | blobFromImagesWithParams (InputArrayOfArrays images, OutputArray blob, const Image2BlobParams ¶m=Image2BlobParams()) |
| Mat | blobFromImageWithParams (InputArray image, const Image2BlobParams ¶m=Image2BlobParams()) |
| 根据给定参数从图像创建4维Blob。 | |
| void | blobFromImageWithParams (InputArray image, OutputArray blob, const Image2BlobParams ¶m=Image2BlobParams()) |
| static MatShape | concat (const MatShape &a, const MatShape &b) |
| void | enableModelDiagnostics (bool isDiagnosticsMode) |
| 启用使用 CV DNN API 加载 DNN 模型的详细日志记录。 | |
| std::vector< std::pair< Backend, Target > > | getAvailableBackends () |
| std::vector< Target > | getAvailableTargets (dnn::Backend be) |
| cv::String | getInferenceEngineBackendType () |
| 返回 Inference Engine 内部后端 API。 | |
| cv::String | getInferenceEngineCPUType () |
| 返回 Inference Engine CPU 类型。 | |
| cv::String | getInferenceEngineVPUType () |
| 返回 Inference Engine VPU 类型。 | |
| LayerFactory_Impl & | getLayerFactoryImpl () |
| Mutex & | getLayerFactoryMutex () |
| 获取守护 LayerFactory_Impl 的互斥锁,参见 getLayerFactoryImpl() 函数。 | |
| static Mat | getPlane (const Mat &m, int n, int cn) |
| void | imagesFromBlob (const cv::Mat &blob_, OutputArrayOfArrays images_) |
| 解析一个四维 blob,并通过更简单的数据结构 (std::vector<cv::Mat>) 将其包含的图像作为二维数组输出。 | |
| static bool | isAllOnes (const MatShape &inputShape, int startPos, int endPos) |
| void | NMSBoxes (const std::vector< Rect > &bboxes, const std::vector< float > &scores, const float score_threshold, const float nms_threshold, std::vector< int > &indices, const float eta=1.f, const int top_k=0) |
| 对给定边界框和对应分数执行非极大值抑制。 | |
| void | NMSBoxes (const std::vector< Rect2d > &bboxes, const std::vector< float > &scores, const float score_threshold, const float nms_threshold, std::vector< int > &indices, const float eta=1.f, const int top_k=0) |
| void | NMSBoxes (const std::vector< RotatedRect > &bboxes, const std::vector< float > &scores, const float score_threshold, const float nms_threshold, std::vector< int > &indices, const float eta=1.f, const int top_k=0) |
| void | NMSBoxesBatched (const std::vector< Rect > &bboxes, const std::vector< float > &scores, const std::vector< int > &class_ids, const float score_threshold, const float nms_threshold, std::vector< int > &indices, const float eta=1.f, const int top_k=0) |
| 对给定边界框和对应分数在不同类别上执行批处理非极大值抑制。 | |
| void | NMSBoxesBatched (const std::vector< Rect2d > &bboxes, const std::vector< float > &scores, const std::vector< int > &class_ids, const float score_threshold, const float nms_threshold, std::vector< int > &indices, const float eta=1.f, const int top_k=0) |
| static int | normalize_axis (int axis, const MatShape &shape) |
| static int | normalize_axis (int axis, int dims) |
将轴从 [-dims; dims)(类似于 Python 的切片表示法)转换为 [0; dims) 范围。 | |
| static Range | normalize_axis_range (const Range &r, int axisSize) |
| template<typename _Tp > | |
| static std::ostream & | operator<< (std::ostream &out, const std::vector< _Tp > &shape) |
| template<typename _Tp > | |
| static void | print (const std::vector< _Tp > &shape, const String &name="") |
| Net | readNet (const String &framework, const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig=std::vector< uchar >()) |
| 读取以受支持格式之一表示的深度学习网络。 | |
| Net | readNet (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config="", const String &framework="") |
| 读取以受支持格式之一表示的深度学习网络。 | |
| Net | readNetFromCaffe (const char *bufferProto, size_t lenProto, const char *bufferModel=NULL, size_t lenModel=0) |
| 读取内存中以Caffe模型格式存储的网络模型。 | |
| Net | readNetFromCaffe (const std::vector< uchar > &bufferProto, const std::vector< uchar > &bufferModel=std::vector< uchar >()) |
| 读取内存中以Caffe模型格式存储的网络模型。 | |
| Net | readNetFromCaffe (CV_WRAP_FILE_PATH const String &prototxt, CV_WRAP_FILE_PATH const String &caffeModel=String()) |
| 读取以 Caffe 框架格式存储的网络模型。 | |
| Net | readNetFromDarknet (const char *bufferCfg, size_t lenCfg, const char *bufferModel=NULL, size_t lenModel=0) |
| 读取以 Darknet 模型文件格式存储的网络模型。 | |
| Net | readNetFromDarknet (const std::vector< uchar > &bufferCfg, const std::vector< uchar > &bufferModel=std::vector< uchar >()) |
| 读取以 Darknet 模型文件格式存储的网络模型。 | |
| Net | readNetFromDarknet (CV_WRAP_FILE_PATH const String &cfgFile, CV_WRAP_FILE_PATH const String &darknetModel=String()) |
| 读取以 Darknet 模型文件格式存储的网络模型。 | |
| Net | readNetFromModelOptimizer (const std::vector< uchar > &bufferModelConfig, const std::vector< uchar > &bufferWeights) |
| 从 Intel 的 Model Optimizer 中间表示加载网络。 | |
| Net | readNetFromModelOptimizer (const uchar *bufferModelConfigPtr, size_t bufferModelConfigSize, const uchar *bufferWeightsPtr, size_t bufferWeightsSize) |
| 从 Intel 的 Model Optimizer 中间表示加载网络。 | |
| Net | readNetFromModelOptimizer (CV_WRAP_FILE_PATH const String &xml, CV_WRAP_FILE_PATH const String &bin="") |
| 从 Intel 的 Model Optimizer 中间表示加载网络。 | |
| Net | readNetFromONNX (const char *buffer, size_t sizeBuffer) |
| 从 ONNX 内存缓冲区读取网络模型。 | |
| Net | readNetFromONNX (const std::vector< uchar > &buffer) |
| 从 ONNX 内存缓冲区读取网络模型。 | |
| Net | readNetFromONNX (CV_WRAP_FILE_PATH const String &onnxFile) |
| 读取 ONNX 网络模型。 | |
| Net | readNetFromTensorflow (const char *bufferModel, size_t lenModel, const char *bufferConfig=NULL, size_t lenConfig=0) |
| 读取以 TensorFlow 框架格式存储的网络模型。 | |
| Net | readNetFromTensorflow (const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig=std::vector< uchar >()) |
| 读取以 TensorFlow 框架格式存储的网络模型。 | |
| Net | readNetFromTensorflow (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config=String()) |
| 读取以 TensorFlow 框架格式存储的网络模型。 | |
| Net | readNetFromTFLite (const char *bufferModel, size_t lenModel) |
| 读取以 TFLite 框架格式存储的网络模型。 | |
| Net | readNetFromTFLite (const std::vector< uchar > &bufferModel) |
| 读取以 TFLite 框架格式存储的网络模型。 | |
| Net | readNetFromTFLite (CV_WRAP_FILE_PATH const String &model) |
| 读取以 TFLite 框架格式存储的网络模型。 | |
| Net | readNetFromTorch (CV_WRAP_FILE_PATH const String &model, bool isBinary=true, bool evaluate=true) |
| 读取以 Torch7 框架格式存储的网络模型。 | |
| Mat | readTensorFromONNX (CV_WRAP_FILE_PATH const String &path) |
| 从 .pb 文件创建Blob。 | |
| Mat | readTorchBlob (const String &filename, bool isBinary=true) |
| 加载作为 Torch7 框架的 torch.Tensor 对象序列化的 blob。 | |
| void | releaseHDDLPlugin () |
| 释放 HDDL 插件。 | |
| void | resetMyriadDevice () |
| 释放 Myriad 设备(由 OpenCV 绑定)。 | |
| cv::String | setInferenceEngineBackendType (const cv::String &newBackendType) |
| 指定 Inference Engine 内部后端 API。 | |
| static MatShape | shape (const int *dims, const int n) |
| static MatShape | shape (const Mat &mat) |
| static MatShape | shape (const MatSize &sz) |
| static MatShape | shape (const UMat &mat) |
| static MatShape | shape (int a0, int a1=-1, int a2=-1, int a3=-1) |
| void | shrinkCaffeModel (CV_WRAP_FILE_PATH const String &src, CV_WRAP_FILE_PATH const String &dst, const std::vector< String > &layersTypes=std::vector< String >()) |
| 将 Caffe 网络的所有权重转换为半精度浮点数。 | |
| void | skipModelImport (bool skip) |
| 在 readNet() 函数的诊断运行后跳过模型导入。 | |
| static Mat | slice (const Mat &m, const _Range &r0) |
| static Mat | slice (const Mat &m, const _Range &r0, const _Range &r1) |
| static Mat | slice (const Mat &m, const _Range &r0, const _Range &r1, const _Range &r2) |
| static Mat | slice (const Mat &m, const _Range &r0, const _Range &r1, const _Range &r2, const _Range &r3) |
| void | softNMSBoxes (const std::vector< Rect > &bboxes, const std::vector< float > &scores, std::vector< float > &updated_scores, const float score_threshold, const float nms_threshold, std::vector< int > &indices, size_t top_k=0, const float sigma=0.5, SoftNMSMethod method=SoftNMSMethod::SOFTNMS_GAUSSIAN) |
| 对给定边界框和对应分数执行软非极大值抑制。参考:https://arxiv.org/abs/1704.04503。 | |
| template<typename _Tp > | |
| cv::toLowerCase (const std::string &str) | toString (const std::vector< _Tp > &shape, const String &name="") |
| static int | total (const Mat &mat, int start=-1, int end=-1) |
| static int | total (const MatShape &shape, int start=-1, int end=-1) |
| void | writeTextGraph (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &output) |
| 为以协议缓冲区格式存储的二进制网络创建文本表示。 | |
| cv::String cv::dnn::getInferenceEngineBackendType | ( | ) |
返回 Inference Engine 内部后端 API。
请参阅 CV_DNN_BACKEND_INFERENCE_ENGINE_* 宏的值。
自 4.6.0 版本起,OPENCV_DNN_BACKEND_INFERENCE_ENGINE_TYPE 运行时参数(环境变量)将被忽略。
| cv::String cv::dnn::getInferenceEngineCPUType | ( | ) |
返回 Inference Engine CPU 类型。
指定 OpenVINO 插件:CPU 或 ARM。
| cv::String cv::dnn::getInferenceEngineVPUType | ( | ) |
返回 Inference Engine VPU 类型。
请参阅 CV_DNN_INFERENCE_ENGINE_VPU_TYPE_* 宏的值。
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
将轴从 [-dims; dims)(类似于 Python 的切片表示法)转换为 [0; dims) 范围。
|
inlinestatic |
|
inlinestatic |
| void cv::dnn::releaseHDDLPlugin | ( | ) |
释放 HDDL 插件。
| void cv::dnn::resetMyriadDevice | ( | ) |
释放 Myriad 设备(由 OpenCV 绑定)。
使用 Inference Engine 的 Myriad 插件时,单个 Myriad 设备无法跨多个进程共享。
| cv::String cv::dnn::setInferenceEngineBackendType | ( | const cv::String & | newBackendType | ) |
|
inlinestatic |
|
inlinestatic |
| void cv::dnn::skipModelImport | ( | bool | skip | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |