Class cv::Matx#

Template class for small matrices whose type and size are known at compilation time. View details

Collaboration diagram for cv::Matx:

Public Types#

enum cv::Matx {
    cv::rows = m,
    cv::cols = n,
    cv::channels = rows*cols,
    cv::shortdim = (m < n ? m : n)
}

Detailed Description#

Template class for small matrices whose type and size are known at compilation time.

If you need a more flexible type, use Mat . The elements of the matrix M are accessible using the M(i,j) notation. Most of the common matrix operations (see also MatrixExpressions ) are available. To do an operation on Matx that is not implemented, you can easily convert the matrix to Mat and backwards:

Matx33f m(1, 2, 3,
          4, 5, 6,
          7, 8, 9);
cout << sum(Mat(m*m.t())) << endl;
Except of the plain constructor which takes a list of elements, Matx can be initialized from a C-array:
float values[] = { 1, 2, 3};
Matx31f m(values);
In case if C++11 features are available, std::initializer_list can be also used to initialize Matx:
Matx31f m = { 1, 2, 3};

Member Typedef Documentation#

diag_type#

typedef Matx< _Tp, shortdim, 1 > cv::Matx::diag_type

mat_type#

typedef Matx< _Tp, m, n > cv::Matx::mat_type

value_type#

typedef _Tp cv::Matx::value_type

Member Enumeration Documentation#

enum Matx

rows

cols

channels

shortdim

Constructor & Destructor Documentation#

Matx()#

cv::Matx::Matx()

default constructor

Matx()#

cv::Matx::Matx(_Tp v0)

1x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1 )

1x2 or 2x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2 )

1x3 or 3x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3 )

1x4, 2x2 or 4x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4 )

1x5 or 5x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4,
_Tp v5 )

1x6, 2x3, 3x2 or 6x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4,
_Tp v5,
_Tp v6 )

1x7 or 7x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4,
_Tp v5,
_Tp v6,
_Tp v7 )

1x8, 2x4, 4x2 or 8x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4,
_Tp v5,
_Tp v6,
_Tp v7,
_Tp v8 )

1x9, 3x3 or 9x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4,
_Tp v5,
_Tp v6,
_Tp v7,
_Tp v8,
_Tp v9 )

1x10, 2x5 or 5x2 or 10x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4,
_Tp v5,
_Tp v6,
_Tp v7,
_Tp v8,
_Tp v9,
_Tp v10,
_Tp v11 )

1x12, 2x6, 3x4, 4x3, 6x2 or 12x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4,
_Tp v5,
_Tp v6,
_Tp v7,
_Tp v8,
_Tp v9,
_Tp v10,
_Tp v11,
_Tp v12,
_Tp v13 )

1x14, 2x7, 7x2 or 14x1 matrix

Matx()#

cv::Matx::Matx(
_Tp v0,
_Tp v1,
_Tp v2,
_Tp v3,
_Tp v4,
_Tp v5,
_Tp v6,
_Tp v7,
_Tp v8,
_Tp v9,
_Tp v10,
_Tp v11,
_Tp v12,
_Tp v13,
_Tp v14,
_Tp v15 )

1x16, 4x4 or 16x1 matrix

Matx()#

cv::Matx::Matx(const _Tp * vals)

initialize from a plain array

Matx()#

template<int l>
cv::Matx::Matx(
const Matx< _Tp, m, l > & a,
const Matx< _Tp, l, n > & b,
Matx_MatMulOp )

Matx()#

template<typename _T2>
cv::Matx::Matx(
const Matx< _Tp, m, n > & a,
_T2 alpha,
Matx_ScaleOp )

Matx()#

cv::Matx::Matx(
const Matx< _Tp, m, n > & a,
const Matx< _Tp, m, n > & b,
Matx_AddOp )

Matx()#

cv::Matx::Matx(
const Matx< _Tp, m, n > & a,
const Matx< _Tp, m, n > & b,
Matx_DivOp )

Matx()#

cv::Matx::Matx(
const Matx< _Tp, m, n > & a,
const Matx< _Tp, m, n > & b,
Matx_MulOp )

Matx()#

cv::Matx::Matx(
const Matx< _Tp, m, n > & a,
const Matx< _Tp, m, n > & b,
Matx_SubOp )

Matx()#

cv::Matx::Matx(
const Matx< _Tp, n, m > & a,
Matx_TOp )

Matx()#

cv::Matx::Matx(std::initializer_list< _Tp >)

initialize from an initializer list

Member Function Documentation#

col()#

Matx< _Tp, m, 1 > cv::Matx::col(int i)

extract the matrix column

convertTo()#

void cv::Matx::convertTo(
const _OutputArray & dst,
int type,
double scale = 1.,
double shift = 0. )

copyTo()#

void cv::Matx::copyTo(const _OutputArray & dst)

copy & convert

ddot()#

double cv::Matx::ddot(const Matx< _Tp, m, n > & v)

dot product computed in double-precision arithmetics

diag()#

diag_type cv::Matx::diag()

extract the matrix diagonal

div()#

Matx< _Tp, m, n > cv::Matx::div(const Matx< _Tp, m, n > & a)

divide two matrices element-wise

dot()#

_Tp cv::Matx::dot(const Matx< _Tp, m, n > & v)

dot product computed with the default precision

get_minor()#

template<int m1, int n1>
Matx< _Tp, m1, n1 > cv::Matx::get_minor(
int base_row,
int base_col )

extract part of the matrix

inv()#

Matx< _Tp, n, m > cv::Matx::inv(
int method = DECOMP_LU,
bool * p_is_ok = NULL )

invert the matrix

mul()#

Matx< _Tp, m, n > cv::Matx::mul(const Matx< _Tp, m, n > & a)

multiply two matrices element-wise

operator Matx< T2, m, n >()#

template<typename T2>
cv::Matx::operator Matx< T2, m, n >()

conversion to another data type

operator()()#

_Tp & cv::Matx::operator()(int i)

operator()()#

const _Tp & cv::Matx::operator()(int i)

1D element access

operator()()#

_Tp & cv::Matx::operator()(
int row,
int col )

operator()()#

const _Tp & cv::Matx::operator()(
int row,
int col )

element access

reshape()#

template<int m1, int n1>
Matx< _Tp, m1, n1 > cv::Matx::reshape()

change the matrix shape

row()#

Matx< _Tp, 1, n > cv::Matx::row(int i)

extract the matrix row

solve()#

template<int l>
Matx< _Tp, n, l > cv::Matx::solve(
const Matx< _Tp, m, l > & rhs,
int flags = DECOMP_LU )

solve linear system

solve()#

Vec< _Tp, n > cv::Matx::solve(
const Vec< _Tp, m > & rhs,
int method )

t()#

Matx< _Tp, n, m > cv::Matx::t()

transpose the matrix

all()#

static CV_NODISCARD_STD Matx cv::Matx::all(_Tp alpha)

diag()#

static CV_NODISCARD_STD Matx cv::Matx::diag(const diag_type & d)

eye()#

static CV_NODISCARD_STD Matx cv::Matx::eye()

ones()#

static CV_NODISCARD_STD Matx cv::Matx::ones()

randn()#

static CV_NODISCARD_STD Matx cv::Matx::randn(
_Tp a,
_Tp b )

Generates normally distributed random numbers.

Parameters

  • a — Mean value.

  • b — Standard deviation.

randu()#

static CV_NODISCARD_STD Matx cv::Matx::randu(
_Tp a,
_Tp b )

Generates uniformly distributed random numbers.

Parameters

  • aRange boundary.

  • b — The other range boundary (boundaries don’t have to be ordered, the lower boundary is inclusive, the upper one is exclusive).

zeros()#

static CV_NODISCARD_STD Matx cv::Matx::zeros()

Member Data Documentation#

val#

_Tp cv::Matx::val

matrix elements

Source file#

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