Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
018aba75
Commit
018aba75
authored
Nov 06, 2010
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a few small fixes in Matx operators
parent
d8ace437
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
operations.hpp
modules/core/include/opencv2/core/operations.hpp
+14
-14
No files found.
modules/core/include/opencv2/core/operations.hpp
View file @
018aba75
...
...
@@ -916,7 +916,7 @@ double norm(const Matx<_Tp, m, n>& M, int normType)
{
if
(
normType
==
NORM_INF
)
{
T1
s
=
0
;
_Tp
s
=
0
;
for
(
int
i
=
0
;
i
<
m
*
n
;
i
++
)
s
=
std
::
max
(
s
,
std
::
abs
(
M
.
val
[
i
]));
return
s
;
...
...
@@ -924,7 +924,7 @@ double norm(const Matx<_Tp, m, n>& M, int normType)
if
(
normType
==
NORM_L1
)
{
T1
s
=
0
;
_Tp
s
=
0
;
for
(
int
i
=
0
;
i
<
m
*
n
;
i
++
)
s
+=
std
::
abs
(
M
.
val
[
i
]);
return
s
;
...
...
@@ -939,7 +939,7 @@ template<typename _Tp, int m, int n> static inline
bool
operator
==
(
const
Matx
<
_Tp
,
m
,
n
>&
a
,
const
Matx
<
_Tp
,
m
,
n
>&
b
)
{
for
(
int
i
=
0
;
i
<
m
*
n
;
i
++
)
if
(
a
[
i
]
!=
b
[
i
]
)
return
false
;
if
(
a
.
val
[
i
]
!=
b
.
val
[
i
]
)
return
false
;
return
true
;
}
...
...
@@ -1047,7 +1047,7 @@ template<typename _Tp, int cn> inline Vec<_Tp, cn> Vec<_Tp, cn>::all(_Tp alpha)
template
<
typename
_Tp
,
int
cn
>
inline
Vec
<
_Tp
,
cn
>
Vec
<
_Tp
,
cn
>::
mul
(
const
Vec
<
_Tp
,
cn
>&
v
)
const
{
Vec
<
_Tp
,
cn
>
w
;
for
(
int
i
=
0
;
i
<
cn
;
i
++
)
w
.
val
[
i
]
=
saturate_cast
<
_Tp
>
(
val
[
i
]
*
v
.
val
[
i
]);
for
(
int
i
=
0
;
i
<
cn
;
i
++
)
w
.
val
[
i
]
=
saturate_cast
<
_Tp
>
(
this
->
val
[
i
]
*
v
.
val
[
i
]);
return
w
;
}
...
...
@@ -1061,7 +1061,7 @@ template<typename _Tp, int cn> template<typename T2>
inline
Vec
<
_Tp
,
cn
>::
operator
Vec
<
T2
,
cn
>
()
const
{
Vec
<
T2
,
cn
>
v
;
for
(
int
i
=
0
;
i
<
cn
;
i
++
)
v
.
val
[
i
]
=
saturate_cast
<
T2
>
(
val
[
i
]);
for
(
int
i
=
0
;
i
<
cn
;
i
++
)
v
.
val
[
i
]
=
saturate_cast
<
T2
>
(
this
->
val
[
i
]);
return
v
;
}
...
...
@@ -1069,7 +1069,7 @@ template<typename _Tp, int cn> inline Vec<_Tp, cn>::operator CvScalar() const
{
CvScalar
s
=
{{
0
,
0
,
0
,
0
}};
int
i
;
for
(
i
=
0
;
i
<
std
::
min
(
cn
,
4
);
i
++
)
s
.
val
[
i
]
=
val
[
i
];
for
(
i
=
0
;
i
<
std
::
min
(
cn
,
4
);
i
++
)
s
.
val
[
i
]
=
this
->
val
[
i
];
for
(
;
i
<
4
;
i
++
)
s
.
val
[
i
]
=
0
;
return
s
;
}
...
...
@@ -1077,25 +1077,25 @@ template<typename _Tp, int cn> inline Vec<_Tp, cn>::operator CvScalar() const
template
<
typename
_Tp
,
int
cn
>
inline
const
_Tp
&
Vec
<
_Tp
,
cn
>::
operator
[](
int
i
)
const
{
CV_DbgAssert
(
(
unsigned
)
i
<
(
unsigned
)
cn
);
return
val
[
i
];
return
this
->
val
[
i
];
}
template
<
typename
_Tp
,
int
cn
>
inline
_Tp
&
Vec
<
_Tp
,
cn
>::
operator
[](
int
i
)
{
CV_DbgAssert
(
(
unsigned
)
i
<
(
unsigned
)
cn
);
return
val
[
i
];
return
this
->
val
[
i
];
}
template
<
typename
_Tp
,
int
cn
>
inline
const
_Tp
&
Vec
<
_Tp
,
cn
>::
operator
()(
int
i
)
const
{
CV_DbgAssert
(
(
unsigned
)
i
<
(
unsigned
)
cn
);
return
val
[
i
];
return
this
->
val
[
i
];
}
template
<
typename
_Tp
,
int
cn
>
inline
_Tp
&
Vec
<
_Tp
,
cn
>::
operator
()(
int
i
)
{
CV_DbgAssert
(
(
unsigned
)
i
<
(
unsigned
)
cn
);
return
val
[
i
];
return
this
->
val
[
i
];
}
template
<
typename
_Tp1
,
typename
_Tp2
,
int
cn
>
static
inline
Vec
<
_Tp1
,
cn
>&
...
...
@@ -1241,14 +1241,14 @@ VecCommaInitializer<_Tp, cn> operator << (const Vec<_Tp, cn>& vec, _T2 val)
template
<
typename
_Tp
,
int
cn
>
inline
VecCommaInitializer
<
_Tp
,
cn
>::
VecCommaInitializer
(
Vec
<
_Tp
,
cn
>*
_vec
)
:
MatxCommaInitializer
(
_vec
)
:
MatxCommaInitializer
<
_Tp
,
cn
,
1
>
(
_vec
)
{}
template
<
typename
_Tp
,
int
cn
>
template
<
typename
_T2
>
inline
VecCommaInitializer
<
_Tp
,
cn
>&
VecCommaInitializer
<
_Tp
,
cn
>::
operator
,
(
_T2
value
)
{
CV_DbgAssert
(
idx
<
cn
);
vec
->
val
[
idx
++
]
=
saturate_cast
<
_Tp
>
(
value
);
CV_DbgAssert
(
this
->
idx
<
cn
);
this
->
dst
->
val
[
this
->
idx
++
]
=
saturate_cast
<
_Tp
>
(
value
);
return
*
this
;
}
...
...
@@ -1256,7 +1256,7 @@ template<typename _Tp, int cn> inline
Vec
<
_Tp
,
cn
>
VecCommaInitializer
<
_Tp
,
cn
>::
operator
*
()
const
{
CV_DbgAssert
(
this
->
idx
==
cn
);
return
*
vec
;
return
*
this
->
dst
;
}
//////////////////////////////// Complex //////////////////////////////
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment