OpenCV  4.1.0
Open Source Computer Vision
Namespaces | Classes | Typedefs | Enumerations | Functions
cv::dnn Namespace Reference

Namespaces

namespace  details
 

Classes

struct  _Range
 
class  AbsLayer
 
class  ActivationLayer
 
class  BackendNode
 Derivatives of this class encapsulates functions of certain backends. More...
 
class  BackendWrapper
 Derivatives of this class wraps cv::Mat for different backends and targets. More...
 
class  BaseConvolutionLayer
 
class  BatchNormLayer
 
class  BlankLayer
 
class  BNLLLayer
 
class  ChannelsPReLULayer
 
class  ConcatLayer
 
class  ConstLayer
 
class  ConvolutionLayer
 
class  CropAndResizeLayer
 
class  CropLayer
 
class  DeconvolutionLayer
 
class  DetectionOutputLayer
 
class  Dict
 This class implements name-value dictionary, values are instances of DictValue. More...
 
struct  DictValue
 This struct stores the scalar value (or array) of one of the following type: double, cv::String or int64. More...
 
class  EltwiseLayer
 
class  ELULayer
 
class  FlattenLayer
 
class  InnerProductLayer
 
class  InterpLayer
 Bilinear resize layer from https://github.com/cdmh/deeplab-public. More...
 
class  Layer
 This interface class allows to build new Layers - are building blocks of networks. More...
 
class  LayerFactory
 Layer factory allows to create instances of registered layers. More...
 
class  LayerParams
 This class provides all data needed to initialize layer. More...
 
class  LRNLayer
 
class  LSTMLayer
 LSTM recurrent layer. More...
 
class  MaxUnpoolLayer
 
class  MVNLayer
 
class  Net
 This class allows to create and manipulate comprehensive artificial neural networks. More...
 
class  NormalizeBBoxLayer
 \( L_p \) - normalization layer. More...
 
class  PaddingLayer
 Adds extra values for specific axes. More...
 
class  PermuteLayer
 
class  PoolingLayer
 
class  PowerLayer
 
class  PriorBoxLayer
 
class  ProposalLayer
 
class  RegionLayer
 
class  ReLU6Layer
 
class  ReLULayer
 
class  ReorgLayer
 
class  ReshapeLayer
 
class  ResizeLayer
 Resize input 4-dimensional blob by nearest neighbor or bilinear strategy. More...
 
class  RNNLayer
 Classical recurrent layer. More...
 
class  ScaleLayer
 
class  ShiftLayer
 
class  ShuffleChannelLayer
 
class  SigmoidLayer
 
class  SliceLayer
 
class  SoftmaxLayer
 
class  SplitLayer
 
class  TanHLayer
 

Typedefs

typedef std::vector< int > MatShape
 

Enumerations

enum  Backend {
  DNN_BACKEND_DEFAULT,
  DNN_BACKEND_HALIDE,
  DNN_BACKEND_INFERENCE_ENGINE,
  DNN_BACKEND_OPENCV,
  DNN_BACKEND_VKCOM
}
 Enum of computation backends supported by layers. More...
 
enum  Target {
  DNN_TARGET_CPU,
  DNN_TARGET_OPENCL,
  DNN_TARGET_OPENCL_FP16,
  DNN_TARGET_MYRIAD,
  DNN_TARGET_VULKAN,
  DNN_TARGET_FPGA
}
 Enum of target devices for computations. More...
 

Functions

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)
 Creates 4-dimensional blob from image. Optionally resizes and crops image from center, subtract mean values, scales values by scalefactor, swap Blue and Red channels.
 
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)
 Creates 4-dimensional blob from image.
 
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)
 Creates 4-dimensional blob from series of images. Optionally resizes and crops images from center, subtract mean values, scales values by scalefactor, swap Blue and Red channels.
 
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)
 Creates 4-dimensional blob from series of images.
 
int clamp (int ax, int dims)
 
int clamp (int ax, const MatShape &shape)
 
Range clamp (const Range &r, int axisSize)
 
static MatShape concat (const MatShape &a, const MatShape &b)
 
std::vector< std::pair
< Backend, Target > > 
getAvailableBackends ()
 
std::vector< TargetgetAvailableTargets (Backend be)
 
cv::String getInferenceEngineVPUType ()
 Returns Inference Engine VPU type.
 
static Mat getPlane (const Mat &m, int n, int cn)
 
void imagesFromBlob (const cv::Mat &blob_, OutputArrayOfArrays images_)
 Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure (std::vector<cv::Mat>).
 
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)
 Performs non maximum suppression given boxes and corresponding scores.
 
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)
 
static std::ostream & operator<< (std::ostream &out, const MatShape &shape)
 
static void print (const MatShape &shape, const String &name="")
 
Net readNet (const String &model, const String &config="", const String &framework="")
 Read deep learning network represented in one of the supported formats.
 
Net readNet (const String &framework, const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig=std::vector< uchar >())
 Read deep learning network represented in one of the supported formats.
 
Net readNetFromCaffe (const String &prototxt, const String &caffeModel=String())
 Reads a network model stored in Caffe framework's format.
 
Net readNetFromCaffe (const std::vector< uchar > &bufferProto, const std::vector< uchar > &bufferModel=std::vector< uchar >())
 Reads a network model stored in Caffe model in memory.
 
Net readNetFromCaffe (const char *bufferProto, size_t lenProto, const char *bufferModel=NULL, size_t lenModel=0)
 Reads a network model stored in Caffe model in memory.
 
Net readNetFromDarknet (const String &cfgFile, const String &darknetModel=String())
 Reads a network model stored in Darknet model files.
 
Net readNetFromDarknet (const std::vector< uchar > &bufferCfg, const std::vector< uchar > &bufferModel=std::vector< uchar >())
 Reads a network model stored in Darknet model files.
 
Net readNetFromDarknet (const char *bufferCfg, size_t lenCfg, const char *bufferModel=NULL, size_t lenModel=0)
 Reads a network model stored in Darknet model files.
 
Net readNetFromModelOptimizer (const String &xml, const String &bin)
 Load a network from Intel's Model Optimizer intermediate representation.
 
Net readNetFromONNX (const String &onnxFile)
 Reads a network model ONNX.
 
Net readNetFromTensorflow (const String &model, const String &config=String())
 Reads a network model stored in TensorFlow framework's format.
 
Net readNetFromTensorflow (const std::vector< uchar > &bufferModel, const std::vector< uchar > &bufferConfig=std::vector< uchar >())
 Reads a network model stored in TensorFlow framework's format.
 
Net readNetFromTensorflow (const char *bufferModel, size_t lenModel, const char *bufferConfig=NULL, size_t lenConfig=0)
 Reads a network model stored in TensorFlow framework's format.
 
Net readNetFromTorch (const String &model, bool isBinary=true, bool evaluate=true)
 Reads a network model stored in Torch7 framework's format.
 
Mat readTensorFromONNX (const String &path)
 Creates blob from .pb file.
 
Mat readTorchBlob (const String &filename, bool isBinary=true)
 Loads blob which was serialized as torch.Tensor object of Torch7 framework.
 
void resetMyriadDevice ()
 Release a Myriad device (binded by OpenCV).
 
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 (const String &src, const String &dst, const std::vector< String > &layersTypes=std::vector< String >())
 Convert all weights of Caffe network to half precision floating point.
 
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)
 
static std::string toString (const MatShape &shape, const String &name="")
 
static int total (const MatShape &shape, int start=-1, int end=-1)
 
void writeTextGraph (const String &model, const String &output)
 Create a text representation for a binary network stored in protocol buffer format.
 

Function Documentation

int cv::dnn::clamp ( int  ax,
int  dims 
)
inline
int cv::dnn::clamp ( int  ax,
const MatShape &  shape 
)
inline
Range cv::dnn::clamp ( const Range &  r,
int  axisSize 
)
inline
static MatShape cv::dnn::concat ( const MatShape &  a,
const MatShape &  b 
)
inlinestatic
cv::String cv::dnn::getInferenceEngineVPUType ( )

Returns Inference Engine VPU type.

See values of CV_DNN_INFERENCE_ENGINE_VPU_TYPE_* macros.

static Mat cv::dnn::getPlane ( const Mat &  m,
int  n,
int  cn 
)
inlinestatic
static std::ostream& cv::dnn::operator<< ( std::ostream &  out,
const MatShape &  shape 
)
inlinestatic
static void cv::dnn::print ( const MatShape &  shape,
const String &  name = "" 
)
inlinestatic
void cv::dnn::resetMyriadDevice ( )

Release a Myriad device (binded by OpenCV).

Single Myriad device cannot be shared across multiple processes which uses Inference Engine's Myriad plugin.

static MatShape cv::dnn::shape ( const int *  dims,
const int  n 
)
inlinestatic
static MatShape cv::dnn::shape ( const Mat &  mat)
inlinestatic
static MatShape cv::dnn::shape ( const MatSize &  sz)
inlinestatic
static MatShape cv::dnn::shape ( const UMat &  mat)
inlinestatic
static MatShape cv::dnn::shape ( int  a0,
int  a1 = -1,
int  a2 = -1,
int  a3 = -1 
)
inlinestatic
static Mat cv::dnn::slice ( const Mat &  m,
const _Range &  r0 
)
inlinestatic
static Mat cv::dnn::slice ( const Mat &  m,
const _Range &  r0,
const _Range &  r1 
)
inlinestatic
static Mat cv::dnn::slice ( const Mat &  m,
const _Range &  r0,
const _Range &  r1,
const _Range &  r2 
)
inlinestatic
static Mat cv::dnn::slice ( const Mat &  m,
const _Range &  r0,
const _Range &  r1,
const _Range &  r2,
const _Range &  r3 
)
inlinestatic
static std::string cv::dnn::toString ( const MatShape &  shape,
const String &  name = "" 
)
inlinestatic
static int cv::dnn::total ( const MatShape &  shape,
int  start = -1,
int  end = -1 
)
inlinestatic