OpenCV  3.1.0
Open Source Computer Vision
Public Member Functions | List of all members
cv::dnn::BlobShape Struct Reference

Lightweight class for storing and processing a shape of blob (or anything else). More...

#include "blob.hpp"

Public Member Functions

 BlobShape (int ndims=4, int fill=1)
 Creates n-dim shape and fill its by fill. More...
 
 BlobShape (int num, int cn, int rows, int cols)
 Creates 4-dim shape [num, cn, rows, cols]. More...
 
 BlobShape (int ndims, const int *sizes)
 Creates n-dim shape from the sizes array. More...
 
 BlobShape (const std::vector< int > &sizes)
 Creates n-dim shape from the sizes vector. More...
 
template<int n>
 BlobShape (const Vec< int, n > &shape)
 Creates n-dim shape from cv::Vec. More...
 
int dims () const
 Returns number of dimensions. More...
 
bool equal (const BlobShape &other) const
 Checks equality of two shapes. More...
 
bool operator== (const BlobShape &r) const
 
int operator[] (int axis) const
 Does the same thing as size(axis). More...
 
int & operator[] (int axis)
 Does the same thing as size(int) const. More...
 
const int * ptr () const
 Returns pointer to the first element of continuous size array. More...
 
int & size (int axis)
 Returns reference to the size of the specified axis. More...
 
int size (int axis) const
 Returns the size of the specified axis. More...
 
ptrdiff_t total ()
 Returns the product of all sizes of axes. More...
 
int xsize (int axis) const
 Returns the size of the specified axis. More...
 

Detailed Description

Lightweight class for storing and processing a shape of blob (or anything else).

Constructor & Destructor Documentation

cv::dnn::BlobShape::BlobShape ( int  ndims = 4,
int  fill = 1 
)
explicit

Creates n-dim shape and fill its by fill.

cv::dnn::BlobShape::BlobShape ( int  num,
int  cn,
int  rows,
int  cols 
)

Creates 4-dim shape [num, cn, rows, cols].

cv::dnn::BlobShape::BlobShape ( int  ndims,
const int *  sizes 
)

Creates n-dim shape from the sizes array.

cv::dnn::BlobShape::BlobShape ( const std::vector< int > &  sizes)

Creates n-dim shape from the sizes vector.

template<int n>
cv::dnn::BlobShape::BlobShape ( const Vec< int, n > &  shape)

Creates n-dim shape from cv::Vec.

Member Function Documentation

int cv::dnn::BlobShape::dims ( ) const

Returns number of dimensions.

bool cv::dnn::BlobShape::equal ( const BlobShape other) const

Checks equality of two shapes.

bool cv::dnn::BlobShape::operator== ( const BlobShape r) const
int cv::dnn::BlobShape::operator[] ( int  axis) const

Does the same thing as size(axis).

int& cv::dnn::BlobShape::operator[] ( int  axis)

Does the same thing as size(int) const.

const int* cv::dnn::BlobShape::ptr ( ) const

Returns pointer to the first element of continuous size array.

int& cv::dnn::BlobShape::size ( int  axis)

Returns reference to the size of the specified axis.

Negative axis is supported, in this case a counting starts from the last axis, i. e. -1 corresponds to last axis. If non-existing axis was passed then an error will be generated.

int cv::dnn::BlobShape::size ( int  axis) const

Returns the size of the specified axis.

See also
size()
ptrdiff_t cv::dnn::BlobShape::total ( )

Returns the product of all sizes of axes.

int cv::dnn::BlobShape::xsize ( int  axis) const

Returns the size of the specified axis.

Does the same thing as size(int) const, but if non-existing axis will be passed then 1 will be returned, therefore this function always finishes successfully.


The documentation for this struct was generated from the following file: