11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #Android上使用OpenCV提取特征识别特定区域
2 | ####分别使用JNI和java调用OpenCV
3 | ##Functions
4 | 1. 在Functions中选择java调用还是jni调用
5 | 2. Detector检测关键点算法
6 | 3. DescriptorExtractor提取关键点
7 | 4. Matcher比较算法
8 |
9 |
10 |
11 | ####例图使用的是:
12 | Detector:ORB
13 |
14 | DescriptorExtractor:ORB
15 |
16 | Matcher:Brute-Force
17 |
18 | 
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Sets the minimum version of CMake required to build the native
2 | # library. You should either keep the default value or only pass a
3 | # value of 3.4.0 or lower.
4 |
5 | cmake_minimum_required(VERSION 3.4.1)
6 |
7 | set(CMAKE_VERBOSE_MAKEFILE on)
8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
9 |
10 |
11 | set(PATH_TO_PROJECT /Users/flb/Downloads/SmartObjectRecognition)
12 | set(PATH_TO_OPENCV_SDK /Users/flb/Documents/SourceCode/OpenCV-2.4.10-android-sdk)
13 |
14 | include_directories(${PATH_TO_OPENCV_SDK}/sdk/native/jni/include)
15 |
16 |
17 |
18 | add_library( open-cv SHARED IMPORTED )
19 | set_target_properties(open-cv PROPERTIES IMPORTED_LOCATION ${PATH_TO_PROJECT}/app/src/main/jniLibs/${ANDROID_ABI}/libopencv_java.so)
20 |
21 | add_library( native-lib SHARED src/main/cpp/native-lib.cpp )
22 |
23 | find_library( log-lib log )
24 |
25 | target_link_libraries( native-lib $\{log-lib} open-cv)
26 |
27 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "24.0.1"
6 | defaultConfig {
7 | applicationId "com.itil.smartobjectrecognition"
8 | minSdkVersion 15
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | externalNativeBuild {
14 | cmake {
15 | cppFlags "-std=c++11 -frtti -fexceptions"
16 | abiFilters 'x86', 'armeabi', 'armeabi-v7a'
17 | }
18 | }
19 | }
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | externalNativeBuild {
27 | cmake {
28 | path "CMakeLists.txt"
29 | }
30 | }
31 | sourceSets { main { jni.srcDirs = ['/Users/flb/Downloads/SmartObjectRecognition/app/src/main/jniLibs/'] } }
32 | }
33 |
34 | dependencies {
35 | compile fileTree(include: ['*.jar'], dir: 'libs')
36 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
37 | exclude group: 'com.android.support', module: 'support-annotations'
38 | })
39 | compile 'com.android.support:appcompat-v7:25.1.0'
40 | testCompile 'junit:junit:4.12'
41 | compile project(':openCVLibrary2410')
42 | }
43 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/flb/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/itil/smartobjectrecognition/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.itil.smartobjectrecognition;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.itil.smartobjectrecognition", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
19 |
20 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r2.2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r2.2.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r2.3.3.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r2.3.3.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r3.0.1.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r3.0.1.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.0.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.0.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.0.3.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.0.3.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.1.1.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.1.1.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.2.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.3.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.3.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.4.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libnative_camera_r4.4.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_androidcamera.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_androidcamera.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_calib3d.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_calib3d.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_contrib.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_contrib.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_core.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_core.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_features2d.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_features2d.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_flann.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_flann.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_highgui.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_highgui.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_imgproc.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_imgproc.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_info.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_info.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_java.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_java.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_legacy.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_legacy.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_ml.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_ml.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_objdetect.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_objdetect.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_ocl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_ocl.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_photo.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_photo.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_stitching.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_stitching.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_superres.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_superres.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_ts.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_ts.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_video.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_video.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libopencv_videostab.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi-v7a/libopencv_videostab.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r2.2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r2.2.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r2.3.3.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r2.3.3.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r3.0.1.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r3.0.1.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r4.0.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r4.0.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r4.0.3.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r4.0.3.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r4.1.1.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r4.1.1.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r4.2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r4.2.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r4.3.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r4.3.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnative_camera_r4.4.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libnative_camera_r4.4.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_androidcamera.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_androidcamera.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_calib3d.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_calib3d.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_contrib.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_contrib.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_core.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_core.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_features2d.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_features2d.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_flann.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_flann.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_highgui.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_highgui.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_imgproc.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_imgproc.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_info.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_info.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_java.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_java.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_legacy.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_legacy.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_ml.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_ml.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_objdetect.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_objdetect.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_ocl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_ocl.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_photo.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_photo.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_stitching.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_stitching.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_superres.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_superres.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_ts.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_ts.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_video.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_video.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libopencv_videostab.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/armeabi/libopencv_videostab.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libnative_camera_r2.3.3.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libnative_camera_r2.3.3.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libnative_camera_r3.0.1.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libnative_camera_r3.0.1.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libnative_camera_r4.0.3.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libnative_camera_r4.0.3.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libnative_camera_r4.1.1.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libnative_camera_r4.1.1.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libnative_camera_r4.2.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libnative_camera_r4.2.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libnative_camera_r4.3.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libnative_camera_r4.3.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libnative_camera_r4.4.0.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libnative_camera_r4.4.0.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_androidcamera.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_androidcamera.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_calib3d.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_calib3d.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_contrib.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_contrib.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_core.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_core.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_features2d.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_features2d.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_flann.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_flann.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_highgui.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_highgui.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_imgproc.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_imgproc.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_info.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_info.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_java.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_java.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_legacy.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_legacy.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_ml.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_ml.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_objdetect.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_objdetect.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_ocl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_ocl.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_photo.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_photo.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_stitching.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_stitching.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_superres.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_superres.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_ts.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_ts.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_video.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_video.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libopencv_videostab.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/jniLibs/x86/libopencv_videostab.a
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | SmartObjectRecognition
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/itil/smartobjectrecognition/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.itil.smartobjectrecognition;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/cut.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/cut.mp4
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 | android.useDeprecatedNdk = true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "24.0.1"
6 |
7 | defaultConfig {
8 | minSdkVersion 14
9 | targetSdkVersion 25
10 | }
11 |
12 | buildTypes {
13 | release {
14 | minifyEnabled false
15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/generated/source/buildConfig/androidTest/debug/org/opencv/test/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Automatically generated file. DO NOT MODIFY
3 | */
4 | package org.opencv.test;
5 |
6 | public final class BuildConfig {
7 | public static final boolean DEBUG = Boolean.parseBoolean("true");
8 | public static final String APPLICATION_ID = "org.opencv.test";
9 | public static final String BUILD_TYPE = "debug";
10 | public static final String FLAVOR = "";
11 | public static final int VERSION_CODE = -1;
12 | public static final String VERSION_NAME = "";
13 | }
14 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/generated/source/buildConfig/debug/org/opencv/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Automatically generated file. DO NOT MODIFY
3 | */
4 | package org.opencv;
5 |
6 | public final class BuildConfig {
7 | public static final boolean DEBUG = Boolean.parseBoolean("true");
8 | public static final String APPLICATION_ID = "org.opencv";
9 | public static final String BUILD_TYPE = "debug";
10 | public static final String FLAVOR = "";
11 | public static final int VERSION_CODE = 24100;
12 | public static final String VERSION_NAME = "2.4.10";
13 | }
14 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/generated/source/r/androidTest/debug/org/opencv/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 | package org.opencv;
8 |
9 | public final class R {
10 | public static final class attr {
11 | public static final int camera_id = 0x7f010001;
12 | public static final int show_fps = 0x7f010000;
13 | }
14 | public static final class id {
15 | public static final int any = 0x7f020000;
16 | public static final int back = 0x7f020001;
17 | public static final int front = 0x7f020002;
18 | }
19 | public static final class styleable {
20 | public static final int[] CameraBridgeViewBase = { 0x7f010000, 0x7f010001 };
21 | public static final int CameraBridgeViewBase_camera_id = 1;
22 | public static final int CameraBridgeViewBase_show_fps = 0;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/generated/source/r/androidTest/debug/org/opencv/test/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package org.opencv.test;
9 |
10 | public final class R {
11 | public static final class attr {
12 | /**
May be an integer value, such as "100".
13 |
This may also be a reference to a resource (in the form
14 | "@[package:]type:name") or
15 | theme attribute (in the form
16 | "?[package:][type:]name")
17 | containing a value of this type.
18 |
May be one of the following constant values.
19 |
20 |
21 |
22 |
23 |
Constant
Value
Description
24 |
any
-1
25 |
back
99
26 |
front
98
27 |
28 | */
29 | public static final int camera_id=0x7f010001;
30 | /**
Must be a boolean value, either "true" or "false".
31 |
This may also be a reference to a resource (in the form
32 | "@[package:]type:name") or
33 | theme attribute (in the form
34 | "?[package:][type:]name")
35 | containing a value of this type.
36 | */
37 | public static final int show_fps=0x7f010000;
38 | }
39 | public static final class id {
40 | public static final int any=0x7f020000;
41 | public static final int back=0x7f020001;
42 | public static final int front=0x7f020002;
43 | }
44 | public static final class styleable {
45 | /** Attributes that can be used with a CameraBridgeViewBase.
46 |
This symbol is the offset where the {@link org.opencv.test.R.attr#camera_id}
62 | attribute's value can be found in the {@link #CameraBridgeViewBase} array.
63 |
64 |
65 |
May be an integer value, such as "100".
66 |
This may also be a reference to a resource (in the form
67 | "@[package:]type:name") or
68 | theme attribute (in the form
69 | "?[package:][type:]name")
70 | containing a value of this type.
71 |
May be one of the following constant values.
72 |
73 |
74 |
75 |
76 |
Constant
Value
Description
77 |
any
-1
78 |
back
99
79 |
front
98
80 |
81 | @attr name org.opencv.test:camera_id
82 | */
83 | public static final int CameraBridgeViewBase_camera_id = 1;
84 | /**
85 |
This symbol is the offset where the {@link org.opencv.test.R.attr#show_fps}
86 | attribute's value can be found in the {@link #CameraBridgeViewBase} array.
87 |
88 |
89 |
Must be a boolean value, either "true" or "false".
90 |
This may also be a reference to a resource (in the form
91 | "@[package:]type:name") or
92 | theme attribute (in the form
93 | "?[package:][type:]name")
94 | containing a value of this type.
95 | @attr name org.opencv.test:show_fps
96 | */
97 | public static final int CameraBridgeViewBase_show_fps = 0;
98 | };
99 | }
100 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/generated/source/r/debug/org/opencv/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package org.opencv;
9 |
10 | public final class R {
11 | public static final class attr {
12 | /**
May be an integer value, such as "100".
13 |
This may also be a reference to a resource (in the form
14 | "@[package:]type:name") or
15 | theme attribute (in the form
16 | "?[package:][type:]name")
17 | containing a value of this type.
18 |
May be one of the following constant values.
19 |
20 |
21 |
22 |
23 |
Constant
Value
Description
24 |
any
-1
25 |
back
99
26 |
front
98
27 |
28 | */
29 | public static int camera_id=0x7f010001;
30 | /**
Must be a boolean value, either "true" or "false".
31 |
This may also be a reference to a resource (in the form
32 | "@[package:]type:name") or
33 | theme attribute (in the form
34 | "?[package:][type:]name")
35 | containing a value of this type.
36 | */
37 | public static int show_fps=0x7f010000;
38 | }
39 | public static final class id {
40 | public static int any=0x7f020000;
41 | public static int back=0x7f020001;
42 | public static int front=0x7f020002;
43 | }
44 | public static final class styleable {
45 | /** Attributes that can be used with a CameraBridgeViewBase.
46 |
This symbol is the offset where the {@link org.opencv.R.attr#camera_id}
62 | attribute's value can be found in the {@link #CameraBridgeViewBase} array.
63 |
64 |
65 |
May be an integer value, such as "100".
66 |
This may also be a reference to a resource (in the form
67 | "@[package:]type:name") or
68 | theme attribute (in the form
69 | "?[package:][type:]name")
70 | containing a value of this type.
71 |
May be one of the following constant values.
72 |
73 |
74 |
75 |
76 |
Constant
Value
Description
77 |
any
-1
78 |
back
99
79 |
front
98
80 |
81 | @attr name org.opencv:camera_id
82 | */
83 | public static int CameraBridgeViewBase_camera_id = 1;
84 | /**
85 |
This symbol is the offset where the {@link org.opencv.R.attr#show_fps}
86 | attribute's value can be found in the {@link #CameraBridgeViewBase} array.
87 |
88 |
89 |
Must be a boolean value, either "true" or "false".
90 |
This may also be a reference to a resource (in the form
91 | "@[package:]type:name") or
92 | theme attribute (in the form
93 | "?[package:][type:]name")
94 | containing a value of this type.
95 | @attr name org.opencv:show_fps
96 | */
97 | public static int CameraBridgeViewBase_show_fps = 0;
98 | };
99 | }
100 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/blame/res/androidTest/debug/multi/values.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "outputFile": "/Users/flb/Downloads/SmartObjectRecognition/openCVLibrary2410/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml",
4 | "map": []
5 | }
6 | ]
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/bundles/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/bundles/debug/R.txt:
--------------------------------------------------------------------------------
1 | int attr camera_id 0x7f010001
2 | int attr show_fps 0x7f010000
3 | int id any 0x7f020000
4 | int id back 0x7f020001
5 | int id front 0x7f020002
6 | int[] styleable CameraBridgeViewBase { 0x7f010000, 0x7f010001 }
7 | int styleable CameraBridgeViewBase_camera_id 1
8 | int styleable CameraBridgeViewBase_show_fps 0
9 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/bundles/debug/res/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/bundles/release/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/bundles/release/res/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/compileDebugAidl/dependency.store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/openCVLibrary2410/build/intermediates/incremental/compileDebugAidl/dependency.store
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/compileDebugAndroidTestAidl/dependency.store:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/compileReleaseAidl/dependency.store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/openCVLibrary2410/build/intermediates/incremental/compileReleaseAidl/dependency.store
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/mergeDebugAndroidTestResources/compile-file-map.properties:
--------------------------------------------------------------------------------
1 | #Tue Feb 21 11:27:51 CST 2017
2 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/mergeDebugAndroidTestResources/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/mergeDebugAssets/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/mergeDebugShaders/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/mergeReleaseAssets/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/mergeReleaseShaders/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/packageDebugResources/compile-file-map.properties:
--------------------------------------------------------------------------------
1 | #Tue Feb 21 11:27:51 CST 2017
2 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/packageDebugResources/merged.dir/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/packageDebugResources/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/packageReleaseResources/compile-file-map.properties:
--------------------------------------------------------------------------------
1 | #Tue Feb 21 11:27:38 CST 2017
2 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/packageReleaseResources/merged.dir/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/incremental/packageReleaseResources/merger.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/manifest/androidTest/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/manifests/aapt/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/manifests/aapt/release/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/res/merged/androidTest/debug/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/res/resources-debug-androidTest.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/openCVLibrary2410/build/intermediates/res/resources-debug-androidTest.ap_
--------------------------------------------------------------------------------
/openCVLibrary2410/build/intermediates/symbols/androidTest/debug/R.txt:
--------------------------------------------------------------------------------
1 | int attr camera_id 0x7f010001
2 | int attr show_fps 0x7f010000
3 | int id any 0x7f020000
4 | int id back 0x7f020001
5 | int id front 0x7f020002
6 | int[] styleable CameraBridgeViewBase { 0x7f010000, 0x7f010001 }
7 | int styleable CameraBridgeViewBase_camera_id 1
8 | int styleable CameraBridgeViewBase_show_fps 0
9 |
--------------------------------------------------------------------------------
/openCVLibrary2410/build/outputs/aar/openCVLibrary2410-debug.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/openCVLibrary2410/build/outputs/aar/openCVLibrary2410-debug.aar
--------------------------------------------------------------------------------
/openCVLibrary2410/build/outputs/aar/openCVLibrary2410-release.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/openCVLibrary2410/build/outputs/aar/openCVLibrary2410-release.aar
--------------------------------------------------------------------------------
/openCVLibrary2410/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/aidl/org/opencv/engine/OpenCVEngineInterface.aidl:
--------------------------------------------------------------------------------
1 | package org.opencv.engine;
2 |
3 | /**
4 | * Class provides a Java interface for OpenCV Engine Service. It's synchronous with native OpenCVEngine class.
5 | */
6 | interface OpenCVEngineInterface
7 | {
8 | /**
9 | * @return Returns service version.
10 | */
11 | int getEngineVersion();
12 |
13 | /**
14 | * Finds an installed OpenCV library.
15 | * @param OpenCV version.
16 | * @return Returns path to OpenCV native libs or an empty string if OpenCV can not be found.
17 | */
18 | String getLibPathByVersion(String version);
19 |
20 | /**
21 | * Tries to install defined version of OpenCV from Google Play Market.
22 | * @param OpenCV version.
23 | * @return Returns true if installation was successful or OpenCV package has been already installed.
24 | */
25 | boolean installVersion(String version);
26 |
27 | /**
28 | * Returns list of libraries in loading order, separated by semicolon.
29 | * @param OpenCV version.
30 | * @return Returns names of OpenCV libraries, separated by semicolon.
31 | */
32 | String getLibraryList(String version);
33 | }
34 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/android/FpsMeter.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | import java.text.DecimalFormat;
4 |
5 | import org.opencv.core.Core;
6 |
7 | import android.graphics.Canvas;
8 | import android.graphics.Color;
9 | import android.graphics.Paint;
10 | import android.util.Log;
11 |
12 | public class FpsMeter {
13 | private static final String TAG = "FpsMeter";
14 | private static final int STEP = 20;
15 | private static final DecimalFormat FPS_FORMAT = new DecimalFormat("0.00");
16 |
17 | private int mFramesCouner;
18 | private double mFrequency;
19 | private long mprevFrameTime;
20 | private String mStrfps;
21 | Paint mPaint;
22 | boolean mIsInitialized = false;
23 | int mWidth = 0;
24 | int mHeight = 0;
25 |
26 | public void init() {
27 | mFramesCouner = 0;
28 | mFrequency = Core.getTickFrequency();
29 | mprevFrameTime = Core.getTickCount();
30 | mStrfps = "";
31 |
32 | mPaint = new Paint();
33 | mPaint.setColor(Color.BLUE);
34 | mPaint.setTextSize(20);
35 | }
36 |
37 | public void measure() {
38 | if (!mIsInitialized) {
39 | init();
40 | mIsInitialized = true;
41 | } else {
42 | mFramesCouner++;
43 | if (mFramesCouner % STEP == 0) {
44 | long time = Core.getTickCount();
45 | double fps = STEP * mFrequency / (time - mprevFrameTime);
46 | mprevFrameTime = time;
47 | if (mWidth != 0 && mHeight != 0)
48 | mStrfps = FPS_FORMAT.format(fps) + " FPS@" + Integer.valueOf(mWidth) + "x" + Integer.valueOf(mHeight);
49 | else
50 | mStrfps = FPS_FORMAT.format(fps) + " FPS";
51 | Log.i(TAG, mStrfps);
52 | }
53 | }
54 | }
55 |
56 | public void setResolution(int width, int height) {
57 | mWidth = width;
58 | mHeight = height;
59 | }
60 |
61 | public void draw(Canvas canvas, float offsetx, float offsety) {
62 | Log.d(TAG, mStrfps);
63 | canvas.drawText(mStrfps, offsetx, offsety, mPaint);
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/android/InstallCallbackInterface.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | /**
4 | * Installation callback interface.
5 | */
6 | public interface InstallCallbackInterface
7 | {
8 | /**
9 | * New package installation is required.
10 | */
11 | static final int NEW_INSTALLATION = 0;
12 | /**
13 | * Current package installation is in progress.
14 | */
15 | static final int INSTALLATION_PROGRESS = 1;
16 |
17 | /**
18 | * Target package name.
19 | * @return Return target package name.
20 | */
21 | public String getPackageName();
22 | /**
23 | * Installation is approved.
24 | */
25 | public void install();
26 | /**
27 | * Installation is canceled.
28 | */
29 | public void cancel();
30 | /**
31 | * Wait for package installation.
32 | */
33 | public void wait_install();
34 | };
35 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/android/LoaderCallbackInterface.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | /**
4 | * Interface for callback object in case of asynchronous initialization of OpenCV.
5 | */
6 | public interface LoaderCallbackInterface
7 | {
8 | /**
9 | * OpenCV initialization finished successfully.
10 | */
11 | static final int SUCCESS = 0;
12 | /**
13 | * Google Play Market cannot be invoked.
14 | */
15 | static final int MARKET_ERROR = 2;
16 | /**
17 | * OpenCV library installation has been canceled by the user.
18 | */
19 | static final int INSTALL_CANCELED = 3;
20 | /**
21 | * This version of OpenCV Manager Service is incompatible with the app. Possibly, a service update is required.
22 | */
23 | static final int INCOMPATIBLE_MANAGER_VERSION = 4;
24 | /**
25 | * OpenCV library initialization has failed.
26 | */
27 | static final int INIT_FAILED = 0xff;
28 |
29 | /**
30 | * Callback method, called after OpenCV library initialization.
31 | * @param status status of initialization (see initialization status constants).
32 | */
33 | public void onManagerConnected(int status);
34 |
35 | /**
36 | * Callback method, called in case the package installation is needed.
37 | * @param callback answer object with approve and cancel methods and the package description.
38 | */
39 | public void onPackageInstall(final int operation, InstallCallbackInterface callback);
40 | };
41 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/android/OpenCVLoader.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * Helper class provides common initialization methods for OpenCV library.
7 | */
8 | public class OpenCVLoader
9 | {
10 | /**
11 | * OpenCV Library version 2.4.2.
12 | */
13 | public static final String OPENCV_VERSION_2_4_2 = "2.4.2";
14 |
15 | /**
16 | * OpenCV Library version 2.4.3.
17 | */
18 | public static final String OPENCV_VERSION_2_4_3 = "2.4.3";
19 |
20 | /**
21 | * OpenCV Library version 2.4.4.
22 | */
23 | public static final String OPENCV_VERSION_2_4_4 = "2.4.4";
24 |
25 | /**
26 | * OpenCV Library version 2.4.5.
27 | */
28 | public static final String OPENCV_VERSION_2_4_5 = "2.4.5";
29 |
30 | /**
31 | * OpenCV Library version 2.4.6.
32 | */
33 | public static final String OPENCV_VERSION_2_4_6 = "2.4.6";
34 |
35 | /**
36 | * OpenCV Library version 2.4.7.
37 | */
38 | public static final String OPENCV_VERSION_2_4_7 = "2.4.7";
39 |
40 | /**
41 | * OpenCV Library version 2.4.8.
42 | */
43 | public static final String OPENCV_VERSION_2_4_8 = "2.4.8";
44 |
45 | /**
46 | * OpenCV Library version 2.4.9.
47 | */
48 | public static final String OPENCV_VERSION_2_4_9 = "2.4.9";
49 |
50 | /**
51 | * OpenCV Library version 2.4.10.
52 | */
53 | public static final String OPENCV_VERSION_2_4_10 = "2.4.10";
54 |
55 |
56 | /**
57 | * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
58 | * @return Returns true is initialization of OpenCV was successful.
59 | */
60 | public static boolean initDebug()
61 | {
62 | return StaticHelper.initOpenCV(false);
63 | }
64 |
65 | /**
66 | * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
67 | * @param InitCuda load and initialize CUDA runtime libraries.
68 | * @return Returns true is initialization of OpenCV was successful.
69 | */
70 | public static boolean initDebug(boolean InitCuda)
71 | {
72 | return StaticHelper.initOpenCV(InitCuda);
73 | }
74 |
75 | /**
76 | * Loads and initializes OpenCV library using OpenCV Engine service.
77 | * @param Version OpenCV library version.
78 | * @param AppContext application context for connecting to the service.
79 | * @param Callback object, that implements LoaderCallbackInterface for handling the connection status.
80 | * @return Returns true if initialization of OpenCV is successful.
81 | */
82 | public static boolean initAsync(String Version, Context AppContext,
83 | LoaderCallbackInterface Callback)
84 | {
85 | return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback);
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/android/StaticHelper.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | import org.opencv.core.Core;
4 |
5 | import java.util.StringTokenizer;
6 | import android.util.Log;
7 |
8 | class StaticHelper {
9 |
10 | public static boolean initOpenCV(boolean InitCuda)
11 | {
12 | boolean result;
13 | String libs = "";
14 |
15 | if(InitCuda)
16 | {
17 | loadLibrary("cudart");
18 | loadLibrary("nppc");
19 | loadLibrary("nppi");
20 | loadLibrary("npps");
21 | loadLibrary("cufft");
22 | loadLibrary("cublas");
23 | }
24 |
25 | Log.d(TAG, "Trying to get library list");
26 |
27 | try
28 | {
29 | System.loadLibrary("opencv_info");
30 | libs = getLibraryList();
31 | }
32 | catch(UnsatisfiedLinkError e)
33 | {
34 | Log.e(TAG, "OpenCV error: Cannot load info library for OpenCV");
35 | }
36 |
37 | Log.d(TAG, "Library list: \"" + libs + "\"");
38 | Log.d(TAG, "First attempt to load libs");
39 | if (initOpenCVLibs(libs))
40 | {
41 | Log.d(TAG, "First attempt to load libs is OK");
42 | String eol = System.getProperty("line.separator");
43 | for (String str : Core.getBuildInformation().split(eol))
44 | Log.i(TAG, str);
45 |
46 | result = true;
47 | }
48 | else
49 | {
50 | Log.d(TAG, "First attempt to load libs fails");
51 | result = false;
52 | }
53 |
54 | return result;
55 | }
56 |
57 | private static boolean loadLibrary(String Name)
58 | {
59 | boolean result = true;
60 |
61 | Log.d(TAG, "Trying to load library " + Name);
62 | try
63 | {
64 | System.loadLibrary(Name);
65 | Log.d(TAG, "Library " + Name + " loaded");
66 | }
67 | catch(UnsatisfiedLinkError e)
68 | {
69 | Log.d(TAG, "Cannot load library \"" + Name + "\"");
70 | e.printStackTrace();
71 | result &= false;
72 | }
73 |
74 | return result;
75 | }
76 |
77 | private static boolean initOpenCVLibs(String Libs)
78 | {
79 | Log.d(TAG, "Trying to init OpenCV libs");
80 |
81 | boolean result = true;
82 |
83 | if ((null != Libs) && (Libs.length() != 0))
84 | {
85 | Log.d(TAG, "Trying to load libs by dependency list");
86 | StringTokenizer splitter = new StringTokenizer(Libs, ";");
87 | while(splitter.hasMoreTokens())
88 | {
89 | result &= loadLibrary(splitter.nextToken());
90 | }
91 | }
92 | else
93 | {
94 | // If dependencies list is not defined or empty.
95 | result &= loadLibrary("opencv_java");
96 | }
97 |
98 | return result;
99 | }
100 |
101 | private static final String TAG = "OpenCV/StaticHelper";
102 |
103 | private static native String getLibraryList();
104 | }
105 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/CvException.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | public class CvException extends RuntimeException {
4 |
5 | private static final long serialVersionUID = 1L;
6 |
7 | public CvException(String msg) {
8 | super(msg);
9 | }
10 |
11 | @Override
12 | public String toString() {
13 | return "CvException [" + super.toString() + "]";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/CvType.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | public final class CvType {
4 |
5 | // type depth constants
6 | public static final int
7 | CV_8U = 0, CV_8S = 1,
8 | CV_16U = 2, CV_16S = 3,
9 | CV_32S = 4,
10 | CV_32F = 5,
11 | CV_64F = 6,
12 | CV_USRTYPE1 = 7;
13 |
14 | // predefined type constants
15 | public static final int
16 | CV_8UC1 = CV_8UC(1), CV_8UC2 = CV_8UC(2), CV_8UC3 = CV_8UC(3), CV_8UC4 = CV_8UC(4),
17 | CV_8SC1 = CV_8SC(1), CV_8SC2 = CV_8SC(2), CV_8SC3 = CV_8SC(3), CV_8SC4 = CV_8SC(4),
18 | CV_16UC1 = CV_16UC(1), CV_16UC2 = CV_16UC(2), CV_16UC3 = CV_16UC(3), CV_16UC4 = CV_16UC(4),
19 | CV_16SC1 = CV_16SC(1), CV_16SC2 = CV_16SC(2), CV_16SC3 = CV_16SC(3), CV_16SC4 = CV_16SC(4),
20 | CV_32SC1 = CV_32SC(1), CV_32SC2 = CV_32SC(2), CV_32SC3 = CV_32SC(3), CV_32SC4 = CV_32SC(4),
21 | CV_32FC1 = CV_32FC(1), CV_32FC2 = CV_32FC(2), CV_32FC3 = CV_32FC(3), CV_32FC4 = CV_32FC(4),
22 | CV_64FC1 = CV_64FC(1), CV_64FC2 = CV_64FC(2), CV_64FC3 = CV_64FC(3), CV_64FC4 = CV_64FC(4);
23 |
24 | private static final int CV_CN_MAX = 512, CV_CN_SHIFT = 3, CV_DEPTH_MAX = (1 << CV_CN_SHIFT);
25 |
26 | public static final int makeType(int depth, int channels) {
27 | if (channels <= 0 || channels >= CV_CN_MAX) {
28 | throw new java.lang.UnsupportedOperationException(
29 | "Channels count should be 1.." + (CV_CN_MAX - 1));
30 | }
31 | if (depth < 0 || depth >= CV_DEPTH_MAX) {
32 | throw new java.lang.UnsupportedOperationException(
33 | "Data type depth should be 0.." + (CV_DEPTH_MAX - 1));
34 | }
35 | return (depth & (CV_DEPTH_MAX - 1)) + ((channels - 1) << CV_CN_SHIFT);
36 | }
37 |
38 | public static final int CV_8UC(int ch) {
39 | return makeType(CV_8U, ch);
40 | }
41 |
42 | public static final int CV_8SC(int ch) {
43 | return makeType(CV_8S, ch);
44 | }
45 |
46 | public static final int CV_16UC(int ch) {
47 | return makeType(CV_16U, ch);
48 | }
49 |
50 | public static final int CV_16SC(int ch) {
51 | return makeType(CV_16S, ch);
52 | }
53 |
54 | public static final int CV_32SC(int ch) {
55 | return makeType(CV_32S, ch);
56 | }
57 |
58 | public static final int CV_32FC(int ch) {
59 | return makeType(CV_32F, ch);
60 | }
61 |
62 | public static final int CV_64FC(int ch) {
63 | return makeType(CV_64F, ch);
64 | }
65 |
66 | public static final int channels(int type) {
67 | return (type >> CV_CN_SHIFT) + 1;
68 | }
69 |
70 | public static final int depth(int type) {
71 | return type & (CV_DEPTH_MAX - 1);
72 | }
73 |
74 | public static final boolean isInteger(int type) {
75 | return depth(type) < CV_32F;
76 | }
77 |
78 | public static final int ELEM_SIZE(int type) {
79 | switch (depth(type)) {
80 | case CV_8U:
81 | case CV_8S:
82 | return channels(type);
83 | case CV_16U:
84 | case CV_16S:
85 | return 2 * channels(type);
86 | case CV_32S:
87 | case CV_32F:
88 | return 4 * channels(type);
89 | case CV_64F:
90 | return 8 * channels(type);
91 | default:
92 | throw new java.lang.UnsupportedOperationException(
93 | "Unsupported CvType value: " + type);
94 | }
95 | }
96 |
97 | public static final String typeToString(int type) {
98 | String s;
99 | switch (depth(type)) {
100 | case CV_8U:
101 | s = "CV_8U";
102 | break;
103 | case CV_8S:
104 | s = "CV_8S";
105 | break;
106 | case CV_16U:
107 | s = "CV_16U";
108 | break;
109 | case CV_16S:
110 | s = "CV_16S";
111 | break;
112 | case CV_32S:
113 | s = "CV_32S";
114 | break;
115 | case CV_32F:
116 | s = "CV_32F";
117 | break;
118 | case CV_64F:
119 | s = "CV_64F";
120 | break;
121 | case CV_USRTYPE1:
122 | s = "CV_USRTYPE1";
123 | break;
124 | default:
125 | throw new java.lang.UnsupportedOperationException(
126 | "Unsupported CvType value: " + type);
127 | }
128 |
129 | int ch = channels(type);
130 | if (ch <= 4)
131 | return s + "C" + ch;
132 | else
133 | return s + "C(" + ch + ")";
134 | }
135 |
136 | }
137 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/MatOfByte.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | public class MatOfByte extends Mat {
7 | // 8UC(x)
8 | private static final int _depth = CvType.CV_8U;
9 | private static final int _channels = 1;
10 |
11 | public MatOfByte() {
12 | super();
13 | }
14 |
15 | protected MatOfByte(long addr) {
16 | super(addr);
17 | if( !empty() && checkVector(_channels, _depth) < 0 )
18 | throw new IllegalArgumentException("Incompatible Mat");
19 | //FIXME: do we need release() here?
20 | }
21 |
22 | public static MatOfByte fromNativeAddr(long addr) {
23 | return new MatOfByte(addr);
24 | }
25 |
26 | public MatOfByte(Mat m) {
27 | super(m, Range.all());
28 | if( !empty() && checkVector(_channels, _depth) < 0 )
29 | throw new IllegalArgumentException("Incompatible Mat");
30 | //FIXME: do we need release() here?
31 | }
32 |
33 | public MatOfByte(byte...a) {
34 | super();
35 | fromArray(a);
36 | }
37 |
38 | public void alloc(int elemNumber) {
39 | if(elemNumber>0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(byte...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public byte[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | byte[] a = new byte[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Byte ab[] = lb.toArray(new Byte[0]);
66 | byte a[] = new byte[ab.length];
67 | for(int i=0; i toList() {
73 | byte[] a = toArray();
74 | Byte ab[] = new Byte[a.length];
75 | for(int i=0; i0)
42 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
43 | }
44 |
45 |
46 | public void fromArray(DMatch...a) {
47 | if(a==null || a.length==0)
48 | return;
49 | int num = a.length;
50 | alloc(num);
51 | float buff[] = new float[num * _channels];
52 | for(int i=0; i ldm) {
75 | DMatch adm[] = ldm.toArray(new DMatch[0]);
76 | fromArray(adm);
77 | }
78 |
79 | public List toList() {
80 | DMatch[] adm = toArray();
81 | return Arrays.asList(adm);
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/MatOfDouble.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | public class MatOfDouble extends Mat {
7 | // 64FC(x)
8 | private static final int _depth = CvType.CV_64F;
9 | private static final int _channels = 1;
10 |
11 | public MatOfDouble() {
12 | super();
13 | }
14 |
15 | protected MatOfDouble(long addr) {
16 | super(addr);
17 | if( !empty() && checkVector(_channels, _depth) < 0 )
18 | throw new IllegalArgumentException("Incompatible Mat");
19 | //FIXME: do we need release() here?
20 | }
21 |
22 | public static MatOfDouble fromNativeAddr(long addr) {
23 | return new MatOfDouble(addr);
24 | }
25 |
26 | public MatOfDouble(Mat m) {
27 | super(m, Range.all());
28 | if( !empty() && checkVector(_channels, _depth) < 0 )
29 | throw new IllegalArgumentException("Incompatible Mat");
30 | //FIXME: do we need release() here?
31 | }
32 |
33 | public MatOfDouble(double...a) {
34 | super();
35 | fromArray(a);
36 | }
37 |
38 | public void alloc(int elemNumber) {
39 | if(elemNumber>0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(double...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public double[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | double[] a = new double[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Double ab[] = lb.toArray(new Double[0]);
66 | double a[] = new double[ab.length];
67 | for(int i=0; i toList() {
73 | double[] a = toArray();
74 | Double ab[] = new Double[a.length];
75 | for(int i=0; i0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(float...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public float[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | float[] a = new float[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Float ab[] = lb.toArray(new Float[0]);
66 | float a[] = new float[ab.length];
67 | for(int i=0; i toList() {
73 | float[] a = toArray();
74 | Float ab[] = new Float[a.length];
75 | for(int i=0; i0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(float...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public float[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | float[] a = new float[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Float ab[] = lb.toArray(new Float[0]);
66 | float a[] = new float[ab.length];
67 | for(int i=0; i toList() {
73 | float[] a = toArray();
74 | Float ab[] = new Float[a.length];
75 | for(int i=0; i0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(float...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public float[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | float[] a = new float[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Float ab[] = lb.toArray(new Float[0]);
66 | float a[] = new float[ab.length];
67 | for(int i=0; i toList() {
73 | float[] a = toArray();
74 | Float ab[] = new Float[a.length];
75 | for(int i=0; i0)
41 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
42 | }
43 |
44 | public void fromArray(int...a) {
45 | if(a==null || a.length==0)
46 | return;
47 | int num = a.length / _channels;
48 | alloc(num);
49 | put(0, 0, a); //TODO: check ret val!
50 | }
51 |
52 | public int[] toArray() {
53 | int num = checkVector(_channels, _depth);
54 | if(num < 0)
55 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
56 | int[] a = new int[num * _channels];
57 | if(num == 0)
58 | return a;
59 | get(0, 0, a); //TODO: check ret val!
60 | return a;
61 | }
62 |
63 | public void fromList(List lb) {
64 | if(lb==null || lb.size()==0)
65 | return;
66 | Integer ab[] = lb.toArray(new Integer[0]);
67 | int a[] = new int[ab.length];
68 | for(int i=0; i toList() {
74 | int[] a = toArray();
75 | Integer ab[] = new Integer[a.length];
76 | for(int i=0; i0)
41 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
42 | }
43 |
44 | public void fromArray(int...a) {
45 | if(a==null || a.length==0)
46 | return;
47 | int num = a.length / _channels;
48 | alloc(num);
49 | put(0, 0, a); //TODO: check ret val!
50 | }
51 |
52 | public int[] toArray() {
53 | int num = checkVector(_channels, _depth);
54 | if(num < 0)
55 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
56 | int[] a = new int[num * _channels];
57 | if(num == 0)
58 | return a;
59 | get(0, 0, a); //TODO: check ret val!
60 | return a;
61 | }
62 |
63 | public void fromList(List lb) {
64 | if(lb==null || lb.size()==0)
65 | return;
66 | Integer ab[] = lb.toArray(new Integer[0]);
67 | int a[] = new int[ab.length];
68 | for(int i=0; i toList() {
74 | int[] a = toArray();
75 | Integer ab[] = new Integer[a.length];
76 | for(int i=0; i0)
42 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
43 | }
44 |
45 | public void fromArray(KeyPoint...a) {
46 | if(a==null || a.length==0)
47 | return;
48 | int num = a.length;
49 | alloc(num);
50 | float buff[] = new float[num * _channels];
51 | for(int i=0; i lkp) {
78 | KeyPoint akp[] = lkp.toArray(new KeyPoint[0]);
79 | fromArray(akp);
80 | }
81 |
82 | public List toList() {
83 | KeyPoint[] akp = toArray();
84 | return Arrays.asList(akp);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/MatOfPoint.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | public class MatOfPoint extends Mat {
7 | // 32SC2
8 | private static final int _depth = CvType.CV_32S;
9 | private static final int _channels = 2;
10 |
11 | public MatOfPoint() {
12 | super();
13 | }
14 |
15 | protected MatOfPoint(long addr) {
16 | super(addr);
17 | if( !empty() && checkVector(_channels, _depth) < 0 )
18 | throw new IllegalArgumentException("Incompatible Mat");
19 | //FIXME: do we need release() here?
20 | }
21 |
22 | public static MatOfPoint fromNativeAddr(long addr) {
23 | return new MatOfPoint(addr);
24 | }
25 |
26 | public MatOfPoint(Mat m) {
27 | super(m, Range.all());
28 | if( !empty() && checkVector(_channels, _depth) < 0 )
29 | throw new IllegalArgumentException("Incompatible Mat");
30 | //FIXME: do we need release() here?
31 | }
32 |
33 | public MatOfPoint(Point...a) {
34 | super();
35 | fromArray(a);
36 | }
37 |
38 | public void alloc(int elemNumber) {
39 | if(elemNumber>0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(Point...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length;
47 | alloc(num);
48 | int buff[] = new int[num * _channels];
49 | for(int i=0; i lp) {
70 | Point ap[] = lp.toArray(new Point[0]);
71 | fromArray(ap);
72 | }
73 |
74 | public List toList() {
75 | Point[] ap = toArray();
76 | return Arrays.asList(ap);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/MatOfPoint2f.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | public class MatOfPoint2f extends Mat {
7 | // 32FC2
8 | private static final int _depth = CvType.CV_32F;
9 | private static final int _channels = 2;
10 |
11 | public MatOfPoint2f() {
12 | super();
13 | }
14 |
15 | protected MatOfPoint2f(long addr) {
16 | super(addr);
17 | if( !empty() && checkVector(_channels, _depth) < 0 )
18 | throw new IllegalArgumentException("Incompatible Mat");
19 | //FIXME: do we need release() here?
20 | }
21 |
22 | public static MatOfPoint2f fromNativeAddr(long addr) {
23 | return new MatOfPoint2f(addr);
24 | }
25 |
26 | public MatOfPoint2f(Mat m) {
27 | super(m, Range.all());
28 | if( !empty() && checkVector(_channels, _depth) < 0 )
29 | throw new IllegalArgumentException("Incompatible Mat");
30 | //FIXME: do we need release() here?
31 | }
32 |
33 | public MatOfPoint2f(Point...a) {
34 | super();
35 | fromArray(a);
36 | }
37 |
38 | public void alloc(int elemNumber) {
39 | if(elemNumber>0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(Point...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length;
47 | alloc(num);
48 | float buff[] = new float[num * _channels];
49 | for(int i=0; i lp) {
70 | Point ap[] = lp.toArray(new Point[0]);
71 | fromArray(ap);
72 | }
73 |
74 | public List toList() {
75 | Point[] ap = toArray();
76 | return Arrays.asList(ap);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/MatOfPoint3.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | public class MatOfPoint3 extends Mat {
7 | // 32SC3
8 | private static final int _depth = CvType.CV_32S;
9 | private static final int _channels = 3;
10 |
11 | public MatOfPoint3() {
12 | super();
13 | }
14 |
15 | protected MatOfPoint3(long addr) {
16 | super(addr);
17 | if( !empty() && checkVector(_channels, _depth) < 0 )
18 | throw new IllegalArgumentException("Incompatible Mat");
19 | //FIXME: do we need release() here?
20 | }
21 |
22 | public static MatOfPoint3 fromNativeAddr(long addr) {
23 | return new MatOfPoint3(addr);
24 | }
25 |
26 | public MatOfPoint3(Mat m) {
27 | super(m, Range.all());
28 | if( !empty() && checkVector(_channels, _depth) < 0 )
29 | throw new IllegalArgumentException("Incompatible Mat");
30 | //FIXME: do we need release() here?
31 | }
32 |
33 | public MatOfPoint3(Point3...a) {
34 | super();
35 | fromArray(a);
36 | }
37 |
38 | public void alloc(int elemNumber) {
39 | if(elemNumber>0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(Point3...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length;
47 | alloc(num);
48 | int buff[] = new int[num * _channels];
49 | for(int i=0; i lp) {
71 | Point3 ap[] = lp.toArray(new Point3[0]);
72 | fromArray(ap);
73 | }
74 |
75 | public List toList() {
76 | Point3[] ap = toArray();
77 | return Arrays.asList(ap);
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/MatOfPoint3f.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | public class MatOfPoint3f extends Mat {
7 | // 32FC3
8 | private static final int _depth = CvType.CV_32F;
9 | private static final int _channels = 3;
10 |
11 | public MatOfPoint3f() {
12 | super();
13 | }
14 |
15 | protected MatOfPoint3f(long addr) {
16 | super(addr);
17 | if( !empty() && checkVector(_channels, _depth) < 0 )
18 | throw new IllegalArgumentException("Incompatible Mat");
19 | //FIXME: do we need release() here?
20 | }
21 |
22 | public static MatOfPoint3f fromNativeAddr(long addr) {
23 | return new MatOfPoint3f(addr);
24 | }
25 |
26 | public MatOfPoint3f(Mat m) {
27 | super(m, Range.all());
28 | if( !empty() && checkVector(_channels, _depth) < 0 )
29 | throw new IllegalArgumentException("Incompatible Mat");
30 | //FIXME: do we need release() here?
31 | }
32 |
33 | public MatOfPoint3f(Point3...a) {
34 | super();
35 | fromArray(a);
36 | }
37 |
38 | public void alloc(int elemNumber) {
39 | if(elemNumber>0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(Point3...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length;
47 | alloc(num);
48 | float buff[] = new float[num * _channels];
49 | for(int i=0; i lp) {
71 | Point3 ap[] = lp.toArray(new Point3[0]);
72 | fromArray(ap);
73 | }
74 |
75 | public List toList() {
76 | Point3[] ap = toArray();
77 | return Arrays.asList(ap);
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/MatOfRect.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 |
7 | public class MatOfRect extends Mat {
8 | // 32SC4
9 | private static final int _depth = CvType.CV_32S;
10 | private static final int _channels = 4;
11 |
12 | public MatOfRect() {
13 | super();
14 | }
15 |
16 | protected MatOfRect(long addr) {
17 | super(addr);
18 | if( !empty() && checkVector(_channels, _depth) < 0 )
19 | throw new IllegalArgumentException("Incompatible Mat");
20 | //FIXME: do we need release() here?
21 | }
22 |
23 | public static MatOfRect fromNativeAddr(long addr) {
24 | return new MatOfRect(addr);
25 | }
26 |
27 | public MatOfRect(Mat m) {
28 | super(m, Range.all());
29 | if( !empty() && checkVector(_channels, _depth) < 0 )
30 | throw new IllegalArgumentException("Incompatible Mat");
31 | //FIXME: do we need release() here?
32 | }
33 |
34 | public MatOfRect(Rect...a) {
35 | super();
36 | fromArray(a);
37 | }
38 |
39 | public void alloc(int elemNumber) {
40 | if(elemNumber>0)
41 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
42 | }
43 |
44 | public void fromArray(Rect...a) {
45 | if(a==null || a.length==0)
46 | return;
47 | int num = a.length;
48 | alloc(num);
49 | int buff[] = new int[num * _channels];
50 | for(int i=0; i lr) {
73 | Rect ap[] = lr.toArray(new Rect[0]);
74 | fromArray(ap);
75 | }
76 |
77 | public List toList() {
78 | Rect[] ar = toArray();
79 | return Arrays.asList(ar);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/Point.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | /**
4 | *
template class CV_EXPORTS Point_
5 | *
6 | *
// C++ code:
7 | *
8 | *
9 | *
public:
10 | *
11 | *
typedef _Tp value_type;
12 | *
13 | *
// various constructors
14 | *
15 | *
Point_();
16 | *
17 | *
Point_(_Tp _x, _Tp _y);
18 | *
19 | *
Point_(const Point_& pt);
20 | *
21 | *
Point_(const CvPoint& pt);
22 | *
23 | *
Point_(const CvPoint2D32f& pt);
24 | *
25 | *
Point_(const Size_<_Tp>& sz);
26 | *
27 | *
Point_(const Vec<_Tp, 2>& v);
28 | *
29 | *
Point_& operator = (const Point_& pt);
30 | *
31 | *
//! conversion to another data type
32 | *
33 | *
template operator Point_<_Tp2>() const;
34 | *
35 | *
//! conversion to the old-style C structures
36 | *
37 | *
operator CvPoint() const;
38 | *
39 | *
operator CvPoint2D32f() const;
40 | *
41 | *
operator Vec<_Tp, 2>() const;
42 | *
43 | *
//! dot product
44 | *
45 | *
_Tp dot(const Point_& pt) const;
46 | *
47 | *
//! dot product computed in double-precision arithmetics
48 | *
49 | *
double ddot(const Point_& pt) const;
50 | *
51 | *
//! cross-product
52 | *
53 | *
double cross(const Point_& pt) const;
54 | *
55 | *
//! checks whether the point is inside the specified rectangle
56 | *
57 | *
bool inside(const Rect_<_Tp>& r) const;
58 | *
59 | *
_Tp x, y; //< the point coordinates
60 | *
61 | *
};
62 | *
63 | *
Template class for 2D points specified by its coordinates
64 | *
65 | *
x and y.
66 | * An instance of the class is interchangeable with C structures,
67 | * CvPoint and CvPoint2D32f. There is also a cast
68 | * operator to convert point coordinates to the specified type. The conversion
69 | * from floating-point coordinates to integer coordinates is done by rounding.
70 | * Commonly, the conversion uses thisoperation for each of the coordinates.
71 | * Besides the class members listed in the declaration above, the following
72 | * operations on points are implemented:
73 | *
74 | *
// C++ code:
75 | *
76 | *
pt1 = pt2 + pt3;
77 | *
78 | *
pt1 = pt2 - pt3;
79 | *
80 | *
pt1 = pt2 * a;
81 | *
82 | *
pt1 = a * pt2;
83 | *
84 | *
pt1 += pt2;
85 | *
86 | *
pt1 -= pt2;
87 | *
88 | *
pt1 *= a;
89 | *
90 | *
double value = norm(pt); // L2 norm
91 | *
92 | *
pt1 == pt2;
93 | *
94 | *
pt1 != pt2;
95 | *
96 | *
For your convenience, the following type aliases are defined:
97 | *
98 | *
typedef Point_ Point2i;
99 | *
100 | *
typedef Point2i Point;
101 | *
102 | *
typedef Point_ Point2f;
103 | *
104 | *
typedef Point_ Point2d;
105 | *
106 | *
Example:
107 | *
108 | *
Point2f a(0.3f, 0.f), b(0.f, 0.4f);
109 | *
110 | *
Point pt = (a + b)*10.f;
111 | *
112 | *
cout << pt.x << ", " << pt.y << endl;
113 | *
114 | * @see org.opencv.core.Point_
115 | */
116 | public class Point {
117 |
118 | public double x, y;
119 |
120 | public Point(double x, double y) {
121 | this.x = x;
122 | this.y = y;
123 | }
124 |
125 | public Point() {
126 | this(0, 0);
127 | }
128 |
129 | public Point(double[] vals) {
130 | this();
131 | set(vals);
132 | }
133 |
134 | public void set(double[] vals) {
135 | if (vals != null) {
136 | x = vals.length > 0 ? vals[0] : 0;
137 | y = vals.length > 1 ? vals[1] : 0;
138 | } else {
139 | x = 0;
140 | y = 0;
141 | }
142 | }
143 |
144 | public Point clone() {
145 | return new Point(x, y);
146 | }
147 |
148 | public double dot(Point p) {
149 | return x * p.x + y * p.y;
150 | }
151 |
152 | @Override
153 | public int hashCode() {
154 | final int prime = 31;
155 | int result = 1;
156 | long temp;
157 | temp = Double.doubleToLongBits(x);
158 | result = prime * result + (int) (temp ^ (temp >>> 32));
159 | temp = Double.doubleToLongBits(y);
160 | result = prime * result + (int) (temp ^ (temp >>> 32));
161 | return result;
162 | }
163 |
164 | @Override
165 | public boolean equals(Object obj) {
166 | if (this == obj) return true;
167 | if (!(obj instanceof Point)) return false;
168 | Point it = (Point) obj;
169 | return x == it.x && y == it.y;
170 | }
171 |
172 | public boolean inside(Rect r) {
173 | return r.contains(this);
174 | }
175 |
176 | @Override
177 | public String toString() {
178 | return "{" + x + ", " + y + "}";
179 | }
180 | }
181 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/Point3.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | /**
4 | *
template class CV_EXPORTS Point3_
5 | *
6 | *
// C++ code:
7 | *
8 | *
9 | *
public:
10 | *
11 | *
typedef _Tp value_type;
12 | *
13 | *
// various constructors
14 | *
15 | *
Point3_();
16 | *
17 | *
Point3_(_Tp _x, _Tp _y, _Tp _z);
18 | *
19 | *
Point3_(const Point3_& pt);
20 | *
21 | *
explicit Point3_(const Point_<_Tp>& pt);
22 | *
23 | *
Point3_(const CvPoint3D32f& pt);
24 | *
25 | *
Point3_(const Vec<_Tp, 3>& v);
26 | *
27 | *
Point3_& operator = (const Point3_& pt);
28 | *
29 | *
//! conversion to another data type
30 | *
31 | *
template operator Point3_<_Tp2>() const;
32 | *
33 | *
//! conversion to the old-style CvPoint...
34 | *
35 | *
operator CvPoint3D32f() const;
36 | *
37 | *
//! conversion to cv.Vec<>
38 | *
39 | *
operator Vec<_Tp, 3>() const;
40 | *
41 | *
//! dot product
42 | *
43 | *
_Tp dot(const Point3_& pt) const;
44 | *
45 | *
//! dot product computed in double-precision arithmetics
46 | *
47 | *
double ddot(const Point3_& pt) const;
48 | *
49 | *
//! cross product of the 2 3D points
50 | *
51 | *
Point3_ cross(const Point3_& pt) const;
52 | *
53 | *
_Tp x, y, z; //< the point coordinates
54 | *
55 | *
};
56 | *
57 | *
Template class for 3D points specified by its coordinates
58 | *
59 | *
x, y and z.
60 | * An instance of the class is interchangeable with the C structure
61 | * CvPoint2D32f. Similarly to Point_, the coordinates
62 | * of 3D points can be converted to another type. The vector arithmetic and
63 | * comparison operations are also supported.
64 | * The following Point3_<> aliases are available:
65 | *
66 | *
// C++ code:
67 | *
68 | *
typedef Point3_ Point3i;
69 | *
70 | *
typedef Point3_ Point3f;
71 | *
72 | *
typedef Point3_ Point3d;
73 | *
74 | * @see org.opencv.core.Point3_
75 | */
76 | public class Point3 {
77 |
78 | public double x, y, z;
79 |
80 | public Point3(double x, double y, double z) {
81 | this.x = x;
82 | this.y = y;
83 | this.z = z;
84 | }
85 |
86 | public Point3() {
87 | this(0, 0, 0);
88 | }
89 |
90 | public Point3(Point p) {
91 | x = p.x;
92 | y = p.y;
93 | z = 0;
94 | }
95 |
96 | public Point3(double[] vals) {
97 | this();
98 | set(vals);
99 | }
100 |
101 | public void set(double[] vals) {
102 | if (vals != null) {
103 | x = vals.length > 0 ? vals[0] : 0;
104 | y = vals.length > 1 ? vals[1] : 0;
105 | z = vals.length > 2 ? vals[2] : 0;
106 | } else {
107 | x = 0;
108 | y = 0;
109 | z = 0;
110 | }
111 | }
112 |
113 | public Point3 clone() {
114 | return new Point3(x, y, z);
115 | }
116 |
117 | public double dot(Point3 p) {
118 | return x * p.x + y * p.y + z * p.z;
119 | }
120 |
121 | public Point3 cross(Point3 p) {
122 | return new Point3(y * p.z - z * p.y, z * p.x - x * p.z, x * p.y - y * p.x);
123 | }
124 |
125 | @Override
126 | public int hashCode() {
127 | final int prime = 31;
128 | int result = 1;
129 | long temp;
130 | temp = Double.doubleToLongBits(x);
131 | result = prime * result + (int) (temp ^ (temp >>> 32));
132 | temp = Double.doubleToLongBits(y);
133 | result = prime * result + (int) (temp ^ (temp >>> 32));
134 | temp = Double.doubleToLongBits(z);
135 | result = prime * result + (int) (temp ^ (temp >>> 32));
136 | return result;
137 | }
138 |
139 | @Override
140 | public boolean equals(Object obj) {
141 | if (this == obj) return true;
142 | if (!(obj instanceof Point3)) return false;
143 | Point3 it = (Point3) obj;
144 | return x == it.x && y == it.y && z == it.z;
145 | }
146 |
147 | @Override
148 | public String toString() {
149 | return "{" + x + ", " + y + ", " + z + "}";
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/Range.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | /**
4 | *
Template class specifying a continuous subsequence (slice) of a sequence.
5 | *
6 | *
class CV_EXPORTS Range
7 | *
8 | *
// C++ code:
9 | *
10 | *
11 | *
public:
12 | *
13 | *
Range();
14 | *
15 | *
Range(int _start, int _end);
16 | *
17 | *
Range(const CvSlice& slice);
18 | *
19 | *
int size() const;
20 | *
21 | *
bool empty() const;
22 | *
23 | *
static Range all();
24 | *
25 | *
operator CvSlice() const;
26 | *
27 | *
int start, end;
28 | *
29 | *
};
30 | *
31 | *
The class is used to specify a row or a column span in a matrix (
32 | *
33 | *
"Mat") and for many other purposes. Range(a,b) is basically the
34 | * same as a:b in Matlab or a..b in Python. As in
35 | * Python, start is an inclusive left boundary of the range and
36 | * end is an exclusive right boundary of the range. Such a
37 | * half-opened interval is usually denoted as [start,end).
38 | * The static method Range.all() returns a special variable that
39 | * means "the whole sequence" or "the whole range", just like " : "
40 | * in Matlab or " ... " in Python. All the methods and functions in
41 | * OpenCV that take Range support this special Range.all()
42 | * value. But, of course, in case of your own custom processing, you will
43 | * probably have to check and handle it explicitly:
44 | *
45 | *
// C++ code:
46 | *
47 | *
void my_function(..., const Range& r,....)
48 | *
49 | *
50 | *
if(r == Range.all()) {
51 | *
52 | *
// process all the data
53 | *
54 | *
55 | *
else {
56 | *
57 | *
// process [r.start, r.end)
58 | *
59 | *
60 | *
61 | *
62 | *
63 | * @see org.opencv.core.Range
64 | */
65 | public class Range {
66 |
67 | public int start, end;
68 |
69 | public Range(int s, int e) {
70 | this.start = s;
71 | this.end = e;
72 | }
73 |
74 | public Range() {
75 | this(0, 0);
76 | }
77 |
78 | public Range(double[] vals) {
79 | set(vals);
80 | }
81 |
82 | public void set(double[] vals) {
83 | if (vals != null) {
84 | start = vals.length > 0 ? (int) vals[0] : 0;
85 | end = vals.length > 1 ? (int) vals[1] : 0;
86 | } else {
87 | start = 0;
88 | end = 0;
89 | }
90 |
91 | }
92 |
93 | public int size() {
94 | return empty() ? 0 : end - start;
95 | }
96 |
97 | public boolean empty() {
98 | return end <= start;
99 | }
100 |
101 | public static Range all() {
102 | return new Range(Integer.MIN_VALUE, Integer.MAX_VALUE);
103 | }
104 |
105 | public Range intersection(Range r1) {
106 | Range r = new Range(Math.max(r1.start, this.start), Math.min(r1.end, this.end));
107 | r.end = Math.max(r.end, r.start);
108 | return r;
109 | }
110 |
111 | public Range shift(int delta) {
112 | return new Range(start + delta, end + delta);
113 | }
114 |
115 | public Range clone() {
116 | return new Range(start, end);
117 | }
118 |
119 | @Override
120 | public int hashCode() {
121 | final int prime = 31;
122 | int result = 1;
123 | long temp;
124 | temp = Double.doubleToLongBits(start);
125 | result = prime * result + (int) (temp ^ (temp >>> 32));
126 | temp = Double.doubleToLongBits(end);
127 | result = prime * result + (int) (temp ^ (temp >>> 32));
128 | return result;
129 | }
130 |
131 | @Override
132 | public boolean equals(Object obj) {
133 | if (this == obj) return true;
134 | if (!(obj instanceof Range)) return false;
135 | Range it = (Range) obj;
136 | return start == it.start && end == it.end;
137 | }
138 |
139 | @Override
140 | public String toString() {
141 | return "[" + start + ", " + end + ")";
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/RotatedRect.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | public class RotatedRect {
4 |
5 | public Point center;
6 | public Size size;
7 | public double angle;
8 |
9 | public RotatedRect() {
10 | this.center = new Point();
11 | this.size = new Size();
12 | this.angle = 0;
13 | }
14 |
15 | public RotatedRect(Point c, Size s, double a) {
16 | this.center = c.clone();
17 | this.size = s.clone();
18 | this.angle = a;
19 | }
20 |
21 | public RotatedRect(double[] vals) {
22 | this();
23 | set(vals);
24 | }
25 |
26 | public void set(double[] vals) {
27 | if (vals != null) {
28 | center.x = vals.length > 0 ? (double) vals[0] : 0;
29 | center.y = vals.length > 1 ? (double) vals[1] : 0;
30 | size.width = vals.length > 2 ? (double) vals[2] : 0;
31 | size.height = vals.length > 3 ? (double) vals[3] : 0;
32 | angle = vals.length > 4 ? (double) vals[4] : 0;
33 | } else {
34 | center.x = 0;
35 | center.x = 0;
36 | size.width = 0;
37 | size.height = 0;
38 | angle = 0;
39 | }
40 | }
41 |
42 | public void points(Point pt[])
43 | {
44 | double _angle = angle * Math.PI / 180.0;
45 | double b = (double) Math.cos(_angle) * 0.5f;
46 | double a = (double) Math.sin(_angle) * 0.5f;
47 |
48 | pt[0] = new Point(
49 | center.x - a * size.height - b * size.width,
50 | center.y + b * size.height - a * size.width);
51 |
52 | pt[1] = new Point(
53 | center.x + a * size.height - b * size.width,
54 | center.y - b * size.height - a * size.width);
55 |
56 | pt[2] = new Point(
57 | 2 * center.x - pt[0].x,
58 | 2 * center.y - pt[0].y);
59 |
60 | pt[3] = new Point(
61 | 2 * center.x - pt[1].x,
62 | 2 * center.y - pt[1].y);
63 | }
64 |
65 | public Rect boundingRect()
66 | {
67 | Point pt[] = new Point[4];
68 | points(pt);
69 | Rect r = new Rect((int) Math.floor(Math.min(Math.min(Math.min(pt[0].x, pt[1].x), pt[2].x), pt[3].x)),
70 | (int) Math.floor(Math.min(Math.min(Math.min(pt[0].y, pt[1].y), pt[2].y), pt[3].y)),
71 | (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].x, pt[1].x), pt[2].x), pt[3].x)),
72 | (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].y, pt[1].y), pt[2].y), pt[3].y)));
73 | r.width -= r.x - 1;
74 | r.height -= r.y - 1;
75 | return r;
76 | }
77 |
78 | public RotatedRect clone() {
79 | return new RotatedRect(center, size, angle);
80 | }
81 |
82 | @Override
83 | public int hashCode() {
84 | final int prime = 31;
85 | int result = 1;
86 | long temp;
87 | temp = Double.doubleToLongBits(center.x);
88 | result = prime * result + (int) (temp ^ (temp >>> 32));
89 | temp = Double.doubleToLongBits(center.y);
90 | result = prime * result + (int) (temp ^ (temp >>> 32));
91 | temp = Double.doubleToLongBits(size.width);
92 | result = prime * result + (int) (temp ^ (temp >>> 32));
93 | temp = Double.doubleToLongBits(size.height);
94 | result = prime * result + (int) (temp ^ (temp >>> 32));
95 | temp = Double.doubleToLongBits(angle);
96 | result = prime * result + (int) (temp ^ (temp >>> 32));
97 | return result;
98 | }
99 |
100 | @Override
101 | public boolean equals(Object obj) {
102 | if (this == obj) return true;
103 | if (!(obj instanceof RotatedRect)) return false;
104 | RotatedRect it = (RotatedRect) obj;
105 | return center.equals(it.center) && size.equals(it.size) && angle == it.angle;
106 | }
107 |
108 | @Override
109 | public String toString() {
110 | return "{ " + center + " " + size + " * " + angle + " }";
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/core/Scalar.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | /**
4 | *
Template class for a 4-element vector derived from Vec.
5 | *
6 | *
template class CV_EXPORTS Scalar_ : public Vec<_Tp, 4>
Being derived from Vec<_Tp, 4>, Scalar_ and
52 | * Scalar can be used just as typical 4-element vectors. In
53 | * addition, they can be converted to/from CvScalar. The type
54 | * Scalar is widely used in OpenCV to pass pixel values.
55 | *
Template class for specifying the size of an image or rectangle. The class
48 | * includes two members called width and height. The
49 | * structure can be converted to and from the old OpenCV structures
50 | *
51 | *
CvSize and CvSize2D32f. The same set of arithmetic
52 | * and comparison operations as for Point_ is available.
53 | * OpenCV defines the following Size_<> aliases:
COUNT=1, //!< the maximum number of iterations or elements to compute
15 | *
16 | *
MAX_ITER=COUNT, //!< ditto
17 | *
18 | *
EPS=2 //!< the desired accuracy or change in parameters at which the
19 | * iterative algorithm stops
20 | *
21 | *
};
22 | *
23 | *
//! default constructor
24 | *
25 | *
TermCriteria();
26 | *
27 | *
//! full constructor
28 | *
29 | *
TermCriteria(int type, int maxCount, double epsilon);
30 | *
31 | *
//! conversion from CvTermCriteria
32 | *
33 | *
TermCriteria(const CvTermCriteria& criteria);
34 | *
35 | *
//! conversion to CvTermCriteria
36 | *
37 | *
operator CvTermCriteria() const;
38 | *
39 | *
int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS
40 | *
41 | *
int maxCount; // the maximum number of iterations/elements
42 | *
43 | *
double epsilon; // the desired accuracy
44 | *
45 | *
};
46 | *
47 | *
The class defining termination criteria for iterative algorithms. You can
48 | * initialize it by default constructor and then override any parameters, or the
49 | * structure may be fully initialized using the advanced variant of the
50 | * constructor.
51 | *
The class implements the Extremely randomized trees algorithm.
12 | * CvERTrees is inherited from "CvRTrees" and has the same
13 | * interface, so see description of "CvRTrees" class to get details. To set the
14 | * training parameters of Extremely randomized trees the same class "CvRTParams"
15 | * is used.
16 | *
17 | * @see org.opencv.ml.CvERTrees : public CvRTrees
18 | */
19 | public class CvERTrees extends CvRTrees {
20 |
21 | protected CvERTrees(long addr) { super(addr); }
22 |
23 |
24 | //
25 | // C++: CvERTrees::CvERTrees()
26 | //
27 |
28 | public CvERTrees()
29 | {
30 |
31 | super( CvERTrees_0() );
32 |
33 | return;
34 | }
35 |
36 |
37 | //
38 | // C++: bool CvERTrees::train(Mat trainData, int tflag, Mat responses, Mat varIdx = cv::Mat(), Mat sampleIdx = cv::Mat(), Mat varType = cv::Mat(), Mat missingDataMask = cv::Mat(), CvRTParams params = CvRTParams())
39 | //
40 |
41 | public boolean train(Mat trainData, int tflag, Mat responses, Mat varIdx, Mat sampleIdx, Mat varType, Mat missingDataMask, CvRTParams params)
42 | {
43 |
44 | boolean retVal = train_0(nativeObj, trainData.nativeObj, tflag, responses.nativeObj, varIdx.nativeObj, sampleIdx.nativeObj, varType.nativeObj, missingDataMask.nativeObj, params.nativeObj);
45 |
46 | return retVal;
47 | }
48 |
49 | public boolean train(Mat trainData, int tflag, Mat responses)
50 | {
51 |
52 | boolean retVal = train_1(nativeObj, trainData.nativeObj, tflag, responses.nativeObj);
53 |
54 | return retVal;
55 | }
56 |
57 |
58 | @Override
59 | protected void finalize() throws Throwable {
60 | delete(nativeObj);
61 | }
62 |
63 |
64 |
65 | // C++: CvERTrees::CvERTrees()
66 | private static native long CvERTrees_0();
67 |
68 | // C++: bool CvERTrees::train(Mat trainData, int tflag, Mat responses, Mat varIdx = cv::Mat(), Mat sampleIdx = cv::Mat(), Mat varType = cv::Mat(), Mat missingDataMask = cv::Mat(), CvRTParams params = CvRTParams())
69 | private static native boolean train_0(long nativeObj, long trainData_nativeObj, int tflag, long responses_nativeObj, long varIdx_nativeObj, long sampleIdx_nativeObj, long varType_nativeObj, long missingDataMask_nativeObj, long params_nativeObj);
70 | private static native boolean train_1(long nativeObj, long trainData_nativeObj, int tflag, long responses_nativeObj);
71 |
72 | // native support for java finalize()
73 | private static native void delete(long nativeObj);
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/ml/CvGBTreesParams.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.ml;
6 |
7 |
8 |
9 | // C++: class CvGBTreesParams
10 | /**
11 | *
GBT training parameters.
12 | *
13 | *
The structure contains parameters for each single decision tree in the
14 | * ensemble, as well as the whole model characteristics. The structure is
15 | * derived from "CvDTreeParams" but not all of the decision tree parameters are
16 | * supported: cross-validation, pruning, and class priorities are not used.
The structure represents the logarithmic grid range of statmodel parameters.
12 | * It is used for optimizing statmodel accuracy by varying model parameters, the
13 | * accuracy estimate being computed by cross-validation.
14 | *
15 | *
Minimum value of the statmodel parameter.
16 | *
17 | *
Maximum value of the statmodel parameter.
18 | *
19 | *
20 | *
// C++ code:
21 | *
22 | *
Logarithmic step for iterating the statmodel parameter.
23 | *
24 | *
The grid determines the following iteration sequence of the statmodel
25 | * parameter values:
The set of training parameters for the forest is a superset of the training
14 | * parameters for a single tree. However, random trees do not need all the
15 | * functionality/features of decision trees. Most noticeably, the trees are not
16 | * pruned, so the cross-validation parameters are not used.
The function is a wrapper for the generic function "partition". It clusters
42 | * all the input rectangles using the rectangle equivalence criteria that
43 | * combines rectangles with similar sizes and similar locations. The similarity
44 | * is defined by eps. When eps=0, no clustering is
45 | * done at all. If eps-> +inf, all the rectangles are put in one
46 | * cluster. Then, the small clusters containing less than or equal to
47 | * groupThreshold rectangles are rejected. In each other cluster,
48 | * the average rectangle is computed and put into the output rectangle list.
49 | *
50 | * @param rectList Input/output vector of rectangles. Output vector includes
51 | * retained and grouped rectangles. (The Python list is not modified in place.)
52 | * @param weights a weights
53 | * @param groupThreshold Minimum possible number of rectangles minus 1. The
54 | * threshold is used in a group of rectangles to retain it.
55 | * @param eps Relative difference between sides of the rectangles to merge them
56 | * into a group.
57 | *
58 | * @see org.opencv.objdetect.Objdetect.groupRectangles
59 | */
60 | public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps)
61 | {
62 | Mat rectList_mat = rectList;
63 | Mat weights_mat = weights;
64 | groupRectangles_0(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold, eps);
65 |
66 | return;
67 | }
68 |
69 | /**
70 | *
Groups the object candidate rectangles.
71 | *
72 | *
The function is a wrapper for the generic function "partition". It clusters
73 | * all the input rectangles using the rectangle equivalence criteria that
74 | * combines rectangles with similar sizes and similar locations. The similarity
75 | * is defined by eps. When eps=0, no clustering is
76 | * done at all. If eps-> +inf, all the rectangles are put in one
77 | * cluster. Then, the small clusters containing less than or equal to
78 | * groupThreshold rectangles are rejected. In each other cluster,
79 | * the average rectangle is computed and put into the output rectangle list.
80 | *
81 | * @param rectList Input/output vector of rectangles. Output vector includes
82 | * retained and grouped rectangles. (The Python list is not modified in place.)
83 | * @param weights a weights
84 | * @param groupThreshold Minimum possible number of rectangles minus 1. The
85 | * threshold is used in a group of rectangles to retain it.
86 | *
87 | * @see org.opencv.objdetect.Objdetect.groupRectangles
88 | */
89 | public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold)
90 | {
91 | Mat rectList_mat = rectList;
92 | Mat weights_mat = weights;
93 | groupRectangles_1(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold);
94 |
95 | return;
96 | }
97 |
98 |
99 |
100 |
101 | // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2)
102 | private static native void groupRectangles_0(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold, double eps);
103 | private static native void groupRectangles_1(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold);
104 |
105 | }
106 |
--------------------------------------------------------------------------------
/openCVLibrary2410/src/main/java/org/opencv/video/BackgroundSubtractor.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.video;
6 |
7 | import org.opencv.core.Algorithm;
8 | import org.opencv.core.Mat;
9 |
10 | // C++: class BackgroundSubtractor
11 | /**
12 | *
Base class for background/foreground segmentation.
The class implements the algorithm described in P. KadewTraKuPong and R.
14 | * Bowden, *An improved adaptive background mixture model for real-time tracking
15 | * with shadow detection*, Proc. 2nd European Workshop on Advanced Video-Based
16 | * Surveillance Systems, 2001: http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf