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
3425c90b
Commit
3425c90b
authored
Jan 13, 2015
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GPU samples with NVIDIA specific API excluded from build if CUDA disabled.
parent
b0c5f491
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
37 deletions
+31
-37
CMakeLists.txt
samples/gpu/CMakeLists.txt
+28
-5
cascadeclassifier_nvidia_api.cpp
samples/gpu/cascadeclassifier_nvidia_api.cpp
+3
-18
opticalflow_nvidia_api.cpp
samples/gpu/opticalflow_nvidia_api.cpp
+0
-14
No files found.
samples/gpu/CMakeLists.txt
View file @
3425c90b
...
...
@@ -69,11 +69,27 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
endif
()
ENDMACRO
()
# remove all matching elements from the list
MACRO
(
list_filterout lst regex
)
foreach
(
item
${${
lst
}}
)
if
(
item MATCHES
"
${
regex
}
"
)
list
(
REMOVE_ITEM
${
lst
}
"
${
item
}
"
)
endif
()
endforeach
()
ENDMACRO
()
file
(
GLOB all_samples RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*.cpp
)
if
(
NOT
WITH
_OPENGL
)
if
(
NOT
HAVE
_OPENGL
)
list
(
REMOVE_ITEM all_samples
"opengl.cpp"
)
endif
(
NOT WITH_OPENGL
)
endif
()
if
(
NOT HAVE_CUDA
)
list
(
REMOVE_ITEM all_samples
"opticalflow_nvidia_api.cpp"
)
list
(
REMOVE_ITEM all_samples
"cascadeclassifier_nvidia_api.cpp"
)
list
(
REMOVE_ITEM all_samples
"driver_api_multi.cpp"
)
list
(
REMOVE_ITEM all_samples
"driver_api_stereo_multi.cpp"
)
endif
()
foreach
(
sample_filename
${
all_samples
}
)
get_filename_component
(
sample
${
sample_filename
}
NAME_WE
)
...
...
@@ -86,9 +102,16 @@ endif()
if
(
OCV_DEPENDENCIES_FOUND AND INSTALL_C_EXAMPLES AND NOT WIN32
)
file
(
GLOB install_list *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd
)
if
(
NOT WITH_OPENGL
)
list
(
REMOVE_ITEM all_samples
"opengl.cpp"
)
endif
(
NOT WITH_OPENGL
)
message
(
" install_list:
${
install_list
}
"
)
if
(
NOT HAVE_OPENGL
)
list_filterout
(
install_list
".*opengl.cpp"
)
endif
()
if
(
NOT HAVE_CUDA
)
list_filterout
(
install_list
".*opticalflow_nvidia_api.cpp"
)
list_filterout
(
install_list
".*cascadeclassifier_nvidia_api.cpp"
)
list_filterout
(
install_list
".*driver_api_multi.cpp"
)
list_filterout
(
install_list
".*driver_api_stereo_multi.cpp"
)
endif
()
install
(
FILES
${
install_list
}
DESTINATION
${
OPENCV_SAMPLES_SRC_INSTALL_PATH
}
/gpu
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples
)
...
...
samples/gpu/cascadeclassifier_nvidia_api.cpp
View file @
3425c90b
...
...
@@ -2,39 +2,24 @@
#pragma warning( disable : 4201 4408 4127 4100)
#endif
#include "cvconfig.h"
#include <iostream>
#include <iomanip>
#include <cstdio>
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/highgui/highgui.hpp"
#ifdef HAVE_CUDA
#include "NCVHaarObjectDetection.hpp"
#endif
using
namespace
std
;
using
namespace
cv
;
#if !defined(HAVE_CUDA) || defined(__arm__)
int
main
(
int
,
const
char
**
)
{
#if !defined(HAVE_CUDA)
std
::
cout
<<
"CUDA support is required (CMake key 'WITH_CUDA' must be true)."
<<
std
::
endl
;
#endif
#if defined(__arm__)
int
main
()
{
std
::
cout
<<
"Unsupported for ARM CUDA library."
<<
std
::
endl
;
#endif
return
0
;
}
#else
const
Size2i
preferredVideoFrameSize
(
640
,
480
);
const
string
wndTitle
=
"NVIDIA Computer Vision :: Haar Classifiers Cascade"
;
...
...
@@ -386,4 +371,4 @@ int main(int argc, const char** argv)
return
0
;
}
#endif
//!defined(HAVE_CUDA)
#endif
samples/gpu/opticalflow_nvidia_api.cpp
View file @
3425c90b
...
...
@@ -9,26 +9,14 @@
#include <ctime>
#include <ctype.h>
#include "cvconfig.h"
#include <iostream>
#include <iomanip>
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/highgui/highgui.hpp"
#ifdef HAVE_CUDA
#include "NPP_staging/NPP_staging.hpp"
#include "NCVBroxOpticalFlow.hpp"
#endif
#if !defined(HAVE_CUDA)
int
main
(
int
,
const
char
**
)
{
std
::
cout
<<
"Please compile the library with CUDA support"
<<
std
::
endl
;
return
-
1
;
}
#else
//using std::tr1::shared_ptr;
using
cv
::
Ptr
;
#define PARAM_LEFT "--left"
...
...
@@ -649,5 +637,3 @@ int main(int argc, char **argv)
return
0
;
}
#endif
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