Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
0f7df315
Commit
0f7df315
authored
Sep 11, 2014
by
Bellaktris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-||-
parent
33eb6c28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
inpainting.cpp
modules/xphoto/src/inpainting.cpp
+0
-1
norm2.hpp
modules/xphoto/src/norm2.hpp
+23
-3
No files found.
modules/xphoto/src/inpainting.cpp
View file @
0f7df315
...
...
@@ -37,7 +37,6 @@
//
//M*/
#include <type_traits>
#include <vector>
#include <stack>
#include <limits>
...
...
modules/xphoto/src/norm2.hpp
View file @
0f7df315
...
...
@@ -40,13 +40,32 @@
#ifndef __NORM2_HPP__
#define __NORM2_HPP__
template
<
bool
B
,
class
T
=
void
>
struct
iftype
{};
template
<
class
T
>
struct
iftype
<
true
,
T
>
{
typedef
T
type
;
};
// enable_if
template
<
class
T
,
T
v
>
struct
int_const
{
// integral_constant
static
const
T
value
=
v
;
typedef
T
value_type
;
typedef
int_const
type
;
operator
value_type
()
const
{
return
value
;
}
value_type
operator
()()
const
{
return
value
;
}
};
typedef
int_const
<
bool
,
true
>
ttype
;
// true_type
typedef
int_const
<
bool
,
false
>
ftype
;
// false_type
template
<
class
T
,
class
U
>
struct
same_as
:
ftype
{};
template
<
class
T
>
struct
same_as
<
T
,
T
>
:
ttype
{};
// is_same
template
<
typename
_Tp
>
struct
is_norm2_type
:
std
::
integral_constant
<
bool
,
!
std
::
is_unsigned
<
_Tp
>::
value
&&
!
std
::
is_same
<
_Tp
,
char
>::
value
>
{};
int_const
<
bool
,
_Tp
(
-
1
)
<
_Tp
(
0
)
&&
!
same_as
<
_Tp
,
char
>::
value
>
{};
template
<
typename
_Tp
,
int
cn
>
static
inline
typename
std
::
enable_if
<
is_norm2_type
<
_Tp
>::
value
,
_Tp
>::
template
<
typename
_Tp
,
int
cn
>
static
inline
typename
iftype
<
is_norm2_type
<
_Tp
>::
value
,
_Tp
>::
type
norm2
(
cv
::
Vec
<
_Tp
,
cn
>
a
,
cv
::
Vec
<
_Tp
,
cn
>
b
)
{
return
(
a
-
b
).
dot
(
a
-
b
);
}
template
<
typename
_Tp
>
static
inline
typename
std
::
enable_if
<
is_norm2_type
<
_Tp
>::
value
,
_Tp
>::
template
<
typename
_Tp
>
static
inline
typename
iftype
<
is_norm2_type
<
_Tp
>::
value
,
_Tp
>::
type
norm2
(
const
_Tp
&
a
,
const
_Tp
&
b
)
{
return
(
a
-
b
)
*
(
a
-
b
);
}
#endif
/* __NORM2_HPP__ */
\ No newline at end of file
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