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
03bab0fc
Commit
03bab0fc
authored
Aug 12, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tutorial-4-opencl: enable build with OpenCV
parent
e1ad86c1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
3 deletions
+24
-3
CMakeLists.txt
samples/android/CMakeLists.txt
+1
-0
CMakeLists.txt
samples/android/tutorial-4-opencl/CMakeLists.txt
+15
-1
Android.mk
samples/android/tutorial-4-opencl/jni/Android.mk
+4
-0
CLprocessor.cpp
samples/android/tutorial-4-opencl/jni/CLprocessor.cpp
+2
-1
GLrender.cpp
samples/android/tutorial-4-opencl/jni/GLrender.cpp
+2
-1
No files found.
samples/android/CMakeLists.txt
View file @
03bab0fc
...
@@ -14,6 +14,7 @@ add_subdirectory(color-blob-detection)
...
@@ -14,6 +14,7 @@ add_subdirectory(color-blob-detection)
add_subdirectory
(
tutorial-1-camerapreview
)
add_subdirectory
(
tutorial-1-camerapreview
)
add_subdirectory
(
tutorial-2-mixedprocessing
)
add_subdirectory
(
tutorial-2-mixedprocessing
)
add_subdirectory
(
tutorial-3-cameracontrol
)
add_subdirectory
(
tutorial-3-cameracontrol
)
add_subdirectory
(
tutorial-4-opencl
)
# hello-android sample
# hello-android sample
if
(
HAVE_opencv_highgui
)
if
(
HAVE_opencv_highgui
)
...
...
samples/android/tutorial-4-opencl/CMakeLists.txt
View file @
03bab0fc
set
(
sample example-tutorial-4-opencl
)
set
(
sample example-tutorial-4-opencl
)
if
(
NOT DEFINED ANDROID_OPENCL_SDK
)
message
(
STATUS
"Sample
${
sample
}
is disabled, because ANDROID_OPENCL_SDK is not specified"
)
return
()
endif
()
if
(
ANDROID_NATIVE_API_LEVEL LESS 14
)
message
(
STATUS
"Sample
${
sample
}
is disabled, because ANDROID_NATIVE_API_LEVEL < 14"
)
return
()
endif
()
if
(
BUILD_FAT_JAVA_LIB
)
if
(
BUILD_FAT_JAVA_LIB
)
set
(
native_deps opencv_java
)
set
(
native_deps opencv_java
)
...
@@ -6,7 +14,13 @@ else()
...
@@ -6,7 +14,13 @@ else()
set
(
native_deps opencv_imgproc
)
set
(
native_deps opencv_imgproc
)
endif
()
endif
()
add_android_project
(
${
sample
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
LIBRARY_DEPS
${
OpenCV_BINARY_DIR
}
SDK_TARGET 21
${
ANDROID_SDK_TARGET
}
NATIVE_DEPS
${
native_deps
}
)
include_directories
(
${
ANDROID_OPENCL_SDK
}
/include
)
link_directories
(
${
ANDROID_OPENCL_SDK
}
/lib/
${
ANDROID_ABI
}
)
add_android_project
(
${
sample
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
LIBRARY_DEPS
${
OpenCV_BINARY_DIR
}
SDK_TARGET 21
${
ANDROID_SDK_TARGET
}
NATIVE_DEPS
${
native_deps
}
-lGLESv2 -lEGL -lOpenCL
)
if
(
TARGET
${
sample
}
)
if
(
TARGET
${
sample
}
)
add_dependencies
(
opencv_android_examples
${
sample
}
)
add_dependencies
(
opencv_android_examples
${
sample
}
)
endif
()
endif
()
samples/android/tutorial-4-opencl/jni/Android.mk
View file @
03bab0fc
...
@@ -13,6 +13,10 @@ else
...
@@ -13,6 +13,10 @@ else
include ../../sdk/native/jni/OpenCV.mk
include ../../sdk/native/jni/OpenCV.mk
endif
endif
ifndef OPENCL_SDK
$(error Specify OPENCL_SDK to Android OpenCL SDK location)
endif
# add OpenCL
# add OpenCL
LOCAL_C_INCLUDES += $(OPENCL_SDK)/include
LOCAL_C_INCLUDES += $(OPENCL_SDK)/include
LOCAL_LDLIBS += -L$(OPENCL_SDK)/lib/$(TARGET_ARCH_ABI) -lOpenCL
LOCAL_LDLIBS += -L$(OPENCL_SDK)/lib/$(TARGET_ARCH_ABI) -lOpenCL
...
...
samples/android/tutorial-4-opencl/jni/CLprocessor.cpp
View file @
03bab0fc
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
#include <EGL/egl.h>
#include <EGL/egl.h>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/core/ocl.hpp>
#include <opencv2/core/ocl.hpp>
#include "common.hpp"
#include "common.hpp"
...
...
samples/android/tutorial-4-opencl/jni/GLrender.cpp
View file @
03bab0fc
#include <GLES2/gl2.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2ext.h>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include "common.hpp"
#include "common.hpp"
...
...
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