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
53fc0861
Commit
53fc0861
authored
Aug 04, 2014
by
biagio montesano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deteted warning on hashing code
parent
29b6529c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
11 deletions
+13
-11
bitops.hpp
...ine_descriptor/include/opencv2/line_descriptor/bitops.hpp
+1
-1
lines_extraction.cpp
modules/line_descriptor/samples/lines_extraction.cpp
+1
-0
array32.cpp
modules/line_descriptor/src/array32.cpp
+3
-3
mihasher.cpp
modules/line_descriptor/src/mihasher.cpp
+8
-7
No files found.
modules/line_descriptor/include/opencv2/line_descriptor/bitops.hpp
View file @
53fc0861
...
@@ -143,7 +143,7 @@ inline UINT64 next_set_of_n_elements( UINT64 x )
...
@@ -143,7 +143,7 @@ inline UINT64 next_set_of_n_elements( UINT64 x )
/* print code */
/* print code */
inline
void
print_code
(
UINT64
tmp
,
int
b
)
inline
void
print_code
(
UINT64
tmp
,
int
b
)
{
{
for
(
int
j
=
(
b
-
1
);
j
>=
0
;
j
--
)
for
(
long
long
int
j
=
(
b
-
1
);
j
>=
0
;
j
--
)
{
{
printf
(
"%llu"
,
(
long
long
int
)
tmp
/
(
1
<<
j
)
);
printf
(
"%llu"
,
(
long
long
int
)
tmp
/
(
1
<<
j
)
);
tmp
=
tmp
-
(
tmp
/
(
1
<<
j
)
)
*
(
1
<<
j
);
tmp
=
tmp
-
(
tmp
/
(
1
<<
j
)
)
*
(
1
<<
j
);
...
...
modules/line_descriptor/samples/lines_extraction.cpp
View file @
53fc0861
...
@@ -78,6 +78,7 @@ int main( int argc, char** argv )
...
@@ -78,6 +78,7 @@ int main( int argc, char** argv )
if
(
imageMat
.
data
==
NULL
)
if
(
imageMat
.
data
==
NULL
)
{
{
std
::
cout
<<
"Error, image could not be loaded. Please, check its path"
<<
std
::
endl
;
std
::
cout
<<
"Error, image could not be loaded. Please, check its path"
<<
std
::
endl
;
return
-
1
;
}
}
/* create a random binary mask */
/* create a random binary mask */
...
...
modules/line_descriptor/src/array32.cpp
View file @
53fc0861
...
@@ -85,7 +85,7 @@ void Array32::push( UINT32 Data )
...
@@ -85,7 +85,7 @@ void Array32::push( UINT32 Data )
{
{
if
(
arr
[
0
]
==
arr
[
1
]
)
if
(
arr
[
0
]
==
arr
[
1
]
)
{
{
arr
[
1
]
=
std
::
max
(
ceil
(
arr
[
1
]
*
ARRAY_RESIZE_FACTOR
),
arr
[
1
]
+
ARRAY_RESIZE_ADD_FACTOR
);
arr
[
1
]
=
(
UINT32
)
std
::
max
(
ceil
(
arr
[
1
]
*
ARRAY_RESIZE_FACTOR
),
arr
[
1
]
+
ARRAY_RESIZE_ADD_FACTOR
);
UINT32
*
new_Data
=
static_cast
<
UINT32
*>
(
realloc
(
arr
,
sizeof
(
UINT32
)
*
(
2
+
arr
[
1
]
)
)
);
UINT32
*
new_Data
=
static_cast
<
UINT32
*>
(
realloc
(
arr
,
sizeof
(
UINT32
)
*
(
2
+
arr
[
1
]
)
)
);
if
(
new_Data
==
NULL
)
if
(
new_Data
==
NULL
)
{
{
...
@@ -107,7 +107,7 @@ void Array32::push( UINT32 Data )
...
@@ -107,7 +107,7 @@ void Array32::push( UINT32 Data )
else
else
{
{
arr
=
(
UINT32
*
)
malloc
(
(
2
+
ARRAY_RESIZE_ADD_FACTOR
)
*
sizeof
(
UINT32
)
);
arr
=
(
UINT32
*
)
malloc
(
(
size_t
)
(
2
+
ARRAY_RESIZE_ADD_FACTOR
)
*
sizeof
(
UINT32
)
);
arr
[
0
]
=
1
;
arr
[
0
]
=
1
;
arr
[
1
]
=
1
;
arr
[
1
]
=
1
;
arr
[
2
]
=
Data
;
arr
[
2
]
=
Data
;
...
@@ -121,7 +121,7 @@ void Array32::insert( UINT32 index, UINT32 Data )
...
@@ -121,7 +121,7 @@ void Array32::insert( UINT32 index, UINT32 Data )
{
{
if
(
arr
[
0
]
==
arr
[
1
]
)
if
(
arr
[
0
]
==
arr
[
1
]
)
{
{
arr
[
1
]
=
ceil
(
arr
[
0
]
*
1.1
);
arr
[
1
]
=
(
UINT32
)
ceil
(
arr
[
0
]
*
1.1
);
UINT32
*
new_data
=
static_cast
<
UINT32
*>
(
realloc
(
arr
,
sizeof
(
UINT32
)
*
(
2
+
arr
[
1
]
)
)
);
UINT32
*
new_data
=
static_cast
<
UINT32
*>
(
realloc
(
arr
,
sizeof
(
UINT32
)
*
(
2
+
arr
[
1
]
)
)
);
if
(
new_data
==
NULL
)
if
(
new_data
==
NULL
)
{
{
...
...
modules/line_descriptor/src/mihasher.cpp
View file @
53fc0861
...
@@ -86,7 +86,7 @@ void Mihasher::query( UINT32* results, UINT32* numres, UINT8 * Query, UINT64 *ch
...
@@ -86,7 +86,7 @@ void Mihasher::query( UINT32* results, UINT32* numres, UINT8 * Query, UINT64 *ch
{
{
/* if K == 0 that means we want everything to be processed.
/* if K == 0 that means we want everything to be processed.
So maxres = N in that case. Otherwise K limits the results processed */
So maxres = N in that case. Otherwise K limits the results processed */
UINT32
maxres
=
K
?
K
:
N
;
UINT32
maxres
=
K
?
K
:
(
UINT32
)
N
;
/* number of results so far obtained (up to a distance of s per chunk) */
/* number of results so far obtained (up to a distance of s per chunk) */
UINT32
n
=
0
;
UINT32
n
=
0
;
...
@@ -142,7 +142,8 @@ void Mihasher::query( UINT32* results, UINT32* numres, UINT8 * Query, UINT64 *ch
...
@@ -142,7 +142,8 @@ void Mihasher::query( UINT32* results, UINT32* numres, UINT8 * Query, UINT64 *ch
it touches another one */
it touches another one */
/* the loop for changing bitstr */
/* the loop for changing bitstr */
while
(
true
)
bool
infiniteWhile
=
true
;
while
(
infiniteWhile
)
{
{
if
(
bit
!=
-
1
)
if
(
bit
!=
-
1
)
{
{
...
@@ -207,12 +208,12 @@ Mihasher::Mihasher( int _B, int _m )
...
@@ -207,12 +208,12 @@ Mihasher::Mihasher( int _B, int _m )
B
=
_B
;
B
=
_B
;
B_over_8
=
B
/
8
;
B_over_8
=
B
/
8
;
m
=
_m
;
m
=
_m
;
b
=
ceil
(
(
double
)
B
/
m
);
b
=
(
int
)
ceil
(
(
double
)
B
/
m
);
/* assuming that B/2 is large enough radius to include
/* assuming that B/2 is large enough radius to include
all of the k nearest neighbors */
all of the k nearest neighbors */
D
=
ceil
(
B
/
2.0
);
D
=
(
int
)
ceil
(
B
/
2.0
);
d
=
ceil
(
(
double
)
D
/
m
);
d
=
(
int
)
ceil
(
(
double
)
D
/
m
);
/* mplus is the number of chunks with b bits
/* mplus is the number of chunks with b bits
(m-mplus) is the number of chunks with (b-1) bits */
(m-mplus) is the number of chunks with (b-1) bits */
...
@@ -221,7 +222,7 @@ Mihasher::Mihasher( int _B, int _m )
...
@@ -221,7 +222,7 @@ Mihasher::Mihasher( int _B, int _m )
xornum
=
new
UINT32
[
d
+
2
];
xornum
=
new
UINT32
[
d
+
2
];
xornum
[
0
]
=
0
;
xornum
[
0
]
=
0
;
for
(
int
i
=
0
;
i
<=
d
;
i
++
)
for
(
int
i
=
0
;
i
<=
d
;
i
++
)
xornum
[
i
+
1
]
=
xornum
[
i
]
+
choose
(
b
,
i
);
xornum
[
i
+
1
]
=
xornum
[
i
]
+
(
UINT32
)
choose
(
b
,
i
);
H
=
new
SparseHashtable
[
m
];
H
=
new
SparseHashtable
[
m
];
...
@@ -258,7 +259,7 @@ void Mihasher::populate( cv::Mat & _codes, UINT32 _N, int dim1codes )
...
@@ -258,7 +259,7 @@ void Mihasher::populate( cv::Mat & _codes, UINT32 _N, int dim1codes )
split
(
chunks
,
pcodes
,
m
,
mplus
,
b
);
split
(
chunks
,
pcodes
,
m
,
mplus
,
b
);
for
(
int
k
=
0
;
k
<
m
;
k
++
)
for
(
int
k
=
0
;
k
<
m
;
k
++
)
H
[
k
].
insert
(
chunks
[
k
],
i
);
H
[
k
].
insert
(
chunks
[
k
],
(
UINT32
)
i
);
if
(
i
%
(
int
)
ceil
(
N
/
1000.0
)
==
0
)
if
(
i
%
(
int
)
ceil
(
N
/
1000.0
)
==
0
)
fflush
(
stdout
);
fflush
(
stdout
);
...
...
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