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
c209f795
Commit
c209f795
authored
Nov 13, 2015
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for NORM_L2SQR in norm(Matx<..>)
parent
b4112a58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
matx.hpp
modules/core/include/opencv2/core/matx.hpp
+11
-3
No files found.
modules/core/include/opencv2/core/matx.hpp
View file @
c209f795
...
@@ -840,9 +840,17 @@ double norm(const Matx<_Tp, m, n>& M)
...
@@ -840,9 +840,17 @@ double norm(const Matx<_Tp, m, n>& M)
template
<
typename
_Tp
,
int
m
,
int
n
>
static
inline
template
<
typename
_Tp
,
int
m
,
int
n
>
static
inline
double
norm
(
const
Matx
<
_Tp
,
m
,
n
>&
M
,
int
normType
)
double
norm
(
const
Matx
<
_Tp
,
m
,
n
>&
M
,
int
normType
)
{
{
return
normType
==
NORM_INF
?
(
double
)
normInf
<
_Tp
,
typename
DataType
<
_Tp
>::
work_type
>
(
M
.
val
,
m
*
n
)
:
switch
(
normType
)
{
normType
==
NORM_L1
?
(
double
)
normL1
<
_Tp
,
typename
DataType
<
_Tp
>::
work_type
>
(
M
.
val
,
m
*
n
)
:
case
NORM_INF
:
std
::
sqrt
((
double
)
normL2Sqr
<
_Tp
,
typename
DataType
<
_Tp
>::
work_type
>
(
M
.
val
,
m
*
n
));
return
(
double
)
normInf
<
_Tp
,
typename
DataType
<
_Tp
>::
work_type
>
(
M
.
val
,
m
*
n
);
case
NORM_L1
:
return
(
double
)
normL1
<
_Tp
,
typename
DataType
<
_Tp
>::
work_type
>
(
M
.
val
,
m
*
n
);
case
NORM_L2SQR
:
return
(
double
)
normL2Sqr
<
_Tp
,
typename
DataType
<
_Tp
>::
work_type
>
(
M
.
val
,
m
*
n
);
default
:
case
NORM_L2
:
return
std
::
sqrt
((
double
)
normL2Sqr
<
_Tp
,
typename
DataType
<
_Tp
>::
work_type
>
(
M
.
val
,
m
*
n
));
}
}
}
...
...
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