├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── CMakeLists.txt ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── cpp │ └── native-lib.cpp │ ├── java │ └── br │ │ └── com │ │ └── helpdev │ │ └── facedetect │ │ └── MainActivity.java │ ├── jniLibs │ └── res │ ├── layout │ └── activity_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 │ ├── raw │ └── haarcascade_frontalface_alt.xml │ ├── values-w820dp │ └── dimens.xml │ ├── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── backup_descriptor.xml ├── build.gradle ├── faces_detected.png ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── openCVLibrary343 ├── build.gradle ├── lint.xml └── src │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── org │ │ └── opencv │ │ └── engine │ │ └── OpenCVEngineInterface.aidl │ ├── java │ └── org │ │ └── opencv │ │ ├── android │ │ ├── AsyncServiceHelper.java │ │ ├── BaseLoaderCallback.java │ │ ├── Camera2Renderer.java │ │ ├── CameraBridgeViewBase.java │ │ ├── CameraGLRendererBase.java │ │ ├── CameraGLSurfaceView.java │ │ ├── CameraRenderer.java │ │ ├── FpsMeter.java │ │ ├── InstallCallbackInterface.java │ │ ├── JavaCamera2View.java │ │ ├── JavaCameraView.java │ │ ├── LoaderCallbackInterface.java │ │ ├── OpenCVLoader.java │ │ ├── StaticHelper.java │ │ └── Utils.java │ │ ├── calib3d │ │ ├── Calib3d.java │ │ ├── StereoBM.java │ │ ├── StereoMatcher.java │ │ └── StereoSGBM.java │ │ ├── core │ │ ├── Algorithm.java │ │ ├── Core.java │ │ ├── CvException.java │ │ ├── CvType.java │ │ ├── DMatch.java │ │ ├── KeyPoint.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 │ │ ├── MatOfRect2d.java │ │ ├── MatOfRotatedRect.java │ │ ├── Point.java │ │ ├── Point3.java │ │ ├── Range.java │ │ ├── Rect.java │ │ ├── Rect2d.java │ │ ├── RotatedRect.java │ │ ├── Scalar.java │ │ ├── Size.java │ │ ├── TermCriteria.java │ │ └── TickMeter.java │ │ ├── dnn │ │ ├── DictValue.java │ │ ├── Dnn.java │ │ ├── Layer.java │ │ └── Net.java │ │ ├── engine │ │ └── OpenCVEngineInterface.aidl │ │ ├── features2d │ │ ├── AKAZE.java │ │ ├── AgastFeatureDetector.java │ │ ├── BFMatcher.java │ │ ├── BOWImgDescriptorExtractor.java │ │ ├── BOWKMeansTrainer.java │ │ ├── BOWTrainer.java │ │ ├── BRISK.java │ │ ├── DescriptorExtractor.java │ │ ├── DescriptorMatcher.java │ │ ├── FastFeatureDetector.java │ │ ├── Feature2D.java │ │ ├── FeatureDetector.java │ │ ├── Features2d.java │ │ ├── FlannBasedMatcher.java │ │ ├── GFTTDetector.java │ │ ├── KAZE.java │ │ ├── MSER.java │ │ ├── ORB.java │ │ └── Params.java │ │ ├── imgcodecs │ │ └── Imgcodecs.java │ │ ├── imgproc │ │ ├── CLAHE.java │ │ ├── Imgproc.java │ │ ├── LineSegmentDetector.java │ │ ├── Moments.java │ │ └── Subdiv2D.java │ │ ├── ml │ │ ├── ANN_MLP.java │ │ ├── ANN_MLP_ANNEAL.java │ │ ├── Boost.java │ │ ├── DTrees.java │ │ ├── EM.java │ │ ├── KNearest.java │ │ ├── LogisticRegression.java │ │ ├── Ml.java │ │ ├── NormalBayesClassifier.java │ │ ├── ParamGrid.java │ │ ├── RTrees.java │ │ ├── SVM.java │ │ ├── SVMSGD.java │ │ ├── StatModel.java │ │ └── TrainData.java │ │ ├── objdetect │ │ ├── BaseCascadeClassifier.java │ │ ├── CascadeClassifier.java │ │ ├── HOGDescriptor.java │ │ └── Objdetect.java │ │ ├── osgi │ │ ├── OpenCVInterface.java │ │ └── OpenCVNativeLoader.java │ │ ├── photo │ │ ├── AlignExposures.java │ │ ├── AlignMTB.java │ │ ├── CalibrateCRF.java │ │ ├── CalibrateDebevec.java │ │ ├── CalibrateRobertson.java │ │ ├── MergeDebevec.java │ │ ├── MergeExposures.java │ │ ├── MergeMertens.java │ │ ├── MergeRobertson.java │ │ ├── Photo.java │ │ ├── Tonemap.java │ │ ├── TonemapDrago.java │ │ ├── TonemapDurand.java │ │ ├── TonemapMantiuk.java │ │ └── TonemapReinhard.java │ │ ├── utils │ │ └── Converters.java │ │ ├── video │ │ ├── BackgroundSubtractor.java │ │ ├── BackgroundSubtractorKNN.java │ │ ├── BackgroundSubtractorMOG2.java │ │ ├── DenseOpticalFlow.java │ │ ├── DualTVL1OpticalFlow.java │ │ ├── FarnebackOpticalFlow.java │ │ ├── KalmanFilter.java │ │ ├── SparseOpticalFlow.java │ │ ├── SparsePyrLKOpticalFlow.java │ │ └── Video.java │ │ └── videoio │ │ ├── VideoCapture.java │ │ ├── VideoWriter.java │ │ └── Videoio.java │ └── res │ └── values │ └── attrs.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/android 3 | 4 | ### Android ### 5 | # Built application files 6 | *.apk 7 | *.ap_ 8 | 9 | # Files for the ART/Dalvik VM 10 | *.dex 11 | 12 | # Java class files 13 | *.class 14 | 15 | # Generated files 16 | bin/ 17 | gen/ 18 | out/ 19 | 20 | # Gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Local configuration file (sdk path, etc) 25 | local.properties 26 | 27 | # Proguard folder generated by Eclipse 28 | proguard/ 29 | 30 | # Log Files 31 | *.log 32 | 33 | # Android Studio Navigation editor temp files 34 | .navigation/ 35 | 36 | # Android Studio captures folder 37 | captures/ 38 | 39 | # Intellij 40 | *.iml 41 | .idea/ 42 | 43 | # Keystore files 44 | *.jks 45 | 46 | # External native build folder generated in Android Studio 2.2 and later 47 | .externalNativeBuild 48 | 49 | ### Android Patch ### 50 | gen-external-apklibs 51 | -------------------------------------------------------------------------------- /.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/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 HelpDEV 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Native OpenCV in Android Studio with face detect 2 | 3 | This application is a sample of the `OpenCV` in Android. 4 | In the sample we use the [OpenCV SDK](https://sourceforge.net/projects/opencvlibrary/files/opencv-android/) 5 | to detect faces. 6 | 7 | The application has been tested with: 8 | 9 | * Android Compile SDK '28' 10 | * Android Build Tools '28.0.3' 11 | * Gradle '3.4.2' 12 | * OpenCV SDK '3.4.3' 13 | 14 | ## Configuration / Usage: 15 | 16 | Here is how to use this project to run native `OpenCV` code. 17 | 18 | * Make sure you have `Android SDK` up to date, with `NDK` installed 19 | * Download [OpenCV SDK 3.4.3](https://sourceforge.net/projects/opencvlibrary/files/opencv-android/) for Android from OpenCV.org and decompress the zip file. 20 | * Clone [this project](https://github.com/gbzarelli/AndroidFaceDetectOpenCV) 21 | * Create a symlink named `jniLibs` in `app/src/main` that points to `${YOUR_HOME_OPENCV_SDK}/sdk/native/libs` 22 | * In `app/CMakeLists.txt` change line 9 to points to `${YOUR_HOME_OPENCV_SDK}/sdk/native/jni/include` 23 | * Sync gradle 24 | * Run the application 25 | 26 | ### Notes: 27 | 28 | - The openCVLibaray343 library inside the project contains the java code of 29 | `/openCVLibrary343/src/main/java`, copied from the `${YOUR_HOME_OPENCV_SDK}/sdk/java/src` folder. 30 | 31 | - The aidl folder `/openCVLibrary343/src/main/aidl` contains the contents 32 | of `${YOUR_HOME_OPENCV_SDK}/sdk/java/src/org/opencv/engine` folder, 33 | keeping the same package. 34 | 35 | - For detection we are using a `Haar Cascade` frontal face detection 36 | inserted in `res/raw/haarcascade_frontalface_alt.xml` ( We can find other 37 | Haar at: [GitHub Link](https://github.com/opencv/opencv/tree/master/data/haarcascades) ) 38 | 39 | ---- 40 | 41 | ## Sample App Image 42 | 43 | 44 | 45 | ### References 46 | 47 | - https://github.com/leadrien/opencv_native_androidstudio -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Sets the minimum version of CMake required to build the native 3 | # library. You should either keep the default value or only pass a 4 | # value of 3.4.0 or lower. 5 | 6 | cmake_minimum_required(VERSION 3.4.1) 7 | 8 | # OpenCV stuff 9 | include_directories(/sdk/ocv_343/sdk/native/jni/include) 10 | add_library( lib_opencv SHARED IMPORTED ) 11 | set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libopencv_java3.so) 12 | 13 | # Creates and names a library, sets it as either STATIC 14 | # or SHARED, and provides the relative paths to its source code. 15 | # You can define multiple libraries, and CMake builds it for you. 16 | # Gradle automatically packages shared libraries with your APK. 17 | 18 | add_library( # Sets the name of the library. 19 | native-lib 20 | 21 | # Sets the library as a shared library. 22 | SHARED 23 | 24 | # Provides a relative path to your source file(s). 25 | # Associated headers in the same location as their source 26 | # file are automatically included. 27 | src/main/cpp/native-lib.cpp ) 28 | 29 | 30 | # Searches for a specified prebuilt library and stores the path as a 31 | # variable. Because system libraries are included in the search path by 32 | # default, you only need to specify the name of the public NDK library 33 | # you want to add. CMake verifies that the library exists before 34 | # completing its build. 35 | 36 | find_library( # Sets the name of the path variable. 37 | log-lib 38 | 39 | # Specifies the name of the NDK library that 40 | # you want CMake to locate. 41 | log ) 42 | 43 | # Specifies libraries CMake should link to your target library. You 44 | # can link multiple libraries, such as libraries you define in the 45 | # build script, prebuilt third-party libraries, or system libraries. 46 | 47 | target_link_libraries( # Specifies the target library. 48 | native-lib 49 | 50 | # OpenCV lib 51 | lib_opencv 52 | 53 | # Links the target library to the log library 54 | # included in the NDK. 55 | ${log-lib} ) 56 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | buildToolsVersion "28.0.3" 6 | 7 | defaultConfig { 8 | applicationId "br.com.helpdev.facedetect" 9 | minSdkVersion 19 10 | targetSdkVersion 28 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | externalNativeBuild { 15 | cmake { 16 | cppFlags "-frtti -fexceptions" 17 | abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' 18 | } 19 | } 20 | } 21 | sourceSets { 22 | main { 23 | jniLibs.srcDirs = ['src/main/jniLibs'] 24 | } 25 | } 26 | buildTypes { 27 | release { 28 | minifyEnabled false 29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | externalNativeBuild { 33 | cmake { 34 | path "CMakeLists.txt" 35 | } 36 | } 37 | } 38 | 39 | dependencies { 40 | implementation 'com.android.support:appcompat-v7:28.0.0' 41 | implementation project(':openCVLibrary343') 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 /home/adrien/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/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/cpp/native-lib.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | using namespace cv; 9 | 10 | extern "C" 11 | { 12 | void JNICALL Java_ch_hepia_iti_opencvnativeandroidstudio_MainActivity_salt(JNIEnv *env, jobject instance, 13 | jlong matAddrGray, 14 | jint nbrElem) { 15 | Mat &mGr = *(Mat *) matAddrGray; 16 | for (int k = 0; k < nbrElem; k++) { 17 | int i = rand() % mGr.cols; 18 | int j = rand() % mGr.rows; 19 | mGr.at(j, i) = 255; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/jniLibs: -------------------------------------------------------------------------------- 1 | /sdk/ocv_343/sdk/native/libs/ -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 17 | 18 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gbzarelli/AndroidFaceDetectOpenCV/aeb4d4aeaf5ab2cbcdc51a1cfb01ffd31dc00517/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gbzarelli/AndroidFaceDetectOpenCV/aeb4d4aeaf5ab2cbcdc51a1cfb01ffd31dc00517/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gbzarelli/AndroidFaceDetectOpenCV/aeb4d4aeaf5ab2cbcdc51a1cfb01ffd31dc00517/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gbzarelli/AndroidFaceDetectOpenCV/aeb4d4aeaf5ab2cbcdc51a1cfb01ffd31dc00517/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gbzarelli/AndroidFaceDetectOpenCV/aeb4d4aeaf5ab2cbcdc51a1cfb01ffd31dc00517/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 | OpenCV - Facedetect sample 3 | FACES DETECTADAS: %d 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_descriptor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /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 | google() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.4.2' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | jcenter() 19 | google() 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } 26 | -------------------------------------------------------------------------------- /faces_detected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gbzarelli/AndroidFaceDetectOpenCV/aeb4d4aeaf5ab2cbcdc51a1cfb01ffd31dc00517/faces_detected.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Thu Dec 21 13:02:41 BRST 2017 16 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gbzarelli/AndroidFaceDetectOpenCV/aeb4d4aeaf5ab2cbcdc51a1cfb01ffd31dc00517/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 17 10:16:35 BRT 2019 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-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /openCVLibrary343/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 28 5 | 6 | defaultConfig { 7 | minSdkVersion 19 8 | targetSdkVersion 28 9 | } 10 | 11 | buildTypes { 12 | release { 13 | minifyEnabled false 14 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /openCVLibrary343/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/android/CameraGLSurfaceView.java: -------------------------------------------------------------------------------- 1 | package org.opencv.android; 2 | 3 | import org.opencv.R; 4 | 5 | import android.content.Context; 6 | import android.content.res.TypedArray; 7 | import android.opengl.GLSurfaceView; 8 | import android.util.AttributeSet; 9 | import android.util.Log; 10 | import android.view.SurfaceHolder; 11 | 12 | public class CameraGLSurfaceView extends GLSurfaceView { 13 | 14 | private static final String LOGTAG = "CameraGLSurfaceView"; 15 | 16 | public interface CameraTextureListener { 17 | /** 18 | * This method is invoked when camera preview has started. After this method is invoked 19 | * the frames will start to be delivered to client via the onCameraFrame() callback. 20 | * @param width - the width of the frames that will be delivered 21 | * @param height - the height of the frames that will be delivered 22 | */ 23 | public void onCameraViewStarted(int width, int height); 24 | 25 | /** 26 | * This method is invoked when camera preview has been stopped for some reason. 27 | * No frames will be delivered via onCameraFrame() callback after this method is called. 28 | */ 29 | public void onCameraViewStopped(); 30 | 31 | /** 32 | * This method is invoked when a new preview frame from Camera is ready. 33 | * @param texIn - the OpenGL texture ID that contains frame in RGBA format 34 | * @param texOut - the OpenGL texture ID that can be used to store modified frame image t display 35 | * @param width - the width of the frame 36 | * @param height - the height of the frame 37 | * @return `true` if `texOut` should be displayed, `false` - to show `texIn` 38 | */ 39 | public boolean onCameraTexture(int texIn, int texOut, int width, int height); 40 | }; 41 | 42 | private CameraTextureListener mTexListener; 43 | private CameraGLRendererBase mRenderer; 44 | 45 | public CameraGLSurfaceView(Context context, AttributeSet attrs) { 46 | super(context, attrs); 47 | 48 | TypedArray styledAttrs = getContext().obtainStyledAttributes(attrs, R.styleable.CameraBridgeViewBase); 49 | int cameraIndex = styledAttrs.getInt(R.styleable.CameraBridgeViewBase_camera_id, -1); 50 | styledAttrs.recycle(); 51 | 52 | if(android.os.Build.VERSION.SDK_INT >= 21) 53 | mRenderer = new Camera2Renderer(this); 54 | else 55 | mRenderer = new CameraRenderer(this); 56 | 57 | setCameraIndex(cameraIndex); 58 | 59 | setEGLContextClientVersion(2); 60 | setRenderer(mRenderer); 61 | setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); 62 | } 63 | 64 | public void setCameraTextureListener(CameraTextureListener texListener) 65 | { 66 | mTexListener = texListener; 67 | } 68 | 69 | public CameraTextureListener getCameraTextureListener() 70 | { 71 | return mTexListener; 72 | } 73 | 74 | public void setCameraIndex(int cameraIndex) { 75 | mRenderer.setCameraIndex(cameraIndex); 76 | } 77 | 78 | public void setMaxCameraPreviewSize(int maxWidth, int maxHeight) { 79 | mRenderer.setMaxCameraPreviewSize(maxWidth, maxHeight); 80 | } 81 | 82 | @Override 83 | public void surfaceCreated(SurfaceHolder holder) { 84 | super.surfaceCreated(holder); 85 | } 86 | 87 | @Override 88 | public void surfaceDestroyed(SurfaceHolder holder) { 89 | mRenderer.mHaveSurface = false; 90 | super.surfaceDestroyed(holder); 91 | } 92 | 93 | @Override 94 | public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { 95 | super.surfaceChanged(holder, format, w, h); 96 | } 97 | 98 | @Override 99 | public void onResume() { 100 | Log.i(LOGTAG, "onResume"); 101 | super.onResume(); 102 | mRenderer.onResume(); 103 | } 104 | 105 | @Override 106 | public void onPause() { 107 | Log.i(LOGTAG, "onPause"); 108 | mRenderer.onPause(); 109 | super.onPause(); 110 | } 111 | 112 | public void enableView() { 113 | mRenderer.enableView(); 114 | } 115 | 116 | public void disableView() { 117 | mRenderer.disableView(); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | * OpenCV Library version 2.4.11. 57 | */ 58 | public static final String OPENCV_VERSION_2_4_11 = "2.4.11"; 59 | 60 | /** 61 | * OpenCV Library version 2.4.12. 62 | */ 63 | public static final String OPENCV_VERSION_2_4_12 = "2.4.12"; 64 | 65 | /** 66 | * OpenCV Library version 2.4.13. 67 | */ 68 | public static final String OPENCV_VERSION_2_4_13 = "2.4.13"; 69 | 70 | /** 71 | * OpenCV Library version 3.0.0. 72 | */ 73 | public static final String OPENCV_VERSION_3_0_0 = "3.0.0"; 74 | 75 | /** 76 | * OpenCV Library version 3.1.0. 77 | */ 78 | public static final String OPENCV_VERSION_3_1_0 = "3.1.0"; 79 | 80 | /** 81 | * OpenCV Library version 3.2.0. 82 | */ 83 | public static final String OPENCV_VERSION_3_2_0 = "3.2.0"; 84 | 85 | /** 86 | * OpenCV Library version 3.3.0. 87 | */ 88 | public static final String OPENCV_VERSION_3_3_0 = "3.3.0"; 89 | 90 | /** 91 | * OpenCV Library version 3.4.0. 92 | */ 93 | public static final String OPENCV_VERSION_3_4_0 = "3.4.0"; 94 | 95 | /** 96 | * Current OpenCV Library version 97 | */ 98 | public static final String OPENCV_VERSION = "3.4.3"; 99 | 100 | 101 | /** 102 | * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java"). 103 | * @return Returns true is initialization of OpenCV was successful. 104 | */ 105 | public static boolean initDebug() 106 | { 107 | return StaticHelper.initOpenCV(false); 108 | } 109 | 110 | /** 111 | * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java"). 112 | * @param InitCuda load and initialize CUDA runtime libraries. 113 | * @return Returns true is initialization of OpenCV was successful. 114 | */ 115 | public static boolean initDebug(boolean InitCuda) 116 | { 117 | return StaticHelper.initOpenCV(InitCuda); 118 | } 119 | 120 | /** 121 | * Loads and initializes OpenCV library using OpenCV Engine service. 122 | * @param Version OpenCV library version. 123 | * @param AppContext application context for connecting to the service. 124 | * @param Callback object, that implements LoaderCallbackInterface for handling the connection status. 125 | * @return Returns true if initialization of OpenCV is successful. 126 | */ 127 | public static boolean initAsync(String Version, Context AppContext, 128 | LoaderCallbackInterface Callback) 129 | { 130 | return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /openCVLibrary343/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_java3"); 96 | } 97 | 98 | return result; 99 | } 100 | 101 | private static final String TAG = "OpenCV/StaticHelper"; 102 | 103 | private static native String getLibraryList(); 104 | } 105 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/Algorithm.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.core; 5 | 6 | import java.lang.String; 7 | 8 | // C++: class Algorithm 9 | //javadoc: Algorithm 10 | 11 | public class Algorithm { 12 | 13 | protected final long nativeObj; 14 | protected Algorithm(long addr) { nativeObj = addr; } 15 | 16 | public long getNativeObjAddr() { return nativeObj; } 17 | 18 | // internal usage only 19 | public static Algorithm __fromPtr__(long addr) { return new Algorithm(addr); } 20 | 21 | // 22 | // C++: String cv::Algorithm::getDefaultName() 23 | // 24 | 25 | //javadoc: Algorithm::getDefaultName() 26 | public String getDefaultName() 27 | { 28 | 29 | String retVal = getDefaultName_0(nativeObj); 30 | 31 | return retVal; 32 | } 33 | 34 | 35 | // 36 | // C++: bool cv::Algorithm::empty() 37 | // 38 | 39 | //javadoc: Algorithm::empty() 40 | public boolean empty() 41 | { 42 | 43 | boolean retVal = empty_0(nativeObj); 44 | 45 | return retVal; 46 | } 47 | 48 | 49 | // 50 | // C++: void cv::Algorithm::clear() 51 | // 52 | 53 | //javadoc: Algorithm::clear() 54 | public void clear() 55 | { 56 | 57 | clear_0(nativeObj); 58 | 59 | return; 60 | } 61 | 62 | 63 | // 64 | // C++: void cv::Algorithm::read(FileNode fn) 65 | // 66 | 67 | // Unknown type 'FileNode' (I), skipping the function 68 | 69 | 70 | // 71 | // C++: void cv::Algorithm::save(String filename) 72 | // 73 | 74 | //javadoc: Algorithm::save(filename) 75 | public void save(String filename) 76 | { 77 | 78 | save_0(nativeObj, filename); 79 | 80 | return; 81 | } 82 | 83 | 84 | // 85 | // C++: void cv::Algorithm::write(Ptr_FileStorage fs, String name = String()) 86 | // 87 | 88 | // Unknown type 'Ptr_FileStorage' (I), skipping the function 89 | 90 | 91 | @Override 92 | protected void finalize() throws Throwable { 93 | delete(nativeObj); 94 | } 95 | 96 | 97 | 98 | // C++: String cv::Algorithm::getDefaultName() 99 | private static native String getDefaultName_0(long nativeObj); 100 | 101 | // C++: bool cv::Algorithm::empty() 102 | private static native boolean empty_0(long nativeObj); 103 | 104 | // C++: void cv::Algorithm::clear() 105 | private static native void clear_0(long nativeObj); 106 | 107 | // C++: void cv::Algorithm::save(String filename) 108 | private static native void save_0(long nativeObj, String filename); 109 | 110 | // native support for java finalize() 111 | private static native void delete(long nativeObj); 112 | 113 | } 114 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/DMatch.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 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 | // javadoc: DMatch::distance 25 | public float distance; 26 | 27 | // javadoc: DMatch::DMatch() 28 | public DMatch() { 29 | this(-1, -1, Float.MAX_VALUE); 30 | } 31 | 32 | // javadoc: DMatch::DMatch(_queryIdx, _trainIdx, _distance) 33 | public DMatch(int _queryIdx, int _trainIdx, float _distance) { 34 | queryIdx = _queryIdx; 35 | trainIdx = _trainIdx; 36 | imgIdx = -1; 37 | distance = _distance; 38 | } 39 | 40 | // javadoc: DMatch::DMatch(_queryIdx, _trainIdx, _imgIdx, _distance) 41 | public DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance) { 42 | queryIdx = _queryIdx; 43 | trainIdx = _trainIdx; 44 | imgIdx = _imgIdx; 45 | distance = _distance; 46 | } 47 | 48 | public boolean lessThan(DMatch it) { 49 | return distance < it.distance; 50 | } 51 | 52 | @Override 53 | public String toString() { 54 | return "DMatch [queryIdx=" + queryIdx + ", trainIdx=" + trainIdx 55 | + ", imgIdx=" + imgIdx + ", distance=" + distance + "]"; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/KeyPoint.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | import org.opencv.core.Point; 4 | 5 | //javadoc: KeyPoint 6 | public class KeyPoint { 7 | 8 | /** 9 | * Coordinates of the keypoint. 10 | */ 11 | public Point pt; 12 | /** 13 | * Diameter of the useful keypoint adjacent area. 14 | */ 15 | public float size; 16 | /** 17 | * Computed orientation of the keypoint (-1 if not applicable). 18 | */ 19 | public float angle; 20 | /** 21 | * The response, by which the strongest keypoints have been selected. Can 22 | * be used for further sorting or subsampling. 23 | */ 24 | public float response; 25 | /** 26 | * Octave (pyramid layer), from which the keypoint has been extracted. 27 | */ 28 | public int octave; 29 | /** 30 | * Object ID, that can be used to cluster keypoints by an object they 31 | * belong to. 32 | */ 33 | public int class_id; 34 | 35 | // javadoc:KeyPoint::KeyPoint(x,y,_size,_angle,_response,_octave,_class_id) 36 | public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave, int _class_id) 37 | { 38 | pt = new Point(x, y); 39 | size = _size; 40 | angle = _angle; 41 | response = _response; 42 | octave = _octave; 43 | class_id = _class_id; 44 | } 45 | 46 | // javadoc: KeyPoint::KeyPoint() 47 | public KeyPoint() 48 | { 49 | this(0, 0, 0, -1, 0, 0, -1); 50 | } 51 | 52 | // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response, _octave) 53 | public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave) 54 | { 55 | this(x, y, _size, _angle, _response, _octave, -1); 56 | } 57 | 58 | // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response) 59 | public KeyPoint(float x, float y, float _size, float _angle, float _response) 60 | { 61 | this(x, y, _size, _angle, _response, 0, -1); 62 | } 63 | 64 | // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle) 65 | public KeyPoint(float x, float y, float _size, float _angle) 66 | { 67 | this(x, y, _size, _angle, 0, 0, -1); 68 | } 69 | 70 | // javadoc: KeyPoint::KeyPoint(x, y, _size) 71 | public KeyPoint(float x, float y, float _size) 72 | { 73 | this(x, y, _size, -1, 0, 0, -1); 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | return "KeyPoint [pt=" + pt + ", size=" + size + ", angle=" + angle 79 | + ", response=" + response + ", octave=" + octave 80 | + ", class_id=" + class_id + "]"; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /openCVLibrary343/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 MatOfByte(int offset, int length, byte...a) { 39 | super(); 40 | fromArray(offset, length, a); 41 | } 42 | 43 | public void alloc(int elemNumber) { 44 | if(elemNumber>0) 45 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); 46 | } 47 | 48 | public void fromArray(byte...a) { 49 | if(a==null || a.length==0) 50 | return; 51 | int num = a.length / _channels; 52 | alloc(num); 53 | put(0, 0, a); //TODO: check ret val! 54 | } 55 | 56 | public void fromArray(int offset, int length, byte...a) { 57 | if (offset < 0) 58 | throw new IllegalArgumentException("offset < 0"); 59 | if (a == null) 60 | throw new NullPointerException(); 61 | if (length < 0 || length + offset > a.length) 62 | throw new IllegalArgumentException("invalid 'length' parameter: " + Integer.toString(length)); 63 | if (a.length == 0) 64 | return; 65 | int num = length / _channels; 66 | alloc(num); 67 | put(0, 0, a, offset, length); //TODO: check ret val! 68 | } 69 | 70 | public byte[] toArray() { 71 | int num = checkVector(_channels, _depth); 72 | if(num < 0) 73 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); 74 | byte[] a = new byte[num * _channels]; 75 | if(num == 0) 76 | return a; 77 | get(0, 0, a); //TODO: check ret val! 78 | return a; 79 | } 80 | 81 | public void fromList(List lb) { 82 | if(lb==null || lb.size()==0) 83 | return; 84 | Byte ab[] = lb.toArray(new Byte[0]); 85 | byte a[] = new byte[ab.length]; 86 | for(int i=0; i toList() { 92 | byte[] a = toArray(); 93 | Byte ab[] = new Byte[a.length]; 94 | 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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/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 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/MatOfRect2d.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | 7 | public class MatOfRect2d extends Mat { 8 | // 64FC4 9 | private static final int _depth = CvType.CV_64F; 10 | private static final int _channels = 4; 11 | 12 | public MatOfRect2d() { 13 | super(); 14 | } 15 | 16 | protected MatOfRect2d(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 MatOfRect2d fromNativeAddr(long addr) { 24 | return new MatOfRect2d(addr); 25 | } 26 | 27 | public MatOfRect2d(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 MatOfRect2d(Rect2d...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(Rect2d...a) { 45 | if(a==null || a.length==0) 46 | return; 47 | int num = a.length; 48 | alloc(num); 49 | double buff[] = new double[num * _channels]; 50 | for(int i=0; i lr) { 73 | Rect2d ap[] = lr.toArray(new Rect2d[0]); 74 | fromArray(ap); 75 | } 76 | 77 | public List toList() { 78 | Rect2d[] ar = toArray(); 79 | return Arrays.asList(ar); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/MatOfRotatedRect.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | import org.opencv.core.RotatedRect; 7 | 8 | 9 | 10 | public class MatOfRotatedRect extends Mat { 11 | // 32FC5 12 | private static final int _depth = CvType.CV_32F; 13 | private static final int _channels = 5; 14 | 15 | public MatOfRotatedRect() { 16 | super(); 17 | } 18 | 19 | protected MatOfRotatedRect(long addr) { 20 | super(addr); 21 | if( !empty() && checkVector(_channels, _depth) < 0 ) 22 | throw new IllegalArgumentException("Incompatible Mat"); 23 | //FIXME: do we need release() here? 24 | } 25 | 26 | public static MatOfRotatedRect fromNativeAddr(long addr) { 27 | return new MatOfRotatedRect(addr); 28 | } 29 | 30 | public MatOfRotatedRect(Mat m) { 31 | super(m, Range.all()); 32 | if( !empty() && checkVector(_channels, _depth) < 0 ) 33 | throw new IllegalArgumentException("Incompatible Mat"); 34 | //FIXME: do we need release() here? 35 | } 36 | 37 | public MatOfRotatedRect(RotatedRect...a) { 38 | super(); 39 | fromArray(a); 40 | } 41 | 42 | public void alloc(int elemNumber) { 43 | if(elemNumber>0) 44 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); 45 | } 46 | 47 | public void fromArray(RotatedRect...a) { 48 | if(a==null || a.length==0) 49 | return; 50 | int num = a.length; 51 | alloc(num); 52 | float buff[] = new float[num * _channels]; 53 | for(int i=0; i lr) { 78 | RotatedRect ap[] = lr.toArray(new RotatedRect[0]); 79 | fromArray(ap); 80 | } 81 | 82 | public List toList() { 83 | RotatedRect[] ar = toArray(); 84 | return Arrays.asList(ar); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/Point.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:Point_ 4 | public class Point { 5 | 6 | public double x, y; 7 | 8 | public Point(double x, double y) { 9 | this.x = x; 10 | this.y = y; 11 | } 12 | 13 | public Point() { 14 | this(0, 0); 15 | } 16 | 17 | public Point(double[] vals) { 18 | this(); 19 | set(vals); 20 | } 21 | 22 | public void set(double[] vals) { 23 | if (vals != null) { 24 | x = vals.length > 0 ? vals[0] : 0; 25 | y = vals.length > 1 ? vals[1] : 0; 26 | } else { 27 | x = 0; 28 | y = 0; 29 | } 30 | } 31 | 32 | public Point clone() { 33 | return new Point(x, y); 34 | } 35 | 36 | public double dot(Point p) { 37 | return x * p.x + y * p.y; 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | final int prime = 31; 43 | int result = 1; 44 | long temp; 45 | temp = Double.doubleToLongBits(x); 46 | result = prime * result + (int) (temp ^ (temp >>> 32)); 47 | temp = Double.doubleToLongBits(y); 48 | result = prime * result + (int) (temp ^ (temp >>> 32)); 49 | return result; 50 | } 51 | 52 | @Override 53 | public boolean equals(Object obj) { 54 | if (this == obj) return true; 55 | if (!(obj instanceof Point)) return false; 56 | Point it = (Point) obj; 57 | return x == it.x && y == it.y; 58 | } 59 | 60 | public boolean inside(Rect r) { 61 | return r.contains(this); 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return "{" + x + ", " + y + "}"; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/Point3.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:Point3_ 4 | public class Point3 { 5 | 6 | public double x, y, z; 7 | 8 | public Point3(double x, double y, double z) { 9 | this.x = x; 10 | this.y = y; 11 | this.z = z; 12 | } 13 | 14 | public Point3() { 15 | this(0, 0, 0); 16 | } 17 | 18 | public Point3(Point p) { 19 | x = p.x; 20 | y = p.y; 21 | z = 0; 22 | } 23 | 24 | public Point3(double[] vals) { 25 | this(); 26 | set(vals); 27 | } 28 | 29 | public void set(double[] vals) { 30 | if (vals != null) { 31 | x = vals.length > 0 ? vals[0] : 0; 32 | y = vals.length > 1 ? vals[1] : 0; 33 | z = vals.length > 2 ? vals[2] : 0; 34 | } else { 35 | x = 0; 36 | y = 0; 37 | z = 0; 38 | } 39 | } 40 | 41 | public Point3 clone() { 42 | return new Point3(x, y, z); 43 | } 44 | 45 | public double dot(Point3 p) { 46 | return x * p.x + y * p.y + z * p.z; 47 | } 48 | 49 | public Point3 cross(Point3 p) { 50 | return new Point3(y * p.z - z * p.y, z * p.x - x * p.z, x * p.y - y * p.x); 51 | } 52 | 53 | @Override 54 | public int hashCode() { 55 | final int prime = 31; 56 | int result = 1; 57 | long temp; 58 | temp = Double.doubleToLongBits(x); 59 | result = prime * result + (int) (temp ^ (temp >>> 32)); 60 | temp = Double.doubleToLongBits(y); 61 | result = prime * result + (int) (temp ^ (temp >>> 32)); 62 | temp = Double.doubleToLongBits(z); 63 | result = prime * result + (int) (temp ^ (temp >>> 32)); 64 | return result; 65 | } 66 | 67 | @Override 68 | public boolean equals(Object obj) { 69 | if (this == obj) return true; 70 | if (!(obj instanceof Point3)) return false; 71 | Point3 it = (Point3) obj; 72 | return x == it.x && y == it.y && z == it.z; 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return "{" + x + ", " + y + ", " + z + "}"; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/Range.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:Range 4 | public class Range { 5 | 6 | public int start, end; 7 | 8 | public Range(int s, int e) { 9 | this.start = s; 10 | this.end = e; 11 | } 12 | 13 | public Range() { 14 | this(0, 0); 15 | } 16 | 17 | public Range(double[] vals) { 18 | set(vals); 19 | } 20 | 21 | public void set(double[] vals) { 22 | if (vals != null) { 23 | start = vals.length > 0 ? (int) vals[0] : 0; 24 | end = vals.length > 1 ? (int) vals[1] : 0; 25 | } else { 26 | start = 0; 27 | end = 0; 28 | } 29 | 30 | } 31 | 32 | public int size() { 33 | return empty() ? 0 : end - start; 34 | } 35 | 36 | public boolean empty() { 37 | return end <= start; 38 | } 39 | 40 | public static Range all() { 41 | return new Range(Integer.MIN_VALUE, Integer.MAX_VALUE); 42 | } 43 | 44 | public Range intersection(Range r1) { 45 | Range r = new Range(Math.max(r1.start, this.start), Math.min(r1.end, this.end)); 46 | r.end = Math.max(r.end, r.start); 47 | return r; 48 | } 49 | 50 | public Range shift(int delta) { 51 | return new Range(start + delta, end + delta); 52 | } 53 | 54 | public Range clone() { 55 | return new Range(start, end); 56 | } 57 | 58 | @Override 59 | public int hashCode() { 60 | final int prime = 31; 61 | int result = 1; 62 | long temp; 63 | temp = Double.doubleToLongBits(start); 64 | result = prime * result + (int) (temp ^ (temp >>> 32)); 65 | temp = Double.doubleToLongBits(end); 66 | result = prime * result + (int) (temp ^ (temp >>> 32)); 67 | return result; 68 | } 69 | 70 | @Override 71 | public boolean equals(Object obj) { 72 | if (this == obj) return true; 73 | if (!(obj instanceof Range)) return false; 74 | Range it = (Range) obj; 75 | return start == it.start && end == it.end; 76 | } 77 | 78 | @Override 79 | public String toString() { 80 | return "[" + start + ", " + end + ")"; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/Rect.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:Rect_ 4 | public class Rect { 5 | 6 | public int x, y, width, height; 7 | 8 | public Rect(int x, int y, int width, int height) { 9 | this.x = x; 10 | this.y = y; 11 | this.width = width; 12 | this.height = height; 13 | } 14 | 15 | public Rect() { 16 | this(0, 0, 0, 0); 17 | } 18 | 19 | public Rect(Point p1, Point p2) { 20 | x = (int) (p1.x < p2.x ? p1.x : p2.x); 21 | y = (int) (p1.y < p2.y ? p1.y : p2.y); 22 | width = (int) (p1.x > p2.x ? p1.x : p2.x) - x; 23 | height = (int) (p1.y > p2.y ? p1.y : p2.y) - y; 24 | } 25 | 26 | public Rect(Point p, Size s) { 27 | this((int) p.x, (int) p.y, (int) s.width, (int) s.height); 28 | } 29 | 30 | public Rect(double[] vals) { 31 | set(vals); 32 | } 33 | 34 | public void set(double[] vals) { 35 | if (vals != null) { 36 | x = vals.length > 0 ? (int) vals[0] : 0; 37 | y = vals.length > 1 ? (int) vals[1] : 0; 38 | width = vals.length > 2 ? (int) vals[2] : 0; 39 | height = vals.length > 3 ? (int) vals[3] : 0; 40 | } else { 41 | x = 0; 42 | y = 0; 43 | width = 0; 44 | height = 0; 45 | } 46 | } 47 | 48 | public Rect clone() { 49 | return new Rect(x, y, width, height); 50 | } 51 | 52 | public Point tl() { 53 | return new Point(x, y); 54 | } 55 | 56 | public Point br() { 57 | return new Point(x + width, y + height); 58 | } 59 | 60 | public Size size() { 61 | return new Size(width, height); 62 | } 63 | 64 | public double area() { 65 | return width * height; 66 | } 67 | 68 | public boolean empty() { 69 | return width <= 0 || height <= 0; 70 | } 71 | 72 | public boolean contains(Point p) { 73 | return x <= p.x && p.x < x + width && y <= p.y && p.y < y + height; 74 | } 75 | 76 | @Override 77 | public int hashCode() { 78 | final int prime = 31; 79 | int result = 1; 80 | long temp; 81 | temp = Double.doubleToLongBits(height); 82 | result = prime * result + (int) (temp ^ (temp >>> 32)); 83 | temp = Double.doubleToLongBits(width); 84 | result = prime * result + (int) (temp ^ (temp >>> 32)); 85 | temp = Double.doubleToLongBits(x); 86 | result = prime * result + (int) (temp ^ (temp >>> 32)); 87 | temp = Double.doubleToLongBits(y); 88 | result = prime * result + (int) (temp ^ (temp >>> 32)); 89 | return result; 90 | } 91 | 92 | @Override 93 | public boolean equals(Object obj) { 94 | if (this == obj) return true; 95 | if (!(obj instanceof Rect)) return false; 96 | Rect it = (Rect) obj; 97 | return x == it.x && y == it.y && width == it.width && height == it.height; 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | return "{" + x + ", " + y + ", " + width + "x" + height + "}"; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/Rect2d.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:Rect2d_ 4 | public class Rect2d { 5 | 6 | public double x, y, width, height; 7 | 8 | public Rect2d(double x, double y, double width, double height) { 9 | this.x = x; 10 | this.y = y; 11 | this.width = width; 12 | this.height = height; 13 | } 14 | 15 | public Rect2d() { 16 | this(0, 0, 0, 0); 17 | } 18 | 19 | public Rect2d(Point p1, Point p2) { 20 | x = (double) (p1.x < p2.x ? p1.x : p2.x); 21 | y = (double) (p1.y < p2.y ? p1.y : p2.y); 22 | width = (double) (p1.x > p2.x ? p1.x : p2.x) - x; 23 | height = (double) (p1.y > p2.y ? p1.y : p2.y) - y; 24 | } 25 | 26 | public Rect2d(Point p, Size s) { 27 | this((double) p.x, (double) p.y, (double) s.width, (double) s.height); 28 | } 29 | 30 | public Rect2d(double[] vals) { 31 | set(vals); 32 | } 33 | 34 | public void set(double[] vals) { 35 | if (vals != null) { 36 | x = vals.length > 0 ? (double) vals[0] : 0; 37 | y = vals.length > 1 ? (double) vals[1] : 0; 38 | width = vals.length > 2 ? (double) vals[2] : 0; 39 | height = vals.length > 3 ? (double) vals[3] : 0; 40 | } else { 41 | x = 0; 42 | y = 0; 43 | width = 0; 44 | height = 0; 45 | } 46 | } 47 | 48 | public Rect2d clone() { 49 | return new Rect2d(x, y, width, height); 50 | } 51 | 52 | public Point tl() { 53 | return new Point(x, y); 54 | } 55 | 56 | public Point br() { 57 | return new Point(x + width, y + height); 58 | } 59 | 60 | public Size size() { 61 | return new Size(width, height); 62 | } 63 | 64 | public double area() { 65 | return width * height; 66 | } 67 | 68 | public boolean empty() { 69 | return width <= 0 || height <= 0; 70 | } 71 | 72 | public boolean contains(Point p) { 73 | return x <= p.x && p.x < x + width && y <= p.y && p.y < y + height; 74 | } 75 | 76 | @Override 77 | public int hashCode() { 78 | final int prime = 31; 79 | int result = 1; 80 | long temp; 81 | temp = Double.doubleToLongBits(height); 82 | result = prime * result + (int) (temp ^ (temp >>> 32)); 83 | temp = Double.doubleToLongBits(width); 84 | result = prime * result + (int) (temp ^ (temp >>> 32)); 85 | temp = Double.doubleToLongBits(x); 86 | result = prime * result + (int) (temp ^ (temp >>> 32)); 87 | temp = Double.doubleToLongBits(y); 88 | result = prime * result + (int) (temp ^ (temp >>> 32)); 89 | return result; 90 | } 91 | 92 | @Override 93 | public boolean equals(Object obj) { 94 | if (this == obj) return true; 95 | if (!(obj instanceof Rect2d)) return false; 96 | Rect2d it = (Rect2d) obj; 97 | return x == it.x && y == it.y && width == it.width && height == it.height; 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | return "{" + x + ", " + y + ", " + width + "x" + height + "}"; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/RotatedRect.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:RotatedRect_ 4 | public class RotatedRect { 5 | 6 | public Point center; 7 | public Size size; 8 | public double angle; 9 | 10 | public RotatedRect() { 11 | this.center = new Point(); 12 | this.size = new Size(); 13 | this.angle = 0; 14 | } 15 | 16 | public RotatedRect(Point c, Size s, double a) { 17 | this.center = c.clone(); 18 | this.size = s.clone(); 19 | this.angle = a; 20 | } 21 | 22 | public RotatedRect(double[] vals) { 23 | this(); 24 | set(vals); 25 | } 26 | 27 | public void set(double[] vals) { 28 | if (vals != null) { 29 | center.x = vals.length > 0 ? (double) vals[0] : 0; 30 | center.y = vals.length > 1 ? (double) vals[1] : 0; 31 | size.width = vals.length > 2 ? (double) vals[2] : 0; 32 | size.height = vals.length > 3 ? (double) vals[3] : 0; 33 | angle = vals.length > 4 ? (double) vals[4] : 0; 34 | } else { 35 | center.x = 0; 36 | center.x = 0; 37 | size.width = 0; 38 | size.height = 0; 39 | angle = 0; 40 | } 41 | } 42 | 43 | public void points(Point pt[]) 44 | { 45 | double _angle = angle * Math.PI / 180.0; 46 | double b = (double) Math.cos(_angle) * 0.5f; 47 | double a = (double) Math.sin(_angle) * 0.5f; 48 | 49 | pt[0] = new Point( 50 | center.x - a * size.height - b * size.width, 51 | center.y + b * size.height - a * size.width); 52 | 53 | pt[1] = new Point( 54 | center.x + a * size.height - b * size.width, 55 | center.y - b * size.height - a * size.width); 56 | 57 | pt[2] = new Point( 58 | 2 * center.x - pt[0].x, 59 | 2 * center.y - pt[0].y); 60 | 61 | pt[3] = new Point( 62 | 2 * center.x - pt[1].x, 63 | 2 * center.y - pt[1].y); 64 | } 65 | 66 | public Rect boundingRect() 67 | { 68 | Point pt[] = new Point[4]; 69 | points(pt); 70 | 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)), 71 | (int) Math.floor(Math.min(Math.min(Math.min(pt[0].y, pt[1].y), pt[2].y), pt[3].y)), 72 | (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].x, pt[1].x), pt[2].x), pt[3].x)), 73 | (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].y, pt[1].y), pt[2].y), pt[3].y))); 74 | r.width -= r.x - 1; 75 | r.height -= r.y - 1; 76 | return r; 77 | } 78 | 79 | public RotatedRect clone() { 80 | return new RotatedRect(center, size, angle); 81 | } 82 | 83 | @Override 84 | public int hashCode() { 85 | final int prime = 31; 86 | int result = 1; 87 | long temp; 88 | temp = Double.doubleToLongBits(center.x); 89 | result = prime * result + (int) (temp ^ (temp >>> 32)); 90 | temp = Double.doubleToLongBits(center.y); 91 | result = prime * result + (int) (temp ^ (temp >>> 32)); 92 | temp = Double.doubleToLongBits(size.width); 93 | result = prime * result + (int) (temp ^ (temp >>> 32)); 94 | temp = Double.doubleToLongBits(size.height); 95 | result = prime * result + (int) (temp ^ (temp >>> 32)); 96 | temp = Double.doubleToLongBits(angle); 97 | result = prime * result + (int) (temp ^ (temp >>> 32)); 98 | return result; 99 | } 100 | 101 | @Override 102 | public boolean equals(Object obj) { 103 | if (this == obj) return true; 104 | if (!(obj instanceof RotatedRect)) return false; 105 | RotatedRect it = (RotatedRect) obj; 106 | return center.equals(it.center) && size.equals(it.size) && angle == it.angle; 107 | } 108 | 109 | @Override 110 | public String toString() { 111 | return "{ " + center + " " + size + " * " + angle + " }"; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/Scalar.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:Scalar_ 4 | public class Scalar { 5 | 6 | public double val[]; 7 | 8 | public Scalar(double v0, double v1, double v2, double v3) { 9 | val = new double[] { v0, v1, v2, v3 }; 10 | } 11 | 12 | public Scalar(double v0, double v1, double v2) { 13 | val = new double[] { v0, v1, v2, 0 }; 14 | } 15 | 16 | public Scalar(double v0, double v1) { 17 | val = new double[] { v0, v1, 0, 0 }; 18 | } 19 | 20 | public Scalar(double v0) { 21 | val = new double[] { v0, 0, 0, 0 }; 22 | } 23 | 24 | public Scalar(double[] vals) { 25 | if (vals != null && vals.length == 4) 26 | val = vals.clone(); 27 | else { 28 | val = new double[4]; 29 | set(vals); 30 | } 31 | } 32 | 33 | public void set(double[] vals) { 34 | if (vals != null) { 35 | val[0] = vals.length > 0 ? vals[0] : 0; 36 | val[1] = vals.length > 1 ? vals[1] : 0; 37 | val[2] = vals.length > 2 ? vals[2] : 0; 38 | val[3] = vals.length > 3 ? vals[3] : 0; 39 | } else 40 | val[0] = val[1] = val[2] = val[3] = 0; 41 | } 42 | 43 | public static Scalar all(double v) { 44 | return new Scalar(v, v, v, v); 45 | } 46 | 47 | public Scalar clone() { 48 | return new Scalar(val); 49 | } 50 | 51 | public Scalar mul(Scalar it, double scale) { 52 | return new Scalar(val[0] * it.val[0] * scale, val[1] * it.val[1] * scale, 53 | val[2] * it.val[2] * scale, val[3] * it.val[3] * scale); 54 | } 55 | 56 | public Scalar mul(Scalar it) { 57 | return mul(it, 1); 58 | } 59 | 60 | public Scalar conj() { 61 | return new Scalar(val[0], -val[1], -val[2], -val[3]); 62 | } 63 | 64 | public boolean isReal() { 65 | return val[1] == 0 && val[2] == 0 && val[3] == 0; 66 | } 67 | 68 | @Override 69 | public int hashCode() { 70 | final int prime = 31; 71 | int result = 1; 72 | result = prime * result + java.util.Arrays.hashCode(val); 73 | return result; 74 | } 75 | 76 | @Override 77 | public boolean equals(Object obj) { 78 | if (this == obj) return true; 79 | if (!(obj instanceof Scalar)) return false; 80 | Scalar it = (Scalar) obj; 81 | if (!java.util.Arrays.equals(val, it.val)) return false; 82 | return true; 83 | } 84 | 85 | @Override 86 | public String toString() { 87 | return "[" + val[0] + ", " + val[1] + ", " + val[2] + ", " + val[3] + "]"; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/Size.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:Size_ 4 | public class Size { 5 | 6 | public double width, height; 7 | 8 | public Size(double width, double height) { 9 | this.width = width; 10 | this.height = height; 11 | } 12 | 13 | public Size() { 14 | this(0, 0); 15 | } 16 | 17 | public Size(Point p) { 18 | width = p.x; 19 | height = p.y; 20 | } 21 | 22 | public Size(double[] vals) { 23 | set(vals); 24 | } 25 | 26 | public void set(double[] vals) { 27 | if (vals != null) { 28 | width = vals.length > 0 ? vals[0] : 0; 29 | height = vals.length > 1 ? vals[1] : 0; 30 | } else { 31 | width = 0; 32 | height = 0; 33 | } 34 | } 35 | 36 | public double area() { 37 | return width * height; 38 | } 39 | 40 | public boolean empty() { 41 | return width <= 0 || height <= 0; 42 | } 43 | 44 | public Size clone() { 45 | return new Size(width, height); 46 | } 47 | 48 | @Override 49 | public int hashCode() { 50 | final int prime = 31; 51 | int result = 1; 52 | long temp; 53 | temp = Double.doubleToLongBits(height); 54 | result = prime * result + (int) (temp ^ (temp >>> 32)); 55 | temp = Double.doubleToLongBits(width); 56 | result = prime * result + (int) (temp ^ (temp >>> 32)); 57 | return result; 58 | } 59 | 60 | @Override 61 | public boolean equals(Object obj) { 62 | if (this == obj) return true; 63 | if (!(obj instanceof Size)) return false; 64 | Size it = (Size) obj; 65 | return width == it.width && height == it.height; 66 | } 67 | 68 | @Override 69 | public String toString() { 70 | return (int)width + "x" + (int)height; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/TermCriteria.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | //javadoc:TermCriteria 4 | public class TermCriteria { 5 | 6 | /** 7 | * The maximum number of iterations or elements to compute 8 | */ 9 | public static final int COUNT = 1; 10 | /** 11 | * The maximum number of iterations or elements to compute 12 | */ 13 | public static final int MAX_ITER = COUNT; 14 | /** 15 | * The desired accuracy threshold or change in parameters at which the iterative algorithm is terminated. 16 | */ 17 | public static final int EPS = 2; 18 | 19 | public int type; 20 | public int maxCount; 21 | public double epsilon; 22 | 23 | /** 24 | * Termination criteria for iterative algorithms. 25 | * 26 | * @param type 27 | * the type of termination criteria: COUNT, EPS or COUNT + EPS. 28 | * @param maxCount 29 | * the maximum number of iterations/elements. 30 | * @param epsilon 31 | * the desired accuracy. 32 | */ 33 | public TermCriteria(int type, int maxCount, double epsilon) { 34 | this.type = type; 35 | this.maxCount = maxCount; 36 | this.epsilon = epsilon; 37 | } 38 | 39 | /** 40 | * Termination criteria for iterative algorithms. 41 | */ 42 | public TermCriteria() { 43 | this(0, 0, 0.0); 44 | } 45 | 46 | public TermCriteria(double[] vals) { 47 | set(vals); 48 | } 49 | 50 | public void set(double[] vals) { 51 | if (vals != null) { 52 | type = vals.length > 0 ? (int) vals[0] : 0; 53 | maxCount = vals.length > 1 ? (int) vals[1] : 0; 54 | epsilon = vals.length > 2 ? (double) vals[2] : 0; 55 | } else { 56 | type = 0; 57 | maxCount = 0; 58 | epsilon = 0; 59 | } 60 | } 61 | 62 | public TermCriteria clone() { 63 | return new TermCriteria(type, maxCount, epsilon); 64 | } 65 | 66 | @Override 67 | public int hashCode() { 68 | final int prime = 31; 69 | int result = 1; 70 | long temp; 71 | temp = Double.doubleToLongBits(type); 72 | result = prime * result + (int) (temp ^ (temp >>> 32)); 73 | temp = Double.doubleToLongBits(maxCount); 74 | result = prime * result + (int) (temp ^ (temp >>> 32)); 75 | temp = Double.doubleToLongBits(epsilon); 76 | result = prime * result + (int) (temp ^ (temp >>> 32)); 77 | return result; 78 | } 79 | 80 | @Override 81 | public boolean equals(Object obj) { 82 | if (this == obj) return true; 83 | if (!(obj instanceof TermCriteria)) return false; 84 | TermCriteria it = (TermCriteria) obj; 85 | return type == it.type && maxCount == it.maxCount && epsilon == it.epsilon; 86 | } 87 | 88 | @Override 89 | public String toString() { 90 | return "{ type: " + type + ", maxCount: " + maxCount + ", epsilon: " + epsilon + "}"; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/core/TickMeter.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.core; 5 | 6 | 7 | 8 | // C++: class TickMeter 9 | //javadoc: TickMeter 10 | 11 | public class TickMeter { 12 | 13 | protected final long nativeObj; 14 | protected TickMeter(long addr) { nativeObj = addr; } 15 | 16 | public long getNativeObjAddr() { return nativeObj; } 17 | 18 | // internal usage only 19 | public static TickMeter __fromPtr__(long addr) { return new TickMeter(addr); } 20 | 21 | // 22 | // C++: cv::TickMeter::TickMeter() 23 | // 24 | 25 | //javadoc: TickMeter::TickMeter() 26 | public TickMeter() 27 | { 28 | 29 | nativeObj = TickMeter_0(); 30 | 31 | return; 32 | } 33 | 34 | 35 | // 36 | // C++: double cv::TickMeter::getTimeMicro() 37 | // 38 | 39 | //javadoc: TickMeter::getTimeMicro() 40 | public double getTimeMicro() 41 | { 42 | 43 | double retVal = getTimeMicro_0(nativeObj); 44 | 45 | return retVal; 46 | } 47 | 48 | 49 | // 50 | // C++: double cv::TickMeter::getTimeMilli() 51 | // 52 | 53 | //javadoc: TickMeter::getTimeMilli() 54 | public double getTimeMilli() 55 | { 56 | 57 | double retVal = getTimeMilli_0(nativeObj); 58 | 59 | return retVal; 60 | } 61 | 62 | 63 | // 64 | // C++: double cv::TickMeter::getTimeSec() 65 | // 66 | 67 | //javadoc: TickMeter::getTimeSec() 68 | public double getTimeSec() 69 | { 70 | 71 | double retVal = getTimeSec_0(nativeObj); 72 | 73 | return retVal; 74 | } 75 | 76 | 77 | // 78 | // C++: int64 cv::TickMeter::getCounter() 79 | // 80 | 81 | //javadoc: TickMeter::getCounter() 82 | public long getCounter() 83 | { 84 | 85 | long retVal = getCounter_0(nativeObj); 86 | 87 | return retVal; 88 | } 89 | 90 | 91 | // 92 | // C++: int64 cv::TickMeter::getTimeTicks() 93 | // 94 | 95 | //javadoc: TickMeter::getTimeTicks() 96 | public long getTimeTicks() 97 | { 98 | 99 | long retVal = getTimeTicks_0(nativeObj); 100 | 101 | return retVal; 102 | } 103 | 104 | 105 | // 106 | // C++: void cv::TickMeter::reset() 107 | // 108 | 109 | //javadoc: TickMeter::reset() 110 | public void reset() 111 | { 112 | 113 | reset_0(nativeObj); 114 | 115 | return; 116 | } 117 | 118 | 119 | // 120 | // C++: void cv::TickMeter::start() 121 | // 122 | 123 | //javadoc: TickMeter::start() 124 | public void start() 125 | { 126 | 127 | start_0(nativeObj); 128 | 129 | return; 130 | } 131 | 132 | 133 | // 134 | // C++: void cv::TickMeter::stop() 135 | // 136 | 137 | //javadoc: TickMeter::stop() 138 | public void stop() 139 | { 140 | 141 | stop_0(nativeObj); 142 | 143 | return; 144 | } 145 | 146 | 147 | @Override 148 | protected void finalize() throws Throwable { 149 | delete(nativeObj); 150 | } 151 | 152 | 153 | 154 | // C++: cv::TickMeter::TickMeter() 155 | private static native long TickMeter_0(); 156 | 157 | // C++: double cv::TickMeter::getTimeMicro() 158 | private static native double getTimeMicro_0(long nativeObj); 159 | 160 | // C++: double cv::TickMeter::getTimeMilli() 161 | private static native double getTimeMilli_0(long nativeObj); 162 | 163 | // C++: double cv::TickMeter::getTimeSec() 164 | private static native double getTimeSec_0(long nativeObj); 165 | 166 | // C++: int64 cv::TickMeter::getCounter() 167 | private static native long getCounter_0(long nativeObj); 168 | 169 | // C++: int64 cv::TickMeter::getTimeTicks() 170 | private static native long getTimeTicks_0(long nativeObj); 171 | 172 | // C++: void cv::TickMeter::reset() 173 | private static native void reset_0(long nativeObj); 174 | 175 | // C++: void cv::TickMeter::start() 176 | private static native void start_0(long nativeObj); 177 | 178 | // C++: void cv::TickMeter::stop() 179 | private static native void stop_0(long nativeObj); 180 | 181 | // native support for java finalize() 182 | private static native void delete(long nativeObj); 183 | 184 | } 185 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/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 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/features2d/BFMatcher.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.features2d; 5 | 6 | import org.opencv.features2d.BFMatcher; 7 | import org.opencv.features2d.DescriptorMatcher; 8 | 9 | // C++: class BFMatcher 10 | //javadoc: BFMatcher 11 | 12 | public class BFMatcher extends DescriptorMatcher { 13 | 14 | protected BFMatcher(long addr) { super(addr); } 15 | 16 | // internal usage only 17 | public static BFMatcher __fromPtr__(long addr) { return new BFMatcher(addr); } 18 | 19 | // 20 | // C++: cv::BFMatcher::BFMatcher(int normType = NORM_L2, bool crossCheck = false) 21 | // 22 | 23 | //javadoc: BFMatcher::BFMatcher(normType, crossCheck) 24 | public BFMatcher(int normType, boolean crossCheck) 25 | { 26 | 27 | super( BFMatcher_0(normType, crossCheck) ); 28 | 29 | return; 30 | } 31 | 32 | //javadoc: BFMatcher::BFMatcher(normType) 33 | public BFMatcher(int normType) 34 | { 35 | 36 | super( BFMatcher_1(normType) ); 37 | 38 | return; 39 | } 40 | 41 | //javadoc: BFMatcher::BFMatcher() 42 | public BFMatcher() 43 | { 44 | 45 | super( BFMatcher_2() ); 46 | 47 | return; 48 | } 49 | 50 | 51 | // 52 | // C++: static Ptr_BFMatcher cv::BFMatcher::create(int normType = NORM_L2, bool crossCheck = false) 53 | // 54 | 55 | //javadoc: BFMatcher::create(normType, crossCheck) 56 | public static BFMatcher create(int normType, boolean crossCheck) 57 | { 58 | 59 | BFMatcher retVal = BFMatcher.__fromPtr__(create_0(normType, crossCheck)); 60 | 61 | return retVal; 62 | } 63 | 64 | //javadoc: BFMatcher::create(normType) 65 | public static BFMatcher create(int normType) 66 | { 67 | 68 | BFMatcher retVal = BFMatcher.__fromPtr__(create_1(normType)); 69 | 70 | return retVal; 71 | } 72 | 73 | //javadoc: BFMatcher::create() 74 | public static BFMatcher create() 75 | { 76 | 77 | BFMatcher retVal = BFMatcher.__fromPtr__(create_2()); 78 | 79 | return retVal; 80 | } 81 | 82 | 83 | @Override 84 | protected void finalize() throws Throwable { 85 | delete(nativeObj); 86 | } 87 | 88 | 89 | 90 | // C++: cv::BFMatcher::BFMatcher(int normType = NORM_L2, bool crossCheck = false) 91 | private static native long BFMatcher_0(int normType, boolean crossCheck); 92 | private static native long BFMatcher_1(int normType); 93 | private static native long BFMatcher_2(); 94 | 95 | // C++: static Ptr_BFMatcher cv::BFMatcher::create(int normType = NORM_L2, bool crossCheck = false) 96 | private static native long create_0(int normType, boolean crossCheck); 97 | private static native long create_1(int normType); 98 | private static native long create_2(); 99 | 100 | // native support for java finalize() 101 | private static native void delete(long nativeObj); 102 | 103 | } 104 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/features2d/BOWImgDescriptorExtractor.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.features2d; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import org.opencv.core.Mat; 9 | import org.opencv.core.MatOfKeyPoint; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class BOWImgDescriptorExtractor 13 | //javadoc: BOWImgDescriptorExtractor 14 | 15 | public class BOWImgDescriptorExtractor { 16 | 17 | protected final long nativeObj; 18 | protected BOWImgDescriptorExtractor(long addr) { nativeObj = addr; } 19 | 20 | public long getNativeObjAddr() { return nativeObj; } 21 | 22 | // internal usage only 23 | public static BOWImgDescriptorExtractor __fromPtr__(long addr) { return new BOWImgDescriptorExtractor(addr); } 24 | 25 | // 26 | // C++: cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor(Ptr_DescriptorExtractor dextractor, Ptr_DescriptorMatcher dmatcher) 27 | // 28 | 29 | // Unknown type 'Ptr_DescriptorExtractor' (I), skipping the function 30 | 31 | 32 | // 33 | // C++: Mat cv::BOWImgDescriptorExtractor::getVocabulary() 34 | // 35 | 36 | //javadoc: BOWImgDescriptorExtractor::getVocabulary() 37 | public Mat getVocabulary() 38 | { 39 | 40 | Mat retVal = new Mat(getVocabulary_0(nativeObj)); 41 | 42 | return retVal; 43 | } 44 | 45 | 46 | // 47 | // C++: int cv::BOWImgDescriptorExtractor::descriptorSize() 48 | // 49 | 50 | //javadoc: BOWImgDescriptorExtractor::descriptorSize() 51 | public int descriptorSize() 52 | { 53 | 54 | int retVal = descriptorSize_0(nativeObj); 55 | 56 | return retVal; 57 | } 58 | 59 | 60 | // 61 | // C++: int cv::BOWImgDescriptorExtractor::descriptorType() 62 | // 63 | 64 | //javadoc: BOWImgDescriptorExtractor::descriptorType() 65 | public int descriptorType() 66 | { 67 | 68 | int retVal = descriptorType_0(nativeObj); 69 | 70 | return retVal; 71 | } 72 | 73 | 74 | // 75 | // C++: void cv::BOWImgDescriptorExtractor::compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor) 76 | // 77 | 78 | //javadoc: BOWImgDescriptorExtractor::compute(image, keypoints, imgDescriptor) 79 | public void compute(Mat image, MatOfKeyPoint keypoints, Mat imgDescriptor) 80 | { 81 | Mat keypoints_mat = keypoints; 82 | compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, imgDescriptor.nativeObj); 83 | 84 | return; 85 | } 86 | 87 | 88 | // 89 | // C++: void cv::BOWImgDescriptorExtractor::setVocabulary(Mat vocabulary) 90 | // 91 | 92 | //javadoc: BOWImgDescriptorExtractor::setVocabulary(vocabulary) 93 | public void setVocabulary(Mat vocabulary) 94 | { 95 | 96 | setVocabulary_0(nativeObj, vocabulary.nativeObj); 97 | 98 | return; 99 | } 100 | 101 | 102 | @Override 103 | protected void finalize() throws Throwable { 104 | delete(nativeObj); 105 | } 106 | 107 | 108 | 109 | // C++: Mat cv::BOWImgDescriptorExtractor::getVocabulary() 110 | private static native long getVocabulary_0(long nativeObj); 111 | 112 | // C++: int cv::BOWImgDescriptorExtractor::descriptorSize() 113 | private static native int descriptorSize_0(long nativeObj); 114 | 115 | // C++: int cv::BOWImgDescriptorExtractor::descriptorType() 116 | private static native int descriptorType_0(long nativeObj); 117 | 118 | // C++: void cv::BOWImgDescriptorExtractor::compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor) 119 | private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long imgDescriptor_nativeObj); 120 | 121 | // C++: void cv::BOWImgDescriptorExtractor::setVocabulary(Mat vocabulary) 122 | private static native void setVocabulary_0(long nativeObj, long vocabulary_nativeObj); 123 | 124 | // native support for java finalize() 125 | private static native void delete(long nativeObj); 126 | 127 | } 128 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/features2d/BOWKMeansTrainer.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.features2d; 5 | 6 | import org.opencv.core.Mat; 7 | import org.opencv.core.TermCriteria; 8 | import org.opencv.features2d.BOWTrainer; 9 | 10 | // C++: class BOWKMeansTrainer 11 | //javadoc: BOWKMeansTrainer 12 | 13 | public class BOWKMeansTrainer extends BOWTrainer { 14 | 15 | protected BOWKMeansTrainer(long addr) { super(addr); } 16 | 17 | // internal usage only 18 | public static BOWKMeansTrainer __fromPtr__(long addr) { return new BOWKMeansTrainer(addr); } 19 | 20 | // 21 | // C++: cv::BOWKMeansTrainer::BOWKMeansTrainer(int clusterCount, TermCriteria termcrit = TermCriteria(), int attempts = 3, int flags = KMEANS_PP_CENTERS) 22 | // 23 | 24 | //javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount, termcrit, attempts, flags) 25 | public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit, int attempts, int flags) 26 | { 27 | 28 | super( BOWKMeansTrainer_0(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon, attempts, flags) ); 29 | 30 | return; 31 | } 32 | 33 | //javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount, termcrit, attempts) 34 | public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit, int attempts) 35 | { 36 | 37 | super( BOWKMeansTrainer_1(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon, attempts) ); 38 | 39 | return; 40 | } 41 | 42 | //javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount, termcrit) 43 | public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit) 44 | { 45 | 46 | super( BOWKMeansTrainer_2(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon) ); 47 | 48 | return; 49 | } 50 | 51 | //javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount) 52 | public BOWKMeansTrainer(int clusterCount) 53 | { 54 | 55 | super( BOWKMeansTrainer_3(clusterCount) ); 56 | 57 | return; 58 | } 59 | 60 | 61 | // 62 | // C++: Mat cv::BOWKMeansTrainer::cluster(Mat descriptors) 63 | // 64 | 65 | //javadoc: BOWKMeansTrainer::cluster(descriptors) 66 | public Mat cluster(Mat descriptors) 67 | { 68 | 69 | Mat retVal = new Mat(cluster_0(nativeObj, descriptors.nativeObj)); 70 | 71 | return retVal; 72 | } 73 | 74 | 75 | // 76 | // C++: Mat cv::BOWKMeansTrainer::cluster() 77 | // 78 | 79 | //javadoc: BOWKMeansTrainer::cluster() 80 | public Mat cluster() 81 | { 82 | 83 | Mat retVal = new Mat(cluster_1(nativeObj)); 84 | 85 | return retVal; 86 | } 87 | 88 | 89 | @Override 90 | protected void finalize() throws Throwable { 91 | delete(nativeObj); 92 | } 93 | 94 | 95 | 96 | // C++: cv::BOWKMeansTrainer::BOWKMeansTrainer(int clusterCount, TermCriteria termcrit = TermCriteria(), int attempts = 3, int flags = KMEANS_PP_CENTERS) 97 | private static native long BOWKMeansTrainer_0(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon, int attempts, int flags); 98 | private static native long BOWKMeansTrainer_1(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon, int attempts); 99 | private static native long BOWKMeansTrainer_2(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon); 100 | private static native long BOWKMeansTrainer_3(int clusterCount); 101 | 102 | // C++: Mat cv::BOWKMeansTrainer::cluster(Mat descriptors) 103 | private static native long cluster_0(long nativeObj, long descriptors_nativeObj); 104 | 105 | // C++: Mat cv::BOWKMeansTrainer::cluster() 106 | private static native long cluster_1(long nativeObj); 107 | 108 | // native support for java finalize() 109 | private static native void delete(long nativeObj); 110 | 111 | } 112 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/features2d/BOWTrainer.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.features2d; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import org.opencv.core.Mat; 9 | import org.opencv.utils.Converters; 10 | 11 | // C++: class BOWTrainer 12 | //javadoc: BOWTrainer 13 | 14 | public class BOWTrainer { 15 | 16 | protected final long nativeObj; 17 | protected BOWTrainer(long addr) { nativeObj = addr; } 18 | 19 | public long getNativeObjAddr() { return nativeObj; } 20 | 21 | // internal usage only 22 | public static BOWTrainer __fromPtr__(long addr) { return new BOWTrainer(addr); } 23 | 24 | // 25 | // C++: Mat cv::BOWTrainer::cluster(Mat descriptors) 26 | // 27 | 28 | //javadoc: BOWTrainer::cluster(descriptors) 29 | public Mat cluster(Mat descriptors) 30 | { 31 | 32 | Mat retVal = new Mat(cluster_0(nativeObj, descriptors.nativeObj)); 33 | 34 | return retVal; 35 | } 36 | 37 | 38 | // 39 | // C++: Mat cv::BOWTrainer::cluster() 40 | // 41 | 42 | //javadoc: BOWTrainer::cluster() 43 | public Mat cluster() 44 | { 45 | 46 | Mat retVal = new Mat(cluster_1(nativeObj)); 47 | 48 | return retVal; 49 | } 50 | 51 | 52 | // 53 | // C++: int cv::BOWTrainer::descriptorsCount() 54 | // 55 | 56 | //javadoc: BOWTrainer::descriptorsCount() 57 | public int descriptorsCount() 58 | { 59 | 60 | int retVal = descriptorsCount_0(nativeObj); 61 | 62 | return retVal; 63 | } 64 | 65 | 66 | // 67 | // C++: vector_Mat cv::BOWTrainer::getDescriptors() 68 | // 69 | 70 | //javadoc: BOWTrainer::getDescriptors() 71 | public List getDescriptors() 72 | { 73 | List retVal = new ArrayList(); 74 | Mat retValMat = new Mat(getDescriptors_0(nativeObj)); 75 | Converters.Mat_to_vector_Mat(retValMat, retVal); 76 | return retVal; 77 | } 78 | 79 | 80 | // 81 | // C++: void cv::BOWTrainer::add(Mat descriptors) 82 | // 83 | 84 | //javadoc: BOWTrainer::add(descriptors) 85 | public void add(Mat descriptors) 86 | { 87 | 88 | add_0(nativeObj, descriptors.nativeObj); 89 | 90 | return; 91 | } 92 | 93 | 94 | // 95 | // C++: void cv::BOWTrainer::clear() 96 | // 97 | 98 | //javadoc: BOWTrainer::clear() 99 | public void clear() 100 | { 101 | 102 | clear_0(nativeObj); 103 | 104 | return; 105 | } 106 | 107 | 108 | @Override 109 | protected void finalize() throws Throwable { 110 | delete(nativeObj); 111 | } 112 | 113 | 114 | 115 | // C++: Mat cv::BOWTrainer::cluster(Mat descriptors) 116 | private static native long cluster_0(long nativeObj, long descriptors_nativeObj); 117 | 118 | // C++: Mat cv::BOWTrainer::cluster() 119 | private static native long cluster_1(long nativeObj); 120 | 121 | // C++: int cv::BOWTrainer::descriptorsCount() 122 | private static native int descriptorsCount_0(long nativeObj); 123 | 124 | // C++: vector_Mat cv::BOWTrainer::getDescriptors() 125 | private static native long getDescriptors_0(long nativeObj); 126 | 127 | // C++: void cv::BOWTrainer::add(Mat descriptors) 128 | private static native void add_0(long nativeObj, long descriptors_nativeObj); 129 | 130 | // C++: void cv::BOWTrainer::clear() 131 | private static native void clear_0(long nativeObj); 132 | 133 | // native support for java finalize() 134 | private static native void delete(long nativeObj); 135 | 136 | } 137 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/features2d/FlannBasedMatcher.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.features2d; 5 | 6 | import org.opencv.features2d.DescriptorMatcher; 7 | import org.opencv.features2d.FlannBasedMatcher; 8 | 9 | // C++: class FlannBasedMatcher 10 | //javadoc: FlannBasedMatcher 11 | 12 | public class FlannBasedMatcher extends DescriptorMatcher { 13 | 14 | protected FlannBasedMatcher(long addr) { super(addr); } 15 | 16 | // internal usage only 17 | public static FlannBasedMatcher __fromPtr__(long addr) { return new FlannBasedMatcher(addr); } 18 | 19 | // 20 | // C++: cv::FlannBasedMatcher::FlannBasedMatcher(Ptr_flann_IndexParams indexParams = makePtr(), Ptr_flann_SearchParams searchParams = makePtr()) 21 | // 22 | 23 | //javadoc: FlannBasedMatcher::FlannBasedMatcher() 24 | public FlannBasedMatcher() 25 | { 26 | 27 | super( FlannBasedMatcher_0() ); 28 | 29 | return; 30 | } 31 | 32 | 33 | // 34 | // C++: static Ptr_FlannBasedMatcher cv::FlannBasedMatcher::create() 35 | // 36 | 37 | //javadoc: FlannBasedMatcher::create() 38 | public static FlannBasedMatcher create() 39 | { 40 | 41 | FlannBasedMatcher retVal = FlannBasedMatcher.__fromPtr__(create_0()); 42 | 43 | return retVal; 44 | } 45 | 46 | 47 | @Override 48 | protected void finalize() throws Throwable { 49 | delete(nativeObj); 50 | } 51 | 52 | 53 | 54 | // C++: cv::FlannBasedMatcher::FlannBasedMatcher(Ptr_flann_IndexParams indexParams = makePtr(), Ptr_flann_SearchParams searchParams = makePtr()) 55 | private static native long FlannBasedMatcher_0(); 56 | 57 | // C++: static Ptr_FlannBasedMatcher cv::FlannBasedMatcher::create() 58 | private static native long create_0(); 59 | 60 | // native support for java finalize() 61 | private static native void delete(long nativeObj); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/imgproc/CLAHE.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.imgproc; 5 | 6 | import org.opencv.core.Algorithm; 7 | import org.opencv.core.Mat; 8 | import org.opencv.core.Size; 9 | 10 | // C++: class CLAHE 11 | //javadoc: CLAHE 12 | 13 | public class CLAHE extends Algorithm { 14 | 15 | protected CLAHE(long addr) { super(addr); } 16 | 17 | // internal usage only 18 | public static CLAHE __fromPtr__(long addr) { return new CLAHE(addr); } 19 | 20 | // 21 | // C++: Size cv::CLAHE::getTilesGridSize() 22 | // 23 | 24 | //javadoc: CLAHE::getTilesGridSize() 25 | public Size getTilesGridSize() 26 | { 27 | 28 | Size retVal = new Size(getTilesGridSize_0(nativeObj)); 29 | 30 | return retVal; 31 | } 32 | 33 | 34 | // 35 | // C++: double cv::CLAHE::getClipLimit() 36 | // 37 | 38 | //javadoc: CLAHE::getClipLimit() 39 | public double getClipLimit() 40 | { 41 | 42 | double retVal = getClipLimit_0(nativeObj); 43 | 44 | return retVal; 45 | } 46 | 47 | 48 | // 49 | // C++: void cv::CLAHE::apply(Mat src, Mat& dst) 50 | // 51 | 52 | //javadoc: CLAHE::apply(src, dst) 53 | public void apply(Mat src, Mat dst) 54 | { 55 | 56 | apply_0(nativeObj, src.nativeObj, dst.nativeObj); 57 | 58 | return; 59 | } 60 | 61 | 62 | // 63 | // C++: void cv::CLAHE::collectGarbage() 64 | // 65 | 66 | //javadoc: CLAHE::collectGarbage() 67 | public void collectGarbage() 68 | { 69 | 70 | collectGarbage_0(nativeObj); 71 | 72 | return; 73 | } 74 | 75 | 76 | // 77 | // C++: void cv::CLAHE::setClipLimit(double clipLimit) 78 | // 79 | 80 | //javadoc: CLAHE::setClipLimit(clipLimit) 81 | public void setClipLimit(double clipLimit) 82 | { 83 | 84 | setClipLimit_0(nativeObj, clipLimit); 85 | 86 | return; 87 | } 88 | 89 | 90 | // 91 | // C++: void cv::CLAHE::setTilesGridSize(Size tileGridSize) 92 | // 93 | 94 | //javadoc: CLAHE::setTilesGridSize(tileGridSize) 95 | public void setTilesGridSize(Size tileGridSize) 96 | { 97 | 98 | setTilesGridSize_0(nativeObj, tileGridSize.width, tileGridSize.height); 99 | 100 | return; 101 | } 102 | 103 | 104 | @Override 105 | protected void finalize() throws Throwable { 106 | delete(nativeObj); 107 | } 108 | 109 | 110 | 111 | // C++: Size cv::CLAHE::getTilesGridSize() 112 | private static native double[] getTilesGridSize_0(long nativeObj); 113 | 114 | // C++: double cv::CLAHE::getClipLimit() 115 | private static native double getClipLimit_0(long nativeObj); 116 | 117 | // C++: void cv::CLAHE::apply(Mat src, Mat& dst) 118 | private static native void apply_0(long nativeObj, long src_nativeObj, long dst_nativeObj); 119 | 120 | // C++: void cv::CLAHE::collectGarbage() 121 | private static native void collectGarbage_0(long nativeObj); 122 | 123 | // C++: void cv::CLAHE::setClipLimit(double clipLimit) 124 | private static native void setClipLimit_0(long nativeObj, double clipLimit); 125 | 126 | // C++: void cv::CLAHE::setTilesGridSize(Size tileGridSize) 127 | private static native void setTilesGridSize_0(long nativeObj, double tileGridSize_width, double tileGridSize_height); 128 | 129 | // native support for java finalize() 130 | private static native void delete(long nativeObj); 131 | 132 | } 133 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/imgproc/LineSegmentDetector.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.imgproc; 5 | 6 | import org.opencv.core.Algorithm; 7 | import org.opencv.core.Mat; 8 | import org.opencv.core.Size; 9 | 10 | // C++: class LineSegmentDetector 11 | //javadoc: LineSegmentDetector 12 | 13 | public class LineSegmentDetector extends Algorithm { 14 | 15 | protected LineSegmentDetector(long addr) { super(addr); } 16 | 17 | // internal usage only 18 | public static LineSegmentDetector __fromPtr__(long addr) { return new LineSegmentDetector(addr); } 19 | 20 | // 21 | // C++: int cv::LineSegmentDetector::compareSegments(Size size, Mat lines1, Mat lines2, Mat& _image = Mat()) 22 | // 23 | 24 | //javadoc: LineSegmentDetector::compareSegments(size, lines1, lines2, _image) 25 | public int compareSegments(Size size, Mat lines1, Mat lines2, Mat _image) 26 | { 27 | 28 | int retVal = compareSegments_0(nativeObj, size.width, size.height, lines1.nativeObj, lines2.nativeObj, _image.nativeObj); 29 | 30 | return retVal; 31 | } 32 | 33 | //javadoc: LineSegmentDetector::compareSegments(size, lines1, lines2) 34 | public int compareSegments(Size size, Mat lines1, Mat lines2) 35 | { 36 | 37 | int retVal = compareSegments_1(nativeObj, size.width, size.height, lines1.nativeObj, lines2.nativeObj); 38 | 39 | return retVal; 40 | } 41 | 42 | 43 | // 44 | // C++: void cv::LineSegmentDetector::detect(Mat _image, Mat& _lines, Mat& width = Mat(), Mat& prec = Mat(), Mat& nfa = Mat()) 45 | // 46 | 47 | //javadoc: LineSegmentDetector::detect(_image, _lines, width, prec, nfa) 48 | public void detect(Mat _image, Mat _lines, Mat width, Mat prec, Mat nfa) 49 | { 50 | 51 | detect_0(nativeObj, _image.nativeObj, _lines.nativeObj, width.nativeObj, prec.nativeObj, nfa.nativeObj); 52 | 53 | return; 54 | } 55 | 56 | //javadoc: LineSegmentDetector::detect(_image, _lines, width, prec) 57 | public void detect(Mat _image, Mat _lines, Mat width, Mat prec) 58 | { 59 | 60 | detect_1(nativeObj, _image.nativeObj, _lines.nativeObj, width.nativeObj, prec.nativeObj); 61 | 62 | return; 63 | } 64 | 65 | //javadoc: LineSegmentDetector::detect(_image, _lines, width) 66 | public void detect(Mat _image, Mat _lines, Mat width) 67 | { 68 | 69 | detect_2(nativeObj, _image.nativeObj, _lines.nativeObj, width.nativeObj); 70 | 71 | return; 72 | } 73 | 74 | //javadoc: LineSegmentDetector::detect(_image, _lines) 75 | public void detect(Mat _image, Mat _lines) 76 | { 77 | 78 | detect_3(nativeObj, _image.nativeObj, _lines.nativeObj); 79 | 80 | return; 81 | } 82 | 83 | 84 | // 85 | // C++: void cv::LineSegmentDetector::drawSegments(Mat& _image, Mat lines) 86 | // 87 | 88 | //javadoc: LineSegmentDetector::drawSegments(_image, lines) 89 | public void drawSegments(Mat _image, Mat lines) 90 | { 91 | 92 | drawSegments_0(nativeObj, _image.nativeObj, lines.nativeObj); 93 | 94 | return; 95 | } 96 | 97 | 98 | @Override 99 | protected void finalize() throws Throwable { 100 | delete(nativeObj); 101 | } 102 | 103 | 104 | 105 | // C++: int cv::LineSegmentDetector::compareSegments(Size size, Mat lines1, Mat lines2, Mat& _image = Mat()) 106 | private static native int compareSegments_0(long nativeObj, double size_width, double size_height, long lines1_nativeObj, long lines2_nativeObj, long _image_nativeObj); 107 | private static native int compareSegments_1(long nativeObj, double size_width, double size_height, long lines1_nativeObj, long lines2_nativeObj); 108 | 109 | // C++: void cv::LineSegmentDetector::detect(Mat _image, Mat& _lines, Mat& width = Mat(), Mat& prec = Mat(), Mat& nfa = Mat()) 110 | private static native void detect_0(long nativeObj, long _image_nativeObj, long _lines_nativeObj, long width_nativeObj, long prec_nativeObj, long nfa_nativeObj); 111 | private static native void detect_1(long nativeObj, long _image_nativeObj, long _lines_nativeObj, long width_nativeObj, long prec_nativeObj); 112 | private static native void detect_2(long nativeObj, long _image_nativeObj, long _lines_nativeObj, long width_nativeObj); 113 | private static native void detect_3(long nativeObj, long _image_nativeObj, long _lines_nativeObj); 114 | 115 | // C++: void cv::LineSegmentDetector::drawSegments(Mat& _image, Mat lines) 116 | private static native void drawSegments_0(long nativeObj, long _image_nativeObj, long lines_nativeObj); 117 | 118 | // native support for java finalize() 119 | private static native void delete(long nativeObj); 120 | 121 | } 122 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/ml/ANN_MLP_ANNEAL.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.ml; 5 | 6 | import org.opencv.ml.ANN_MLP; 7 | 8 | // C++: class ANN_MLP_ANNEAL 9 | //javadoc: ANN_MLP_ANNEAL 10 | 11 | public class ANN_MLP_ANNEAL extends ANN_MLP { 12 | 13 | protected ANN_MLP_ANNEAL(long addr) { super(addr); } 14 | 15 | // internal usage only 16 | public static ANN_MLP_ANNEAL __fromPtr__(long addr) { return new ANN_MLP_ANNEAL(addr); } 17 | 18 | // 19 | // C++: double cv::ml::ANN_MLP_ANNEAL::getAnnealCoolingRatio() 20 | // 21 | 22 | //javadoc: ANN_MLP_ANNEAL::getAnnealCoolingRatio() 23 | public double getAnnealCoolingRatio() 24 | { 25 | 26 | double retVal = getAnnealCoolingRatio_0(nativeObj); 27 | 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: double cv::ml::ANN_MLP_ANNEAL::getAnnealFinalT() 34 | // 35 | 36 | //javadoc: ANN_MLP_ANNEAL::getAnnealFinalT() 37 | public double getAnnealFinalT() 38 | { 39 | 40 | double retVal = getAnnealFinalT_0(nativeObj); 41 | 42 | return retVal; 43 | } 44 | 45 | 46 | // 47 | // C++: double cv::ml::ANN_MLP_ANNEAL::getAnnealInitialT() 48 | // 49 | 50 | //javadoc: ANN_MLP_ANNEAL::getAnnealInitialT() 51 | public double getAnnealInitialT() 52 | { 53 | 54 | double retVal = getAnnealInitialT_0(nativeObj); 55 | 56 | return retVal; 57 | } 58 | 59 | 60 | // 61 | // C++: int cv::ml::ANN_MLP_ANNEAL::getAnnealItePerStep() 62 | // 63 | 64 | //javadoc: ANN_MLP_ANNEAL::getAnnealItePerStep() 65 | public int getAnnealItePerStep() 66 | { 67 | 68 | int retVal = getAnnealItePerStep_0(nativeObj); 69 | 70 | return retVal; 71 | } 72 | 73 | 74 | // 75 | // C++: void cv::ml::ANN_MLP_ANNEAL::setAnnealCoolingRatio(double val) 76 | // 77 | 78 | //javadoc: ANN_MLP_ANNEAL::setAnnealCoolingRatio(val) 79 | public void setAnnealCoolingRatio(double val) 80 | { 81 | 82 | setAnnealCoolingRatio_0(nativeObj, val); 83 | 84 | return; 85 | } 86 | 87 | 88 | // 89 | // C++: void cv::ml::ANN_MLP_ANNEAL::setAnnealFinalT(double val) 90 | // 91 | 92 | //javadoc: ANN_MLP_ANNEAL::setAnnealFinalT(val) 93 | public void setAnnealFinalT(double val) 94 | { 95 | 96 | setAnnealFinalT_0(nativeObj, val); 97 | 98 | return; 99 | } 100 | 101 | 102 | // 103 | // C++: void cv::ml::ANN_MLP_ANNEAL::setAnnealInitialT(double val) 104 | // 105 | 106 | //javadoc: ANN_MLP_ANNEAL::setAnnealInitialT(val) 107 | public void setAnnealInitialT(double val) 108 | { 109 | 110 | setAnnealInitialT_0(nativeObj, val); 111 | 112 | return; 113 | } 114 | 115 | 116 | // 117 | // C++: void cv::ml::ANN_MLP_ANNEAL::setAnnealItePerStep(int val) 118 | // 119 | 120 | //javadoc: ANN_MLP_ANNEAL::setAnnealItePerStep(val) 121 | public void setAnnealItePerStep(int val) 122 | { 123 | 124 | setAnnealItePerStep_0(nativeObj, val); 125 | 126 | return; 127 | } 128 | 129 | 130 | @Override 131 | protected void finalize() throws Throwable { 132 | delete(nativeObj); 133 | } 134 | 135 | 136 | 137 | // C++: double cv::ml::ANN_MLP_ANNEAL::getAnnealCoolingRatio() 138 | private static native double getAnnealCoolingRatio_0(long nativeObj); 139 | 140 | // C++: double cv::ml::ANN_MLP_ANNEAL::getAnnealFinalT() 141 | private static native double getAnnealFinalT_0(long nativeObj); 142 | 143 | // C++: double cv::ml::ANN_MLP_ANNEAL::getAnnealInitialT() 144 | private static native double getAnnealInitialT_0(long nativeObj); 145 | 146 | // C++: int cv::ml::ANN_MLP_ANNEAL::getAnnealItePerStep() 147 | private static native int getAnnealItePerStep_0(long nativeObj); 148 | 149 | // C++: void cv::ml::ANN_MLP_ANNEAL::setAnnealCoolingRatio(double val) 150 | private static native void setAnnealCoolingRatio_0(long nativeObj, double val); 151 | 152 | // C++: void cv::ml::ANN_MLP_ANNEAL::setAnnealFinalT(double val) 153 | private static native void setAnnealFinalT_0(long nativeObj, double val); 154 | 155 | // C++: void cv::ml::ANN_MLP_ANNEAL::setAnnealInitialT(double val) 156 | private static native void setAnnealInitialT_0(long nativeObj, double val); 157 | 158 | // C++: void cv::ml::ANN_MLP_ANNEAL::setAnnealItePerStep(int val) 159 | private static native void setAnnealItePerStep_0(long nativeObj, int val); 160 | 161 | // native support for java finalize() 162 | private static native void delete(long nativeObj); 163 | 164 | } 165 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/ml/Boost.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.ml; 5 | 6 | import java.lang.String; 7 | import org.opencv.ml.Boost; 8 | import org.opencv.ml.DTrees; 9 | 10 | // C++: class Boost 11 | //javadoc: Boost 12 | 13 | public class Boost extends DTrees { 14 | 15 | protected Boost(long addr) { super(addr); } 16 | 17 | // internal usage only 18 | public static Boost __fromPtr__(long addr) { return new Boost(addr); } 19 | 20 | public static final int 21 | DISCRETE = 0, 22 | REAL = 1, 23 | LOGIT = 2, 24 | GENTLE = 3; 25 | 26 | 27 | // 28 | // C++: static Ptr_Boost cv::ml::Boost::create() 29 | // 30 | 31 | //javadoc: Boost::create() 32 | public static Boost create() 33 | { 34 | 35 | Boost retVal = Boost.__fromPtr__(create_0()); 36 | 37 | return retVal; 38 | } 39 | 40 | 41 | // 42 | // C++: static Ptr_Boost cv::ml::Boost::load(String filepath, String nodeName = String()) 43 | // 44 | 45 | //javadoc: Boost::load(filepath, nodeName) 46 | public static Boost load(String filepath, String nodeName) 47 | { 48 | 49 | Boost retVal = Boost.__fromPtr__(load_0(filepath, nodeName)); 50 | 51 | return retVal; 52 | } 53 | 54 | //javadoc: Boost::load(filepath) 55 | public static Boost load(String filepath) 56 | { 57 | 58 | Boost retVal = Boost.__fromPtr__(load_1(filepath)); 59 | 60 | return retVal; 61 | } 62 | 63 | 64 | // 65 | // C++: double cv::ml::Boost::getWeightTrimRate() 66 | // 67 | 68 | //javadoc: Boost::getWeightTrimRate() 69 | public double getWeightTrimRate() 70 | { 71 | 72 | double retVal = getWeightTrimRate_0(nativeObj); 73 | 74 | return retVal; 75 | } 76 | 77 | 78 | // 79 | // C++: int cv::ml::Boost::getBoostType() 80 | // 81 | 82 | //javadoc: Boost::getBoostType() 83 | public int getBoostType() 84 | { 85 | 86 | int retVal = getBoostType_0(nativeObj); 87 | 88 | return retVal; 89 | } 90 | 91 | 92 | // 93 | // C++: int cv::ml::Boost::getWeakCount() 94 | // 95 | 96 | //javadoc: Boost::getWeakCount() 97 | public int getWeakCount() 98 | { 99 | 100 | int retVal = getWeakCount_0(nativeObj); 101 | 102 | return retVal; 103 | } 104 | 105 | 106 | // 107 | // C++: void cv::ml::Boost::setBoostType(int val) 108 | // 109 | 110 | //javadoc: Boost::setBoostType(val) 111 | public void setBoostType(int val) 112 | { 113 | 114 | setBoostType_0(nativeObj, val); 115 | 116 | return; 117 | } 118 | 119 | 120 | // 121 | // C++: void cv::ml::Boost::setWeakCount(int val) 122 | // 123 | 124 | //javadoc: Boost::setWeakCount(val) 125 | public void setWeakCount(int val) 126 | { 127 | 128 | setWeakCount_0(nativeObj, val); 129 | 130 | return; 131 | } 132 | 133 | 134 | // 135 | // C++: void cv::ml::Boost::setWeightTrimRate(double val) 136 | // 137 | 138 | //javadoc: Boost::setWeightTrimRate(val) 139 | public void setWeightTrimRate(double val) 140 | { 141 | 142 | setWeightTrimRate_0(nativeObj, val); 143 | 144 | return; 145 | } 146 | 147 | 148 | @Override 149 | protected void finalize() throws Throwable { 150 | delete(nativeObj); 151 | } 152 | 153 | 154 | 155 | // C++: static Ptr_Boost cv::ml::Boost::create() 156 | private static native long create_0(); 157 | 158 | // C++: static Ptr_Boost cv::ml::Boost::load(String filepath, String nodeName = String()) 159 | private static native long load_0(String filepath, String nodeName); 160 | private static native long load_1(String filepath); 161 | 162 | // C++: double cv::ml::Boost::getWeightTrimRate() 163 | private static native double getWeightTrimRate_0(long nativeObj); 164 | 165 | // C++: int cv::ml::Boost::getBoostType() 166 | private static native int getBoostType_0(long nativeObj); 167 | 168 | // C++: int cv::ml::Boost::getWeakCount() 169 | private static native int getWeakCount_0(long nativeObj); 170 | 171 | // C++: void cv::ml::Boost::setBoostType(int val) 172 | private static native void setBoostType_0(long nativeObj, int val); 173 | 174 | // C++: void cv::ml::Boost::setWeakCount(int val) 175 | private static native void setWeakCount_0(long nativeObj, int val); 176 | 177 | // C++: void cv::ml::Boost::setWeightTrimRate(double val) 178 | private static native void setWeightTrimRate_0(long nativeObj, double val); 179 | 180 | // native support for java finalize() 181 | private static native void delete(long nativeObj); 182 | 183 | } 184 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/ml/Ml.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.ml; 5 | 6 | 7 | 8 | // C++: class Ml 9 | //javadoc: Ml 10 | 11 | public class Ml { 12 | 13 | public static final int 14 | VAR_NUMERICAL = 0, 15 | VAR_ORDERED = 0, 16 | VAR_CATEGORICAL = 1, 17 | TEST_ERROR = 0, 18 | TRAIN_ERROR = 1, 19 | ROW_SAMPLE = 0, 20 | COL_SAMPLE = 1; 21 | 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/ml/NormalBayesClassifier.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.ml; 5 | 6 | import java.lang.String; 7 | import org.opencv.core.Mat; 8 | import org.opencv.ml.NormalBayesClassifier; 9 | import org.opencv.ml.StatModel; 10 | 11 | // C++: class NormalBayesClassifier 12 | //javadoc: NormalBayesClassifier 13 | 14 | public class NormalBayesClassifier extends StatModel { 15 | 16 | protected NormalBayesClassifier(long addr) { super(addr); } 17 | 18 | // internal usage only 19 | public static NormalBayesClassifier __fromPtr__(long addr) { return new NormalBayesClassifier(addr); } 20 | 21 | // 22 | // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::create() 23 | // 24 | 25 | //javadoc: NormalBayesClassifier::create() 26 | public static NormalBayesClassifier create() 27 | { 28 | 29 | NormalBayesClassifier retVal = NormalBayesClassifier.__fromPtr__(create_0()); 30 | 31 | return retVal; 32 | } 33 | 34 | 35 | // 36 | // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::load(String filepath, String nodeName = String()) 37 | // 38 | 39 | //javadoc: NormalBayesClassifier::load(filepath, nodeName) 40 | public static NormalBayesClassifier load(String filepath, String nodeName) 41 | { 42 | 43 | NormalBayesClassifier retVal = NormalBayesClassifier.__fromPtr__(load_0(filepath, nodeName)); 44 | 45 | return retVal; 46 | } 47 | 48 | //javadoc: NormalBayesClassifier::load(filepath) 49 | public static NormalBayesClassifier load(String filepath) 50 | { 51 | 52 | NormalBayesClassifier retVal = NormalBayesClassifier.__fromPtr__(load_1(filepath)); 53 | 54 | return retVal; 55 | } 56 | 57 | 58 | // 59 | // C++: float cv::ml::NormalBayesClassifier::predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0) 60 | // 61 | 62 | //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs, flags) 63 | public float predictProb(Mat inputs, Mat outputs, Mat outputProbs, int flags) 64 | { 65 | 66 | float retVal = predictProb_0(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj, flags); 67 | 68 | return retVal; 69 | } 70 | 71 | //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs) 72 | public float predictProb(Mat inputs, Mat outputs, Mat outputProbs) 73 | { 74 | 75 | float retVal = predictProb_1(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj); 76 | 77 | return retVal; 78 | } 79 | 80 | 81 | @Override 82 | protected void finalize() throws Throwable { 83 | delete(nativeObj); 84 | } 85 | 86 | 87 | 88 | // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::create() 89 | private static native long create_0(); 90 | 91 | // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::load(String filepath, String nodeName = String()) 92 | private static native long load_0(String filepath, String nodeName); 93 | private static native long load_1(String filepath); 94 | 95 | // C++: float cv::ml::NormalBayesClassifier::predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0) 96 | private static native float predictProb_0(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj, int flags); 97 | private static native float predictProb_1(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj); 98 | 99 | // native support for java finalize() 100 | private static native void delete(long nativeObj); 101 | 102 | } 103 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/ml/ParamGrid.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.ml; 5 | 6 | import org.opencv.ml.ParamGrid; 7 | 8 | // C++: class ParamGrid 9 | //javadoc: ParamGrid 10 | 11 | public class ParamGrid { 12 | 13 | protected final long nativeObj; 14 | protected ParamGrid(long addr) { nativeObj = addr; } 15 | 16 | public long getNativeObjAddr() { return nativeObj; } 17 | 18 | // internal usage only 19 | public static ParamGrid __fromPtr__(long addr) { return new ParamGrid(addr); } 20 | 21 | // 22 | // C++: static Ptr_ParamGrid cv::ml::ParamGrid::create(double minVal = 0., double maxVal = 0., double logstep = 1.) 23 | // 24 | 25 | //javadoc: ParamGrid::create(minVal, maxVal, logstep) 26 | public static ParamGrid create(double minVal, double maxVal, double logstep) 27 | { 28 | 29 | ParamGrid retVal = ParamGrid.__fromPtr__(create_0(minVal, maxVal, logstep)); 30 | 31 | return retVal; 32 | } 33 | 34 | //javadoc: ParamGrid::create(minVal, maxVal) 35 | public static ParamGrid create(double minVal, double maxVal) 36 | { 37 | 38 | ParamGrid retVal = ParamGrid.__fromPtr__(create_1(minVal, maxVal)); 39 | 40 | return retVal; 41 | } 42 | 43 | //javadoc: ParamGrid::create(minVal) 44 | public static ParamGrid create(double minVal) 45 | { 46 | 47 | ParamGrid retVal = ParamGrid.__fromPtr__(create_2(minVal)); 48 | 49 | return retVal; 50 | } 51 | 52 | //javadoc: ParamGrid::create() 53 | public static ParamGrid create() 54 | { 55 | 56 | ParamGrid retVal = ParamGrid.__fromPtr__(create_3()); 57 | 58 | return retVal; 59 | } 60 | 61 | 62 | // 63 | // C++: double ParamGrid::minVal 64 | // 65 | 66 | //javadoc: ParamGrid::get_minVal() 67 | public double get_minVal() 68 | { 69 | 70 | double retVal = get_minVal_0(nativeObj); 71 | 72 | return retVal; 73 | } 74 | 75 | 76 | // 77 | // C++: void ParamGrid::minVal 78 | // 79 | 80 | //javadoc: ParamGrid::set_minVal(minVal) 81 | public void set_minVal(double minVal) 82 | { 83 | 84 | set_minVal_0(nativeObj, minVal); 85 | 86 | return; 87 | } 88 | 89 | 90 | // 91 | // C++: double ParamGrid::maxVal 92 | // 93 | 94 | //javadoc: ParamGrid::get_maxVal() 95 | public double get_maxVal() 96 | { 97 | 98 | double retVal = get_maxVal_0(nativeObj); 99 | 100 | return retVal; 101 | } 102 | 103 | 104 | // 105 | // C++: void ParamGrid::maxVal 106 | // 107 | 108 | //javadoc: ParamGrid::set_maxVal(maxVal) 109 | public void set_maxVal(double maxVal) 110 | { 111 | 112 | set_maxVal_0(nativeObj, maxVal); 113 | 114 | return; 115 | } 116 | 117 | 118 | // 119 | // C++: double ParamGrid::logStep 120 | // 121 | 122 | //javadoc: ParamGrid::get_logStep() 123 | public double get_logStep() 124 | { 125 | 126 | double retVal = get_logStep_0(nativeObj); 127 | 128 | return retVal; 129 | } 130 | 131 | 132 | // 133 | // C++: void ParamGrid::logStep 134 | // 135 | 136 | //javadoc: ParamGrid::set_logStep(logStep) 137 | public void set_logStep(double logStep) 138 | { 139 | 140 | set_logStep_0(nativeObj, logStep); 141 | 142 | return; 143 | } 144 | 145 | 146 | @Override 147 | protected void finalize() throws Throwable { 148 | delete(nativeObj); 149 | } 150 | 151 | 152 | 153 | // C++: static Ptr_ParamGrid cv::ml::ParamGrid::create(double minVal = 0., double maxVal = 0., double logstep = 1.) 154 | private static native long create_0(double minVal, double maxVal, double logstep); 155 | private static native long create_1(double minVal, double maxVal); 156 | private static native long create_2(double minVal); 157 | private static native long create_3(); 158 | 159 | // C++: double ParamGrid::minVal 160 | private static native double get_minVal_0(long nativeObj); 161 | 162 | // C++: void ParamGrid::minVal 163 | private static native void set_minVal_0(long nativeObj, double minVal); 164 | 165 | // C++: double ParamGrid::maxVal 166 | private static native double get_maxVal_0(long nativeObj); 167 | 168 | // C++: void ParamGrid::maxVal 169 | private static native void set_maxVal_0(long nativeObj, double maxVal); 170 | 171 | // C++: double ParamGrid::logStep 172 | private static native double get_logStep_0(long nativeObj); 173 | 174 | // C++: void ParamGrid::logStep 175 | private static native void set_logStep_0(long nativeObj, double logStep); 176 | 177 | // native support for java finalize() 178 | private static native void delete(long nativeObj); 179 | 180 | } 181 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/objdetect/BaseCascadeClassifier.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.objdetect; 5 | 6 | import org.opencv.core.Algorithm; 7 | 8 | // C++: class BaseCascadeClassifier 9 | //javadoc: BaseCascadeClassifier 10 | 11 | public class BaseCascadeClassifier extends Algorithm { 12 | 13 | protected BaseCascadeClassifier(long addr) { super(addr); } 14 | 15 | // internal usage only 16 | public static BaseCascadeClassifier __fromPtr__(long addr) { return new BaseCascadeClassifier(addr); } 17 | 18 | @Override 19 | protected void finalize() throws Throwable { 20 | delete(nativeObj); 21 | } 22 | 23 | 24 | 25 | // native support for java finalize() 26 | private static native void delete(long nativeObj); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/objdetect/Objdetect.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.objdetect; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import org.opencv.core.Mat; 9 | import org.opencv.core.MatOfInt; 10 | import org.opencv.core.MatOfRect; 11 | import org.opencv.utils.Converters; 12 | 13 | // C++: class Objdetect 14 | //javadoc: Objdetect 15 | 16 | public class Objdetect { 17 | 18 | public static final int 19 | CASCADE_DO_CANNY_PRUNING = 1, 20 | CASCADE_SCALE_IMAGE = 2, 21 | CASCADE_FIND_BIGGEST_OBJECT = 4, 22 | CASCADE_DO_ROUGH_SEARCH = 8; 23 | 24 | 25 | // 26 | // C++: void cv::groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) 27 | // 28 | 29 | //javadoc: groupRectangles(rectList, weights, groupThreshold, eps) 30 | public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps) 31 | { 32 | Mat rectList_mat = rectList; 33 | Mat weights_mat = weights; 34 | groupRectangles_0(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold, eps); 35 | 36 | return; 37 | } 38 | 39 | //javadoc: groupRectangles(rectList, weights, groupThreshold) 40 | public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold) 41 | { 42 | Mat rectList_mat = rectList; 43 | Mat weights_mat = weights; 44 | groupRectangles_1(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold); 45 | 46 | return; 47 | } 48 | 49 | 50 | 51 | 52 | // C++: void cv::groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) 53 | private static native void groupRectangles_0(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold, double eps); 54 | private static native void groupRectangles_1(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/osgi/OpenCVInterface.java: -------------------------------------------------------------------------------- 1 | package org.opencv.osgi; 2 | 3 | /** 4 | * Dummy interface to allow some integration testing within OSGi implementation. 5 | */ 6 | public interface OpenCVInterface 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/osgi/OpenCVNativeLoader.java: -------------------------------------------------------------------------------- 1 | package org.opencv.osgi; 2 | 3 | import java.util.logging.Level; 4 | import java.util.logging.Logger; 5 | 6 | /** 7 | * This class is intended to provide a convenient way to load OpenCV's native 8 | * library from the Java bundle. If Blueprint is enabled in the OSGi container 9 | * this class will be instantiated automatically and the init() method called 10 | * loading the native library. 11 | */ 12 | public class OpenCVNativeLoader implements OpenCVInterface { 13 | 14 | public void init() { 15 | System.loadLibrary("opencv_java3"); 16 | Logger.getLogger("org.opencv.osgi").log(Level.INFO, "Successfully loaded OpenCV native library."); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/AlignExposures.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import org.opencv.core.Algorithm; 9 | import org.opencv.core.Mat; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class AlignExposures 13 | //javadoc: AlignExposures 14 | 15 | public class AlignExposures extends Algorithm { 16 | 17 | protected AlignExposures(long addr) { super(addr); } 18 | 19 | // internal usage only 20 | public static AlignExposures __fromPtr__(long addr) { return new AlignExposures(addr); } 21 | 22 | // 23 | // C++: void cv::AlignExposures::process(vector_Mat src, vector_Mat dst, Mat times, Mat response) 24 | // 25 | 26 | //javadoc: AlignExposures::process(src, dst, times, response) 27 | public void process(List src, List dst, Mat times, Mat response) 28 | { 29 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 30 | Mat dst_mat = Converters.vector_Mat_to_Mat(dst); 31 | process_0(nativeObj, src_mat.nativeObj, dst_mat.nativeObj, times.nativeObj, response.nativeObj); 32 | 33 | return; 34 | } 35 | 36 | 37 | @Override 38 | protected void finalize() throws Throwable { 39 | delete(nativeObj); 40 | } 41 | 42 | 43 | 44 | // C++: void cv::AlignExposures::process(vector_Mat src, vector_Mat dst, Mat times, Mat response) 45 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_mat_nativeObj, long times_nativeObj, long response_nativeObj); 46 | 47 | // native support for java finalize() 48 | private static native void delete(long nativeObj); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/CalibrateCRF.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import org.opencv.core.Algorithm; 9 | import org.opencv.core.Mat; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class CalibrateCRF 13 | //javadoc: CalibrateCRF 14 | 15 | public class CalibrateCRF extends Algorithm { 16 | 17 | protected CalibrateCRF(long addr) { super(addr); } 18 | 19 | // internal usage only 20 | public static CalibrateCRF __fromPtr__(long addr) { return new CalibrateCRF(addr); } 21 | 22 | // 23 | // C++: void cv::CalibrateCRF::process(vector_Mat src, Mat& dst, Mat times) 24 | // 25 | 26 | //javadoc: CalibrateCRF::process(src, dst, times) 27 | public void process(List src, Mat dst, Mat times) 28 | { 29 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 30 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj); 31 | 32 | return; 33 | } 34 | 35 | 36 | @Override 37 | protected void finalize() throws Throwable { 38 | delete(nativeObj); 39 | } 40 | 41 | 42 | 43 | // C++: void cv::CalibrateCRF::process(vector_Mat src, Mat& dst, Mat times) 44 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 45 | 46 | // native support for java finalize() 47 | private static native void delete(long nativeObj); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/CalibrateDebevec.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import org.opencv.photo.CalibrateCRF; 7 | 8 | // C++: class CalibrateDebevec 9 | //javadoc: CalibrateDebevec 10 | 11 | public class CalibrateDebevec extends CalibrateCRF { 12 | 13 | protected CalibrateDebevec(long addr) { super(addr); } 14 | 15 | // internal usage only 16 | public static CalibrateDebevec __fromPtr__(long addr) { return new CalibrateDebevec(addr); } 17 | 18 | // 19 | // C++: bool cv::CalibrateDebevec::getRandom() 20 | // 21 | 22 | //javadoc: CalibrateDebevec::getRandom() 23 | public boolean getRandom() 24 | { 25 | 26 | boolean retVal = getRandom_0(nativeObj); 27 | 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: float cv::CalibrateDebevec::getLambda() 34 | // 35 | 36 | //javadoc: CalibrateDebevec::getLambda() 37 | public float getLambda() 38 | { 39 | 40 | float retVal = getLambda_0(nativeObj); 41 | 42 | return retVal; 43 | } 44 | 45 | 46 | // 47 | // C++: int cv::CalibrateDebevec::getSamples() 48 | // 49 | 50 | //javadoc: CalibrateDebevec::getSamples() 51 | public int getSamples() 52 | { 53 | 54 | int retVal = getSamples_0(nativeObj); 55 | 56 | return retVal; 57 | } 58 | 59 | 60 | // 61 | // C++: void cv::CalibrateDebevec::setLambda(float lambda) 62 | // 63 | 64 | //javadoc: CalibrateDebevec::setLambda(lambda) 65 | public void setLambda(float lambda) 66 | { 67 | 68 | setLambda_0(nativeObj, lambda); 69 | 70 | return; 71 | } 72 | 73 | 74 | // 75 | // C++: void cv::CalibrateDebevec::setRandom(bool random) 76 | // 77 | 78 | //javadoc: CalibrateDebevec::setRandom(random) 79 | public void setRandom(boolean random) 80 | { 81 | 82 | setRandom_0(nativeObj, random); 83 | 84 | return; 85 | } 86 | 87 | 88 | // 89 | // C++: void cv::CalibrateDebevec::setSamples(int samples) 90 | // 91 | 92 | //javadoc: CalibrateDebevec::setSamples(samples) 93 | public void setSamples(int samples) 94 | { 95 | 96 | setSamples_0(nativeObj, samples); 97 | 98 | return; 99 | } 100 | 101 | 102 | @Override 103 | protected void finalize() throws Throwable { 104 | delete(nativeObj); 105 | } 106 | 107 | 108 | 109 | // C++: bool cv::CalibrateDebevec::getRandom() 110 | private static native boolean getRandom_0(long nativeObj); 111 | 112 | // C++: float cv::CalibrateDebevec::getLambda() 113 | private static native float getLambda_0(long nativeObj); 114 | 115 | // C++: int cv::CalibrateDebevec::getSamples() 116 | private static native int getSamples_0(long nativeObj); 117 | 118 | // C++: void cv::CalibrateDebevec::setLambda(float lambda) 119 | private static native void setLambda_0(long nativeObj, float lambda); 120 | 121 | // C++: void cv::CalibrateDebevec::setRandom(bool random) 122 | private static native void setRandom_0(long nativeObj, boolean random); 123 | 124 | // C++: void cv::CalibrateDebevec::setSamples(int samples) 125 | private static native void setSamples_0(long nativeObj, int samples); 126 | 127 | // native support for java finalize() 128 | private static native void delete(long nativeObj); 129 | 130 | } 131 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/CalibrateRobertson.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import org.opencv.core.Mat; 7 | import org.opencv.photo.CalibrateCRF; 8 | 9 | // C++: class CalibrateRobertson 10 | //javadoc: CalibrateRobertson 11 | 12 | public class CalibrateRobertson extends CalibrateCRF { 13 | 14 | protected CalibrateRobertson(long addr) { super(addr); } 15 | 16 | // internal usage only 17 | public static CalibrateRobertson __fromPtr__(long addr) { return new CalibrateRobertson(addr); } 18 | 19 | // 20 | // C++: Mat cv::CalibrateRobertson::getRadiance() 21 | // 22 | 23 | //javadoc: CalibrateRobertson::getRadiance() 24 | public Mat getRadiance() 25 | { 26 | 27 | Mat retVal = new Mat(getRadiance_0(nativeObj)); 28 | 29 | return retVal; 30 | } 31 | 32 | 33 | // 34 | // C++: float cv::CalibrateRobertson::getThreshold() 35 | // 36 | 37 | //javadoc: CalibrateRobertson::getThreshold() 38 | public float getThreshold() 39 | { 40 | 41 | float retVal = getThreshold_0(nativeObj); 42 | 43 | return retVal; 44 | } 45 | 46 | 47 | // 48 | // C++: int cv::CalibrateRobertson::getMaxIter() 49 | // 50 | 51 | //javadoc: CalibrateRobertson::getMaxIter() 52 | public int getMaxIter() 53 | { 54 | 55 | int retVal = getMaxIter_0(nativeObj); 56 | 57 | return retVal; 58 | } 59 | 60 | 61 | // 62 | // C++: void cv::CalibrateRobertson::setMaxIter(int max_iter) 63 | // 64 | 65 | //javadoc: CalibrateRobertson::setMaxIter(max_iter) 66 | public void setMaxIter(int max_iter) 67 | { 68 | 69 | setMaxIter_0(nativeObj, max_iter); 70 | 71 | return; 72 | } 73 | 74 | 75 | // 76 | // C++: void cv::CalibrateRobertson::setThreshold(float threshold) 77 | // 78 | 79 | //javadoc: CalibrateRobertson::setThreshold(threshold) 80 | public void setThreshold(float threshold) 81 | { 82 | 83 | setThreshold_0(nativeObj, threshold); 84 | 85 | return; 86 | } 87 | 88 | 89 | @Override 90 | protected void finalize() throws Throwable { 91 | delete(nativeObj); 92 | } 93 | 94 | 95 | 96 | // C++: Mat cv::CalibrateRobertson::getRadiance() 97 | private static native long getRadiance_0(long nativeObj); 98 | 99 | // C++: float cv::CalibrateRobertson::getThreshold() 100 | private static native float getThreshold_0(long nativeObj); 101 | 102 | // C++: int cv::CalibrateRobertson::getMaxIter() 103 | private static native int getMaxIter_0(long nativeObj); 104 | 105 | // C++: void cv::CalibrateRobertson::setMaxIter(int max_iter) 106 | private static native void setMaxIter_0(long nativeObj, int max_iter); 107 | 108 | // C++: void cv::CalibrateRobertson::setThreshold(float threshold) 109 | private static native void setThreshold_0(long nativeObj, float threshold); 110 | 111 | // native support for java finalize() 112 | private static native void delete(long nativeObj); 113 | 114 | } 115 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/MergeDebevec.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import org.opencv.core.Mat; 9 | import org.opencv.photo.MergeExposures; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class MergeDebevec 13 | //javadoc: MergeDebevec 14 | 15 | public class MergeDebevec extends MergeExposures { 16 | 17 | protected MergeDebevec(long addr) { super(addr); } 18 | 19 | // internal usage only 20 | public static MergeDebevec __fromPtr__(long addr) { return new MergeDebevec(addr); } 21 | 22 | // 23 | // C++: void cv::MergeDebevec::process(vector_Mat src, Mat& dst, Mat times, Mat response) 24 | // 25 | 26 | //javadoc: MergeDebevec::process(src, dst, times, response) 27 | public void process(List src, Mat dst, Mat times, Mat response) 28 | { 29 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 30 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 31 | 32 | return; 33 | } 34 | 35 | 36 | // 37 | // C++: void cv::MergeDebevec::process(vector_Mat src, Mat& dst, Mat times) 38 | // 39 | 40 | //javadoc: MergeDebevec::process(src, dst, times) 41 | public void process(List src, Mat dst, Mat times) 42 | { 43 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 44 | process_1(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj); 45 | 46 | return; 47 | } 48 | 49 | 50 | @Override 51 | protected void finalize() throws Throwable { 52 | delete(nativeObj); 53 | } 54 | 55 | 56 | 57 | // C++: void cv::MergeDebevec::process(vector_Mat src, Mat& dst, Mat times, Mat response) 58 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 59 | 60 | // C++: void cv::MergeDebevec::process(vector_Mat src, Mat& dst, Mat times) 61 | private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 62 | 63 | // native support for java finalize() 64 | private static native void delete(long nativeObj); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/MergeExposures.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import org.opencv.core.Algorithm; 9 | import org.opencv.core.Mat; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class MergeExposures 13 | //javadoc: MergeExposures 14 | 15 | public class MergeExposures extends Algorithm { 16 | 17 | protected MergeExposures(long addr) { super(addr); } 18 | 19 | // internal usage only 20 | public static MergeExposures __fromPtr__(long addr) { return new MergeExposures(addr); } 21 | 22 | // 23 | // C++: void cv::MergeExposures::process(vector_Mat src, Mat& dst, Mat times, Mat response) 24 | // 25 | 26 | //javadoc: MergeExposures::process(src, dst, times, response) 27 | public void process(List src, Mat dst, Mat times, Mat response) 28 | { 29 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 30 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 31 | 32 | return; 33 | } 34 | 35 | 36 | @Override 37 | protected void finalize() throws Throwable { 38 | delete(nativeObj); 39 | } 40 | 41 | 42 | 43 | // C++: void cv::MergeExposures::process(vector_Mat src, Mat& dst, Mat times, Mat response) 44 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 45 | 46 | // native support for java finalize() 47 | private static native void delete(long nativeObj); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/MergeRobertson.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import org.opencv.core.Mat; 9 | import org.opencv.photo.MergeExposures; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class MergeRobertson 13 | //javadoc: MergeRobertson 14 | 15 | public class MergeRobertson extends MergeExposures { 16 | 17 | protected MergeRobertson(long addr) { super(addr); } 18 | 19 | // internal usage only 20 | public static MergeRobertson __fromPtr__(long addr) { return new MergeRobertson(addr); } 21 | 22 | // 23 | // C++: void cv::MergeRobertson::process(vector_Mat src, Mat& dst, Mat times, Mat response) 24 | // 25 | 26 | //javadoc: MergeRobertson::process(src, dst, times, response) 27 | public void process(List src, Mat dst, Mat times, Mat response) 28 | { 29 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 30 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 31 | 32 | return; 33 | } 34 | 35 | 36 | // 37 | // C++: void cv::MergeRobertson::process(vector_Mat src, Mat& dst, Mat times) 38 | // 39 | 40 | //javadoc: MergeRobertson::process(src, dst, times) 41 | public void process(List src, Mat dst, Mat times) 42 | { 43 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 44 | process_1(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj); 45 | 46 | return; 47 | } 48 | 49 | 50 | @Override 51 | protected void finalize() throws Throwable { 52 | delete(nativeObj); 53 | } 54 | 55 | 56 | 57 | // C++: void cv::MergeRobertson::process(vector_Mat src, Mat& dst, Mat times, Mat response) 58 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 59 | 60 | // C++: void cv::MergeRobertson::process(vector_Mat src, Mat& dst, Mat times) 61 | private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 62 | 63 | // native support for java finalize() 64 | private static native void delete(long nativeObj); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/Tonemap.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import org.opencv.core.Algorithm; 7 | import org.opencv.core.Mat; 8 | 9 | // C++: class Tonemap 10 | //javadoc: Tonemap 11 | 12 | public class Tonemap extends Algorithm { 13 | 14 | protected Tonemap(long addr) { super(addr); } 15 | 16 | // internal usage only 17 | public static Tonemap __fromPtr__(long addr) { return new Tonemap(addr); } 18 | 19 | // 20 | // C++: float cv::Tonemap::getGamma() 21 | // 22 | 23 | //javadoc: Tonemap::getGamma() 24 | public float getGamma() 25 | { 26 | 27 | float retVal = getGamma_0(nativeObj); 28 | 29 | return retVal; 30 | } 31 | 32 | 33 | // 34 | // C++: void cv::Tonemap::process(Mat src, Mat& dst) 35 | // 36 | 37 | //javadoc: Tonemap::process(src, dst) 38 | public void process(Mat src, Mat dst) 39 | { 40 | 41 | process_0(nativeObj, src.nativeObj, dst.nativeObj); 42 | 43 | return; 44 | } 45 | 46 | 47 | // 48 | // C++: void cv::Tonemap::setGamma(float gamma) 49 | // 50 | 51 | //javadoc: Tonemap::setGamma(gamma) 52 | public void setGamma(float gamma) 53 | { 54 | 55 | setGamma_0(nativeObj, gamma); 56 | 57 | return; 58 | } 59 | 60 | 61 | @Override 62 | protected void finalize() throws Throwable { 63 | delete(nativeObj); 64 | } 65 | 66 | 67 | 68 | // C++: float cv::Tonemap::getGamma() 69 | private static native float getGamma_0(long nativeObj); 70 | 71 | // C++: void cv::Tonemap::process(Mat src, Mat& dst) 72 | private static native void process_0(long nativeObj, long src_nativeObj, long dst_nativeObj); 73 | 74 | // C++: void cv::Tonemap::setGamma(float gamma) 75 | private static native void setGamma_0(long nativeObj, float gamma); 76 | 77 | // native support for java finalize() 78 | private static native void delete(long nativeObj); 79 | 80 | } 81 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/TonemapDrago.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import org.opencv.photo.Tonemap; 7 | 8 | // C++: class TonemapDrago 9 | //javadoc: TonemapDrago 10 | 11 | public class TonemapDrago extends Tonemap { 12 | 13 | protected TonemapDrago(long addr) { super(addr); } 14 | 15 | // internal usage only 16 | public static TonemapDrago __fromPtr__(long addr) { return new TonemapDrago(addr); } 17 | 18 | // 19 | // C++: float cv::TonemapDrago::getBias() 20 | // 21 | 22 | //javadoc: TonemapDrago::getBias() 23 | public float getBias() 24 | { 25 | 26 | float retVal = getBias_0(nativeObj); 27 | 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: float cv::TonemapDrago::getSaturation() 34 | // 35 | 36 | //javadoc: TonemapDrago::getSaturation() 37 | public float getSaturation() 38 | { 39 | 40 | float retVal = getSaturation_0(nativeObj); 41 | 42 | return retVal; 43 | } 44 | 45 | 46 | // 47 | // C++: void cv::TonemapDrago::setBias(float bias) 48 | // 49 | 50 | //javadoc: TonemapDrago::setBias(bias) 51 | public void setBias(float bias) 52 | { 53 | 54 | setBias_0(nativeObj, bias); 55 | 56 | return; 57 | } 58 | 59 | 60 | // 61 | // C++: void cv::TonemapDrago::setSaturation(float saturation) 62 | // 63 | 64 | //javadoc: TonemapDrago::setSaturation(saturation) 65 | public void setSaturation(float saturation) 66 | { 67 | 68 | setSaturation_0(nativeObj, saturation); 69 | 70 | return; 71 | } 72 | 73 | 74 | @Override 75 | protected void finalize() throws Throwable { 76 | delete(nativeObj); 77 | } 78 | 79 | 80 | 81 | // C++: float cv::TonemapDrago::getBias() 82 | private static native float getBias_0(long nativeObj); 83 | 84 | // C++: float cv::TonemapDrago::getSaturation() 85 | private static native float getSaturation_0(long nativeObj); 86 | 87 | // C++: void cv::TonemapDrago::setBias(float bias) 88 | private static native void setBias_0(long nativeObj, float bias); 89 | 90 | // C++: void cv::TonemapDrago::setSaturation(float saturation) 91 | private static native void setSaturation_0(long nativeObj, float saturation); 92 | 93 | // native support for java finalize() 94 | private static native void delete(long nativeObj); 95 | 96 | } 97 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/TonemapDurand.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import org.opencv.photo.Tonemap; 7 | 8 | // C++: class TonemapDurand 9 | //javadoc: TonemapDurand 10 | 11 | public class TonemapDurand extends Tonemap { 12 | 13 | protected TonemapDurand(long addr) { super(addr); } 14 | 15 | // internal usage only 16 | public static TonemapDurand __fromPtr__(long addr) { return new TonemapDurand(addr); } 17 | 18 | // 19 | // C++: float cv::TonemapDurand::getContrast() 20 | // 21 | 22 | //javadoc: TonemapDurand::getContrast() 23 | public float getContrast() 24 | { 25 | 26 | float retVal = getContrast_0(nativeObj); 27 | 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: float cv::TonemapDurand::getSaturation() 34 | // 35 | 36 | //javadoc: TonemapDurand::getSaturation() 37 | public float getSaturation() 38 | { 39 | 40 | float retVal = getSaturation_0(nativeObj); 41 | 42 | return retVal; 43 | } 44 | 45 | 46 | // 47 | // C++: float cv::TonemapDurand::getSigmaColor() 48 | // 49 | 50 | //javadoc: TonemapDurand::getSigmaColor() 51 | public float getSigmaColor() 52 | { 53 | 54 | float retVal = getSigmaColor_0(nativeObj); 55 | 56 | return retVal; 57 | } 58 | 59 | 60 | // 61 | // C++: float cv::TonemapDurand::getSigmaSpace() 62 | // 63 | 64 | //javadoc: TonemapDurand::getSigmaSpace() 65 | public float getSigmaSpace() 66 | { 67 | 68 | float retVal = getSigmaSpace_0(nativeObj); 69 | 70 | return retVal; 71 | } 72 | 73 | 74 | // 75 | // C++: void cv::TonemapDurand::setContrast(float contrast) 76 | // 77 | 78 | //javadoc: TonemapDurand::setContrast(contrast) 79 | public void setContrast(float contrast) 80 | { 81 | 82 | setContrast_0(nativeObj, contrast); 83 | 84 | return; 85 | } 86 | 87 | 88 | // 89 | // C++: void cv::TonemapDurand::setSaturation(float saturation) 90 | // 91 | 92 | //javadoc: TonemapDurand::setSaturation(saturation) 93 | public void setSaturation(float saturation) 94 | { 95 | 96 | setSaturation_0(nativeObj, saturation); 97 | 98 | return; 99 | } 100 | 101 | 102 | // 103 | // C++: void cv::TonemapDurand::setSigmaColor(float sigma_color) 104 | // 105 | 106 | //javadoc: TonemapDurand::setSigmaColor(sigma_color) 107 | public void setSigmaColor(float sigma_color) 108 | { 109 | 110 | setSigmaColor_0(nativeObj, sigma_color); 111 | 112 | return; 113 | } 114 | 115 | 116 | // 117 | // C++: void cv::TonemapDurand::setSigmaSpace(float sigma_space) 118 | // 119 | 120 | //javadoc: TonemapDurand::setSigmaSpace(sigma_space) 121 | public void setSigmaSpace(float sigma_space) 122 | { 123 | 124 | setSigmaSpace_0(nativeObj, sigma_space); 125 | 126 | return; 127 | } 128 | 129 | 130 | @Override 131 | protected void finalize() throws Throwable { 132 | delete(nativeObj); 133 | } 134 | 135 | 136 | 137 | // C++: float cv::TonemapDurand::getContrast() 138 | private static native float getContrast_0(long nativeObj); 139 | 140 | // C++: float cv::TonemapDurand::getSaturation() 141 | private static native float getSaturation_0(long nativeObj); 142 | 143 | // C++: float cv::TonemapDurand::getSigmaColor() 144 | private static native float getSigmaColor_0(long nativeObj); 145 | 146 | // C++: float cv::TonemapDurand::getSigmaSpace() 147 | private static native float getSigmaSpace_0(long nativeObj); 148 | 149 | // C++: void cv::TonemapDurand::setContrast(float contrast) 150 | private static native void setContrast_0(long nativeObj, float contrast); 151 | 152 | // C++: void cv::TonemapDurand::setSaturation(float saturation) 153 | private static native void setSaturation_0(long nativeObj, float saturation); 154 | 155 | // C++: void cv::TonemapDurand::setSigmaColor(float sigma_color) 156 | private static native void setSigmaColor_0(long nativeObj, float sigma_color); 157 | 158 | // C++: void cv::TonemapDurand::setSigmaSpace(float sigma_space) 159 | private static native void setSigmaSpace_0(long nativeObj, float sigma_space); 160 | 161 | // native support for java finalize() 162 | private static native void delete(long nativeObj); 163 | 164 | } 165 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/TonemapMantiuk.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import org.opencv.photo.Tonemap; 7 | 8 | // C++: class TonemapMantiuk 9 | //javadoc: TonemapMantiuk 10 | 11 | public class TonemapMantiuk extends Tonemap { 12 | 13 | protected TonemapMantiuk(long addr) { super(addr); } 14 | 15 | // internal usage only 16 | public static TonemapMantiuk __fromPtr__(long addr) { return new TonemapMantiuk(addr); } 17 | 18 | // 19 | // C++: float cv::TonemapMantiuk::getSaturation() 20 | // 21 | 22 | //javadoc: TonemapMantiuk::getSaturation() 23 | public float getSaturation() 24 | { 25 | 26 | float retVal = getSaturation_0(nativeObj); 27 | 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: float cv::TonemapMantiuk::getScale() 34 | // 35 | 36 | //javadoc: TonemapMantiuk::getScale() 37 | public float getScale() 38 | { 39 | 40 | float retVal = getScale_0(nativeObj); 41 | 42 | return retVal; 43 | } 44 | 45 | 46 | // 47 | // C++: void cv::TonemapMantiuk::setSaturation(float saturation) 48 | // 49 | 50 | //javadoc: TonemapMantiuk::setSaturation(saturation) 51 | public void setSaturation(float saturation) 52 | { 53 | 54 | setSaturation_0(nativeObj, saturation); 55 | 56 | return; 57 | } 58 | 59 | 60 | // 61 | // C++: void cv::TonemapMantiuk::setScale(float scale) 62 | // 63 | 64 | //javadoc: TonemapMantiuk::setScale(scale) 65 | public void setScale(float scale) 66 | { 67 | 68 | setScale_0(nativeObj, scale); 69 | 70 | return; 71 | } 72 | 73 | 74 | @Override 75 | protected void finalize() throws Throwable { 76 | delete(nativeObj); 77 | } 78 | 79 | 80 | 81 | // C++: float cv::TonemapMantiuk::getSaturation() 82 | private static native float getSaturation_0(long nativeObj); 83 | 84 | // C++: float cv::TonemapMantiuk::getScale() 85 | private static native float getScale_0(long nativeObj); 86 | 87 | // C++: void cv::TonemapMantiuk::setSaturation(float saturation) 88 | private static native void setSaturation_0(long nativeObj, float saturation); 89 | 90 | // C++: void cv::TonemapMantiuk::setScale(float scale) 91 | private static native void setScale_0(long nativeObj, float scale); 92 | 93 | // native support for java finalize() 94 | private static native void delete(long nativeObj); 95 | 96 | } 97 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/photo/TonemapReinhard.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.photo; 5 | 6 | import org.opencv.photo.Tonemap; 7 | 8 | // C++: class TonemapReinhard 9 | //javadoc: TonemapReinhard 10 | 11 | public class TonemapReinhard extends Tonemap { 12 | 13 | protected TonemapReinhard(long addr) { super(addr); } 14 | 15 | // internal usage only 16 | public static TonemapReinhard __fromPtr__(long addr) { return new TonemapReinhard(addr); } 17 | 18 | // 19 | // C++: float cv::TonemapReinhard::getColorAdaptation() 20 | // 21 | 22 | //javadoc: TonemapReinhard::getColorAdaptation() 23 | public float getColorAdaptation() 24 | { 25 | 26 | float retVal = getColorAdaptation_0(nativeObj); 27 | 28 | return retVal; 29 | } 30 | 31 | 32 | // 33 | // C++: float cv::TonemapReinhard::getIntensity() 34 | // 35 | 36 | //javadoc: TonemapReinhard::getIntensity() 37 | public float getIntensity() 38 | { 39 | 40 | float retVal = getIntensity_0(nativeObj); 41 | 42 | return retVal; 43 | } 44 | 45 | 46 | // 47 | // C++: float cv::TonemapReinhard::getLightAdaptation() 48 | // 49 | 50 | //javadoc: TonemapReinhard::getLightAdaptation() 51 | public float getLightAdaptation() 52 | { 53 | 54 | float retVal = getLightAdaptation_0(nativeObj); 55 | 56 | return retVal; 57 | } 58 | 59 | 60 | // 61 | // C++: void cv::TonemapReinhard::setColorAdaptation(float color_adapt) 62 | // 63 | 64 | //javadoc: TonemapReinhard::setColorAdaptation(color_adapt) 65 | public void setColorAdaptation(float color_adapt) 66 | { 67 | 68 | setColorAdaptation_0(nativeObj, color_adapt); 69 | 70 | return; 71 | } 72 | 73 | 74 | // 75 | // C++: void cv::TonemapReinhard::setIntensity(float intensity) 76 | // 77 | 78 | //javadoc: TonemapReinhard::setIntensity(intensity) 79 | public void setIntensity(float intensity) 80 | { 81 | 82 | setIntensity_0(nativeObj, intensity); 83 | 84 | return; 85 | } 86 | 87 | 88 | // 89 | // C++: void cv::TonemapReinhard::setLightAdaptation(float light_adapt) 90 | // 91 | 92 | //javadoc: TonemapReinhard::setLightAdaptation(light_adapt) 93 | public void setLightAdaptation(float light_adapt) 94 | { 95 | 96 | setLightAdaptation_0(nativeObj, light_adapt); 97 | 98 | return; 99 | } 100 | 101 | 102 | @Override 103 | protected void finalize() throws Throwable { 104 | delete(nativeObj); 105 | } 106 | 107 | 108 | 109 | // C++: float cv::TonemapReinhard::getColorAdaptation() 110 | private static native float getColorAdaptation_0(long nativeObj); 111 | 112 | // C++: float cv::TonemapReinhard::getIntensity() 113 | private static native float getIntensity_0(long nativeObj); 114 | 115 | // C++: float cv::TonemapReinhard::getLightAdaptation() 116 | private static native float getLightAdaptation_0(long nativeObj); 117 | 118 | // C++: void cv::TonemapReinhard::setColorAdaptation(float color_adapt) 119 | private static native void setColorAdaptation_0(long nativeObj, float color_adapt); 120 | 121 | // C++: void cv::TonemapReinhard::setIntensity(float intensity) 122 | private static native void setIntensity_0(long nativeObj, float intensity); 123 | 124 | // C++: void cv::TonemapReinhard::setLightAdaptation(float light_adapt) 125 | private static native void setLightAdaptation_0(long nativeObj, float light_adapt); 126 | 127 | // native support for java finalize() 128 | private static native void delete(long nativeObj); 129 | 130 | } 131 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/video/BackgroundSubtractor.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.video; 5 | 6 | import org.opencv.core.Algorithm; 7 | import org.opencv.core.Mat; 8 | 9 | // C++: class BackgroundSubtractor 10 | //javadoc: BackgroundSubtractor 11 | 12 | public class BackgroundSubtractor extends Algorithm { 13 | 14 | protected BackgroundSubtractor(long addr) { super(addr); } 15 | 16 | // internal usage only 17 | public static BackgroundSubtractor __fromPtr__(long addr) { return new BackgroundSubtractor(addr); } 18 | 19 | // 20 | // C++: void cv::BackgroundSubtractor::apply(Mat image, Mat& fgmask, double learningRate = -1) 21 | // 22 | 23 | //javadoc: BackgroundSubtractor::apply(image, fgmask, learningRate) 24 | public void apply(Mat image, Mat fgmask, double learningRate) 25 | { 26 | 27 | apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate); 28 | 29 | return; 30 | } 31 | 32 | //javadoc: BackgroundSubtractor::apply(image, fgmask) 33 | public void apply(Mat image, Mat fgmask) 34 | { 35 | 36 | apply_1(nativeObj, image.nativeObj, fgmask.nativeObj); 37 | 38 | return; 39 | } 40 | 41 | 42 | // 43 | // C++: void cv::BackgroundSubtractor::getBackgroundImage(Mat& backgroundImage) 44 | // 45 | 46 | //javadoc: BackgroundSubtractor::getBackgroundImage(backgroundImage) 47 | public void getBackgroundImage(Mat backgroundImage) 48 | { 49 | 50 | getBackgroundImage_0(nativeObj, backgroundImage.nativeObj); 51 | 52 | return; 53 | } 54 | 55 | 56 | @Override 57 | protected void finalize() throws Throwable { 58 | delete(nativeObj); 59 | } 60 | 61 | 62 | 63 | // C++: void cv::BackgroundSubtractor::apply(Mat image, Mat& fgmask, double learningRate = -1) 64 | private static native void apply_0(long nativeObj, long image_nativeObj, long fgmask_nativeObj, double learningRate); 65 | private static native void apply_1(long nativeObj, long image_nativeObj, long fgmask_nativeObj); 66 | 67 | // C++: void cv::BackgroundSubtractor::getBackgroundImage(Mat& backgroundImage) 68 | private static native void getBackgroundImage_0(long nativeObj, long backgroundImage_nativeObj); 69 | 70 | // native support for java finalize() 71 | private static native void delete(long nativeObj); 72 | 73 | } 74 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/video/DenseOpticalFlow.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.video; 5 | 6 | import org.opencv.core.Algorithm; 7 | import org.opencv.core.Mat; 8 | 9 | // C++: class DenseOpticalFlow 10 | //javadoc: DenseOpticalFlow 11 | 12 | public class DenseOpticalFlow extends Algorithm { 13 | 14 | protected DenseOpticalFlow(long addr) { super(addr); } 15 | 16 | // internal usage only 17 | public static DenseOpticalFlow __fromPtr__(long addr) { return new DenseOpticalFlow(addr); } 18 | 19 | // 20 | // C++: void cv::DenseOpticalFlow::calc(Mat I0, Mat I1, Mat& flow) 21 | // 22 | 23 | //javadoc: DenseOpticalFlow::calc(I0, I1, flow) 24 | public void calc(Mat I0, Mat I1, Mat flow) 25 | { 26 | 27 | calc_0(nativeObj, I0.nativeObj, I1.nativeObj, flow.nativeObj); 28 | 29 | return; 30 | } 31 | 32 | 33 | // 34 | // C++: void cv::DenseOpticalFlow::collectGarbage() 35 | // 36 | 37 | //javadoc: DenseOpticalFlow::collectGarbage() 38 | public void collectGarbage() 39 | { 40 | 41 | collectGarbage_0(nativeObj); 42 | 43 | return; 44 | } 45 | 46 | 47 | @Override 48 | protected void finalize() throws Throwable { 49 | delete(nativeObj); 50 | } 51 | 52 | 53 | 54 | // C++: void cv::DenseOpticalFlow::calc(Mat I0, Mat I1, Mat& flow) 55 | private static native void calc_0(long nativeObj, long I0_nativeObj, long I1_nativeObj, long flow_nativeObj); 56 | 57 | // C++: void cv::DenseOpticalFlow::collectGarbage() 58 | private static native void collectGarbage_0(long nativeObj); 59 | 60 | // native support for java finalize() 61 | private static native void delete(long nativeObj); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/java/org/opencv/video/SparseOpticalFlow.java: -------------------------------------------------------------------------------- 1 | // 2 | // This file is auto-generated. Please don't modify it! 3 | // 4 | package org.opencv.video; 5 | 6 | import org.opencv.core.Algorithm; 7 | import org.opencv.core.Mat; 8 | 9 | // C++: class SparseOpticalFlow 10 | //javadoc: SparseOpticalFlow 11 | 12 | public class SparseOpticalFlow extends Algorithm { 13 | 14 | protected SparseOpticalFlow(long addr) { super(addr); } 15 | 16 | // internal usage only 17 | public static SparseOpticalFlow __fromPtr__(long addr) { return new SparseOpticalFlow(addr); } 18 | 19 | // 20 | // C++: void cv::SparseOpticalFlow::calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat& nextPts, Mat& status, Mat& err = cv::Mat()) 21 | // 22 | 23 | //javadoc: SparseOpticalFlow::calc(prevImg, nextImg, prevPts, nextPts, status, err) 24 | public void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status, Mat err) 25 | { 26 | 27 | calc_0(nativeObj, prevImg.nativeObj, nextImg.nativeObj, prevPts.nativeObj, nextPts.nativeObj, status.nativeObj, err.nativeObj); 28 | 29 | return; 30 | } 31 | 32 | //javadoc: SparseOpticalFlow::calc(prevImg, nextImg, prevPts, nextPts, status) 33 | public void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status) 34 | { 35 | 36 | calc_1(nativeObj, prevImg.nativeObj, nextImg.nativeObj, prevPts.nativeObj, nextPts.nativeObj, status.nativeObj); 37 | 38 | return; 39 | } 40 | 41 | 42 | @Override 43 | protected void finalize() throws Throwable { 44 | delete(nativeObj); 45 | } 46 | 47 | 48 | 49 | // C++: void cv::SparseOpticalFlow::calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat& nextPts, Mat& status, Mat& err = cv::Mat()) 50 | private static native void calc_0(long nativeObj, long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_nativeObj, long nextPts_nativeObj, long status_nativeObj, long err_nativeObj); 51 | private static native void calc_1(long nativeObj, long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_nativeObj, long nextPts_nativeObj, long status_nativeObj); 52 | 53 | // native support for java finalize() 54 | private static native void delete(long nativeObj); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /openCVLibrary343/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | include ':openCVLibrary343' 3 | --------------------------------------------------------------------------------