Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
ball_tracking
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Gomez-Gonzalez
ball_tracking
Commits
e34916da
Commit
e34916da
authored
7 years ago
by
Sebastian Gomez-Gonzalez
Browse files
Options
Downloads
Patches
Plain Diff
Fixing problems of compilation in the GPU
parent
379c2e87
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+7
-6
7 additions, 6 deletions
CMakeLists.txt
examples/tracking/gpu_track.cpp
+2
-2
2 additions, 2 deletions
examples/tracking/gpu_track.cpp
src/tracker.cpp
+10
-4
10 additions, 4 deletions
src/tracker.cpp
with
19 additions
and
12 deletions
CMakeLists.txt
+
7
−
6
View file @
e34916da
...
...
@@ -11,7 +11,11 @@ if (CUDA_FOUND)
endif
(
CUDA_FOUND
)
if
(
WITH_CUDA
)
include_directories
(
${
CUDA_INCLUDE_DIRS
}
)
include_directories
(
${
CUDA_INCLUDE_DIRS
}
include
)
add_definitions
(
-DWITH_CUDA
)
set
(
CUDA_NVCC_FLAGS
"
${
CUDA_NVCC_FLAGS
}
-std=c++11 -arch=sm_30"
)
cuda_add_library
(
cu_ball_track SHARED
src/cuda/img_proc.cu
...
...
@@ -22,7 +26,6 @@ if (WITH_CUDA)
set
(
GPU_BT_LIB
cu_ball_track
)
add_definitions
(
-DWITH_CUDA
)
endif
(
WITH_CUDA
)
include_directories
(
include
...
...
@@ -40,6 +43,7 @@ target_link_libraries(ball_tracking
${
GPU_BT_LIB
}
)
#Compile with C++11 support only
if
(
NOT MSVC
AND
((
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"GNU"
)
OR
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)))
include
(
CheckCXXCompilerFlag
)
...
...
@@ -66,6 +70,3 @@ install(TARGETS ball_tracking DESTINATION lib)
install
(
FILES include/json.hpp DESTINATION include
)
install
(
DIRECTORY include/ball_tracking DESTINATION include
)
if
(
PYLIB
)
endif
(
PYLIB
)
This diff is collapsed.
Click to expand it.
examples/tracking/gpu_track.cpp
+
2
−
2
View file @
e34916da
...
...
@@ -123,7 +123,8 @@ int main(int argc, char** argv) {
//3) Run blob detection algorithm (In CPU)
start_t
=
std
::
chrono
::
steady_clock
::
now
();
auto
key_pts
=
bf
(
bin_img
);
gpu_l_lh
.
download
(
l_lh
);
auto
key_pts
=
bf
(
l_lh
);
end_t
=
std
::
chrono
::
steady_clock
::
now
();
blob_time
.
push_back
(
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
end_t
-
start_t
).
count
());
...
...
@@ -133,7 +134,6 @@ int main(int argc, char** argv) {
//4) Compute output image
start_t
=
std
::
chrono
::
steady_clock
::
now
();
gpu_l_lh
.
download
(
l_lh
);
drawKeypoints
(
img
,
key_pts
,
res
(
Rect
(
0
,
0
,
in_size
.
width
,
in_size
.
height
)),
Scalar
(
255
,
255
,
0
),
DrawMatchesFlags
::
DRAW_RICH_KEYPOINTS
);
normalize
(
l_lh
,
tmp
,
0
,
1
,
NORM_MINMAX
);
...
...
This diff is collapsed.
Click to expand it.
src/tracker.cpp
+
10
−
4
View file @
e34916da
...
...
@@ -5,6 +5,11 @@
#include
<algorithm>
#include
<json.hpp>
#ifdef WITH_CUDA
#include
<ball_tracking/cuda/tracker.hpp>
#include
<opencv2/core.hpp>
#endif
using
namespace
cv
;
using
namespace
std
;
using
json
=
nlohmann
::
json
;
...
...
@@ -235,8 +240,9 @@ namespace ball_tracking {
};
#ifdef WITH_CUDA
#include
<ball_tracking/cuda/tracker.hpp>
#include
<opencv2/core.hpp>
using
namespace
cv
::
cuda
;
class
GPUTracker
{
private:
ball_tracking
::
cuda
::
BallLogLikelihood
llh
;
//!< Fully implemented in GPU
...
...
@@ -250,14 +256,14 @@ namespace ball_tracking {
vector
<
KeyPoint
>
operator
()(
cv
::
InputArray
_img
)
{
Mat
img
=
_img
.
getMat
();
GpuMat
gpu_img
(
img
,
stream
)
;
GpuMat
gpu_img
;
GpuMat
gpu_llh_img
;
gpu_img
.
upload
(
img
,
stream
);
llh
(
gpu_img
,
gpu_llh_img
,
stream
);
Mat
llh_img
;
gpu_llh_img
.
download
(
llh_img
,
stream
);
stream
.
waitForCompletion
();
return
blob_detect
(
llh_img
);
}
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment