SlideShare ist ein Scribd-Unternehmen logo
1 von 37
©SIProp Project, 2006-2008 1 
How to Build & Use OpenCL 
on OpenCV & Android NDK 
Noritsuna Imamura 
noritsuna@siprop.org
©SIProp Project, 2006-2008 2 
!!!!!!ATTENTION!!!!!! 
This manual is “How to Build” manual. 
If you want to “Use OpenCL on OpenCV” ONLY, 
Please see 
http://github.com/noritsuna/OpenCVwithOpenCL4 
AndroidNDKSample
How to Build OpenCL on OpenCV 
©SIProp Project, 2006-2008 3 
for Android NDK
©SIProp Project, 2006-2008 4 
Download OpenCV & NDK tool 
› wget 
https://github.com/Itseez/opencv/archive/ 
2.4.10.1tar.gz 
› tar zxfv 2.4.10.1.tar.gz 
› mkdir ~/android/ 
› cd ~/android/ 
› wget http://dl.google.com/android/android-sdk_ 
r23.0.2-linux.tgz 
› wget 
http://dl.google.com/android/ndk/android-ndk- 
r10c-linux-x86_64.bin 
› tar zxfv android-sdk_r23.0.2-linux.tgz 
› ./android-ndk-r10c-linux-x86_64.bin
©SIProp Project, 2006-2008 5 
Edit Setup File 
./opencv- 
2.4.10.1/platforms/scripts/cmake_android_arm.s 
h 
Add WITH_EIGEN=off option. 
Currently version has some bugs. 
› cmake -DWITH_EIGEN=OFF - 
DCMAKE_BUILD_WITH_INSTALL_RPATH=ON - 
DCMAKE_TOOLCHAIN_FILE=../android/android.toolchain.c 
make $@ ../..
©SIProp Project, 2006-2008 6 
Set Path to SDK/NDK 
› export ANDROID_NDK=~/android/android-ndk- 
r10c 
› export ANDROID_SDK=~/android/android-sdk- 
linux
Add “SO loading“ func for Android 1/3 
Change “SO loading“ func for Linux to this func 
without Android. 
~/opencv- 
2.4.10.1/modules/ocl/src/cl_runtime/cl_runtime.cpp 
©SIProp Project, 2006-2008 7 
› #if defined(__linux__) 
↓ 
› #if defined(__linux__) 
&& !defined(__ANDROID__)
Add “SO loading“ func for Android 2/3 
Add “SO loading“ func for Android. (continue to 
next page) 
~/opencv- 
2.4.10.1/modules/ocl/src/cl_runtime/cl_runtime.cpp 
©SIProp Project, 2006-2008 8 
› #if defined(__ANDROID__) 
› #include <dlfcn.h> 
› #include <sys/stat.h> 
› #if defined(__ARM_ARCH_8A__) || defined(_X64_) 
› static const char *default_so_paths[] = { 
› "/system/lib64/libOpenCL.so", 
› "/system/vendor/lib64/libOpenCL.so", 
› "/system/vendor/lib64/egl/libGLES_mali.so" 
› }; 
› #else 
› static const char *default_so_paths[] = { 
› "/system/lib/libOpenCL.so", 
› "/system/vendor/lib/libOpenCL.so", 
› "/system/vendor/lib/egl/libGLES_mali.so" 
› }; 
› #endif 
›
Add “SO loading“ func for Android 3/3 
©SIProp Project, 2006-2008 9 
› static int access_file(const char *filename) 
› { 
› struct stat buffer; 
› return (stat(filename, &buffer) == 0); 
› } 
› static void* GetProcAddress (const char* name) 
› { 
› static void* h = NULL; 
› unsigned int i; 
› if (!h) 
› { 
› const char* name; 
› for(i=0; i<(sizeof(default_so_paths)/sizeof(char*)); i++) 
› { 
› if(access_file(default_so_paths[i])) { 
› name = (char *)default_so_paths[i]; 
› h = dlopen(name, RTLD_LAZY); 
› if (h) break; 
› } 
› } 
› if (!h) 
› return NULL; 
› } 
› return dlsym(h, name); 
› } 
› #define CV_CL_GET_PROC_ADDRESS(name) GetProcAddress(name) 
› #endif
› cd ~/opencv-2.4.10.1/platforms/scripts/ 
› ./cmake_android_arm.sh 
©SIProp Project, 2006-2008 10 
Execute Auto Config & make 
This Script make Makefile for OpenCV. 
In “~/opencv- 
2.4.10.1/platforms/scripts/build_android_arm.sh” 
Make !!! 
› cd ~/opencv- 
2.4.10.1/platforms/scripts/build_android_arm 
/ 
› make
©SIProp Project, 2006-2008 11 
Where are Made Files? 
OpenCV Libs. 
In “~/opencv- 
2.4.10.1/platforms/build_android_arm/lib” 
highgui 
core 
etc... 
3rd Party Libs for OpenCV. 
In “~/opencv- 
2.4.10.1/platforms/build_android_arm/3rdparty/lib” 
libIlmImf 
libjasper 
libjpeg 
libpng 
libtiff
©SIProp Project, 2006-2008 12 
Copy libs to sample program 
OpenCV Libs. 
cp ~/opencv- 
2.4.10.1/platforms/build_android_arm/lib/armeabi-v7a/* 
~/opencv-2.4.10.1/samples/android/native-activity/ 
libs_opencv/ 
3rd Party Libs for OpenCV. 
cp ~/opencv- 
2.4.10.1/platforms/build_android_arm/3rdparty/lib/ar 
meabi-v7a/* ~/opencv- 
2.4.10.1/samples/android/native-activity/ 
libs_opencv/
How to Use OpenCL on OpenCV 
for Android NDK(Native App) 
©SIProp Project, 2006-2008 13
©SIProp Project, 2006-2008 14 
Download Sample Source Code 
http://github.com/noritsuna/OpenCVwithOpenCL4Andr 
oidNDKSample 
Based OpenCV-2.4.10.1 & Android 4.4 
Made Android Native Activity. 
Convert RGB Color Image to Black&White Image.
Call Stack 
Call as C/C++ APIs 
Call as SysCall(C/ASM) 
©SIProp Project, 2006-2008 15 
Native Application 
NDK wo/ADT 
Standard Android 
Application for C/C++ 
Only C/C++ on Limited 
Library Layer 
Advantage 
Only C/C++ 
DirectCall C/C++ API 
Dis-Advantage 
Use a few Android Tools 
A few Docs from Google 
Developer Site & Blogs 
APK File(Your Application) 
(C/C++) 
Library Layer 
(C/C++) 
Kernel/Driver Layer 
(C/ASM)
How to Make this Sample Source Code 
from OpenCV’s Sample Project 
©SIProp Project, 2006-2008 16
©SIProp Project, 2006-2008 17 
Use NativeActivity of OpenCV 
This Sample uses Only C/C++ Code. 
~/opencv-2.4.10.1/samples/android/native-activity 
Structure of NativeActivity 
AndroidManifest.xml <- Property File for Android 
res <- Directory that has Resource file(Image,Voice) 
jni <- Directory that has files for NDK 
Android.mk <- make file of NDK 
Application.mk <- property file of NDK 
native.cpp <- Sample App 
Other Files/Dir, don’t use.
©SIProp Project, 2006-2008 18 
Edit AndroidManifest.xml 
Replace “application” Section 
1. <application android:label="@string/app_name" 
android:hasCode="false"> 
2. <activity android:name="android.app.NativeActivity" 
3. android:label="@string/app_name" 
4. 
android:configChanges="orientation|keyboardHidden"> 
5. <!-- Tell NativeActivity the name of or .so --> 
6. <meta-data android:name="android.app.lib_name" 
7. android:value="native_activity" /> 
8. <intent-filter> 
9. <action 
android:name="android.intent.action.MAIN" /> 
10. <category 
android:name="android.intent.category.LAUNCHER" /> 
11. </intent-filter> 
12. </activity> 
13. </application>
2. <uses-sdk android:minSdkVersion=“9" /> 
©SIProp Project, 2006-2008 19 
About AndroidManifest.xml 
API Level 
1. <!-- This is the platform API where 
NativeActivity was introduced. --> 
Permission 
1. <uses-permission 
android:name="android.permission.CAMERA 
"/>
©SIProp Project, 2006-2008 20 
Create jni/Android.mk 1/9 
1. Delete jni/Android.mk & Create the new 
jni/Android.mk 
2. Set LOCAL_PATH & include 
1. LOCAL_PATH := $(call my-dir) 
2. include $(CLEAR_VARS)
©SIProp Project, 2006-2008 21 
Create jni/Android.mk 2/9 
1. Set OpenCV’s Modules & Libs 
1. OPENCV_MODULES:=contrib legacy ml 
stitching superres objdetect ts videostab 
video photo calib3d features2d highgui 
imgproc flann ocl core androidcamera 
2. OPENCV_3RDPARTY_COMPONENTS:=asse 
tmanager tbb libjpeg libpng libtiff libjasper 
IlmImf 
3. OPENCV_CAMERA_MODULES:= 
native_camera_r2.2.0 native_camera_r2.3.3 
native_camera_r3.0.1 native_camera_r4.0.0 
native_camera_r4.0.3 native_camera_r4.1.1 
native_camera_r4.2.0 native_camera_r4.3.0 
native_camera_r4.4.0
LOCAL_SRC_FILES:=../libs_opencv/libopenc 
v_$1.a 
5. include $(PREBUILT_STATIC_LIBRARY) 
6. endef 
©SIProp Project, 2006-2008 22 
Create jni/Android.mk 3/9 
Set Loading OpenCV Libs Function 
1. define add_opencv_module 
2. include $(CLEAR_VARS) 
3. LOCAL_MODULE:=opencv_$1 
4. 
1. $(foreach 
module,$(OPENCV_MODULES),$(eval $(call 
add_opencv_module,$(module))))
1. define add_opencv_3rdparty_component 
2. include $(CLEAR_VARS) 
3. LOCAL_MODULE:=$1 
4. 
LOCAL_SRC_FILES:=../libs_opencv/lib$1.a 
5. include $(PREBUILT_STATIC_LIBRARY) 
6. endef 
©SIProp Project, 2006-2008 23 
Create jni/Android.mk 4/9 
Set Loading OpenCV Libs Function 
1. $(foreach 
module,$(OPENCV_3RDPARTY_COMPONEN 
TS),$(eval $(call 
add_opencv_3rdparty_component,$(module))))
LOCAL_SRC_FILES:=../libs_opencv/lib$1.so 
5. include $(PREBUILT_SHARED_LIBRARY) 
6. endef 
©SIProp Project, 2006-2008 24 
Create jni/Android.mk 5/9 
Set Loading AndroidCamera Libs Function 
1. define add_opencv_camera_module 
2. include $(CLEAR_VARS) 
3. LOCAL_MODULE:=$1 
4. 
1. $(foreach 
module,$(OPENCV_CAMERA_MODULES),$(e 
val $(call 
add_opencv_camera_module,$(module))))
©SIProp Project, 2006-2008 25 
Create jni/Android.mk 6/9 
Set loading info lib 
1. include $(CLEAR_VARS) 
2. LOCAL_MODULE:=opencv_info 
3. LOCAL_SRC_FILES:=../libs_opencv/libopenc 
v_info.so 
4. include $(PREBUILT_SHARED_LIBRARY)
©SIProp Project, 2006-2008 26 
Create jni/Android.mk 7/9 
Set Include Dir 
Set Module name & Source Code 
OpenCVwithOpenCL4AndroidNDKNativeActivity.cpp 
1. include $(CLEAR_VARS) 
2. LOCAL_C_INCLUDES+=./jni/include 
3. LOCAL_MODULE := OpenCV_CL 
4. LOCAL_SRC_FILES := 
OpenCVwithOpenCL4AndroidNDKNativeActi 
vity.cpp
©SIProp Project, 2006-2008 27 
Create jni/Android.mk 8/9 
Set Loading Lib & OpenCV Lib 
LOCAL_LDLIBS 
-lm -llog -lc -ldl -lz -landroid 
LOCAL_STATIC_LIBRARIES 
$(foreach mod, $(OPENCV_MODULES), opencv_$(mod)) 
$(OPENCV_3RDPARTY_COMPONENTS) 
1. LOCAL_LDLIBS += -lm -llog -lc -ldl -lz - 
landroid 
2. LOCAL_STATIC_LIBRARIES := 
android_native_app_glue $(foreach mod, 
$(OPENCV_MODULES), opencv_$(mod)) 
$(OPENCV_3RDPARTY_COMPONENTS)
©SIProp Project, 2006-2008 28 
Create jni/Android.mk 9/9 
Set Library Type 
Make SO lib 
BUILD_SHARED_LIBRARY 
Set Loading Android module 
Use “native_app_glue” module 
$(call import-module,android/native_app_glue) 
1. include $(BUILD_SHARED_LIBRARY) 
2. $(call import-module, 
android/native_app_glue)
©SIProp Project, 2006-2008 29 
Setup/Make Build.xml 1/2 
Making Setting File for Android using ANT 
Today, Development on CUI Only!!! 
Don’t use Eclipse! 
› android list target 
› Available Android targets: 
› ---------- 
› id: 1 or "android-9" 
› Name: Android 2.3.1 
› Type: Platform 
› API level: 9 
› Revision: 2 
› Skins: WQVGA400, QVGA, HVGA, WVGA800 (default), WVGA854 
› ABIs : armeabi 
› ---------- 
› id: 2 or "android-18" 
› Name: Android 4.3 
› Type: Platform 
› API level: 18 
› Revision: 2 
› Skins: WXGA800, WQVGA400, QVGA, WQVGA432, WXGA800-7in, WVGA800 
(default), HVGA, WXGA720, WSVGA, WVGA854 
› ABIs : armeabi-v7a 
› ----------
©SIProp Project, 2006-2008 30 
Setup/Make Build.xml 2/2 
Make Build.xml 
› android update project --path . --target 2
©SIProp Project, 2006-2008 31 
Build NativeActivity 
Build C/C++ Source Codes 
› ndk-build [clean all] 
Make APK File 
› ant [debug|release]
› adb install bin/NativeActivity-debug.apk 
› adb uninstall com.example.native_activity 
©SIProp Project, 2006-2008 32 
Install NativeActivity.apk 
Install APK File 
UnInstall APK File 
Show Log 
› adb logcat
©SIProp Project, 2006-2008 33 
adb(Android Debug Bridge) 
Functions 
Shell on Android Device 
adb shell 
Show Connected Android Devices 
adb devices 
Install/Uninstall APK File 
adb install/uninstall [App Name]/[Package Name] 
Send/Get File to/from Android Device 
adb push/pull [from File Path] [to File Path] 
Show Log (DDMS) 
adb logcat
©SIProp Project, 2006-2008 34 
Quick Explanation to OpenCL 
1. void android_main(android_app* app) { 
2. (snip) 
3. cv::Mat drawing_frame; 
4. (snip) 
5. colorSampleImage = imread(file_path); 
6. (snip) 
7. // Create Mat Object for OpenCL 
8. cv::ocl::oclMat oclIn(colorSampleImage), oclOut; 
9. // Change Color RGB->Black&White on OpenCL 
10. cv::ocl::cvtColor(oclIn, oclOut, cv::COLOR_BGR2GRAY); 
11. // Download Mat Object for OpenCL to Mat for CPU 
12. oclOut.download(drawing_frame); 
13. 
14. engine_draw_frame(&engine, drawing_frame);
How to Set up OpenCL Driver 
adreno-3xx: Qualcomm's Adreno 3xx GPUs 
©SIProp Project, 2006-2008 35 
mali-t6xx: ARM's Mali-T6xx GPUs
©SIProp Project, 2006-2008 36 
Download OpenCL Drivers 
OpenCL Drivers was deleted since 4.2 
adreno-3xx: Qualcomm's Adreno 3xx GPUs 
mali-t6xx: ARM's Mali-T6xx GPUs 
Download from: 
https://github.com/madeye/opencl-android-proprietary
©SIProp Project, 2006-2008 37 
Set up Drivers to your Android 
Ex. adreno-3xx: Qualcomm's Adreno 3xx GPUs 
1. $ adb push kitkat/system/vendor/lib /sdcard/ 
2. $ adb shell 
3. $ su 
4. # mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 
/system 
5. # cp /sdcard/libOpenCL.so /system/vendor/lib/ 
6. # cp /sdcard/libllvm-a3xx.so /system/vendor/lib/ 
7. # chmod 644 /system/vendor/lib/libOpenCL.so 
8. # chmod 644 /system/vendor/lib/libllvm-a3xx.so

Weitere ähnliche Inhalte

Was ist angesagt?

C++からWebRTC (DataChannel)を利用する
C++からWebRTC (DataChannel)を利用するC++からWebRTC (DataChannel)を利用する
C++からWebRTC (DataChannel)を利用する祐司 伊藤
 
Introduction to .NET Core
Introduction to .NET CoreIntroduction to .NET Core
Introduction to .NET CoreMarco Parenzan
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Robert Stern
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux SystemJian-Hong Pan
 
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
 
Initiation à Express js
Initiation à Express jsInitiation à Express js
Initiation à Express jsAbdoulaye Dieng
 
Android Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndroid Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndreas Jakl
 
Panorama des Technologies mobiles
Panorama des Technologies mobilesPanorama des Technologies mobiles
Panorama des Technologies mobilesAbdoulaye Dieng
 
A flight with Flutter
A flight with FlutterA flight with Flutter
A flight with FlutterAhmed Tarek
 
INTRODUCTION TO FLUTTER BASICS.pptx
INTRODUCTION TO FLUTTER BASICS.pptxINTRODUCTION TO FLUTTER BASICS.pptx
INTRODUCTION TO FLUTTER BASICS.pptx20TUCS033DHAMODHARAK
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 

Was ist angesagt? (20)

Android Binder: Deep Dive
Android Binder: Deep DiveAndroid Binder: Deep Dive
Android Binder: Deep Dive
 
C++からWebRTC (DataChannel)を利用する
C++からWebRTC (DataChannel)を利用するC++からWebRTC (DataChannel)を利用する
C++からWebRTC (DataChannel)を利用する
 
Introduction to .NET Core
Introduction to .NET CoreIntroduction to .NET Core
Introduction to .NET Core
 
Net core
Net coreNet core
Net core
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
How to Build & Use OpenCL on Android Studio
How to Build & Use OpenCL on Android StudioHow to Build & Use OpenCL on Android Studio
How to Build & Use OpenCL on Android Studio
 
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
 
Initiation à Express js
Initiation à Express jsInitiation à Express js
Initiation à Express js
 
Android Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndroid Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - Introduction
 
Panorama des Technologies mobiles
Panorama des Technologies mobilesPanorama des Technologies mobiles
Panorama des Technologies mobiles
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
A flight with Flutter
A flight with FlutterA flight with Flutter
A flight with Flutter
 
Practice of Android Reverse Engineering
Practice of Android Reverse EngineeringPractice of Android Reverse Engineering
Practice of Android Reverse Engineering
 
INTRODUCTION TO FLUTTER BASICS.pptx
INTRODUCTION TO FLUTTER BASICS.pptxINTRODUCTION TO FLUTTER BASICS.pptx
INTRODUCTION TO FLUTTER BASICS.pptx
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Processes
ProcessesProcesses
Processes
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 

Andere mochten auch

Looking into the past - feature extraction from historic maps using Python, O...
Looking into the past - feature extraction from historic maps using Python, O...Looking into the past - feature extraction from historic maps using Python, O...
Looking into the past - feature extraction from historic maps using Python, O...James Crone
 
Introduction to OpenCV with python (at taichung.py)
Introduction to OpenCV with python (at taichung.py)Introduction to OpenCV with python (at taichung.py)
Introduction to OpenCV with python (at taichung.py)Max Lai
 
OpenCV 에서 OpenCL 살짝 써보기
OpenCV 에서 OpenCL 살짝 써보기OpenCV 에서 OpenCL 살짝 써보기
OpenCV 에서 OpenCL 살짝 써보기Seunghwa Song
 
Using openCV 3.1.0 with vs2015
Using openCV 3.1.0 with vs2015Using openCV 3.1.0 with vs2015
Using openCV 3.1.0 with vs2015Wei-Wen Hsu
 
Using openCV 2.0 with Dev C++
Using openCV 2.0 with Dev C++Using openCV 2.0 with Dev C++
Using openCV 2.0 with Dev C++Wei-Wen Hsu
 
OpenCV 3.0 - Latest news and the Roadmap
OpenCV 3.0 - Latest news and the RoadmapOpenCV 3.0 - Latest news and the Roadmap
OpenCV 3.0 - Latest news and the RoadmapEugene Khvedchenya
 
Face Recognition with OpenCV and scikit-learn
Face Recognition with OpenCV and scikit-learnFace Recognition with OpenCV and scikit-learn
Face Recognition with OpenCV and scikit-learnShiqiao Du
 
PYNQ 祭り: Pmod のプログラミング
PYNQ 祭り: Pmod のプログラミングPYNQ 祭り: Pmod のプログラミング
PYNQ 祭り: Pmod のプログラミングryos36
 
PYNQで○○してみた!
PYNQで○○してみた!PYNQで○○してみた!
PYNQで○○してみた!aster_ism
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...Edge AI and Vision Alliance
 
Image Processing with OpenCV
Image Processing with OpenCVImage Processing with OpenCV
Image Processing with OpenCVdebayanin
 
Computer Vision, Deep Learning, OpenCV
Computer Vision, Deep Learning, OpenCVComputer Vision, Deep Learning, OpenCV
Computer Vision, Deep Learning, OpenCVFarshid Pirahansiah
 

Andere mochten auch (20)

OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
 
Zedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on ZedboardZedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on Zedboard
 
How to Add Original Library to Android NDK
How to Add Original Library to Android NDKHow to Add Original Library to Android NDK
How to Add Original Library to Android NDK
 
將DNA在廚房抽出的程序
將DNA在廚房抽出的程序將DNA在廚房抽出的程序
將DNA在廚房抽出的程序
 
Introduction to OpenCV
Introduction to OpenCVIntroduction to OpenCV
Introduction to OpenCV
 
Looking into the past - feature extraction from historic maps using Python, O...
Looking into the past - feature extraction from historic maps using Python, O...Looking into the past - feature extraction from historic maps using Python, O...
Looking into the past - feature extraction from historic maps using Python, O...
 
Introduction to OpenCV with python (at taichung.py)
Introduction to OpenCV with python (at taichung.py)Introduction to OpenCV with python (at taichung.py)
Introduction to OpenCV with python (at taichung.py)
 
OpenCV 에서 OpenCL 살짝 써보기
OpenCV 에서 OpenCL 살짝 써보기OpenCV 에서 OpenCL 살짝 써보기
OpenCV 에서 OpenCL 살짝 써보기
 
Using openCV 3.1.0 with vs2015
Using openCV 3.1.0 with vs2015Using openCV 3.1.0 with vs2015
Using openCV 3.1.0 with vs2015
 
Using openCV 2.0 with Dev C++
Using openCV 2.0 with Dev C++Using openCV 2.0 with Dev C++
Using openCV 2.0 with Dev C++
 
OpenCV 3.0 - Latest news and the Roadmap
OpenCV 3.0 - Latest news and the RoadmapOpenCV 3.0 - Latest news and the Roadmap
OpenCV 3.0 - Latest news and the Roadmap
 
Face Recognition with OpenCV and scikit-learn
Face Recognition with OpenCV and scikit-learnFace Recognition with OpenCV and scikit-learn
Face Recognition with OpenCV and scikit-learn
 
OpenCV Workshop
OpenCV WorkshopOpenCV Workshop
OpenCV Workshop
 
PYNQ 祭り: Pmod のプログラミング
PYNQ 祭り: Pmod のプログラミングPYNQ 祭り: Pmod のプログラミング
PYNQ 祭り: Pmod のプログラミング
 
OpenCV Introduction
OpenCV IntroductionOpenCV Introduction
OpenCV Introduction
 
PYNQで○○してみた!
PYNQで○○してみた!PYNQで○○してみた!
PYNQで○○してみた!
 
PYNQ祭り
PYNQ祭りPYNQ祭り
PYNQ祭り
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
 
Image Processing with OpenCV
Image Processing with OpenCVImage Processing with OpenCV
Image Processing with OpenCV
 
Computer Vision, Deep Learning, OpenCV
Computer Vision, Deep Learning, OpenCVComputer Vision, Deep Learning, OpenCV
Computer Vision, Deep Learning, OpenCV
 

Ähnlich wie How to Build & Use OpenCL on OpenCV & Android NDK

State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopmentgillygize
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalNAVER D2
 
Lecture02web 140phpapp01
Lecture02web 140phpapp01Lecture02web 140phpapp01
Lecture02web 140phpapp01letuan9999
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Native Android for Windows Developers
Native Android for Windows DevelopersNative Android for Windows Developers
Native Android for Windows DevelopersYoss Cohen
 
Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Paris Android User Group
 
Pwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreakPwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreakAbraham Aranguren
 
DEEP: a user success story
DEEP: a user success storyDEEP: a user success story
DEEP: a user success storyEOSC-hub project
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusEmily Jiang
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginXavier Hallade
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deploymentThilo Utke
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)Eric D. Schabell
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Shekhar Gulati
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 

Ähnlich wie How to Build & Use OpenCL on OpenCV & Android NDK (20)

How to Use OpenMP on Native Activity
How to Use OpenMP on Native ActivityHow to Use OpenMP on Native Activity
How to Use OpenMP on Native Activity
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
Lecture02web 140phpapp01
Lecture02web 140phpapp01Lecture02web 140phpapp01
Lecture02web 140phpapp01
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Native Android for Windows Developers
Native Android for Windows DevelopersNative Android for Windows Developers
Native Android for Windows Developers
 
Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014
 
Pwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreakPwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreak
 
DEEP: a user success story
DEEP: a user success storyDEEP: a user success story
DEEP: a user success story
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental pluginMastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
Mastering the NDK with Android Studio 2.0 and the gradle-experimental plugin
 
How to Make Android Native Application
How to Make Android Native ApplicationHow to Make Android Native Application
How to Make Android Native Application
 
Getting Native with NDK
Getting Native with NDKGetting Native with NDK
Getting Native with NDK
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deployment
 
Core Android
Core AndroidCore Android
Core Android
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 
Android development beginners faq
Android development  beginners faqAndroid development  beginners faq
Android development beginners faq
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 

Mehr von Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)

Mehr von Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院) (20)

What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?
 
半導体製造(TinyTapeout)に挑戦しよう!
半導体製造(TinyTapeout)に挑戦しよう!半導体製造(TinyTapeout)に挑戦しよう!
半導体製造(TinyTapeout)に挑戦しよう!
 
Introduction of ISHI-KAI with OpenMPW
Introduction of ISHI-KAI with OpenMPWIntroduction of ISHI-KAI with OpenMPW
Introduction of ISHI-KAI with OpenMPW
 
Kernel/VMレイヤーを自分色に染める!By ISHI会
Kernel/VMレイヤーを自分色に染める!By ISHI会Kernel/VMレイヤーを自分色に染める!By ISHI会
Kernel/VMレイヤーを自分色に染める!By ISHI会
 
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPi
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPiPrinciple Representation of The 8 Qubits Quantum Computer by RaspberryPi
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPi
 
Microwaveguquantum
MicrowaveguquantumMicrowaveguquantum
Microwaveguquantum
 
The easiest way of setup QuTiP on Windows
The easiest way of setup QuTiP on WindowsThe easiest way of setup QuTiP on Windows
The easiest way of setup QuTiP on Windows
 
GNU Radio Study for Super beginner
GNU Radio Study for Super beginnerGNU Radio Study for Super beginner
GNU Radio Study for Super beginner
 
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
 
Self‐Contained SDR Grand Station with Raspberry Pi 3
Self‐Contained SDR Grand Station with Raspberry Pi 3Self‐Contained SDR Grand Station with Raspberry Pi 3
Self‐Contained SDR Grand Station with Raspberry Pi 3
 
衛星追尾用パラボラアンテナ建設記
衛星追尾用パラボラアンテナ建設記衛星追尾用パラボラアンテナ建設記
衛星追尾用パラボラアンテナ建設記
 
All list of the measuring machines for microwave
All list of the measuring machines for microwaveAll list of the measuring machines for microwave
All list of the measuring machines for microwave
 
5000円で誰でも作れる新世代衛星地上局
5000円で誰でも作れる新世代衛星地上局5000円で誰でも作れる新世代衛星地上局
5000円で誰でも作れる新世代衛星地上局
 
How to setup mastodon in chinese
How to setup mastodon in chineseHow to setup mastodon in chinese
How to setup mastodon in chinese
 
Radiation Test -Raspberry PI Zero-
Radiation Test -Raspberry PI Zero-Radiation Test -Raspberry PI Zero-
Radiation Test -Raspberry PI Zero-
 
Protocol of the DNA Extraction in Kitchen
Protocol of the DNA Extraction in KitchenProtocol of the DNA Extraction in Kitchen
Protocol of the DNA Extraction in Kitchen
 
3D Printed Google Cardboard for workshop
3D Printed Google Cardboard for workshop3D Printed Google Cardboard for workshop
3D Printed Google Cardboard for workshop
 
計算機(物理)
計算機(物理)計算機(物理)
計算機(物理)
 
Resume
ResumeResume
Resume
 
How to Make a Scanning Drone in Chinese
How to Make a Scanning Drone in ChineseHow to Make a Scanning Drone in Chinese
How to Make a Scanning Drone in Chinese
 

Kürzlich hochgeladen

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Kürzlich hochgeladen (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

How to Build & Use OpenCL on OpenCV & Android NDK

  • 1. ©SIProp Project, 2006-2008 1 How to Build & Use OpenCL on OpenCV & Android NDK Noritsuna Imamura noritsuna@siprop.org
  • 2. ©SIProp Project, 2006-2008 2 !!!!!!ATTENTION!!!!!! This manual is “How to Build” manual. If you want to “Use OpenCL on OpenCV” ONLY, Please see http://github.com/noritsuna/OpenCVwithOpenCL4 AndroidNDKSample
  • 3. How to Build OpenCL on OpenCV ©SIProp Project, 2006-2008 3 for Android NDK
  • 4. ©SIProp Project, 2006-2008 4 Download OpenCV & NDK tool › wget https://github.com/Itseez/opencv/archive/ 2.4.10.1tar.gz › tar zxfv 2.4.10.1.tar.gz › mkdir ~/android/ › cd ~/android/ › wget http://dl.google.com/android/android-sdk_ r23.0.2-linux.tgz › wget http://dl.google.com/android/ndk/android-ndk- r10c-linux-x86_64.bin › tar zxfv android-sdk_r23.0.2-linux.tgz › ./android-ndk-r10c-linux-x86_64.bin
  • 5. ©SIProp Project, 2006-2008 5 Edit Setup File ./opencv- 2.4.10.1/platforms/scripts/cmake_android_arm.s h Add WITH_EIGEN=off option. Currently version has some bugs. › cmake -DWITH_EIGEN=OFF - DCMAKE_BUILD_WITH_INSTALL_RPATH=ON - DCMAKE_TOOLCHAIN_FILE=../android/android.toolchain.c make $@ ../..
  • 6. ©SIProp Project, 2006-2008 6 Set Path to SDK/NDK › export ANDROID_NDK=~/android/android-ndk- r10c › export ANDROID_SDK=~/android/android-sdk- linux
  • 7. Add “SO loading“ func for Android 1/3 Change “SO loading“ func for Linux to this func without Android. ~/opencv- 2.4.10.1/modules/ocl/src/cl_runtime/cl_runtime.cpp ©SIProp Project, 2006-2008 7 › #if defined(__linux__) ↓ › #if defined(__linux__) && !defined(__ANDROID__)
  • 8. Add “SO loading“ func for Android 2/3 Add “SO loading“ func for Android. (continue to next page) ~/opencv- 2.4.10.1/modules/ocl/src/cl_runtime/cl_runtime.cpp ©SIProp Project, 2006-2008 8 › #if defined(__ANDROID__) › #include <dlfcn.h> › #include <sys/stat.h> › #if defined(__ARM_ARCH_8A__) || defined(_X64_) › static const char *default_so_paths[] = { › "/system/lib64/libOpenCL.so", › "/system/vendor/lib64/libOpenCL.so", › "/system/vendor/lib64/egl/libGLES_mali.so" › }; › #else › static const char *default_so_paths[] = { › "/system/lib/libOpenCL.so", › "/system/vendor/lib/libOpenCL.so", › "/system/vendor/lib/egl/libGLES_mali.so" › }; › #endif ›
  • 9. Add “SO loading“ func for Android 3/3 ©SIProp Project, 2006-2008 9 › static int access_file(const char *filename) › { › struct stat buffer; › return (stat(filename, &buffer) == 0); › } › static void* GetProcAddress (const char* name) › { › static void* h = NULL; › unsigned int i; › if (!h) › { › const char* name; › for(i=0; i<(sizeof(default_so_paths)/sizeof(char*)); i++) › { › if(access_file(default_so_paths[i])) { › name = (char *)default_so_paths[i]; › h = dlopen(name, RTLD_LAZY); › if (h) break; › } › } › if (!h) › return NULL; › } › return dlsym(h, name); › } › #define CV_CL_GET_PROC_ADDRESS(name) GetProcAddress(name) › #endif
  • 10. › cd ~/opencv-2.4.10.1/platforms/scripts/ › ./cmake_android_arm.sh ©SIProp Project, 2006-2008 10 Execute Auto Config & make This Script make Makefile for OpenCV. In “~/opencv- 2.4.10.1/platforms/scripts/build_android_arm.sh” Make !!! › cd ~/opencv- 2.4.10.1/platforms/scripts/build_android_arm / › make
  • 11. ©SIProp Project, 2006-2008 11 Where are Made Files? OpenCV Libs. In “~/opencv- 2.4.10.1/platforms/build_android_arm/lib” highgui core etc... 3rd Party Libs for OpenCV. In “~/opencv- 2.4.10.1/platforms/build_android_arm/3rdparty/lib” libIlmImf libjasper libjpeg libpng libtiff
  • 12. ©SIProp Project, 2006-2008 12 Copy libs to sample program OpenCV Libs. cp ~/opencv- 2.4.10.1/platforms/build_android_arm/lib/armeabi-v7a/* ~/opencv-2.4.10.1/samples/android/native-activity/ libs_opencv/ 3rd Party Libs for OpenCV. cp ~/opencv- 2.4.10.1/platforms/build_android_arm/3rdparty/lib/ar meabi-v7a/* ~/opencv- 2.4.10.1/samples/android/native-activity/ libs_opencv/
  • 13. How to Use OpenCL on OpenCV for Android NDK(Native App) ©SIProp Project, 2006-2008 13
  • 14. ©SIProp Project, 2006-2008 14 Download Sample Source Code http://github.com/noritsuna/OpenCVwithOpenCL4Andr oidNDKSample Based OpenCV-2.4.10.1 & Android 4.4 Made Android Native Activity. Convert RGB Color Image to Black&White Image.
  • 15. Call Stack Call as C/C++ APIs Call as SysCall(C/ASM) ©SIProp Project, 2006-2008 15 Native Application NDK wo/ADT Standard Android Application for C/C++ Only C/C++ on Limited Library Layer Advantage Only C/C++ DirectCall C/C++ API Dis-Advantage Use a few Android Tools A few Docs from Google Developer Site & Blogs APK File(Your Application) (C/C++) Library Layer (C/C++) Kernel/Driver Layer (C/ASM)
  • 16. How to Make this Sample Source Code from OpenCV’s Sample Project ©SIProp Project, 2006-2008 16
  • 17. ©SIProp Project, 2006-2008 17 Use NativeActivity of OpenCV This Sample uses Only C/C++ Code. ~/opencv-2.4.10.1/samples/android/native-activity Structure of NativeActivity AndroidManifest.xml <- Property File for Android res <- Directory that has Resource file(Image,Voice) jni <- Directory that has files for NDK Android.mk <- make file of NDK Application.mk <- property file of NDK native.cpp <- Sample App Other Files/Dir, don’t use.
  • 18. ©SIProp Project, 2006-2008 18 Edit AndroidManifest.xml Replace “application” Section 1. <application android:label="@string/app_name" android:hasCode="false"> 2. <activity android:name="android.app.NativeActivity" 3. android:label="@string/app_name" 4. android:configChanges="orientation|keyboardHidden"> 5. <!-- Tell NativeActivity the name of or .so --> 6. <meta-data android:name="android.app.lib_name" 7. android:value="native_activity" /> 8. <intent-filter> 9. <action android:name="android.intent.action.MAIN" /> 10. <category android:name="android.intent.category.LAUNCHER" /> 11. </intent-filter> 12. </activity> 13. </application>
  • 19. 2. <uses-sdk android:minSdkVersion=“9" /> ©SIProp Project, 2006-2008 19 About AndroidManifest.xml API Level 1. <!-- This is the platform API where NativeActivity was introduced. --> Permission 1. <uses-permission android:name="android.permission.CAMERA "/>
  • 20. ©SIProp Project, 2006-2008 20 Create jni/Android.mk 1/9 1. Delete jni/Android.mk & Create the new jni/Android.mk 2. Set LOCAL_PATH & include 1. LOCAL_PATH := $(call my-dir) 2. include $(CLEAR_VARS)
  • 21. ©SIProp Project, 2006-2008 21 Create jni/Android.mk 2/9 1. Set OpenCV’s Modules & Libs 1. OPENCV_MODULES:=contrib legacy ml stitching superres objdetect ts videostab video photo calib3d features2d highgui imgproc flann ocl core androidcamera 2. OPENCV_3RDPARTY_COMPONENTS:=asse tmanager tbb libjpeg libpng libtiff libjasper IlmImf 3. OPENCV_CAMERA_MODULES:= native_camera_r2.2.0 native_camera_r2.3.3 native_camera_r3.0.1 native_camera_r4.0.0 native_camera_r4.0.3 native_camera_r4.1.1 native_camera_r4.2.0 native_camera_r4.3.0 native_camera_r4.4.0
  • 22. LOCAL_SRC_FILES:=../libs_opencv/libopenc v_$1.a 5. include $(PREBUILT_STATIC_LIBRARY) 6. endef ©SIProp Project, 2006-2008 22 Create jni/Android.mk 3/9 Set Loading OpenCV Libs Function 1. define add_opencv_module 2. include $(CLEAR_VARS) 3. LOCAL_MODULE:=opencv_$1 4. 1. $(foreach module,$(OPENCV_MODULES),$(eval $(call add_opencv_module,$(module))))
  • 23. 1. define add_opencv_3rdparty_component 2. include $(CLEAR_VARS) 3. LOCAL_MODULE:=$1 4. LOCAL_SRC_FILES:=../libs_opencv/lib$1.a 5. include $(PREBUILT_STATIC_LIBRARY) 6. endef ©SIProp Project, 2006-2008 23 Create jni/Android.mk 4/9 Set Loading OpenCV Libs Function 1. $(foreach module,$(OPENCV_3RDPARTY_COMPONEN TS),$(eval $(call add_opencv_3rdparty_component,$(module))))
  • 24. LOCAL_SRC_FILES:=../libs_opencv/lib$1.so 5. include $(PREBUILT_SHARED_LIBRARY) 6. endef ©SIProp Project, 2006-2008 24 Create jni/Android.mk 5/9 Set Loading AndroidCamera Libs Function 1. define add_opencv_camera_module 2. include $(CLEAR_VARS) 3. LOCAL_MODULE:=$1 4. 1. $(foreach module,$(OPENCV_CAMERA_MODULES),$(e val $(call add_opencv_camera_module,$(module))))
  • 25. ©SIProp Project, 2006-2008 25 Create jni/Android.mk 6/9 Set loading info lib 1. include $(CLEAR_VARS) 2. LOCAL_MODULE:=opencv_info 3. LOCAL_SRC_FILES:=../libs_opencv/libopenc v_info.so 4. include $(PREBUILT_SHARED_LIBRARY)
  • 26. ©SIProp Project, 2006-2008 26 Create jni/Android.mk 7/9 Set Include Dir Set Module name & Source Code OpenCVwithOpenCL4AndroidNDKNativeActivity.cpp 1. include $(CLEAR_VARS) 2. LOCAL_C_INCLUDES+=./jni/include 3. LOCAL_MODULE := OpenCV_CL 4. LOCAL_SRC_FILES := OpenCVwithOpenCL4AndroidNDKNativeActi vity.cpp
  • 27. ©SIProp Project, 2006-2008 27 Create jni/Android.mk 8/9 Set Loading Lib & OpenCV Lib LOCAL_LDLIBS -lm -llog -lc -ldl -lz -landroid LOCAL_STATIC_LIBRARIES $(foreach mod, $(OPENCV_MODULES), opencv_$(mod)) $(OPENCV_3RDPARTY_COMPONENTS) 1. LOCAL_LDLIBS += -lm -llog -lc -ldl -lz - landroid 2. LOCAL_STATIC_LIBRARIES := android_native_app_glue $(foreach mod, $(OPENCV_MODULES), opencv_$(mod)) $(OPENCV_3RDPARTY_COMPONENTS)
  • 28. ©SIProp Project, 2006-2008 28 Create jni/Android.mk 9/9 Set Library Type Make SO lib BUILD_SHARED_LIBRARY Set Loading Android module Use “native_app_glue” module $(call import-module,android/native_app_glue) 1. include $(BUILD_SHARED_LIBRARY) 2. $(call import-module, android/native_app_glue)
  • 29. ©SIProp Project, 2006-2008 29 Setup/Make Build.xml 1/2 Making Setting File for Android using ANT Today, Development on CUI Only!!! Don’t use Eclipse! › android list target › Available Android targets: › ---------- › id: 1 or "android-9" › Name: Android 2.3.1 › Type: Platform › API level: 9 › Revision: 2 › Skins: WQVGA400, QVGA, HVGA, WVGA800 (default), WVGA854 › ABIs : armeabi › ---------- › id: 2 or "android-18" › Name: Android 4.3 › Type: Platform › API level: 18 › Revision: 2 › Skins: WXGA800, WQVGA400, QVGA, WQVGA432, WXGA800-7in, WVGA800 (default), HVGA, WXGA720, WSVGA, WVGA854 › ABIs : armeabi-v7a › ----------
  • 30. ©SIProp Project, 2006-2008 30 Setup/Make Build.xml 2/2 Make Build.xml › android update project --path . --target 2
  • 31. ©SIProp Project, 2006-2008 31 Build NativeActivity Build C/C++ Source Codes › ndk-build [clean all] Make APK File › ant [debug|release]
  • 32. › adb install bin/NativeActivity-debug.apk › adb uninstall com.example.native_activity ©SIProp Project, 2006-2008 32 Install NativeActivity.apk Install APK File UnInstall APK File Show Log › adb logcat
  • 33. ©SIProp Project, 2006-2008 33 adb(Android Debug Bridge) Functions Shell on Android Device adb shell Show Connected Android Devices adb devices Install/Uninstall APK File adb install/uninstall [App Name]/[Package Name] Send/Get File to/from Android Device adb push/pull [from File Path] [to File Path] Show Log (DDMS) adb logcat
  • 34. ©SIProp Project, 2006-2008 34 Quick Explanation to OpenCL 1. void android_main(android_app* app) { 2. (snip) 3. cv::Mat drawing_frame; 4. (snip) 5. colorSampleImage = imread(file_path); 6. (snip) 7. // Create Mat Object for OpenCL 8. cv::ocl::oclMat oclIn(colorSampleImage), oclOut; 9. // Change Color RGB->Black&White on OpenCL 10. cv::ocl::cvtColor(oclIn, oclOut, cv::COLOR_BGR2GRAY); 11. // Download Mat Object for OpenCL to Mat for CPU 12. oclOut.download(drawing_frame); 13. 14. engine_draw_frame(&engine, drawing_frame);
  • 35. How to Set up OpenCL Driver adreno-3xx: Qualcomm's Adreno 3xx GPUs ©SIProp Project, 2006-2008 35 mali-t6xx: ARM's Mali-T6xx GPUs
  • 36. ©SIProp Project, 2006-2008 36 Download OpenCL Drivers OpenCL Drivers was deleted since 4.2 adreno-3xx: Qualcomm's Adreno 3xx GPUs mali-t6xx: ARM's Mali-T6xx GPUs Download from: https://github.com/madeye/opencl-android-proprietary
  • 37. ©SIProp Project, 2006-2008 37 Set up Drivers to your Android Ex. adreno-3xx: Qualcomm's Adreno 3xx GPUs 1. $ adb push kitkat/system/vendor/lib /sdcard/ 2. $ adb shell 3. $ su 4. # mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system 5. # cp /sdcard/libOpenCL.so /system/vendor/lib/ 6. # cp /sdcard/libllvm-a3xx.so /system/vendor/lib/ 7. # chmod 644 /system/vendor/lib/libOpenCL.so 8. # chmod 644 /system/vendor/lib/libllvm-a3xx.so