├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── dictionaries │ └── flb.xml ├── encodings.xml ├── gradle.xml ├── markdown-navigator.xml ├── markdown-navigator │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── CMakeLists.txt ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── itil │ │ └── smartobjectrecognition │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── cpp │ │ └── native-lib.cpp │ ├── java │ │ └── com │ │ │ └── itil │ │ │ └── smartobjectrecognition │ │ │ └── MainActivity.java │ ├── jniLibs │ │ ├── armeabi-v7a │ │ │ ├── libnative_camera_r2.2.0.so │ │ │ ├── libnative_camera_r2.3.3.so │ │ │ ├── libnative_camera_r3.0.1.so │ │ │ ├── libnative_camera_r4.0.0.so │ │ │ ├── libnative_camera_r4.0.3.so │ │ │ ├── libnative_camera_r4.1.1.so │ │ │ ├── libnative_camera_r4.2.0.so │ │ │ ├── libnative_camera_r4.3.0.so │ │ │ ├── libnative_camera_r4.4.0.so │ │ │ ├── libopencv_androidcamera.a │ │ │ ├── libopencv_calib3d.a │ │ │ ├── libopencv_contrib.a │ │ │ ├── libopencv_core.a │ │ │ ├── libopencv_features2d.a │ │ │ ├── libopencv_flann.a │ │ │ ├── libopencv_highgui.a │ │ │ ├── libopencv_imgproc.a │ │ │ ├── libopencv_info.so │ │ │ ├── libopencv_java.so │ │ │ ├── libopencv_legacy.a │ │ │ ├── libopencv_ml.a │ │ │ ├── libopencv_objdetect.a │ │ │ ├── libopencv_ocl.a │ │ │ ├── libopencv_photo.a │ │ │ ├── libopencv_stitching.a │ │ │ ├── libopencv_superres.a │ │ │ ├── libopencv_ts.a │ │ │ ├── libopencv_video.a │ │ │ └── libopencv_videostab.a │ │ ├── armeabi │ │ │ ├── libnative_camera_r2.2.0.so │ │ │ ├── libnative_camera_r2.3.3.so │ │ │ ├── libnative_camera_r3.0.1.so │ │ │ ├── libnative_camera_r4.0.0.so │ │ │ ├── libnative_camera_r4.0.3.so │ │ │ ├── libnative_camera_r4.1.1.so │ │ │ ├── libnative_camera_r4.2.0.so │ │ │ ├── libnative_camera_r4.3.0.so │ │ │ ├── libnative_camera_r4.4.0.so │ │ │ ├── libopencv_androidcamera.a │ │ │ ├── libopencv_calib3d.a │ │ │ ├── libopencv_contrib.a │ │ │ ├── libopencv_core.a │ │ │ ├── libopencv_features2d.a │ │ │ ├── libopencv_flann.a │ │ │ ├── libopencv_highgui.a │ │ │ ├── libopencv_imgproc.a │ │ │ ├── libopencv_info.so │ │ │ ├── libopencv_java.so │ │ │ ├── libopencv_legacy.a │ │ │ ├── libopencv_ml.a │ │ │ ├── libopencv_objdetect.a │ │ │ ├── libopencv_ocl.a │ │ │ ├── libopencv_photo.a │ │ │ ├── libopencv_stitching.a │ │ │ ├── libopencv_superres.a │ │ │ ├── libopencv_ts.a │ │ │ ├── libopencv_video.a │ │ │ └── libopencv_videostab.a │ │ └── x86 │ │ │ ├── libnative_camera_r2.3.3.so │ │ │ ├── libnative_camera_r3.0.1.so │ │ │ ├── libnative_camera_r4.0.3.so │ │ │ ├── libnative_camera_r4.1.1.so │ │ │ ├── libnative_camera_r4.2.0.so │ │ │ ├── libnative_camera_r4.3.0.so │ │ │ ├── libnative_camera_r4.4.0.so │ │ │ ├── libopencv_androidcamera.a │ │ │ ├── libopencv_calib3d.a │ │ │ ├── libopencv_contrib.a │ │ │ ├── libopencv_core.a │ │ │ ├── libopencv_features2d.a │ │ │ ├── libopencv_flann.a │ │ │ ├── libopencv_highgui.a │ │ │ ├── libopencv_imgproc.a │ │ │ ├── libopencv_info.so │ │ │ ├── libopencv_java.so │ │ │ ├── libopencv_legacy.a │ │ │ ├── libopencv_ml.a │ │ │ ├── libopencv_objdetect.a │ │ │ ├── libopencv_ocl.a │ │ │ ├── libopencv_photo.a │ │ │ ├── libopencv_stitching.a │ │ │ ├── libopencv_superres.a │ │ │ ├── libopencv_ts.a │ │ │ ├── libopencv_video.a │ │ │ └── libopencv_videostab.a │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── itil │ └── smartobjectrecognition │ └── ExampleUnitTest.java ├── build.gradle ├── cut.mp4 ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── import-summary.txt ├── openCVLibrary2410 ├── build.gradle ├── build │ ├── generated │ │ └── source │ │ │ ├── aidl │ │ │ ├── debug │ │ │ │ └── org │ │ │ │ │ └── opencv │ │ │ │ │ └── engine │ │ │ │ │ └── OpenCVEngineInterface.java │ │ │ └── release │ │ │ │ └── org │ │ │ │ └── opencv │ │ │ │ └── engine │ │ │ │ └── OpenCVEngineInterface.java │ │ │ ├── buildConfig │ │ │ ├── androidTest │ │ │ │ └── debug │ │ │ │ │ └── org │ │ │ │ │ └── opencv │ │ │ │ │ └── test │ │ │ │ │ └── BuildConfig.java │ │ │ └── debug │ │ │ │ └── org │ │ │ │ └── opencv │ │ │ │ └── BuildConfig.java │ │ │ └── r │ │ │ ├── androidTest │ │ │ └── debug │ │ │ │ └── org │ │ │ │ └── opencv │ │ │ │ ├── R.java │ │ │ │ └── test │ │ │ │ └── R.java │ │ │ └── debug │ │ │ └── org │ │ │ └── opencv │ │ │ └── R.java │ ├── intermediates │ │ ├── blame │ │ │ └── res │ │ │ │ └── androidTest │ │ │ │ └── debug │ │ │ │ └── multi │ │ │ │ └── values.json │ │ ├── bundles │ │ │ ├── debug │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── R.txt │ │ │ │ └── res │ │ │ │ │ └── values │ │ │ │ │ └── values.xml │ │ │ └── release │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── res │ │ │ │ └── values │ │ │ │ └── values.xml │ │ ├── incremental │ │ │ ├── compileDebugAidl │ │ │ │ └── dependency.store │ │ │ ├── compileDebugAndroidTestAidl │ │ │ │ └── dependency.store │ │ │ ├── compileReleaseAidl │ │ │ │ └── dependency.store │ │ │ ├── mergeDebugAndroidTestResources │ │ │ │ ├── compile-file-map.properties │ │ │ │ ├── merged.dir │ │ │ │ │ └── values │ │ │ │ │ │ └── values.xml │ │ │ │ └── merger.xml │ │ │ ├── mergeDebugAssets │ │ │ │ └── merger.xml │ │ │ ├── mergeDebugShaders │ │ │ │ └── merger.xml │ │ │ ├── mergeReleaseAssets │ │ │ │ └── merger.xml │ │ │ ├── mergeReleaseShaders │ │ │ │ └── merger.xml │ │ │ ├── packageDebugResources │ │ │ │ ├── compile-file-map.properties │ │ │ │ ├── merged.dir │ │ │ │ │ └── values │ │ │ │ │ │ └── values.xml │ │ │ │ └── merger.xml │ │ │ └── packageReleaseResources │ │ │ │ ├── compile-file-map.properties │ │ │ │ ├── merged.dir │ │ │ │ └── values │ │ │ │ │ └── values.xml │ │ │ │ └── merger.xml │ │ ├── manifest │ │ │ └── androidTest │ │ │ │ └── debug │ │ │ │ └── AndroidManifest.xml │ │ ├── manifests │ │ │ └── aapt │ │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── release │ │ │ │ └── AndroidManifest.xml │ │ ├── res │ │ │ ├── merged │ │ │ │ └── androidTest │ │ │ │ │ └── debug │ │ │ │ │ └── values │ │ │ │ │ └── values.xml │ │ │ └── resources-debug-androidTest.ap_ │ │ └── symbols │ │ │ └── androidTest │ │ │ └── debug │ │ │ └── R.txt │ └── outputs │ │ └── aar │ │ ├── openCVLibrary2410-debug.aar │ │ └── openCVLibrary2410-release.aar ├── lint.xml └── src │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── org │ │ └── opencv │ │ └── engine │ │ └── OpenCVEngineInterface.aidl │ ├── java │ └── org │ │ └── opencv │ │ ├── android │ │ ├── AsyncServiceHelper.java │ │ ├── BaseLoaderCallback.java │ │ ├── CameraBridgeViewBase.java │ │ ├── FpsMeter.java │ │ ├── InstallCallbackInterface.java │ │ ├── JavaCameraView.java │ │ ├── LoaderCallbackInterface.java │ │ ├── NativeCameraView.java │ │ ├── OpenCVLoader.java │ │ ├── StaticHelper.java │ │ └── Utils.java │ │ ├── calib3d │ │ ├── Calib3d.java │ │ ├── StereoBM.java │ │ └── StereoSGBM.java │ │ ├── contrib │ │ ├── Contrib.java │ │ ├── FaceRecognizer.java │ │ └── StereoVar.java │ │ ├── core │ │ ├── Algorithm.java │ │ ├── Core.java │ │ ├── CvException.java │ │ ├── CvType.java │ │ ├── Mat.java │ │ ├── MatOfByte.java │ │ ├── MatOfDMatch.java │ │ ├── MatOfDouble.java │ │ ├── MatOfFloat.java │ │ ├── MatOfFloat4.java │ │ ├── MatOfFloat6.java │ │ ├── MatOfInt.java │ │ ├── MatOfInt4.java │ │ ├── MatOfKeyPoint.java │ │ ├── MatOfPoint.java │ │ ├── MatOfPoint2f.java │ │ ├── MatOfPoint3.java │ │ ├── MatOfPoint3f.java │ │ ├── MatOfRect.java │ │ ├── Point.java │ │ ├── Point3.java │ │ ├── Range.java │ │ ├── Rect.java │ │ ├── RotatedRect.java │ │ ├── Scalar.java │ │ ├── Size.java │ │ └── TermCriteria.java │ │ ├── features2d │ │ ├── DMatch.java │ │ ├── DescriptorExtractor.java │ │ ├── DescriptorMatcher.java │ │ ├── FeatureDetector.java │ │ ├── Features2d.java │ │ ├── GenericDescriptorMatcher.java │ │ └── KeyPoint.java │ │ ├── gpu │ │ ├── DeviceInfo.java │ │ ├── Gpu.java │ │ └── TargetArchs.java │ │ ├── highgui │ │ ├── Highgui.java │ │ └── VideoCapture.java │ │ ├── imgproc │ │ ├── CLAHE.java │ │ ├── Imgproc.java │ │ ├── Moments.java │ │ └── Subdiv2D.java │ │ ├── ml │ │ ├── CvANN_MLP.java │ │ ├── CvANN_MLP_TrainParams.java │ │ ├── CvBoost.java │ │ ├── CvBoostParams.java │ │ ├── CvDTree.java │ │ ├── CvDTreeParams.java │ │ ├── CvERTrees.java │ │ ├── CvGBTrees.java │ │ ├── CvGBTreesParams.java │ │ ├── CvKNearest.java │ │ ├── CvNormalBayesClassifier.java │ │ ├── CvParamGrid.java │ │ ├── CvRTParams.java │ │ ├── CvRTrees.java │ │ ├── CvSVM.java │ │ ├── CvSVMParams.java │ │ ├── CvStatModel.java │ │ ├── EM.java │ │ └── Ml.java │ │ ├── objdetect │ │ ├── CascadeClassifier.java │ │ ├── HOGDescriptor.java │ │ └── Objdetect.java │ │ ├── photo │ │ └── Photo.java │ │ ├── utils │ │ └── Converters.java │ │ └── video │ │ ├── BackgroundSubtractor.java │ │ ├── BackgroundSubtractorMOG.java │ │ ├── BackgroundSubtractorMOG2.java │ │ ├── KalmanFilter.java │ │ └── Video.java │ └── res │ └── values │ └── attrs.xml ├── preview.gif └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | app/libs/ 11 | app/src/main/res/drawable/ 12 | openCVLibrary2410/build/generated/assets/ 13 | openCVLibrary2410/build/generated/res/ 14 | openCVLibrary2410/build/generated/source/aidl/androidTest/ 15 | openCVLibrary2410/build/generated/source/apt/ 16 | openCVLibrary2410/build/generated/source/rs/ 17 | openCVLibrary2410/build/intermediates/bundles/debug/aidl/ 18 | openCVLibrary2410/build/intermediates/bundles/debug/assets/ 19 | openCVLibrary2410/build/intermediates/bundles/release/aidl/ 20 | openCVLibrary2410/build/intermediates/bundles/release/assets/ 21 | openCVLibrary2410/build/intermediates/bundles/release/jni/ 22 | openCVLibrary2410/build/intermediates/bundles/release/libs/ 23 | openCVLibrary2410/build/intermediates/dependency-cache/ 24 | openCVLibrary2410/build/intermediates/incremental/mergeDebugAndroidTestResources/aapt-temp/ 25 | openCVLibrary2410/build/intermediates/incremental/packageDebugAndroidTest/ 26 | openCVLibrary2410/build/intermediates/incremental/packageDebugResources/aapt-temp/ 27 | openCVLibrary2410/build/intermediates/incremental/packageReleaseResources/aapt-temp/ 28 | openCVLibrary2410/build/intermediates/incremental/processDebugAndroidTestResources/ 29 | openCVLibrary2410/build/intermediates/incremental/processDebugResources/ 30 | openCVLibrary2410/build/intermediates/incremental/processReleaseResources/ 31 | openCVLibrary2410/build/intermediates/jniLibs/ 32 | openCVLibrary2410/build/intermediates/lint/ 33 | openCVLibrary2410/build/intermediates/manifest/tmp/ 34 | openCVLibrary2410/build/intermediates/rs/ 35 | openCVLibrary2410/build/intermediates/shaders/ 36 | openCVLibrary2410/build/intermediates/transforms/ 37 | openCVLibrary2410/build/tmp/ 38 | .idea/markdown-navigator.xml 39 | .idea/markdown-navigator/ 40 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/dictionaries/flb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 33 | 34 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Android 39 | 40 | 41 | Android Lint 42 | 43 | 44 | CorrectnessLintAndroid 45 | 46 | 47 | General 48 | 49 | 50 | Java 51 | 52 | 53 | LintAndroid 54 | 55 | 56 | Maven 57 | 58 | 59 | Numeric issuesJava 60 | 61 | 62 | 63 | 64 | Android 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 86 | 87 | 88 | 89 | 90 | 1.8 91 | 92 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | ![preview](preview.gif) -------------------------------------------------------------------------------- /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 | 24 | 25 | 26 | 27 |
ConstantValueDescription
any-1
back99
front98
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 |

Includes the following attributes:

47 | 48 | 49 | 50 | 51 | 52 | 53 |
AttributeDescription
{@link #CameraBridgeViewBase_camera_id org.opencv.test:camera_id}
{@link #CameraBridgeViewBase_show_fps org.opencv.test:show_fps}
54 | @see #CameraBridgeViewBase_camera_id 55 | @see #CameraBridgeViewBase_show_fps 56 | */ 57 | public static final int[] CameraBridgeViewBase = { 58 | 0x7f010000, 0x7f010001 59 | }; 60 | /** 61 |

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 | 77 | 78 | 79 | 80 |
ConstantValueDescription
any-1
back99
front98
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 | 24 | 25 | 26 | 27 |
ConstantValueDescription
any-1
back99
front98
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 |

Includes the following attributes:

47 | 48 | 49 | 50 | 51 | 52 | 53 |
AttributeDescription
{@link #CameraBridgeViewBase_camera_id org.opencv:camera_id}
{@link #CameraBridgeViewBase_show_fps org.opencv:show_fps}
54 | @see #CameraBridgeViewBase_camera_id 55 | @see #CameraBridgeViewBase_show_fps 56 | */ 57 | public static final int[] CameraBridgeViewBase = { 58 | 0x7f010000, 0x7f010001 59 | }; 60 | /** 61 |

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 | 77 | 78 | 79 | 80 |
ConstantValueDescription
any-1
back99
front98
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>

7 | * 8 | *

// C++ code:

9 | * 10 | * 11 | *

public:

12 | * 13 | *

//! various constructors

14 | * 15 | *

Scalar_();

16 | * 17 | *

Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0);

18 | * 19 | *

Scalar_(const CvScalar& s);

20 | * 21 | *

Scalar_(_Tp v0);

22 | * 23 | *

//! returns a scalar with all elements set to v0

24 | * 25 | *

static Scalar_<_Tp> all(_Tp v0);

26 | * 27 | *

//! conversion to the old-style CvScalar

28 | * 29 | *

operator CvScalar() const;

30 | * 31 | *

//! conversion to another data type

32 | * 33 | *

template operator Scalar_() const;

34 | * 35 | *

//! per-element product

36 | * 37 | *

Scalar_<_Tp> mul(const Scalar_<_Tp>& t, double scale=1) const;

38 | * 39 | *

// returns (v0, -v1, -v2, -v3)

40 | * 41 | *

Scalar_<_Tp> conj() const;

42 | * 43 | *

// returns true iff v1 == v2 == v3 == 0

44 | * 45 | *

bool isReal() const;

46 | * 47 | *

};

48 | * 49 | *

typedef Scalar_ Scalar;

50 | * 51 | *

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 | *

56 | * 57 | * @see org.opencv.core.Scalar_ 58 | */ 59 | public class Scalar { 60 | 61 | public double val[]; 62 | 63 | public Scalar(double v0, double v1, double v2, double v3) { 64 | val = new double[] { v0, v1, v2, v3 }; 65 | } 66 | 67 | public Scalar(double v0, double v1, double v2) { 68 | val = new double[] { v0, v1, v2, 0 }; 69 | } 70 | 71 | public Scalar(double v0, double v1) { 72 | val = new double[] { v0, v1, 0, 0 }; 73 | } 74 | 75 | public Scalar(double v0) { 76 | val = new double[] { v0, 0, 0, 0 }; 77 | } 78 | 79 | public Scalar(double[] vals) { 80 | if (vals != null && vals.length == 4) 81 | val = vals.clone(); 82 | else { 83 | val = new double[4]; 84 | set(vals); 85 | } 86 | } 87 | 88 | public void set(double[] vals) { 89 | if (vals != null) { 90 | val[0] = vals.length > 0 ? vals[0] : 0; 91 | val[1] = vals.length > 1 ? vals[1] : 0; 92 | val[2] = vals.length > 2 ? vals[2] : 0; 93 | val[3] = vals.length > 3 ? vals[3] : 0; 94 | } else 95 | val[0] = val[1] = val[2] = val[3] = 0; 96 | } 97 | 98 | public static Scalar all(double v) { 99 | return new Scalar(v, v, v, v); 100 | } 101 | 102 | public Scalar clone() { 103 | return new Scalar(val); 104 | } 105 | 106 | public Scalar mul(Scalar it, double scale) { 107 | return new Scalar(val[0] * it.val[0] * scale, val[1] * it.val[1] * scale, 108 | val[2] * it.val[2] * scale, val[3] * it.val[3] * scale); 109 | } 110 | 111 | public Scalar mul(Scalar it) { 112 | return mul(it, 1); 113 | } 114 | 115 | public Scalar conj() { 116 | return new Scalar(val[0], -val[1], -val[2], -val[3]); 117 | } 118 | 119 | public boolean isReal() { 120 | return val[1] == 0 && val[2] == 0 && val[3] == 0; 121 | } 122 | 123 | @Override 124 | public int hashCode() { 125 | final int prime = 31; 126 | int result = 1; 127 | result = prime * result + java.util.Arrays.hashCode(val); 128 | return result; 129 | } 130 | 131 | @Override 132 | public boolean equals(Object obj) { 133 | if (this == obj) return true; 134 | if (!(obj instanceof Scalar)) return false; 135 | Scalar it = (Scalar) obj; 136 | if (!java.util.Arrays.equals(val, it.val)) return false; 137 | return true; 138 | } 139 | 140 | @Override 141 | public String toString() { 142 | return "[" + val[0] + ", " + val[1] + ", " + val[2] + ", " + val[3] + "]"; 143 | } 144 | 145 | } 146 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/core/Size.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | /** 4 | *

template class CV_EXPORTS Size_

5 | * 6 | *

// C++ code:

7 | * 8 | * 9 | *

public:

10 | * 11 | *

typedef _Tp value_type;

12 | * 13 | *

//! various constructors

14 | * 15 | *

Size_();

16 | * 17 | *

Size_(_Tp _width, _Tp _height);

18 | * 19 | *

Size_(const Size_& sz);

20 | * 21 | *

Size_(const CvSize& sz);

22 | * 23 | *

Size_(const CvSize2D32f& sz);

24 | * 25 | *

Size_(const Point_<_Tp>& pt);

26 | * 27 | *

Size_& operator = (const Size_& sz);

28 | * 29 | *

//! the area (width*height)

30 | * 31 | *

_Tp area() const;

32 | * 33 | *

//! conversion of another data type.

34 | * 35 | *

template operator Size_<_Tp2>() const;

36 | * 37 | *

//! conversion to the old-style OpenCV types

38 | * 39 | *

operator CvSize() const;

40 | * 41 | *

operator CvSize2D32f() const;

42 | * 43 | *

_Tp width, height; // the width and the height

44 | * 45 | *

};

46 | * 47 | *

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:

54 | * 55 | *

// C++ code:

56 | * 57 | *

typedef Size_ Size2i;

58 | * 59 | *

typedef Size2i Size;

60 | * 61 | *

typedef Size_ Size2f;

62 | * 63 | * @see org.opencv.core.Size_ 64 | */ 65 | public class Size { 66 | 67 | public double width, height; 68 | 69 | public Size(double width, double height) { 70 | this.width = width; 71 | this.height = height; 72 | } 73 | 74 | public Size() { 75 | this(0, 0); 76 | } 77 | 78 | public Size(Point p) { 79 | width = p.x; 80 | height = p.y; 81 | } 82 | 83 | public Size(double[] vals) { 84 | set(vals); 85 | } 86 | 87 | public void set(double[] vals) { 88 | if (vals != null) { 89 | width = vals.length > 0 ? vals[0] : 0; 90 | height = vals.length > 1 ? vals[1] : 0; 91 | } else { 92 | width = 0; 93 | height = 0; 94 | } 95 | } 96 | 97 | public double area() { 98 | return width * height; 99 | } 100 | 101 | public Size clone() { 102 | return new Size(width, height); 103 | } 104 | 105 | @Override 106 | public int hashCode() { 107 | final int prime = 31; 108 | int result = 1; 109 | long temp; 110 | temp = Double.doubleToLongBits(height); 111 | result = prime * result + (int) (temp ^ (temp >>> 32)); 112 | temp = Double.doubleToLongBits(width); 113 | result = prime * result + (int) (temp ^ (temp >>> 32)); 114 | return result; 115 | } 116 | 117 | @Override 118 | public boolean equals(Object obj) { 119 | if (this == obj) return true; 120 | if (!(obj instanceof Size)) return false; 121 | Size it = (Size) obj; 122 | return width == it.width && height == it.height; 123 | } 124 | 125 | @Override 126 | public String toString() { 127 | return (int)width + "x" + (int)height; 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/core/TermCriteria.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | /** 4 | *

class CV_EXPORTS TermCriteria

5 | * 6 | *

// C++ code:

7 | * 8 | * 9 | *

public:

10 | * 11 | *

enum

12 | * 13 | * 14 | *

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 | *

52 | * 53 | * @see org.opencv.core.TermCriteria 54 | */ 55 | public class TermCriteria { 56 | 57 | /** 58 | * The maximum number of iterations or elements to compute 59 | */ 60 | public static final int COUNT = 1; 61 | /** 62 | * The maximum number of iterations or elements to compute 63 | */ 64 | public static final int MAX_ITER = COUNT; 65 | /** 66 | * The desired accuracy threshold or change in parameters at which the iterative algorithm is terminated. 67 | */ 68 | public static final int EPS = 2; 69 | 70 | public int type; 71 | public int maxCount; 72 | public double epsilon; 73 | 74 | /** 75 | * Termination criteria for iterative algorithms. 76 | * 77 | * @param type 78 | * the type of termination criteria: COUNT, EPS or COUNT + EPS. 79 | * @param maxCount 80 | * the maximum number of iterations/elements. 81 | * @param epsilon 82 | * the desired accuracy. 83 | */ 84 | public TermCriteria(int type, int maxCount, double epsilon) { 85 | this.type = type; 86 | this.maxCount = maxCount; 87 | this.epsilon = epsilon; 88 | } 89 | 90 | /** 91 | * Termination criteria for iterative algorithms. 92 | */ 93 | public TermCriteria() { 94 | this(0, 0, 0.0); 95 | } 96 | 97 | public TermCriteria(double[] vals) { 98 | set(vals); 99 | } 100 | 101 | public void set(double[] vals) { 102 | if (vals != null) { 103 | type = vals.length > 0 ? (int) vals[0] : 0; 104 | maxCount = vals.length > 1 ? (int) vals[1] : 0; 105 | epsilon = vals.length > 2 ? (double) vals[2] : 0; 106 | } else { 107 | type = 0; 108 | maxCount = 0; 109 | epsilon = 0; 110 | } 111 | } 112 | 113 | public TermCriteria clone() { 114 | return new TermCriteria(type, maxCount, epsilon); 115 | } 116 | 117 | @Override 118 | public int hashCode() { 119 | final int prime = 31; 120 | int result = 1; 121 | long temp; 122 | temp = Double.doubleToLongBits(type); 123 | result = prime * result + (int) (temp ^ (temp >>> 32)); 124 | temp = Double.doubleToLongBits(maxCount); 125 | result = prime * result + (int) (temp ^ (temp >>> 32)); 126 | temp = Double.doubleToLongBits(epsilon); 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 TermCriteria)) return false; 135 | TermCriteria it = (TermCriteria) obj; 136 | return type == it.type && maxCount == it.maxCount && epsilon == it.epsilon; 137 | } 138 | 139 | @Override 140 | public String toString() { 141 | return "{ type: " + type + ", maxCount: " + maxCount + ", epsilon: " + epsilon + "}"; 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/features2d/DMatch.java: -------------------------------------------------------------------------------- 1 | package org.opencv.features2d; 2 | 3 | //C++: class DMatch 4 | 5 | /** 6 | * Structure for matching: query descriptor index, train descriptor index, train 7 | * image index and distance between descriptors. 8 | */ 9 | public class DMatch { 10 | 11 | /** 12 | * Query descriptor index. 13 | */ 14 | public int queryIdx; 15 | /** 16 | * Train descriptor index. 17 | */ 18 | public int trainIdx; 19 | /** 20 | * Train image index. 21 | */ 22 | public int imgIdx; 23 | 24 | public float distance; 25 | 26 | public DMatch() { 27 | this(-1, -1, Float.MAX_VALUE); 28 | } 29 | 30 | public DMatch(int _queryIdx, int _trainIdx, float _distance) { 31 | queryIdx = _queryIdx; 32 | trainIdx = _trainIdx; 33 | imgIdx = -1; 34 | distance = _distance; 35 | } 36 | 37 | public DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance) { 38 | queryIdx = _queryIdx; 39 | trainIdx = _trainIdx; 40 | imgIdx = _imgIdx; 41 | distance = _distance; 42 | } 43 | 44 | /** 45 | * Less is better. 46 | */ 47 | public boolean lessThan(DMatch it) { 48 | return distance < it.distance; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return "DMatch [queryIdx=" + queryIdx + ", trainIdx=" + trainIdx 54 | + ", imgIdx=" + imgIdx + ", distance=" + distance + "]"; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/gpu/Gpu.java: -------------------------------------------------------------------------------- 1 | package org.opencv.gpu; 2 | 3 | public class Gpu { 4 | 5 | public static final int 6 | FEATURE_SET_COMPUTE_10 = 10, 7 | FEATURE_SET_COMPUTE_11 = 11, 8 | FEATURE_SET_COMPUTE_12 = 12, 9 | FEATURE_SET_COMPUTE_13 = 13, 10 | FEATURE_SET_COMPUTE_20 = 20, 11 | FEATURE_SET_COMPUTE_21 = 21, 12 | FEATURE_SET_COMPUTE_30 = 30, 13 | FEATURE_SET_COMPUTE_35 = 35, 14 | GLOBAL_ATOMICS = FEATURE_SET_COMPUTE_11, 15 | SHARED_ATOMICS = FEATURE_SET_COMPUTE_12, 16 | NATIVE_DOUBLE = FEATURE_SET_COMPUTE_13, 17 | WARP_SHUFFLE_FUNCTIONS = FEATURE_SET_COMPUTE_30, 18 | DYNAMIC_PARALLELISM = FEATURE_SET_COMPUTE_35; 19 | 20 | 21 | // 22 | // C++: bool deviceSupports(int feature_set) 23 | // 24 | 25 | public static boolean deviceSupports(int feature_set) 26 | { 27 | boolean retVal = deviceSupports_0(feature_set); 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: int getCudaEnabledDeviceCount() 34 | // 35 | 36 | public static int getCudaEnabledDeviceCount() 37 | { 38 | int retVal = getCudaEnabledDeviceCount_0(); 39 | return retVal; 40 | } 41 | 42 | 43 | // 44 | // C++: int getDevice() 45 | // 46 | 47 | public static int getDevice() 48 | { 49 | int retVal = getDevice_0(); 50 | return retVal; 51 | } 52 | 53 | 54 | // 55 | // C++: void printCudaDeviceInfo(int device) 56 | // 57 | 58 | public static void printCudaDeviceInfo(int device) 59 | { 60 | printCudaDeviceInfo_0(device); 61 | return; 62 | } 63 | 64 | 65 | // 66 | // C++: void printShortCudaDeviceInfo(int device) 67 | // 68 | 69 | public static void printShortCudaDeviceInfo(int device) 70 | { 71 | printShortCudaDeviceInfo_0(device); 72 | return; 73 | } 74 | 75 | 76 | // 77 | // C++: void resetDevice() 78 | // 79 | 80 | public static void resetDevice() 81 | { 82 | resetDevice_0(); 83 | return; 84 | } 85 | 86 | 87 | // 88 | // C++: void setDevice(int device) 89 | // 90 | 91 | public static void setDevice(int device) 92 | { 93 | setDevice_0(device); 94 | return; 95 | } 96 | 97 | 98 | 99 | 100 | // C++: bool deviceSupports(int feature_set) 101 | private static native boolean deviceSupports_0(int feature_set); 102 | 103 | // C++: int getCudaEnabledDeviceCount() 104 | private static native int getCudaEnabledDeviceCount_0(); 105 | 106 | // C++: int getDevice() 107 | private static native int getDevice_0(); 108 | 109 | // C++: void printCudaDeviceInfo(int device) 110 | private static native void printCudaDeviceInfo_0(int device); 111 | 112 | // C++: void printShortCudaDeviceInfo(int device) 113 | private static native void printShortCudaDeviceInfo_0(int device); 114 | 115 | // C++: void resetDevice() 116 | private static native void resetDevice_0(); 117 | 118 | // C++: void setDevice(int device) 119 | private static native void setDevice_0(int device); 120 | 121 | } 122 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/gpu/TargetArchs.java: -------------------------------------------------------------------------------- 1 | package org.opencv.gpu; 2 | 3 | // C++: class TargetArchs 4 | public class TargetArchs { 5 | 6 | protected final long nativeObj; 7 | protected TargetArchs(long addr) { nativeObj = addr; } 8 | 9 | 10 | // 11 | // C++: static bool TargetArchs::builtWith(int feature_set) 12 | // 13 | 14 | public static boolean builtWith(int feature_set) 15 | { 16 | boolean retVal = builtWith_0(feature_set); 17 | return retVal; 18 | } 19 | 20 | 21 | // 22 | // C++: static bool TargetArchs::has(int major, int minor) 23 | // 24 | 25 | public static boolean has(int major, int minor) 26 | { 27 | boolean retVal = has_0(major, minor); 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: static bool TargetArchs::hasBin(int major, int minor) 34 | // 35 | 36 | public static boolean hasBin(int major, int minor) 37 | { 38 | boolean retVal = hasBin_0(major, minor); 39 | return retVal; 40 | } 41 | 42 | 43 | // 44 | // C++: static bool TargetArchs::hasEqualOrGreater(int major, int minor) 45 | // 46 | 47 | public static boolean hasEqualOrGreater(int major, int minor) 48 | { 49 | boolean retVal = hasEqualOrGreater_0(major, minor); 50 | return retVal; 51 | } 52 | 53 | 54 | // 55 | // C++: static bool TargetArchs::hasEqualOrGreaterBin(int major, int minor) 56 | // 57 | 58 | public static boolean hasEqualOrGreaterBin(int major, int minor) 59 | { 60 | boolean retVal = hasEqualOrGreaterBin_0(major, minor); 61 | return retVal; 62 | } 63 | 64 | 65 | // 66 | // C++: static bool TargetArchs::hasEqualOrGreaterPtx(int major, int minor) 67 | // 68 | 69 | public static boolean hasEqualOrGreaterPtx(int major, int minor) 70 | { 71 | boolean retVal = hasEqualOrGreaterPtx_0(major, minor); 72 | return retVal; 73 | } 74 | 75 | 76 | // 77 | // C++: static bool TargetArchs::hasEqualOrLessPtx(int major, int minor) 78 | // 79 | 80 | public static boolean hasEqualOrLessPtx(int major, int minor) 81 | { 82 | boolean retVal = hasEqualOrLessPtx_0(major, minor); 83 | return retVal; 84 | } 85 | 86 | 87 | // 88 | // C++: static bool TargetArchs::hasPtx(int major, int minor) 89 | // 90 | 91 | public static boolean hasPtx(int major, int minor) 92 | { 93 | boolean retVal = hasPtx_0(major, minor); 94 | return retVal; 95 | } 96 | 97 | 98 | @Override 99 | protected void finalize() throws Throwable { 100 | delete(nativeObj); 101 | } 102 | 103 | 104 | 105 | // C++: static bool TargetArchs::builtWith(int feature_set) 106 | private static native boolean builtWith_0(int feature_set); 107 | 108 | // C++: static bool TargetArchs::has(int major, int minor) 109 | private static native boolean has_0(int major, int minor); 110 | 111 | // C++: static bool TargetArchs::hasBin(int major, int minor) 112 | private static native boolean hasBin_0(int major, int minor); 113 | 114 | // C++: static bool TargetArchs::hasEqualOrGreater(int major, int minor) 115 | private static native boolean hasEqualOrGreater_0(int major, int minor); 116 | 117 | // C++: static bool TargetArchs::hasEqualOrGreaterBin(int major, int minor) 118 | private static native boolean hasEqualOrGreaterBin_0(int major, int minor); 119 | 120 | // C++: static bool TargetArchs::hasEqualOrGreaterPtx(int major, int minor) 121 | private static native boolean hasEqualOrGreaterPtx_0(int major, int minor); 122 | 123 | // C++: static bool TargetArchs::hasEqualOrLessPtx(int major, int minor) 124 | private static native boolean hasEqualOrLessPtx_0(int major, int minor); 125 | 126 | // C++: static bool TargetArchs::hasPtx(int major, int minor) 127 | private static native boolean hasPtx_0(int major, int minor); 128 | 129 | // native support for java finalize() 130 | private static native void delete(long nativeObj); 131 | 132 | } 133 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/imgproc/CLAHE.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.imgproc; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | import org.opencv.core.Size; 10 | 11 | // C++: class CLAHE 12 | public class CLAHE extends Algorithm { 13 | 14 | protected CLAHE(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: void CLAHE::apply(Mat src, Mat& dst) 19 | // 20 | 21 | public void apply(Mat src, Mat dst) 22 | { 23 | 24 | apply_0(nativeObj, src.nativeObj, dst.nativeObj); 25 | 26 | return; 27 | } 28 | 29 | 30 | // 31 | // C++: void CLAHE::setClipLimit(double clipLimit) 32 | // 33 | 34 | public void setClipLimit(double clipLimit) 35 | { 36 | 37 | setClipLimit_0(nativeObj, clipLimit); 38 | 39 | return; 40 | } 41 | 42 | 43 | // 44 | // C++: void CLAHE::setTilesGridSize(Size tileGridSize) 45 | // 46 | 47 | public void setTilesGridSize(Size tileGridSize) 48 | { 49 | 50 | setTilesGridSize_0(nativeObj, tileGridSize.width, tileGridSize.height); 51 | 52 | return; 53 | } 54 | 55 | 56 | @Override 57 | protected void finalize() throws Throwable { 58 | delete(nativeObj); 59 | } 60 | 61 | 62 | 63 | // C++: void CLAHE::apply(Mat src, Mat& dst) 64 | private static native void apply_0(long nativeObj, long src_nativeObj, long dst_nativeObj); 65 | 66 | // C++: void CLAHE::setClipLimit(double clipLimit) 67 | private static native void setClipLimit_0(long nativeObj, double clipLimit); 68 | 69 | // C++: void CLAHE::setTilesGridSize(Size tileGridSize) 70 | private static native void setTilesGridSize_0(long nativeObj, double tileGridSize_width, double tileGridSize_height); 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/CvERTrees.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | import org.opencv.core.Mat; 8 | 9 | // C++: class CvERTrees 10 | /** 11 | *

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.

17 | * 18 | * @see org.opencv.ml.CvGBTreesParams : public CvDTreeParams 19 | */ 20 | public class CvGBTreesParams extends CvDTreeParams { 21 | 22 | protected CvGBTreesParams(long addr) { super(addr); } 23 | 24 | 25 | // 26 | // C++: CvGBTreesParams::CvGBTreesParams() 27 | // 28 | 29 | /** 30 | *

By default the following constructor is used: CvGBTreesParams(CvGBTrees.SQUARED_LOSS, 31 | * 200, 0.8f, 0.01f, 3, false)

32 | * 33 | *

// C++ code:

34 | * 35 | *

: CvDTreeParams(3, 10, 0, false, 10, 0, false, false, 0)

36 | * 37 | * @see org.opencv.ml.CvGBTreesParams.CvGBTreesParams 38 | */ 39 | public CvGBTreesParams() 40 | { 41 | 42 | super( CvGBTreesParams_0() ); 43 | 44 | return; 45 | } 46 | 47 | 48 | // 49 | // C++: int CvGBTreesParams::weak_count 50 | // 51 | 52 | public int get_weak_count() 53 | { 54 | 55 | int retVal = get_weak_count_0(nativeObj); 56 | 57 | return retVal; 58 | } 59 | 60 | 61 | // 62 | // C++: void CvGBTreesParams::weak_count 63 | // 64 | 65 | public void set_weak_count(int weak_count) 66 | { 67 | 68 | set_weak_count_0(nativeObj, weak_count); 69 | 70 | return; 71 | } 72 | 73 | 74 | // 75 | // C++: int CvGBTreesParams::loss_function_type 76 | // 77 | 78 | public int get_loss_function_type() 79 | { 80 | 81 | int retVal = get_loss_function_type_0(nativeObj); 82 | 83 | return retVal; 84 | } 85 | 86 | 87 | // 88 | // C++: void CvGBTreesParams::loss_function_type 89 | // 90 | 91 | public void set_loss_function_type(int loss_function_type) 92 | { 93 | 94 | set_loss_function_type_0(nativeObj, loss_function_type); 95 | 96 | return; 97 | } 98 | 99 | 100 | // 101 | // C++: float CvGBTreesParams::subsample_portion 102 | // 103 | 104 | public float get_subsample_portion() 105 | { 106 | 107 | float retVal = get_subsample_portion_0(nativeObj); 108 | 109 | return retVal; 110 | } 111 | 112 | 113 | // 114 | // C++: void CvGBTreesParams::subsample_portion 115 | // 116 | 117 | public void set_subsample_portion(float subsample_portion) 118 | { 119 | 120 | set_subsample_portion_0(nativeObj, subsample_portion); 121 | 122 | return; 123 | } 124 | 125 | 126 | // 127 | // C++: float CvGBTreesParams::shrinkage 128 | // 129 | 130 | public float get_shrinkage() 131 | { 132 | 133 | float retVal = get_shrinkage_0(nativeObj); 134 | 135 | return retVal; 136 | } 137 | 138 | 139 | // 140 | // C++: void CvGBTreesParams::shrinkage 141 | // 142 | 143 | public void set_shrinkage(float shrinkage) 144 | { 145 | 146 | set_shrinkage_0(nativeObj, shrinkage); 147 | 148 | return; 149 | } 150 | 151 | 152 | @Override 153 | protected void finalize() throws Throwable { 154 | delete(nativeObj); 155 | } 156 | 157 | 158 | 159 | // C++: CvGBTreesParams::CvGBTreesParams() 160 | private static native long CvGBTreesParams_0(); 161 | 162 | // C++: int CvGBTreesParams::weak_count 163 | private static native int get_weak_count_0(long nativeObj); 164 | 165 | // C++: void CvGBTreesParams::weak_count 166 | private static native void set_weak_count_0(long nativeObj, int weak_count); 167 | 168 | // C++: int CvGBTreesParams::loss_function_type 169 | private static native int get_loss_function_type_0(long nativeObj); 170 | 171 | // C++: void CvGBTreesParams::loss_function_type 172 | private static native void set_loss_function_type_0(long nativeObj, int loss_function_type); 173 | 174 | // C++: float CvGBTreesParams::subsample_portion 175 | private static native float get_subsample_portion_0(long nativeObj); 176 | 177 | // C++: void CvGBTreesParams::subsample_portion 178 | private static native void set_subsample_portion_0(long nativeObj, float subsample_portion); 179 | 180 | // C++: float CvGBTreesParams::shrinkage 181 | private static native float get_shrinkage_0(long nativeObj); 182 | 183 | // C++: void CvGBTreesParams::shrinkage 184 | private static native void set_shrinkage_0(long nativeObj, float shrinkage); 185 | 186 | // native support for java finalize() 187 | private static native void delete(long nativeObj); 188 | 189 | } 190 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/ml/CvParamGrid.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 CvParamGrid 10 | /** 11 | *

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:

26 | * 27 | *

(min_val, min_val*step, min_val*(step)^2, dots, min_val*(step)^n),

28 | * 29 | *

where n is the maximal index satisfying

30 | * 31 | *

min_val * step ^n < max_val

32 | * 33 | *

The grid is logarithmic, so step must always be greater then 1.

34 | * 35 | * @see org.opencv.ml.CvParamGrid 36 | */ 37 | public class CvParamGrid { 38 | 39 | protected final long nativeObj; 40 | protected CvParamGrid(long addr) { nativeObj = addr; } 41 | 42 | 43 | public static final int 44 | SVM_C = 0, 45 | SVM_GAMMA = 1, 46 | SVM_P = 2, 47 | SVM_NU = 3, 48 | SVM_COEF = 4, 49 | SVM_DEGREE = 5; 50 | 51 | 52 | // 53 | // C++: CvParamGrid::CvParamGrid() 54 | // 55 | 56 | /** 57 | *

The constructors.

58 | * 59 | *

The full constructor initializes corresponding members. The default 60 | * constructor creates a dummy grid:

61 | * 62 | *

63 | * 64 | *

// C++ code:

65 | * 66 | *

CvParamGrid.CvParamGrid()

67 | * 68 | * 69 | *

min_val = max_val = step = 0;

70 | * 71 | * 72 | * @see org.opencv.ml.CvParamGrid.CvParamGrid 73 | */ 74 | public CvParamGrid() 75 | { 76 | 77 | nativeObj = CvParamGrid_0(); 78 | 79 | return; 80 | } 81 | 82 | 83 | // 84 | // C++: double CvParamGrid::min_val 85 | // 86 | 87 | public double get_min_val() 88 | { 89 | 90 | double retVal = get_min_val_0(nativeObj); 91 | 92 | return retVal; 93 | } 94 | 95 | 96 | // 97 | // C++: void CvParamGrid::min_val 98 | // 99 | 100 | public void set_min_val(double min_val) 101 | { 102 | 103 | set_min_val_0(nativeObj, min_val); 104 | 105 | return; 106 | } 107 | 108 | 109 | // 110 | // C++: double CvParamGrid::max_val 111 | // 112 | 113 | public double get_max_val() 114 | { 115 | 116 | double retVal = get_max_val_0(nativeObj); 117 | 118 | return retVal; 119 | } 120 | 121 | 122 | // 123 | // C++: void CvParamGrid::max_val 124 | // 125 | 126 | public void set_max_val(double max_val) 127 | { 128 | 129 | set_max_val_0(nativeObj, max_val); 130 | 131 | return; 132 | } 133 | 134 | 135 | // 136 | // C++: double CvParamGrid::step 137 | // 138 | 139 | public double get_step() 140 | { 141 | 142 | double retVal = get_step_0(nativeObj); 143 | 144 | return retVal; 145 | } 146 | 147 | 148 | // 149 | // C++: void CvParamGrid::step 150 | // 151 | 152 | public void set_step(double step) 153 | { 154 | 155 | set_step_0(nativeObj, step); 156 | 157 | return; 158 | } 159 | 160 | 161 | @Override 162 | protected void finalize() throws Throwable { 163 | delete(nativeObj); 164 | } 165 | 166 | 167 | 168 | // C++: CvParamGrid::CvParamGrid() 169 | private static native long CvParamGrid_0(); 170 | 171 | // C++: double CvParamGrid::min_val 172 | private static native double get_min_val_0(long nativeObj); 173 | 174 | // C++: void CvParamGrid::min_val 175 | private static native void set_min_val_0(long nativeObj, double min_val); 176 | 177 | // C++: double CvParamGrid::max_val 178 | private static native double get_max_val_0(long nativeObj); 179 | 180 | // C++: void CvParamGrid::max_val 181 | private static native void set_max_val_0(long nativeObj, double max_val); 182 | 183 | // C++: double CvParamGrid::step 184 | private static native double get_step_0(long nativeObj); 185 | 186 | // C++: void CvParamGrid::step 187 | private static native void set_step_0(long nativeObj, double step); 188 | 189 | // native support for java finalize() 190 | private static native void delete(long nativeObj); 191 | 192 | } 193 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/ml/CvRTParams.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | import org.opencv.core.TermCriteria; 8 | 9 | // C++: class CvRTParams 10 | /** 11 | *

Training parameters of random trees.

12 | * 13 | *

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.

17 | * 18 | * @see org.opencv.ml.CvRTParams : public CvDTreeParams 19 | */ 20 | public class CvRTParams extends CvDTreeParams { 21 | 22 | protected CvRTParams(long addr) { super(addr); } 23 | 24 | 25 | // 26 | // C++: CvRTParams::CvRTParams() 27 | // 28 | 29 | public CvRTParams() 30 | { 31 | 32 | super( CvRTParams_0() ); 33 | 34 | return; 35 | } 36 | 37 | 38 | // 39 | // C++: bool CvRTParams::calc_var_importance 40 | // 41 | 42 | public boolean get_calc_var_importance() 43 | { 44 | 45 | boolean retVal = get_calc_var_importance_0(nativeObj); 46 | 47 | return retVal; 48 | } 49 | 50 | 51 | // 52 | // C++: void CvRTParams::calc_var_importance 53 | // 54 | 55 | public void set_calc_var_importance(boolean calc_var_importance) 56 | { 57 | 58 | set_calc_var_importance_0(nativeObj, calc_var_importance); 59 | 60 | return; 61 | } 62 | 63 | 64 | // 65 | // C++: int CvRTParams::nactive_vars 66 | // 67 | 68 | public int get_nactive_vars() 69 | { 70 | 71 | int retVal = get_nactive_vars_0(nativeObj); 72 | 73 | return retVal; 74 | } 75 | 76 | 77 | // 78 | // C++: void CvRTParams::nactive_vars 79 | // 80 | 81 | public void set_nactive_vars(int nactive_vars) 82 | { 83 | 84 | set_nactive_vars_0(nativeObj, nactive_vars); 85 | 86 | return; 87 | } 88 | 89 | 90 | // 91 | // C++: TermCriteria CvRTParams::term_crit 92 | // 93 | 94 | public TermCriteria get_term_crit() 95 | { 96 | 97 | TermCriteria retVal = new TermCriteria(get_term_crit_0(nativeObj)); 98 | 99 | return retVal; 100 | } 101 | 102 | 103 | // 104 | // C++: void CvRTParams::term_crit 105 | // 106 | 107 | public void set_term_crit(TermCriteria term_crit) 108 | { 109 | 110 | set_term_crit_0(nativeObj, term_crit.type, term_crit.maxCount, term_crit.epsilon); 111 | 112 | return; 113 | } 114 | 115 | 116 | @Override 117 | protected void finalize() throws Throwable { 118 | delete(nativeObj); 119 | } 120 | 121 | 122 | 123 | // C++: CvRTParams::CvRTParams() 124 | private static native long CvRTParams_0(); 125 | 126 | // C++: bool CvRTParams::calc_var_importance 127 | private static native boolean get_calc_var_importance_0(long nativeObj); 128 | 129 | // C++: void CvRTParams::calc_var_importance 130 | private static native void set_calc_var_importance_0(long nativeObj, boolean calc_var_importance); 131 | 132 | // C++: int CvRTParams::nactive_vars 133 | private static native int get_nactive_vars_0(long nativeObj); 134 | 135 | // C++: void CvRTParams::nactive_vars 136 | private static native void set_nactive_vars_0(long nativeObj, int nactive_vars); 137 | 138 | // C++: TermCriteria CvRTParams::term_crit 139 | private static native double[] get_term_crit_0(long nativeObj); 140 | 141 | // C++: void CvRTParams::term_crit 142 | private static native void set_term_crit_0(long nativeObj, int term_crit_type, int term_crit_maxCount, double term_crit_epsilon); 143 | 144 | // native support for java finalize() 145 | private static native void delete(long nativeObj); 146 | 147 | } 148 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/ml/Ml.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | 8 | 9 | public class Ml { 10 | 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/objdetect/Objdetect.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.objdetect; 6 | 7 | import org.opencv.core.Mat; 8 | import org.opencv.core.MatOfInt; 9 | import org.opencv.core.MatOfRect; 10 | 11 | public class Objdetect { 12 | 13 | public static final int 14 | CASCADE_DO_CANNY_PRUNING = 1, 15 | CASCADE_SCALE_IMAGE = 2, 16 | CASCADE_FIND_BIGGEST_OBJECT = 4, 17 | CASCADE_DO_ROUGH_SEARCH = 8; 18 | 19 | 20 | // 21 | // C++: void drawDataMatrixCodes(Mat& image, vector_string codes, Mat corners) 22 | // 23 | 24 | // Unknown type 'vector_string' (I), skipping the function 25 | 26 | 27 | // 28 | // C++: void findDataMatrix(Mat image, vector_string& codes, Mat& corners = Mat(), vector_Mat& dmtx = vector_Mat()) 29 | // 30 | 31 | // Unknown type 'vector_string' (O), skipping the function 32 | 33 | 34 | // 35 | // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) 36 | // 37 | 38 | /** 39 | *

Groups the object candidate rectangles.

40 | * 41 | *

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.

13 | * 14 | *

class BackgroundSubtractor : public Algorithm

15 | * 16 | *

// C++ code:

17 | * 18 | * 19 | *

public:

20 | * 21 | *

virtual ~BackgroundSubtractor();

22 | * 23 | *

virtual void operator()(InputArray image, OutputArray fgmask, double 24 | * learningRate=0);

25 | * 26 | *

virtual void getBackgroundImage(OutputArray backgroundImage) const;

27 | * 28 | *

};

29 | * 30 | *

The class is only used to define the common interface for the whole family of 31 | * background/foreground segmentation algorithms. 32 | *

33 | * 34 | * @see org.opencv.video.BackgroundSubtractor : public Algorithm 35 | */ 36 | public class BackgroundSubtractor extends Algorithm { 37 | 38 | protected BackgroundSubtractor(long addr) { super(addr); } 39 | 40 | 41 | // 42 | // C++: void BackgroundSubtractor::operator ()(Mat image, Mat& fgmask, double learningRate = 0) 43 | // 44 | 45 | /** 46 | *

Computes a foreground mask.

47 | * 48 | * @param image Next video frame. 49 | * @param fgmask The output foreground mask as an 8-bit binary image. 50 | * @param learningRate a learningRate 51 | * 52 | * @see org.opencv.video.BackgroundSubtractor.operator() 53 | */ 54 | public void apply(Mat image, Mat fgmask, double learningRate) 55 | { 56 | 57 | apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate); 58 | 59 | return; 60 | } 61 | 62 | /** 63 | *

Computes a foreground mask.

64 | * 65 | * @param image Next video frame. 66 | * @param fgmask The output foreground mask as an 8-bit binary image. 67 | * 68 | * @see org.opencv.video.BackgroundSubtractor.operator() 69 | */ 70 | public void apply(Mat image, Mat fgmask) 71 | { 72 | 73 | apply_1(nativeObj, image.nativeObj, fgmask.nativeObj); 74 | 75 | return; 76 | } 77 | 78 | 79 | @Override 80 | protected void finalize() throws Throwable { 81 | delete(nativeObj); 82 | } 83 | 84 | 85 | 86 | // C++: void BackgroundSubtractor::operator ()(Mat image, Mat& fgmask, double learningRate = 0) 87 | private static native void apply_0(long nativeObj, long image_nativeObj, long fgmask_nativeObj, double learningRate); 88 | private static native void apply_1(long nativeObj, long image_nativeObj, long fgmask_nativeObj); 89 | 90 | // native support for java finalize() 91 | private static native void delete(long nativeObj); 92 | 93 | } 94 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/java/org/opencv/video/BackgroundSubtractorMOG.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.video; 6 | 7 | 8 | 9 | // C++: class BackgroundSubtractorMOG 10 | /** 11 | *

Gaussian Mixture-based Background/Foreground Segmentation Algorithm.

12 | * 13 | *

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

17 | * 18 | * @see org.opencv.video.BackgroundSubtractorMOG : public BackgroundSubtractor 19 | */ 20 | public class BackgroundSubtractorMOG extends BackgroundSubtractor { 21 | 22 | protected BackgroundSubtractorMOG(long addr) { super(addr); } 23 | 24 | 25 | // 26 | // C++: BackgroundSubtractorMOG::BackgroundSubtractorMOG() 27 | // 28 | 29 | /** 30 | *

The constructors.

31 | * 32 | *

Default constructor sets all parameters to default values.

33 | * 34 | * @see org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG 35 | */ 36 | public BackgroundSubtractorMOG() 37 | { 38 | 39 | super( BackgroundSubtractorMOG_0() ); 40 | 41 | return; 42 | } 43 | 44 | 45 | // 46 | // C++: BackgroundSubtractorMOG::BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma = 0) 47 | // 48 | 49 | /** 50 | *

The constructors.

51 | * 52 | *

Default constructor sets all parameters to default values.

53 | * 54 | * @param history Length of the history. 55 | * @param nmixtures Number of Gaussian mixtures. 56 | * @param backgroundRatio Background ratio. 57 | * @param noiseSigma Noise strength. 58 | * 59 | * @see org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG 60 | */ 61 | public BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma) 62 | { 63 | 64 | super( BackgroundSubtractorMOG_1(history, nmixtures, backgroundRatio, noiseSigma) ); 65 | 66 | return; 67 | } 68 | 69 | /** 70 | *

The constructors.

71 | * 72 | *

Default constructor sets all parameters to default values.

73 | * 74 | * @param history Length of the history. 75 | * @param nmixtures Number of Gaussian mixtures. 76 | * @param backgroundRatio Background ratio. 77 | * 78 | * @see org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG 79 | */ 80 | public BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio) 81 | { 82 | 83 | super( BackgroundSubtractorMOG_2(history, nmixtures, backgroundRatio) ); 84 | 85 | return; 86 | } 87 | 88 | 89 | @Override 90 | protected void finalize() throws Throwable { 91 | delete(nativeObj); 92 | } 93 | 94 | 95 | 96 | // C++: BackgroundSubtractorMOG::BackgroundSubtractorMOG() 97 | private static native long BackgroundSubtractorMOG_0(); 98 | 99 | // C++: BackgroundSubtractorMOG::BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma = 0) 100 | private static native long BackgroundSubtractorMOG_1(int history, int nmixtures, double backgroundRatio, double noiseSigma); 101 | private static native long BackgroundSubtractorMOG_2(int history, int nmixtures, double backgroundRatio); 102 | 103 | // native support for java finalize() 104 | private static native void delete(long nativeObj); 105 | 106 | } 107 | -------------------------------------------------------------------------------- /openCVLibrary2410/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishCoder/AndroidOpencvDemo/3d4a805bde968ca678cef3ff8b5ce8a41b292a7c/preview.gif -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | include ':openCVLibrary2410' 3 | --------------------------------------------------------------------------------