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
88e9a072
Commit
88e9a072
authored
Oct 15, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix binary compatibility of opencv_flann
parent
64b56d70
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
6 deletions
+41
-6
dist.h
modules/flann/include/opencv2/flann/dist.h
+35
-0
timer.h
modules/flann/include/opencv2/flann/timer.h
+5
-5
miniflann.cpp
modules/flann/src/miniflann.cpp
+1
-1
No files found.
modules/flann/include/opencv2/flann/dist.h
View file @
88e9a072
...
...
@@ -380,6 +380,41 @@ struct HammingLUT
typedef
unsigned
char
ElementType
;
typedef
int
ResultType
;
/** this will count the bits in a ^ b
*/
ResultType
operator
()(
const
unsigned
char
*
a
,
const
unsigned
char
*
b
,
int
size
)
const
{
static
const
uchar
popCountTable
[]
=
{
0
,
1
,
1
,
2
,
1
,
2
,
2
,
3
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
4
,
5
,
5
,
6
,
5
,
6
,
6
,
7
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
4
,
5
,
5
,
6
,
5
,
6
,
6
,
7
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
4
,
5
,
5
,
6
,
5
,
6
,
6
,
7
,
3
,
4
,
4
,
5
,
4
,
5
,
5
,
6
,
4
,
5
,
5
,
6
,
5
,
6
,
6
,
7
,
4
,
5
,
5
,
6
,
5
,
6
,
6
,
7
,
5
,
6
,
6
,
7
,
6
,
7
,
7
,
8
};
ResultType
result
=
0
;
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
result
+=
popCountTable
[
a
[
i
]
^
b
[
i
]];
}
return
result
;
}
};
/**
* Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor
* bit count of A exclusive XOR'ed with B
*/
struct
HammingLUT2
{
typedef
False
is_kdtree_distance
;
typedef
False
is_vector_space_distance
;
typedef
unsigned
char
ElementType
;
typedef
int
ResultType
;
/** this will count the bits in a ^ b
*/
ResultType
operator
()(
const
unsigned
char
*
a
,
const
unsigned
char
*
b
,
size_t
size
)
const
...
...
modules/flann/include/opencv2/flann/timer.h
View file @
88e9a072
...
...
@@ -32,7 +32,7 @@
#define OPENCV_FLANN_TIMER_H
#include <time.h>
#include "opencv2/core/core.hpp"
namespace
cvflann
{
...
...
@@ -44,7 +44,7 @@ namespace cvflann
*/
class
StartStopTimer
{
int64
startTime
;
clock_t
startTime
;
public
:
/**
...
...
@@ -66,7 +66,7 @@ public:
*/
void
start
()
{
startTime
=
c
v
::
getTickCount
();
startTime
=
c
lock
();
}
/**
...
...
@@ -74,8 +74,8 @@ public:
*/
void
stop
()
{
int64
stopTime
=
cv
::
getTickCount
();
value
+=
(
(
double
)
stopTime
-
startTime
)
/
cv
::
getTickFrequency
()
;
clock_t
stopTime
=
clock
();
value
+=
(
(
double
)
stopTime
-
startTime
)
/
CLOCKS_PER_SEC
;
}
/**
...
...
modules/flann/src/miniflann.cpp
View file @
88e9a072
...
...
@@ -331,7 +331,7 @@ buildIndex(void*& index, const Mat& data, const IndexParams& params, const Dista
#if CV_NEON
typedef
::
cvflann
::
Hamming
<
uchar
>
HammingDistance
;
#else
typedef
::
cvflann
::
HammingLUT
HammingDistance
;
typedef
::
cvflann
::
HammingLUT
2
HammingDistance
;
#endif
Index
::
Index
()
...
...
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