OpenCV 4.12.0
开源计算机视觉
加载中...
搜索中...
无匹配项
dnn.hpp 文件参考
#include <vector>
#include <opencv2/core.hpp>
#include "opencv2/core/async.hpp"
#include "../dnn/version.hpp"
#include <opencv2/dnn/dict.hpp>
#include <opencv2/dnn/layer.hpp>
#include <opencv2/dnn/dnn.inl.hpp>
#include <opencv2/dnn/utils/inference_engine.hpp>
dnn.hpp 的包含依赖关系图
此图显示了哪些文件直接或间接包含了此文件

类  cv::dnn::BackendNode
 此类的派生类封装了特定后端的功能。 更多...
 
类  cv::dnn::BackendWrapper
 此类的派生类为不同后端和目标封装 cv::Mat更多...
 
类  cv::dnn::ClassificationModel
 此类代表分类模型的高级 API。 更多...
 
类  cv::dnn::DetectionModel
 此类代表目标检测网络的高级 API。 更多...
 
结构体  cv::dnn::Image2BlobParams
 图像到 Blob 的处理参数。 更多...
 
类  cv::dnn::KeypointsModel
 此类代表关键点模型的高级 API。 更多...
 
类  cv::dnn::Layer
 此接口类允许构建新层 - 网络的构建块。 更多...
 
类  cv::dnn::LayerParams
 此类提供初始化层所需的所有数据。 更多...
 
类  cv::dnn::Model
 此类代表神经网络的高级 API。 更多...
 
类  cv::dnn::Net
 此类允许创建和操作综合性人工神经网络。 更多...
 
类  cv::dnn::SegmentationModel
 此类代表分割模型的高级 API。 更多...
 
类  cv::dnn::TextDetectionModel
 文本检测网络的基类。 更多...
 
类  cv::dnn::TextDetectionModel_DB
 此类代表兼容 DB 模型的文本检测深度学习网络高级 API。 更多...
 
类  cv::dnn::TextDetectionModel_EAST
 此类代表兼容 EAST 模型的文本检测深度学习网络高级 API。 更多...
 
类  cv::dnn::TextRecognitionModel
 此类代表文本识别网络的高级 API。 更多...
 

命名空间

命名空间  cv
 
命名空间  cv::dnn
 
命名空间  cv::dnn::accessor
 

类型定义

typedef std::vector< int > cv::dnn::MatShape
 

枚举

枚举  cv::dnn::Backend {
  cv::dnn::DNN_BACKEND_DEFAULT = 0 ,
  cv::dnn::DNN_BACKEND_HALIDE ,
  cv::dnn::DNN_BACKEND_INFERENCE_ENGINE ,
  cv::dnn::DNN_BACKEND_OPENCV ,
  cv::dnn::DNN_BACKEND_VKCOM ,
  cv::dnn::DNN_BACKEND_CUDA ,
  cv::dnn::DNN_BACKEND_WEBNN ,
  cv::dnn::DNN_BACKEND_TIMVX ,
  cv::dnn::DNN_BACKEND_CANN
}
 层支持的计算后端枚举。 更多...
 
枚举  cv::dnn::DataLayout {
  cv::dnn::DNN_LAYOUT_UNKNOWN = 0 ,
  cv::dnn::DNN_LAYOUT_ND = 1 ,
  cv::dnn::DNN_LAYOUT_NCHW = 2 ,
  cv::dnn::DNN_LAYOUT_NCDHW = 3 ,
  cv::dnn::DNN_LAYOUT_NHWC = 4 ,
  cv::dnn::DNN_LAYOUT_NDHWC = 5 ,
  cv::dnn::DNN_LAYOUT_PLANAR = 6
}
 模型推理的数据布局枚举。 更多...
 
枚举  cv::dnn::ImagePaddingMode {
  cv::dnn::DNN_PMODE_NULL = 0 ,
  cv::dnn::DNN_PMODE_CROP_CENTER = 1 ,
  cv::dnn::DNN_PMODE_LETTERBOX = 2
}
 图像处理模式枚举。旨在促进 dnn 模型预处理要求的专业化。例如,Yolo 系列模型中常用的 letter box更多...
 
enum class  cv::dnn::SoftNMSMethod {
  cv::dnn::SoftNMSMethod::SOFTNMS_LINEAR = 1 ,
  cv::dnn::SoftNMSMethod::SOFTNMS_GAUSSIAN = 2
}
 Soft NMS 方法枚举。 更多...
 
枚举  cv::dnn::Target {
  cv::dnn::DNN_TARGET_CPU = 0 ,
  cv::dnn::DNN_TARGET_OPENCL ,
  cv::dnn::DNN_TARGET_OPENCL_FP16 ,
  cv::dnn::DNN_TARGET_MYRIAD ,
  cv::dnn::DNN_TARGET_VULKAN ,
  cv::dnn::DNN_TARGET_FPGA ,
  cv::dnn::DNN_TARGET_CUDA ,
  cv::dnn::DNN_TARGET_CUDA_FP16 ,
  cv::dnn::DNN_TARGET_HDDL ,
  cv::dnn::DNN_TARGET_NPU ,
  cv::dnn::DNN_TARGET_CPU_FP16
}
 计算目标设备枚举。 更多...
 

函数

Mat cv::dnn::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)
 从图像创建 4 维 Blob。可选地,从中心调整和裁剪 image,减去 mean 值,按 scalefactor 缩放值,交换蓝色和红色通道。
 
void cv::dnn::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 cv::dnn::blobFromImages (InputArrayOfArrays images, double scalefactor=1.0, Size size=Size(), const Scalar &mean=Scalar(), bool swapRB=false, bool crop=false, int ddepth=CV_32F)
 从图像序列创建 4 维 Blob。可选地,从中心调整和裁剪 images,减去 mean 值,按 scalefactor 缩放值,交换蓝色和红色通道。
 
void cv::dnn::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 cv::dnn::blobFromImagesWithParams (InputArrayOfArrays images, const Image2BlobParams &param=Image2BlobParams())
 使用给定参数从图像序列创建 4 维 Blob。
 
void cv::dnn::blobFromImagesWithParams (InputArrayOfArrays images, OutputArray blob, const Image2BlobParams &param=Image2BlobParams())
 
Mat cv::dnn::blobFromImageWithParams (InputArray image, const Image2BlobParams &param=Image2BlobParams())
 根据给定参数从图像创建4维Blob。
 
void cv::dnn::blobFromImageWithParams (InputArray image, OutputArray blob, const Image2BlobParams &param=Image2BlobParams())
 
void cv::dnn::enableModelDiagnostics (bool isDiagnosticsMode)
 启用使用 CV DNN API 加载 DNN 模型的详细日志记录。
 
std::vector< std::pair< Backend, Target > > cv::dnn::getAvailableBackends ()
 
std::vector< Targetcv::dnn::getAvailableTargets (dnn::Backend be)
 
void cv::dnn::imagesFromBlob (const cv::Mat &blob_, OutputArrayOfArrays images_)
 解析 4D Blob 并将其包含的图像作为 2D 数组通过更简单的数据结构 (std::vector<cv::Mat>) 输出。
 
void cv::dnn::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 cv::dnn::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 cv::dnn::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 cv::dnn::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 cv::dnn::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)
 
Net cv::dnn::readNet (const String &framework, const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig=std::vector< uchar >())
 读取以支持格式之一表示的深度学习网络。
 
Net cv::dnn::readNet (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config="", const String &framework="")
 读取以支持格式之一表示的深度学习网络。
 
Net cv::dnn::readNetFromCaffe (const char *bufferProto, size_t lenProto, const char *bufferModel=NULL, size_t lenModel=0)
 读取内存中以Caffe模型格式存储的网络模型。
 
Net cv::dnn::readNetFromCaffe (const std::vector< uchar > &bufferProto, const std::vector< uchar > &bufferModel=std::vector< uchar >())
 读取内存中以Caffe模型格式存储的网络模型。
 
Net cv::dnn::readNetFromCaffe (CV_WRAP_FILE_PATH const String &prototxt, CV_WRAP_FILE_PATH const String &caffeModel=String())
 读取以 Caffe 框架格式存储的网络模型。
 
Net cv::dnn::readNetFromDarknet (const char *bufferCfg, size_t lenCfg, const char *bufferModel=NULL, size_t lenModel=0)
 读取以 Darknet 模型文件格式存储的网络模型。
 
Net cv::dnn::readNetFromDarknet (const std::vector< uchar > &bufferCfg, const std::vector< uchar > &bufferModel=std::vector< uchar >())
 读取以 Darknet 模型文件格式存储的网络模型。
 
Net cv::dnn::readNetFromDarknet (CV_WRAP_FILE_PATH const String &cfgFile, CV_WRAP_FILE_PATH const String &darknetModel=String())
 读取以 Darknet 模型文件格式存储的网络模型。
 
Net cv::dnn::readNetFromModelOptimizer (const std::vector< uchar > &bufferModelConfig, const std::vector< uchar > &bufferWeights)
 从 Intel 的 Model Optimizer 中间表示加载网络。
 
Net cv::dnn::readNetFromModelOptimizer (const uchar *bufferModelConfigPtr, size_t bufferModelConfigSize, const uchar *bufferWeightsPtr, size_t bufferWeightsSize)
 从 Intel 的 Model Optimizer 中间表示加载网络。
 
Net cv::dnn::readNetFromModelOptimizer (CV_WRAP_FILE_PATH const String &xml, CV_WRAP_FILE_PATH const String &bin="")
 从 Intel 的 Model Optimizer 中间表示加载网络。
 
Net cv::dnn::readNetFromONNX (const char *buffer, size_t sizeBuffer)
 ONNX 内存缓冲区读取网络模型。
 
Net cv::dnn::readNetFromONNX (const std::vector< uchar > &buffer)
 ONNX 内存缓冲区读取网络模型。
 
Net cv::dnn::readNetFromONNX (CV_WRAP_FILE_PATH const String &onnxFile)
 读取 ONNX 网络模型。
 
Net cv::dnn::readNetFromTensorflow (const char *bufferModel, size_t lenModel, const char *bufferConfig=NULL, size_t lenConfig=0)
 读取以 TensorFlow 框架格式存储的网络模型。
 
Net cv::dnn::readNetFromTensorflow (const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig=std::vector< uchar >())
 读取以 TensorFlow 框架格式存储的网络模型。
 
Net cv::dnn::readNetFromTensorflow (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &config=String())
 读取以 TensorFlow 框架格式存储的网络模型。
 
Net cv::dnn::readNetFromTFLite (const char *bufferModel, size_t lenModel)
 读取以 TFLite 框架格式存储的网络模型。
 
Net cv::dnn::readNetFromTFLite (const std::vector< uchar > &bufferModel)
 读取以 TFLite 框架格式存储的网络模型。
 
Net cv::dnn::readNetFromTFLite (CV_WRAP_FILE_PATH const String &model)
 读取以 TFLite 框架格式存储的网络模型。
 
Net cv::dnn::readNetFromTorch (CV_WRAP_FILE_PATH const String &model, bool isBinary=true, bool evaluate=true)
 读取以 Torch7 框架格式存储的网络模型。
 
Mat cv::dnn::readTensorFromONNX (CV_WRAP_FILE_PATH const String &path)
 从 .pb 文件创建Blob。
 
Mat cv::dnn::readTorchBlob (const String &filename, bool isBinary=true)
 加载作为 Torch7 框架的 torch.Tensor 对象序列化的 Blob。
 
void cv::dnn::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 cv::dnn::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
 
void cv::dnn::writeTextGraph (CV_WRAP_FILE_PATH const String &model, CV_WRAP_FILE_PATH const String &output)
 为以协议缓冲区格式存储的二进制网络创建文本表示。