Struct cv::MatShape#
Represents shape of a matrix/tensor. Previously, MatShape was defined as an alias of std::vector<int>, but now we use a special structure that provides a few extra benefits: View details
#include <opencv2/core/mat.hpp>Collaboration diagram for cv::MatShape:
Public Types#
Detailed Description#
-
struct MatShape#
Represents shape of a matrix/tensor. Previously, MatShape was defined as an alias of std::vector<int>, but now we use a special structure that provides a few extra benefits:
avoids any heap operations, since the shape is stored in a plain array. This reduces overhead of shape inference etc.
includes information about the layout, including the actual number of channels (‘C’) in the case of block layout.
distinguishes between empty shape (total() == 0) and 0-dimensional shape (dims == 0, but total() == 1).
Member Enumeration Documentation#
enum MatShape
|
Constructor & Destructor Documentation#
MatShape()#
MatShape()#
template<class _It>
cv::MatShape::MatShape(
_It begin,
_It end )
MatShape()#
cv::MatShape::MatShape(
const int * begin,
const int * end,
DataLayout layout = DATA_LAYOUT_UNKNOWN,
int C = 0 )
MatShape()#
cv::MatShape::MatShape(const MatShape & shape)
MatShape()#
cv::MatShape::MatShape(
const std::vector< int > & shape,
DataLayout layout = DATA_LAYOUT_UNKNOWN,
int C = 0 )
MatShape()#
cv::MatShape::MatShape(
int dims,
int value,
DataLayout layout = DATA_LAYOUT_UNKNOWN )
MatShape()#
cv::MatShape::MatShape(
size_t dims,
const int * sizes = nullptr,
DataLayout layout = DATA_LAYOUT_UNKNOWN,
int C = 0 )
MatShape()#
cv::MatShape::MatShape(
size_t dims,
int value,
DataLayout layout = DATA_LAYOUT_UNKNOWN )
MatShape()#
cv::MatShape::MatShape(std::initializer_list< int > shape)
Member Function Documentation#
assign()#
template<class _It>
void cv::MatShape::assign(
_It begin,
_It end )
assign()#
void cv::MatShape::assign(
const int * begin,
const int * end )
assign()#
void cv::MatShape::assign(
int newSize,
int value )
assign()#
void cv::MatShape::assign(
size_t newSize,
int value )
assign_()#
void cv::MatShape::assign_(
const int * begin,
const int * end )
back()#
int & cv::MatShape::back()
back()#
const int & cv::MatShape::back()
begin()#
int * cv::MatShape::begin()
begin()#
const int * cv::MatShape::begin()
channels()#
int cv::MatShape::channels()
Python:
cv.MatShape.channels() -> retval
clear()#
void cv::MatShape::clear()
Python:
cv.MatShape.clear()
data()#
int * cv::MatShape::data()
data()#
const int * cv::MatShape::data()
emplace_back()#
void cv::MatShape::emplace_back(int value)
empty()#
bool cv::MatShape::empty()
Python:
cv.MatShape.empty() -> retval
end()#
int * cv::MatShape::end()
end()#
const int * cv::MatShape::end()
erase()#
void cv::MatShape::erase(int * where)
Python:
cv.MatShape.erase(where)
expand()#
MatShape cv::MatShape::expand(const MatShape & another)
Python:
cv.MatShape.expand(another) -> retval
hasSymbols()#
bool cv::MatShape::hasSymbols()
Python:
cv.MatShape.hasSymbols() -> retval
insert()#
template<class _It>
void cv::MatShape::insert(
int * where,
_It begin,
_It end )
insert()#
void cv::MatShape::insert(
int * where,
const int * begin,
const int * end )
insert()#
void cv::MatShape::insert(
int * where,
int count,
int value )
insert()#
void cv::MatShape::insert(
int * where,
int value )
insert()#
void cv::MatShape::insert(
int * where,
size_t count,
int value )
insert_()#
void cv::MatShape::insert_(
int * where,
const int * begin,
const int * end )
isScalar()#
bool cv::MatShape::isScalar()
Python:
cv.MatShape.isScalar() -> retval
operator()()#
Size cv::MatShape::operator()()
operator=()#
MatShape & cv::MatShape::operator=(const MatShape & shape)
operator#
int & cv::MatShape::operator[](size_t idx)
operator#
const int & cv::MatShape::operator[](size_t idx)
push_back()#
void cv::MatShape::push_back(int value)
reserve()#
void cv::MatShape::reserve(size_t maxSize)
resize()#
void cv::MatShape::resize(
size_t newSize,
int value = 0 )
size()#
size_t cv::MatShape::size()
str()#
std::string cv::MatShape::str()
toLayout()#
MatShape cv::MatShape::toLayout(
DataLayout newLayout,
int C0 = 0 )
Python:
cv.MatShape.toLayout(newLayout[, C0]) -> retval
total()#
size_t cv::MatShape::total()
vec()#
std::vector< int > cv::MatShape::vec()
scalar()#
static MatShape cv::MatShape::scalar()
Member Data Documentation#
C#
int cv::MatShape::C
dims#
int cv::MatShape::dims
layout#
DataLayout cv::MatShape::layout
p#
int cv::MatShape::p
Source file#
The documentation for this struct was generated from the following file:
opencv2/core/mat.hpp