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
769f61f8
Commit
769f61f8
authored
Oct 22, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #55 from vpisarev/ocl_fixes
parents
d1d6ce63
f75946a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
CMakeLists.txt
modules/ocl/CMakeLists.txt
+1
-1
brute_force_matcher.cpp
modules/ocl/src/brute_force_matcher.cpp
+11
-3
No files found.
modules/ocl/CMakeLists.txt
View file @
769f61f8
...
...
@@ -13,7 +13,7 @@ set(kernels_cpp "${CMAKE_CURRENT_BINARY_DIR}/kernels.cpp")
set
(
cl2cpp_script
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cl2cpp.py"
)
set
(
cl2cpp_script_W32
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cl2cpp.js"
)
IF
(
WIN32
)
IF
(
0
)
add_custom_command
(
OUTPUT
${
kernels_cpp
}
COMMAND wscript.exe
${
cl2cpp_script_W32
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/kernels"
${
kernels_cpp
}
...
...
modules/ocl/src/brute_force_matcher.cpp
View file @
769f61f8
...
...
@@ -1548,7 +1548,8 @@ void cv::ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat &query, vector<
temp
.
reserve
(
2
*
k
);
matches
.
resize
(
query
.
rows
);
for_each
(
matches
.
begin
(),
matches
.
end
(),
bind2nd
(
mem_fun_ref
(
&
vector
<
DMatch
>::
reserve
),
k
));
for
(
size_t
queryIdx
=
0
;
queryIdx
<
matches
.
size
();
queryIdx
++
)
matches
[
queryIdx
].
reserve
(
k
);
for
(
size_t
imgIdx
=
0
,
size
=
trainDescCollection
.
size
();
imgIdx
<
size
;
++
imgIdx
)
{
...
...
@@ -1572,8 +1573,15 @@ void cv::ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat &query, vector<
if
(
compactResult
)
{
vector
<
vector
<
DMatch
>
>::
iterator
new_end
=
remove_if
(
matches
.
begin
(),
matches
.
end
(),
mem_fun_ref
(
&
vector
<
DMatch
>::
empty
));
matches
.
erase
(
new_end
,
matches
.
end
());
size_t
i
,
j
=
0
;
for
(
i
=
0
;
i
<
matches
.
size
();
i
++
)
if
(
!
matches
[
i
].
empty
()
)
{
if
(
i
>
j
)
matches
[
j
]
=
matches
[
i
];
j
++
;
}
matches
.
resize
(
j
);
}
}
}
...
...
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