44
#ifndef OPENCV_CORE_MATX_HPP
45
#define OPENCV_CORE_MATX_HPP
48
# error matx.hpp header must be compiled as C++
51
#include "opencv2/core/cvdef.h"
52
#include "opencv2/core/base.hpp"
53
#include "opencv2/core/traits.hpp"
54
#include "opencv2/core/saturate.hpp"
56
#include <initializer_list>
68
struct
CV_EXPORTS Matx_AddOp { Matx_AddOp() {} Matx_AddOp(
const
Matx_AddOp&) {} };
69
struct
CV_EXPORTS Matx_SubOp { Matx_SubOp() {} Matx_SubOp(
const
Matx_SubOp&) {} };
70
struct
CV_EXPORTS Matx_ScaleOp { Matx_ScaleOp() {} Matx_ScaleOp(
const
Matx_ScaleOp&) {} };
71
struct
CV_EXPORTS Matx_MulOp { Matx_MulOp() {} Matx_MulOp(
const
Matx_MulOp&) {} };
72
struct
CV_EXPORTS Matx_DivOp { Matx_DivOp() {} Matx_DivOp(
const
Matx_DivOp&) {} };
73
struct
CV_EXPORTS Matx_MatMulOp { Matx_MatMulOp() {} Matx_MatMulOp(
const
Matx_MatMulOp&) {} };
74
struct
CV_EXPORTS Matx_TOp { Matx_TOp() {} Matx_TOp(
const
Matx_TOp&) {} };
99
template<
typename
_Tp,
int
m,
int
n>
class
Matx
105
channels = rows*cols,
106
#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
108
type = CV_MAKETYPE(depth, channels),
110
shortdim = (m < n ? m : n)
113
typedef
_Tp value_type;
123
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3);
124
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4);
125
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5);
126
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6);
127
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7);
128
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8);
129
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9);
130
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,
131
_Tp v4, _Tp v5, _Tp v6, _Tp v7,
132
_Tp v8, _Tp v9, _Tp v10, _Tp v11);
133
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,
134
_Tp v4, _Tp v5, _Tp v6, _Tp v7,
135
_Tp v8, _Tp v9, _Tp v10, _Tp v11,
137
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,
138
_Tp v4, _Tp v5, _Tp v6, _Tp v7,
139
_Tp v8, _Tp v9, _Tp v10, _Tp v11,
140
_Tp v12, _Tp v13, _Tp v14, _Tp v15);
141
explicit
Matx(
const
_Tp* vals);
143
Matx(std::initializer_list<_Tp>);
145
static
Matx
all(_Tp alpha);
267
typedef
_Tp channel_type;
270
enum
{ generic_type = 0,
273
#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
275
,type = CV_MAKETYPE(depth, channels)
281
template<
typename
_Tp,
int
m,
int
n>
283
template<
typename
_Tp,
int
m,
int
n>
307
template<
typename
_Tp,
int
m,
int
n>
static
double
norm(
const
Matx<_Tp, m, n>& M,
int
normType);
341
template<
typename
_Tp,
int
cn>
class
Vec
:
public
Matx<_Tp, cn, 1>
344
typedef
_Tp value_type;
347
#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
349
type = CV_MAKETYPE(depth, channels),
351
_dummy_enum_finalizer = 0
359
Vec(_Tp v0, _Tp v1, _Tp v2);
360
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3);
361
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4);
362
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5);
363
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6);
364
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7);
365
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8);
366
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9);
367
Vec(_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);
368
explicit
Vec(
const
_Tp* values);
370
Vec(std::initializer_list<_Tp>);
374
static
Vec
all(_Tp alpha);
394
const
_Tp& operator ()(
int
i)
const;
395
_Tp& operator ()(
int
i);
446
typedef
_Tp channel_type;
449
enum
{ generic_type = 0,
452
#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
454
type = CV_MAKETYPE(depth, channels),
456
_dummy_enum_finalizer = 0
461
template<
typename
_Tp,
int
cn>
463
template<
typename
_Tp,
int
cn>
488
template<
typename
_Tp,
int
m>
struct
Matx_DetOp
493
double
p =
LU(temp.val, m*
sizeof(_Tp), m, 0, 0, 0);
496
for(
int
i = 0; i < m; i++ )
502
template<
typename
_Tp>
struct
Matx_DetOp<_Tp, 1>
504
double
operator ()(
const
Matx<_Tp, 1, 1>& a)
const
510
template<
typename
_Tp>
struct
Matx_DetOp<_Tp, 2>
512
double
operator ()(
const
Matx<_Tp, 2, 2>& a)
const
514
return
a(0,0)*a(1,1) - a(0,1)*a(1,0);
518
template<
typename
_Tp>
struct
Matx_DetOp<_Tp, 3>
520
double
operator ()(
const
Matx<_Tp, 3, 3>& a)
const
522
return
a(0,0)*(a(1,1)*a(2,2) - a(2,1)*a(1,2)) -
523
a(0,1)*(a(1,0)*a(2,2) - a(2,0)*a(1,2)) +
524
a(0,2)*(a(1,0)*a(2,1) - a(2,0)*a(1,1));
528
template<
typename
_Tp> Vec<_Tp, 2>
inline
conjugate(
const
Vec<_Tp, 2>& v)
530
return
Vec<_Tp, 2>(v[0], -v[1]);
533
template<
typename
_Tp> Vec<_Tp, 4>
inline
conjugate(
const
Vec<_Tp, 4>& v)
535
return
Vec<_Tp, 4>(v[0], -v[1], -v[2], -v[3]);
544
template<
typename
_Tp,
int
m,
int
n>
inline
547
for(
int
i = 0; i < channels; i++) val[i] = _Tp(0);
550
template<
typename
_Tp,
int
m,
int
n>
inline
554
for(
int
i = 1; i < channels; i++) val[i] = _Tp(0);
557
template<
typename
_Tp,
int
m,
int
n>
inline
560
CV_StaticAssert(channels >= 2,
"Matx should have at least 2 elements.");
561
val[0] = v0; val[1] = v1;
562
for(
int
i = 2; i < channels; i++) val[i] = _Tp(0);
565
template<
typename
_Tp,
int
m,
int
n>
inline
568
CV_StaticAssert(channels >= 3,
"Matx should have at least 3 elements.");
569
val[0] = v0; val[1] = v1; val[2] = v2;
570
for(
int
i = 3; i < channels; i++) val[i] = _Tp(0);
573
template<
typename
_Tp,
int
m,
int
n>
inline
576
CV_StaticAssert(channels >= 4,
"Matx should have at least 4 elements.");
577
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
578
for(
int
i = 4; i < channels; i++) val[i] = _Tp(0);
581
template<
typename
_Tp,
int
m,
int
n>
inline
584
CV_StaticAssert(channels >= 5,
"Matx should have at least 5 elements.");
585
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; val[4] = v4;
586
for(
int
i = 5; i < channels; i++) val[i] = _Tp(0);
589
template<
typename
_Tp,
int
m,
int
n>
inline
592
CV_StaticAssert(channels >= 6,
"Matx should have at least 6 elements.");
593
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
594
val[4] = v4; val[5] = v5;
595
for(
int
i = 6; i < channels; i++) val[i] = _Tp(0);
598
template<
typename
_Tp,
int
m,
int
n>
inline
601
CV_StaticAssert(channels >= 7,
"Matx should have at least 7 elements.");
602
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
603
val[4] = v4; val[5] = v5; val[6] = v6;
604
for(
int
i = 7; i < channels; i++) val[i] = _Tp(0);
607
template<
typename
_Tp,
int
m,
int
n>
inline
610
CV_StaticAssert(channels >= 8,
"Matx should have at least 8 elements.");
611
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
612
val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
613
for(
int
i = 8; i < channels; i++) val[i] = _Tp(0);
616
template<
typename
_Tp,
int
m,
int
n>
inline
617
Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8)
619
CV_StaticAssert(channels >= 9,
"Matx should have at least 9 elements.");
620
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
621
val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
623
for(
int
i = 9; i < channels; i++) val[i] = _Tp(0);
626
template<
typename
_Tp,
int
m,
int
n>
inline
627
Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9)
629
CV_StaticAssert(channels >= 10,
"Matx should have at least 10 elements.");
630
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
631
val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
632
val[8] = v8; val[9] = v9;
633
for(
int
i = 10; i < channels; i++) val[i] = _Tp(0);
637
template<
typename
_Tp,
int
m,
int
n>
inline
638
Matx<_Tp,m,n>::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)
640
CV_StaticAssert(channels >= 12,
"Matx should have at least 12 elements.");
641
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
642
val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
643
val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;
644
for(
int
i = 12; i < channels; i++) val[i] = _Tp(0);
647
template<
typename
_Tp,
int
m,
int
n>
inline
648
Matx<_Tp,m,n>::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)
650
CV_StaticAssert(channels >= 14,
"Matx should have at least 14 elements.");
651
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
652
val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
653
val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;
654
val[12] = v12; val[13] = v13;
655
for
(
int
i = 14; i < channels; i++) val[i] = _Tp(0);
659
template<
typename
_Tp,
int
m,
int
n>
inline
660
Matx<_Tp,m,n>::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)
662
CV_StaticAssert(channels >= 16,
"Matx should have at least 16 elements.");
663
val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;
664
val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;
665
val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;
666
val[12] = v12; val[13] = v13; val[14] = v14; val[15] = v15;
667
for(
int
i = 16; i < channels; i++) val[i] = _Tp(0);
670
template<
typename
_Tp,
int
m,
int
n>
inline
673
for(
int
i = 0; i < channels; i++ ) val[i] = values[i];
676
template<
typename
_Tp,
int
m,
int
n>
inline
681
for(
const
auto& elem : list)
687
template<
typename
_Tp,
int
m,
int
n>
inline
688Matx<_Tp, m, n> Matx<_Tp, m, n>::all(_Tp alpha)
691
for(
int
i = 0; i < m*n; i++ ) M.val[i] = alpha;
695
template<
typename
_Tp,
int
m,
int
n>
inline
696Matx<_Tp,m,n> Matx<_Tp,m,n>::zeros()
701
template<
typename
_Tp,
int
m,
int
n>
inline
702Matx<_Tp,m,n> Matx<_Tp,m,n>::ones()
707
template<
typename
_Tp,
int
m,
int
n>
inline
708Matx<_Tp,m,n> Matx<_Tp,m,n>::eye()
711
for(
int
i = 0; i < shortdim; i++)
716
template<
typename
_Tp,
int
m,
int
n>
inline
720
for(
int
i = 0; i < channels; i++ ) s += val[i]*M.val[i];
724
template<
typename
_Tp,
int
m,
int
n>
inline
728
for(
int
i = 0; i < channels; i++ ) s += (
double)val[i]*M.val[i];
732
template<
typename
_Tp,
int
m,
int
n>
inline
736
for(
int
i = 0; i < shortdim; i++)
741
template<
typename
_Tp,
int
m,
int
n>
template<
typename
T2>
742
inline
Matx<_Tp, m, n>::operator Matx<T2, m, n>()
const
745
for(
int
i = 0; i < m*n; i++ ) M.val[i] = saturate_cast<T2>(val[i]);
749
template<
typename
_Tp,
int
m,
int
n>
template<
int
m1,
int
n1>
inline
752
CV_StaticAssert(m1*n1 == m*n,
"Input and destnarion matrices must have the same number of elements");
753
return
(
const
Matx<_Tp, m1, n1>&)*
this;
756
template<
typename
_Tp,
int
m,
int
n>
757
template<
int
m1,
int
n1>
inline
760
CV_DbgAssert(0 <= base_row && base_row+m1 <= m && 0 <= base_col && base_col+n1 <= n);
762
for(
int
di = 0; di < m1; di++ )
763
for(
int
dj = 0; dj < n1; dj++ )
764
s(di, dj) = (*this)(base_row+di, base_col+dj);
768
template<
typename
_Tp,
int
m,
int
n>
inline
772
return
Matx<_Tp, 1, n>(&val[i*n]);
775
template<
typename
_Tp,
int
m,
int
n>
inline
780
for(
int
i = 0; i < m; i++ )
781
v.val[i] = val[i*n + j];
785
template<
typename
_Tp,
int
m,
int
n>
inline
789
for(
int
i = 0; i < shortdim; i++ )
790
d.val[i] = val[i*n + i];
794
template<
typename
_Tp,
int
m,
int
n>
inline
797
CV_DbgAssert( (
unsigned)row_idx < (
unsigned)m && (
unsigned)col_idx < (
unsigned)n );
798
return
this->val[row_idx*n + col_idx];
801
template<
typename
_Tp,
int
m,
int
n>
inline
804
CV_DbgAssert( (
unsigned)row_idx < (
unsigned)m && (
unsigned)col_idx < (
unsigned)n );
805
return
val[row_idx*n + col_idx];
808
template<
typename
_Tp,
int
m,
int
n>
inline
811
CV_StaticAssert(m == 1 || n == 1,
"Single index indexation requires matrix to be a column or a row");
816
template<
typename
_Tp,
int
m,
int
n>
inline
819
CV_StaticAssert(m == 1 || n == 1,
"Single index indexation requires matrix to be a column or a row");
824
template<
typename
_Tp,
int
m,
int
n>
inline
827
for(
int
i = 0; i < channels; i++ )
828
val[i] = saturate_cast<_Tp>(a.val[i] + b.val[i]);
831
template<
typename
_Tp,
int
m,
int
n>
inline
834
for(
int
i = 0; i < channels; i++ )
835
val[i] = saturate_cast<_Tp>(a.val[i] - b.val[i]);
838
template<
typename
_Tp,
int
m,
int
n>
template<
typename
_T2>
inline
841
for(
int
i = 0; i < channels; i++ )
842
val[i] = saturate_cast<_Tp>(a.val[i] * alpha);
845
template<
typename
_Tp,
int
m,
int
n>
inline
848
for(
int
i = 0; i < channels; i++ )
849
val[i] = saturate_cast<_Tp>(a.val[i] * b.val[i]);
852
template<
typename
_Tp,
int
m,
int
n>
inline
855
for(
int
i = 0; i < channels; i++ )
856
val[i] = saturate_cast<_Tp>(a.val[i] / b.val[i]);
859
template<
typename
_Tp,
int
m,
int
n>
template<
int
l>
inline
862
for(
int
i = 0; i < m; i++ )
863
for(
int
j = 0; j < n; j++ )
866
for(
int
k = 0; k < l; k++ )
867
s += a(i, k) * b(k, j);
872
template<
typename
_Tp,
int
m,
int
n>
inline
875
for(
int
i = 0; i < m; i++ )
876
for(
int
j = 0; j < n; j++ )
877
val[i*n + j] = a(j, i);
880
template<
typename
_Tp,
int
m,
int
n>
inline
883
return
Matx<_Tp, m, n>(*
this, a, Matx_MulOp());
886
template<
typename
_Tp,
int
m,
int
n>
inline
889
return
Matx<_Tp, m, n>(*
this, a, Matx_DivOp());
892
template<
typename
_Tp,
int
m,
int
n>
inline
895
return
Matx<_Tp, n, m>(*
this, Matx_TOp());
898
template<
typename
_Tp,
int
m,
int
n>
inline
901
Matx<_Tp, n, 1> x =
solve((
const
Matx<_Tp, m, 1>&)(rhs), method);
902
return
(Vec<_Tp, n>&)(x);
905
template<
typename
_Tp,
int
m>
static
inline
908
return
cv::internal::Matx_DetOp<_Tp, m>()(a);
911
template<
typename
_Tp,
int
m,
int
n>
static
inline
912
double
trace(
const
Matx<_Tp, m, n>& a)
915
for(
int
i = 0; i <
std::min(m, n); i++ )
920
template<
typename
_Tp,
int
m,
int
n>
static
inline
921
double
norm(
const
Matx<_Tp, m, n>& M)
923
return
std::sqrt(normL2Sqr<_Tp, double>(M.val, m*n));
926
template<
typename
_Tp,
int
m,
int
n>
static
inline
927
double
norm(
const
Matx<_Tp, m, n>& M,
int
normType)
931
return
(
double)normInf<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n);
933
return
(
double)normL1<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n);
935
return
(
double)normL2Sqr<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n);
938
return
std::sqrt((
double)normL2Sqr<_Tp,
typename
DataType<_Tp>::work_type>(M.val, m*n));
946
template<
typename
_Tp,
typename
_T2,
int
m,
int
n>
static
inline
947MatxCommaInitializer<_Tp, m, n> operator << (
const
Matx<_Tp, m, n>& mtx, _T2 val)
949
MatxCommaInitializer<_Tp, m, n> commaInitializer((Matx<_Tp, m, n>*)&mtx);
950
return
(commaInitializer, val);
953
template<
typename
_Tp,
int
m,
int
n>
inline
954MatxCommaInitializer<_Tp, m, n>::MatxCommaInitializer(Matx<_Tp, m, n>* _mtx)
958
template<
typename
_Tp,
int
m,
int
n>
template<
typename
_T2>
inline
959MatxCommaInitializer<_Tp, m, n>& MatxCommaInitializer<_Tp, m, n>::operator , (_T2 value)
962
dst->val[idx++] = saturate_cast<_Tp>(value);
966
template<
typename
_Tp,
int
m,
int
n>
inline
967Matx<_Tp, m, n> MatxCommaInitializer<_Tp, m, n>::operator *()
const
977
template<
typename
_Tp,
int
cn>
inline
980
template<
typename
_Tp,
int
cn>
inline
982
: Matx<_Tp, cn, 1>(v0) {}
984
template<
typename
_Tp,
int
cn>
inline
986
: Matx<_Tp, cn, 1>(v0, v1) {}
988
template<
typename
_Tp,
int
cn>
inline
990
: Matx<_Tp, cn, 1>(v0, v1, v2) {}
992
template<
typename
_Tp,
int
cn>
inline
994
: Matx<_Tp, cn, 1>(v0, v1, v2, v3) {}
996
template<
typename
_Tp,
int
cn>
inline
998
: Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4) {}
1000
template<
typename
_Tp,
int
cn>
inline
1002
: Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5) {}
1004
template<
typename
_Tp,
int
cn>
inline
1006
: Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6) {}
1008
template<
typename
_Tp,
int
cn>
inline
1009
Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7)
1010
: Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7) {}
1012
template<
typename
_Tp,
int
cn>
inline
1013
Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8)
1014
: Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8) {}
1016
template<
typename
_Tp,
int
cn>
inline
1017
Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9)
1018
: Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {}
1020
template<
typename
_Tp,
int
cn>
inline
1021
Vec<_Tp, cn>::Vec(_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)
1022
: Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) {}
1024
template<
typename
_Tp,
int
cn>
inline
1026
: Matx<_Tp, cn, 1>(values) {}
1028
template<
typename
_Tp,
int
cn>
inline
1030
: Matx<_Tp, cn, 1>(list) {}
1032
template<
typename
_Tp,
int
cn>
inline
1034
: Matx<_Tp, cn, 1>(m.val) {}
1036
template<
typename
_Tp,
int
cn>
inline
1037
Vec<_Tp, cn>::Vec(
const
Matx<_Tp, cn, 1>& a,
const
Matx<_Tp, cn, 1>& b, Matx_AddOp op)
1038
: Matx<_Tp, cn, 1>(a, b, op) {}
1040
template<
typename
_Tp,
int
cn>
inline
1041
Vec<_Tp, cn>::Vec(
const
Matx<_Tp, cn, 1>& a,
const
Matx<_Tp, cn, 1>& b, Matx_SubOp op)
1042
: Matx<_Tp, cn, 1>(a, b, op) {}
1044
template<
typename
_Tp,
int
cn>
template<
typename
_T2>
inline
1046
: Matx<_Tp, cn, 1>(a, alpha, op) {}
1048
template<
typename
_Tp,
int
cn>
inline
1049Vec<_Tp, cn> Vec<_Tp, cn>::all(_Tp alpha)
1052
for(
int
i = 0; i < cn; i++ ) v.val[i] = alpha;
1056
template<
typename
_Tp,
int
cn>
inline
1060
for(
int
i = 0; i < cn; i++ ) w.val[i] = saturate_cast<_Tp>(this->val[i]*v.val[i]);
1067
return
cv::internal::conjugate(*
this);
1071Vec<double, 2> Vec<double, 2>::conj()
const
1073
return
cv::internal::conjugate(*
this);
1077Vec<float, 4> Vec<float, 4>::conj()
const
1079
return
cv::internal::conjugate(*
this);
1083Vec<double, 4> Vec<double, 4>::conj()
const
1085
return
cv::internal::conjugate(*
this);
1088
template<
typename
_Tp,
int
cn>
inline
1089Vec<_Tp, cn> Vec<_Tp, cn>::cross(
const
Vec<_Tp, cn>&)
const
1091
CV_StaticAssert(cn == 3,
"for arbitrary-size vector there is no cross-product defined");
1092
return
Vec<_Tp, cn>();
1096Vec<float, 3> Vec<float, 3>::cross(
const
Vec<float, 3>& v)
const
1098
return
Vec<float,3>(this->val[1]*v.val[2] - this->val[2]*v.val[1],
1099
this->val[2]*v.val[0] - this->val[0]*v.val[2],
1100
this->val[0]*v.val[1] - this->val[1]*v.val[0]);
1104Vec<double, 3> Vec<double, 3>::cross(
const
Vec<double, 3>& v)
const
1106
return
Vec<double,3>(this->val[1]*v.val[2] - this->val[2]*v.val[1],
1107
this->val[2]*v.val[0] - this->val[0]*v.val[2],
1108
this->val[0]*v.val[1] - this->val[1]*v.val[0]);
1111
template<
typename
_Tp,
int
cn>
template<
typename
T2>
inline
1112Vec<_Tp, cn>::operator Vec<T2, cn>()
const
1115
for(
int
i = 0; i < cn; i++ ) v.val[i] = saturate_cast<T2>(this->val[i]);
1119
template<
typename
_Tp,
int
cn>
inline
1120
const
_Tp& Vec<_Tp, cn>::operator [](
int
i)
const
1123
return
this->val[i];
1126
template<
typename
_Tp,
int
cn>
inline
1127_Tp& Vec<_Tp, cn>::operator [](
int
i)
1130
return
this->val[i];
1133
template<
typename
_Tp,
int
cn>
inline
1134
const
_Tp& Vec<_Tp, cn>::operator ()(
int
i)
const
1137
return
this->val[i];
1140
template<
typename
_Tp,
int
cn>
inline
1141_Tp& Vec<_Tp, cn>::operator ()(
int
i)
1144
return
this->val[i];
1147
template<
typename
_Tp,
int
cn>
inline
1148Vec<_Tp, cn>
normalize(
const
Vec<_Tp, cn>& v)
1150
double
nv =
norm(v);
1151
return
v * (nv ? 1./nv : 0.);
1159
template<
typename
_Tp,
typename
_T2,
int
cn>
static
inline
1160VecCommaInitializer<_Tp, cn>
operator <<
(
const
Vec<_Tp, cn>& vec, _T2 val)
1162
VecCommaInitializer<_Tp, cn> commaInitializer((Vec<_Tp, cn>*)&vec);
1163
return
(commaInitializer, val);
1166
template<
typename
_Tp,
int
cn>
inline
1167VecCommaInitializer<_Tp, cn>::VecCommaInitializer(Vec<_Tp, cn>* _vec)
1168
: MatxCommaInitializer<_Tp, cn, 1>(_vec)
1171
template<
typename
_Tp,
int
cn>
template<
typename
_T2>
inline
1172VecCommaInitializer<_Tp, cn>& VecCommaInitializer<_Tp, cn>::operator , (_T2 value)
1175
this->dst->val[this->idx++] = saturate_cast<_Tp>(value);
1179
template<
typename
_Tp,
int
cn>
inline
1180Vec<_Tp, cn> VecCommaInitializer<_Tp, cn>::operator *()
const
1193
template<
typename
_Tp1,
typename
_Tp2,
int
m,
int
n>
static
inline
1194Matx<_Tp1, m, n>& operator += (Matx<_Tp1, m, n>& a,
const
Matx<_Tp2, m, n>& b)
1196
for(
int
i = 0; i < m*n; i++ )
1197
a.val[i] = saturate_cast<_Tp1>(a.val[i] + b.val[i]);
1201
template<
typename
_Tp1,
typename
_Tp2,
int
m,
int
n>
static
inline
1202Matx<_Tp1, m, n>& operator -= (Matx<_Tp1, m, n>& a,
const
Matx<_Tp2, m, n>& b)
1204
for(
int
i = 0; i < m*n; i++ )
1205
a.val[i] = saturate_cast<_Tp1>(a.val[i] - b.val[i]);
1209
template<
typename
_Tp,
int
m,
int
n>
static
inline
1210Matx<_Tp, m, n> operator + (
const
Matx<_Tp, m, n>& a,
const
Matx<_Tp, m, n>& b)
1212
return
Matx<_Tp, m, n>(a, b, Matx_AddOp());
1215
template<
typename
_Tp,
int
m,
int
n>
static
inline
1216Matx<_Tp, m, n> operator - (
const
Matx<_Tp, m, n>& a,
const
Matx<_Tp, m, n>& b)
1218
return
Matx<_Tp, m, n>(a, b, Matx_SubOp());
1221
template<
typename
_Tp,
int
m,
int
n>
static
inline
1222Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a,
int
alpha)
1224
for(
int
i = 0; i < m*n; i++ )
1225
a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha);
1229
template<
typename
_Tp,
int
m,
int
n>
static
inline
1230Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a,
float
alpha)
1232
for(
int
i = 0; i < m*n; i++ )
1233
a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha);
1237
template<
typename
_Tp,
int
m,
int
n>
static
inline
1238Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a,
double
alpha)
1240
for(
int
i = 0; i < m*n; i++ )
1241
a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha);
1245
template<
typename
_Tp,
int
m,
int
n>
static
inline
1246Matx<_Tp, m, n> operator * (
const
Matx<_Tp, m, n>& a,
int
alpha)
1248
return
Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());
1251
template<
typename
_Tp,
int
m,
int
n>
static
inline
1252Matx<_Tp, m, n> operator * (
const
Matx<_Tp, m, n>& a,
float
alpha)
1254
return
Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());
1257
template<
typename
_Tp,
int
m,
int
n>
static
inline
1258Matx<_Tp, m, n> operator * (
const
Matx<_Tp, m, n>& a,
double
alpha)
1260
return
Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());
1263
template<
typename
_Tp,
int
m,
int
n>
static
inline
1264Matx<_Tp, m, n> operator * (
int
alpha,
const
Matx<_Tp, m, n>& a)
1266
return
Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());
1269
template<
typename
_Tp,
int
m,
int
n>
static
inline
1270Matx<_Tp, m, n> operator * (
float
alpha,
const
Matx<_Tp, m, n>& a)
1272
return
Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());
1275
template<
typename
_Tp,
int
m,
int
n>
static
inline
1276Matx<_Tp, m, n> operator * (
double
alpha,
const
Matx<_Tp, m, n>& a)
1278
return
Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());
1281
template<
typename
_Tp,
int
m,
int
n>
static
inline
1282Matx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a,
float
alpha)
1284
for(
int
i = 0; i < m*n; i++ )
1285
a.val[i] = a.val[i] / alpha;
1289
template<
typename
_Tp,
int
m,
int
n>
static
inline
1290Matx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a,
double
alpha)
1292
for(
int
i = 0; i < m*n; i++ )
1293
a.val[i] = a.val[i] / alpha;
1297
template<
typename
_Tp,
int
m,
int
n>
static
inline
1298Matx<_Tp, m, n>
operator /
(
const
Matx<_Tp, m, n>& a,
float
alpha)
1300
return
Matx<_Tp, m, n>(a, 1.f/alpha, Matx_ScaleOp());
1303
template<
typename
_Tp,
int
m,
int
n>
static
inline
1304Matx<_Tp, m, n>
operator /
(
const
Matx<_Tp, m, n>& a,
double
alpha)
1306
return
Matx<_Tp, m, n>(a, 1./alpha, Matx_ScaleOp());
1309
template<
typename
_Tp,
int
m,
int
n>
static
inline
1310Matx<_Tp, m, n> operator - (
const
Matx<_Tp, m, n>& a)
1312
return
Matx<_Tp, m, n>(a, -1, Matx_ScaleOp());
1315
template<
typename
_Tp,
int
m,
int
n,
int
l>
static
inline
1316Matx<_Tp, m, n> operator * (
const
Matx<_Tp, m, l>& a,
const
Matx<_Tp, l, n>& b)
1318
return
Matx<_Tp, m, n>(a, b, Matx_MatMulOp());
1321
template<
typename
_Tp,
int
m,
int
n>
static
inline
1322Vec<_Tp, m> operator * (
const
Matx<_Tp, m, n>& a,
const
Vec<_Tp, n>& b)
1324
Matx<_Tp, m, 1> c(a, b, Matx_MatMulOp());
1325
return
(
const
Vec<_Tp, m>&)(c);
1328
template<
typename
_Tp,
int
m,
int
n>
static
inline
1329
bool
operator == (
const
Matx<_Tp, m, n>& a,
const
Matx<_Tp, m, n>& b)
1331
for(
int
i = 0; i < m*n; i++ )
1332
if( a.val[i] != b.val[i] )
return
false;
1336
template<
typename
_Tp,
int
m,
int
n>
static
inline
1337
bool
operator != (
const
Matx<_Tp, m, n>& a,
const
Matx<_Tp, m, n>& b)
1349
template<
typename
_Tp1,
typename
_Tp2,
int
cn>
static
inline
1350Vec<_Tp1, cn>& operator += (Vec<_Tp1, cn>& a,
const
Vec<_Tp2, cn>& b)
1352
for(
int
i = 0; i < cn; i++ )
1353
a.val[i] = saturate_cast<_Tp1>(a.val[i] + b.val[i]);
1357
template<
typename
_Tp1,
typename
_Tp2,
int
cn>
static
inline
1358Vec<_Tp1, cn>& operator -= (Vec<_Tp1, cn>& a,
const
Vec<_Tp2, cn>& b)
1360
for(
int
i = 0; i < cn; i++ )
1361
a.val[i] = saturate_cast<_Tp1>(a.val[i] - b.val[i]);
1365
template<
typename
_Tp,
int
cn>
static
inline
1366Vec<_Tp, cn> operator + (
const
Vec<_Tp, cn>& a,
const
Vec<_Tp, cn>& b)
1368
return
Vec<_Tp, cn>(a, b, Matx_AddOp());
1371
template<
typename
_Tp,
int
cn>
static
inline
1372Vec<_Tp, cn> operator - (
const
Vec<_Tp, cn>& a,
const
Vec<_Tp, cn>& b)
1374
return
Vec<_Tp, cn>(a, b, Matx_SubOp());
1377
template<
typename
_Tp,
int
cn>
static
inline
1378Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a,
int
alpha)
1380
for(
int
i = 0; i < cn; i++ )
1381
a[i] = saturate_cast<_Tp>(a[i]*alpha);
1385
template<
typename
_Tp,
int
cn>
static
inline
1386Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a,
float
alpha)
1388
for(
int
i = 0; i < cn; i++ )
1389
a[i] = saturate_cast<_Tp>(a[i]*alpha);
1393
template<
typename
_Tp,
int
cn>
static
inline
1394Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a,
double
alpha)
1396
for(
int
i = 0; i < cn; i++ )
1397
a[i] = saturate_cast<_Tp>(a[i]*alpha);
1401
template<
typename
_Tp,
int
cn>
static
inline
1402Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a,
int
alpha)
1404
double
ialpha = 1./alpha;
1405
for(
int
i = 0; i < cn; i++ )
1406
a[i] = saturate_cast<_Tp>(a[i]*ialpha);
1410
template<
typename
_Tp,
int
cn>
static
inline
1411Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a,
float
alpha)
1413
float
ialpha = 1.f/alpha;
1414
for(
int
i = 0; i < cn; i++ )
1415
a[i] = saturate_cast<_Tp>(a[i]*ialpha);
1419
template<
typename
_Tp,
int
cn>
static
inline
1420Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a,
double
alpha)
1422
double
ialpha = 1./alpha;
1423
for(
int
i = 0; i < cn; i++ )
1424
a[i] = saturate_cast<_Tp>(a[i]*ialpha);
1428
template<
typename
_Tp,
int
cn>
static
inline
1429Vec<_Tp, cn> operator * (
const
Vec<_Tp, cn>& a,
int
alpha)
1431
return
Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());
1434
template<
typename
_Tp,
int
cn>
static
inline
1435Vec<_Tp, cn> operator * (
int
alpha,
const
Vec<_Tp, cn>& a)
1437
return
Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());
1440
template<
typename
_Tp,
int
cn>
static
inline
1441Vec<_Tp, cn> operator * (
const
Vec<_Tp, cn>& a,
float
alpha)
1443
return
Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());
1446
template<
typename
_Tp,
int
cn>
static
inline
1447Vec<_Tp, cn> operator * (
float
alpha,
const
Vec<_Tp, cn>& a)
1449
return
Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());
1452
template<
typename
_Tp,
int
cn>
static
inline
1453Vec<_Tp, cn> operator * (
const
Vec<_Tp, cn>& a,
double
alpha)
1455
return
Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());
1458
template<
typename
_Tp,
int
cn>
static
inline
1459Vec<_Tp, cn> operator * (
double
alpha,
const
Vec<_Tp, cn>& a)
1461
return
Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());
1464
template<
typename
_Tp,
int
cn>
static
inline
1465Vec<_Tp, cn>
operator /
(
const
Vec<_Tp, cn>& a,
int
alpha)
1467
return
Vec<_Tp, cn>(a, 1./alpha, Matx_ScaleOp());
1470
template<
typename
_Tp,
int
cn>
static
inline
1471Vec<_Tp, cn>
operator /
(
const
Vec<_Tp, cn>& a,
float
alpha)
1473
return
Vec<_Tp, cn>(a, 1.f/alpha, Matx_ScaleOp());
1476
template<
typename
_Tp,
int
cn>
static
inline
1477Vec<_Tp, cn>
operator /
(
const
Vec<_Tp, cn>& a,
double
alpha)
1479
return
Vec<_Tp, cn>(a, 1./alpha, Matx_ScaleOp());
1482
template<
typename
_Tp,
int
cn>
static
inline
1483Vec<_Tp, cn> operator - (
const
Vec<_Tp, cn>& a)
1486
for(
int
i = 0; i < cn; i++ ) t.val[i] = saturate_cast<_Tp>(-a.val[i]);
1490
template<
typename
_Tp>
inline
Vec<_Tp, 4> operator * (
const
Vec<_Tp, 4>& v1,
const
Vec<_Tp, 4>& v2)
1492
return
Vec<_Tp, 4>(saturate_cast<_Tp>(v1[0]*v2[0] - v1[1]*v2[1] - v1[2]*v2[2] - v1[3]*v2[3]),
1493
saturate_cast<_Tp>(v1[0]*v2[1] + v1[1]*v2[0] + v1[2]*v2[3] - v1[3]*v2[2]),
1494
saturate_cast<_Tp>(v1[0]*v2[2] - v1[1]*v2[3] + v1[2]*v2[0] + v1[3]*v2[1]),
1495
saturate_cast<_Tp>(v1[0]*v2[3] + v1[1]*v2[2] - v1[2]*v2[1] + v1[3]*v2[0]));
1498
template<
typename
_Tp>
inline
Vec<_Tp, 4>& operator *= (Vec<_Tp, 4>& v1,
const
Vec<_Tp, 4>& v2)
Template "trait" class for OpenCV primitive data types.
Definition:
traits.hpp:113
CV_EXPORTS FileStorage & operator<<(FileStorage &fs, const String &str)
Writes string to a file storage.
Comma-separated Matrix Initializer
Definition:
matx.hpp:291
Template class for small matrices whose type and size are known at compilation time
Definition:
matx.hpp:100
Matx(_Tp v0, _Tp v1, _Tp v2)
1x3 or 3x1 matrix
Matx< _Tp, m, n > mul(const Matx< _Tp, m, n > &a) const
multiply two matrices element-wise
Matx()
default constructor
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(_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
static Matx randn(_Tp a, _Tp b)
Generates normally distributed random numbers
Matx< _Tp, n, m > t() const
transpose the matrix
Matx< _Tp, n, m > inv(int method=DECOMP_LU, bool *p_is_ok=NULL) const
invert the matrix
Matx< _Tp, 1, n > row(int i) const
extract the matrix row
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4)
1x5 or 5x1 matrix
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6)
1x7 or 7x1 matrix
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< _Tp, m, 1 > col(int i) const
extract the matrix column
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(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5)
1x6, 2x3, 3x2 or 6x1 matrix
Matx< _Tp, m, n > div(const Matx< _Tp, m, n > &a) const
divide two matrices element-wise
Matx(_Tp v0, _Tp v1)
1x2 or 2x1 matrix
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3)
1x4, 2x2 or 4x1 matrix
diag_type diag() const
extract the matrix diagonal
Matx(const _Tp *vals)
initialize from a plain array
static Matx randu(_Tp a, _Tp b)
Generates uniformly distributed random numbers
Matx< _Tp, m1, n1 > reshape() const
change the matrix shape
const _Tp & operator()(int row, int col) const
element access
Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7)
1x8, 2x4, 4x2 or 8x1 matrix
Matx< _Tp, n, l > solve(const Matx< _Tp, m, l > &rhs, int flags=DECOMP_LU) const
solve linear system
double ddot(const Matx< _Tp, m, n > &v) const
dot product computed in double-precision arithmetics
Matx(std::initializer_list< _Tp >)
initialize from an initializer list
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< _Tp, m1, n1 > get_minor(int base_row, int base_col) const
extract part of the matrix
_Tp dot(const Matx< _Tp, m, n > &v) const
dot product computed with the default precision
Comma-separated Vec Initializer
Definition:
matx.hpp:471
Template class for short numerical vectors, a partial case of Matx
Definition:
matx.hpp:342
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8)
9-element vector constructor
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3)
4-element vector constructor
Vec(_Tp v0)
1-element vector constructor
Vec(_Tp v0, _Tp v1, _Tp v2)
3-element vector constructor
Vec()
default constructor
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9)
10-element vector constructor
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6)
7-element vector constructor
const _Tp & operator[](int i) const
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5)
6-element vector constructor
Vec mul(const Vec< _Tp, cn > &v) const
per-element multiplication
Vec(_Tp v0, _Tp v1)
2-element vector constructor
Vec(_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)
14-element vector constructor
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4)
5-element vector constructor
Vec cross(const Vec &v) const
Vec conj() const
conjugation (makes sense for complex numbers and quaternions)
Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7)
8-element vector constructor
CV_EXPORTS_W void sqrt(InputArray src, OutputArray dst)
Calculates a square root of array elements.
CV_EXPORTS_W double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
Calculates the absolute norm of an array.
CV_EXPORTS_W bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
Solves one or more linear systems or least-squares problems.
CV_EXPORTS_W Scalar trace(InputArray mtx)
Returns the trace of a matrix.
CV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst)
Calculates per-element minimum of two arrays or an array and a scalar.
CV_EXPORTS_W double determinant(InputArray mtx)
Returns the determinant of a square floating-point matrix.
CV_EXPORTS_W void normalize(InputArray src, InputOutputArray dst, double alpha=1, double beta=0, int norm_type=NORM_L2, int dtype=-1, InputArray mask=noArray())
Normalizes the norm or value range of an array.
@ DECOMP_LU
Definition:
base.hpp:135
@ NORM_L2
Definition:
base.hpp:185
@ NORM_L1
Definition:
base.hpp:176
@ NORM_L2SQR
Definition:
base.hpp:194
@ NORM_INF
Definition:
base.hpp:168
CV_INLINE v_reg< _Tp, n > operator/(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Divide values
CV_EXPORTS int LU(float *A, size_t astep, int m, float *b, size_t bstep, int n)
#define CV_DbgAssert(expr)
Definition:
base.hpp:375
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75
DualQuat< T > conjugate(const DualQuat< T > &dq)
Definition:
dualquaternion.inl.hpp:125
Definition:
traits.hpp:382
Definition:
traits.hpp:402
Definition:
traits.hpp:386