├── .gitignore ├── .npmignore ├── License ├── README.md ├── android ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── import-summary.txt ├── openCVLibrary320 │ ├── 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 │ │ │ ├── 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 │ │ │ ├── Point.java │ │ │ ├── Point3.java │ │ │ ├── Range.java │ │ │ ├── Rect.java │ │ │ ├── RotatedRect.java │ │ │ ├── Scalar.java │ │ │ ├── Size.java │ │ │ ├── TermCriteria.java │ │ │ └── TickMeter.java │ │ │ ├── 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 │ │ │ ├── Boost.java │ │ │ ├── DTrees.java │ │ │ ├── EM.java │ │ │ ├── KNearest.java │ │ │ ├── LogisticRegression.java │ │ │ ├── Ml.java │ │ │ ├── NormalBayesClassifier.java │ │ │ ├── RTrees.java │ │ │ ├── SVM.java │ │ │ ├── SVMSGD.java │ │ │ ├── StatModel.java │ │ │ └── TrainData.java │ │ │ ├── objdetect │ │ │ ├── BaseCascadeClassifier.java │ │ │ ├── CascadeClassifier.java │ │ │ ├── HOGDescriptor.java │ │ │ └── Objdetect.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 └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── my │ └── fin │ ├── RNScanDocModule.java │ └── RNScanDocPackage.java ├── example ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── __tests__ │ ├── index.android.js │ └── index.ios.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── LifecycleCallbacks.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── import-summary.txt │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ ├── openCVLibrary320 │ │ ├── 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 │ │ │ │ ├── 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 │ │ │ │ ├── Point.java │ │ │ │ ├── Point3.java │ │ │ │ ├── Range.java │ │ │ │ ├── Rect.java │ │ │ │ ├── RotatedRect.java │ │ │ │ ├── Scalar.java │ │ │ │ ├── Size.java │ │ │ │ ├── TermCriteria.java │ │ │ │ └── TickMeter.java │ │ │ │ ├── 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 │ │ │ │ ├── Boost.java │ │ │ │ ├── DTrees.java │ │ │ │ ├── EM.java │ │ │ │ ├── KNearest.java │ │ │ │ ├── LogisticRegression.java │ │ │ │ ├── Ml.java │ │ │ │ ├── NormalBayesClassifier.java │ │ │ │ ├── RTrees.java │ │ │ │ ├── SVM.java │ │ │ │ ├── SVMSGD.java │ │ │ │ ├── StatModel.java │ │ │ │ └── TrainData.java │ │ │ │ ├── objdetect │ │ │ │ ├── BaseCascadeClassifier.java │ │ │ │ ├── CascadeClassifier.java │ │ │ │ ├── HOGDescriptor.java │ │ │ │ └── Objdetect.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 ├── app.json ├── index.android.js ├── index.ios.js ├── ios │ ├── example-tvOS │ │ └── Info.plist │ ├── example-tvOSTests │ │ └── Info.plist │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── example-tvOS.xcscheme │ │ │ └── example.xcscheme │ ├── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m └── package.json ├── index.js ├── ios ├── RNScanDoc.h ├── RNScanDoc.m └── RNScanDoc.xcodeproj │ └── project.pbxproj └── package.json /License: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Yang Yao 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. -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | dependencies { 6 | classpath 'com.android.tools.build:gradle:2.2.2' 7 | } 8 | } 9 | 10 | apply plugin: 'com.android.library' 11 | 12 | android { 13 | compileSdkVersion 23 14 | buildToolsVersion "23.0.1" 15 | 16 | defaultConfig { 17 | minSdkVersion 16 18 | targetSdkVersion 22 19 | versionCode 1 20 | versionName "1.0" 21 | ndk { 22 | abiFilters "armeabi-v7a", "x86" 23 | } 24 | } 25 | lintOptions { 26 | warning 'InvalidPackage' 27 | } 28 | } 29 | 30 | repositories { 31 | mavenCentral() 32 | } 33 | 34 | dependencies { 35 | compile 'com.facebook.react:react-native:+' 36 | compile project(path: ':openCVLibrary320') 37 | } 38 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-scan-doc/fccaf6bf76a6834798ca0ce3590d640939d04d04/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /android/openCVLibrary320/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 14 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 8 9 | targetSdkVersion 21 10 | } 11 | 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/openCVLibrary320/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/core/Algorithm.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.core; 6 | 7 | import java.lang.String; 8 | 9 | // C++: class Algorithm 10 | //javadoc: Algorithm 11 | public class Algorithm { 12 | 13 | protected final long nativeObj; 14 | protected Algorithm(long addr) { nativeObj = addr; } 15 | 16 | 17 | // 18 | // C++: String getDefaultName() 19 | // 20 | 21 | //javadoc: Algorithm::getDefaultName() 22 | public String getDefaultName() 23 | { 24 | 25 | String retVal = getDefaultName_0(nativeObj); 26 | 27 | return retVal; 28 | } 29 | 30 | 31 | // 32 | // C++: void clear() 33 | // 34 | 35 | //javadoc: Algorithm::clear() 36 | public void clear() 37 | { 38 | 39 | clear_0(nativeObj); 40 | 41 | return; 42 | } 43 | 44 | 45 | // 46 | // C++: void save(String filename) 47 | // 48 | 49 | //javadoc: Algorithm::save(filename) 50 | public void save(String filename) 51 | { 52 | 53 | save_0(nativeObj, filename); 54 | 55 | return; 56 | } 57 | 58 | 59 | @Override 60 | protected void finalize() throws Throwable { 61 | delete(nativeObj); 62 | } 63 | 64 | 65 | 66 | // C++: String getDefaultName() 67 | private static native String getDefaultName_0(long nativeObj); 68 | 69 | // C++: void clear() 70 | private static native void clear_0(long nativeObj); 71 | 72 | // C++: void save(String filename) 73 | private static native void save_0(long nativeObj, String filename); 74 | 75 | // native support for java finalize() 76 | private static native void delete(long nativeObj); 77 | 78 | } 79 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | /** 49 | * Less is better. 50 | */ 51 | public boolean lessThan(DMatch it) { 52 | return distance < it.distance; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return "DMatch [queryIdx=" + queryIdx + ", trainIdx=" + trainIdx 58 | + ", imgIdx=" + imgIdx + ", distance=" + distance + "]"; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/core/MatOfByte.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class MatOfByte extends Mat { 7 | // 8UC(x) 8 | private static final int _depth = CvType.CV_8U; 9 | private static final int _channels = 1; 10 | 11 | public MatOfByte() { 12 | super(); 13 | } 14 | 15 | protected MatOfByte(long addr) { 16 | super(addr); 17 | if( !empty() && checkVector(_channels, _depth) < 0 ) 18 | throw new IllegalArgumentException("Incompatible Mat"); 19 | //FIXME: do we need release() here? 20 | } 21 | 22 | public static MatOfByte fromNativeAddr(long addr) { 23 | return new MatOfByte(addr); 24 | } 25 | 26 | public MatOfByte(Mat m) { 27 | super(m, Range.all()); 28 | if( !empty() && checkVector(_channels, _depth) < 0 ) 29 | throw new IllegalArgumentException("Incompatible Mat"); 30 | //FIXME: do we need release() here? 31 | } 32 | 33 | public MatOfByte(byte...a) { 34 | super(); 35 | fromArray(a); 36 | } 37 | 38 | public void alloc(int elemNumber) { 39 | if(elemNumber>0) 40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); 41 | } 42 | 43 | public void fromArray(byte...a) { 44 | if(a==null || a.length==0) 45 | return; 46 | int num = a.length / _channels; 47 | alloc(num); 48 | put(0, 0, a); //TODO: check ret val! 49 | } 50 | 51 | public byte[] toArray() { 52 | int num = checkVector(_channels, _depth); 53 | if(num < 0) 54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); 55 | byte[] a = new byte[num * _channels]; 56 | if(num == 0) 57 | return a; 58 | get(0, 0, a); //TODO: check ret val! 59 | return a; 60 | } 61 | 62 | public void fromList(List lb) { 63 | if(lb==null || lb.size()==0) 64 | return; 65 | Byte ab[] = lb.toArray(new Byte[0]); 66 | byte a[] = new byte[ab.length]; 67 | for(int i=0; i toList() { 73 | byte[] a = toArray(); 74 | Byte ab[] = new Byte[a.length]; 75 | for(int i=0; i0) 42 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); 43 | } 44 | 45 | 46 | public void fromArray(DMatch...a) { 47 | if(a==null || a.length==0) 48 | return; 49 | int num = a.length; 50 | alloc(num); 51 | float buff[] = new float[num * _channels]; 52 | for(int i=0; i ldm) { 75 | DMatch adm[] = ldm.toArray(new DMatch[0]); 76 | fromArray(adm); 77 | } 78 | 79 | public List toList() { 80 | DMatch[] adm = toArray(); 81 | return Arrays.asList(adm); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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) 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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /android/openCVLibrary320/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 Size clone() { 41 | return new Size(width, height); 42 | } 43 | 44 | @Override 45 | public int hashCode() { 46 | final int prime = 31; 47 | int result = 1; 48 | long temp; 49 | temp = Double.doubleToLongBits(height); 50 | result = prime * result + (int) (temp ^ (temp >>> 32)); 51 | temp = Double.doubleToLongBits(width); 52 | result = prime * result + (int) (temp ^ (temp >>> 32)); 53 | return result; 54 | } 55 | 56 | @Override 57 | public boolean equals(Object obj) { 58 | if (this == obj) return true; 59 | if (!(obj instanceof Size)) return false; 60 | Size it = (Size) obj; 61 | return width == it.width && height == it.height; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return (int)width + "x" + (int)height; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/features2d/BFMatcher.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.features2d; 6 | 7 | 8 | 9 | // C++: class BFMatcher 10 | //javadoc: BFMatcher 11 | public class BFMatcher extends DescriptorMatcher { 12 | 13 | protected BFMatcher(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: BFMatcher(int normType = NORM_L2, bool crossCheck = false) 18 | // 19 | 20 | //javadoc: BFMatcher::BFMatcher(normType, crossCheck) 21 | public BFMatcher(int normType, boolean crossCheck) 22 | { 23 | 24 | super( BFMatcher_0(normType, crossCheck) ); 25 | 26 | return; 27 | } 28 | 29 | //javadoc: BFMatcher::BFMatcher() 30 | public BFMatcher() 31 | { 32 | 33 | super( BFMatcher_1() ); 34 | 35 | return; 36 | } 37 | 38 | 39 | // 40 | // C++: static Ptr_BFMatcher create(int normType = NORM_L2, bool crossCheck = false) 41 | // 42 | 43 | //javadoc: BFMatcher::create(normType, crossCheck) 44 | public static BFMatcher create(int normType, boolean crossCheck) 45 | { 46 | 47 | BFMatcher retVal = new BFMatcher(create_0(normType, crossCheck)); 48 | 49 | return retVal; 50 | } 51 | 52 | //javadoc: BFMatcher::create() 53 | public static BFMatcher create() 54 | { 55 | 56 | BFMatcher retVal = new BFMatcher(create_1()); 57 | 58 | return retVal; 59 | } 60 | 61 | 62 | @Override 63 | protected void finalize() throws Throwable { 64 | delete(nativeObj); 65 | } 66 | 67 | 68 | 69 | // C++: BFMatcher(int normType = NORM_L2, bool crossCheck = false) 70 | private static native long BFMatcher_0(int normType, boolean crossCheck); 71 | private static native long BFMatcher_1(); 72 | 73 | // C++: static Ptr_BFMatcher create(int normType = NORM_L2, bool crossCheck = false) 74 | private static native long create_0(int normType, boolean crossCheck); 75 | private static native long create_1(); 76 | 77 | // native support for java finalize() 78 | private static native void delete(long nativeObj); 79 | 80 | } 81 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/features2d/FlannBasedMatcher.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.features2d; 6 | 7 | 8 | 9 | // C++: class FlannBasedMatcher 10 | //javadoc: FlannBasedMatcher 11 | public class FlannBasedMatcher extends DescriptorMatcher { 12 | 13 | protected FlannBasedMatcher(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: FlannBasedMatcher(Ptr_flann_IndexParams indexParams = makePtr(), Ptr_flann_SearchParams searchParams = makePtr()) 18 | // 19 | 20 | //javadoc: FlannBasedMatcher::FlannBasedMatcher() 21 | public FlannBasedMatcher() 22 | { 23 | 24 | super( FlannBasedMatcher_0() ); 25 | 26 | return; 27 | } 28 | 29 | 30 | // 31 | // C++: static Ptr_FlannBasedMatcher create() 32 | // 33 | 34 | //javadoc: FlannBasedMatcher::create() 35 | public static FlannBasedMatcher create() 36 | { 37 | 38 | FlannBasedMatcher retVal = new FlannBasedMatcher(create_0()); 39 | 40 | return retVal; 41 | } 42 | 43 | 44 | @Override 45 | protected void finalize() throws Throwable { 46 | delete(nativeObj); 47 | } 48 | 49 | 50 | 51 | // C++: FlannBasedMatcher(Ptr_flann_IndexParams indexParams = makePtr(), Ptr_flann_SearchParams searchParams = makePtr()) 52 | private static native long FlannBasedMatcher_0(); 53 | 54 | // C++: static Ptr_FlannBasedMatcher create() 55 | private static native long create_0(); 56 | 57 | // native support for java finalize() 58 | private static native void delete(long nativeObj); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/ml/Ml.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | 8 | 9 | public class Ml { 10 | 11 | public static final int 12 | VAR_NUMERICAL = 0, 13 | VAR_ORDERED = 0, 14 | VAR_CATEGORICAL = 1, 15 | TEST_ERROR = 0, 16 | TRAIN_ERROR = 1, 17 | ROW_SAMPLE = 0, 18 | COL_SAMPLE = 1; 19 | 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/ml/NormalBayesClassifier.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | import org.opencv.core.Mat; 8 | 9 | // C++: class NormalBayesClassifier 10 | //javadoc: NormalBayesClassifier 11 | public class NormalBayesClassifier extends StatModel { 12 | 13 | protected NormalBayesClassifier(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: static Ptr_NormalBayesClassifier create() 18 | // 19 | 20 | //javadoc: NormalBayesClassifier::create() 21 | public static NormalBayesClassifier create() 22 | { 23 | 24 | NormalBayesClassifier retVal = new NormalBayesClassifier(create_0()); 25 | 26 | return retVal; 27 | } 28 | 29 | 30 | // 31 | // C++: float predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0) 32 | // 33 | 34 | //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs, flags) 35 | public float predictProb(Mat inputs, Mat outputs, Mat outputProbs, int flags) 36 | { 37 | 38 | float retVal = predictProb_0(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj, flags); 39 | 40 | return retVal; 41 | } 42 | 43 | //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs) 44 | public float predictProb(Mat inputs, Mat outputs, Mat outputProbs) 45 | { 46 | 47 | float retVal = predictProb_1(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj); 48 | 49 | return retVal; 50 | } 51 | 52 | 53 | @Override 54 | protected void finalize() throws Throwable { 55 | delete(nativeObj); 56 | } 57 | 58 | 59 | 60 | // C++: static Ptr_NormalBayesClassifier create() 61 | private static native long create_0(); 62 | 63 | // C++: float predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0) 64 | private static native float predictProb_0(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj, int flags); 65 | private static native float predictProb_1(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj); 66 | 67 | // native support for java finalize() 68 | private static native void delete(long nativeObj); 69 | 70 | } 71 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/objdetect/BaseCascadeClassifier.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.objdetect; 6 | 7 | import org.opencv.core.Algorithm; 8 | 9 | // C++: class BaseCascadeClassifier 10 | //javadoc: BaseCascadeClassifier 11 | public class BaseCascadeClassifier extends Algorithm { 12 | 13 | protected BaseCascadeClassifier(long addr) { super(addr); } 14 | 15 | 16 | @Override 17 | protected void finalize() throws Throwable { 18 | delete(nativeObj); 19 | } 20 | 21 | 22 | 23 | // native support for java finalize() 24 | private static native void delete(long nativeObj); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/objdetect/Objdetect.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.objdetect; 6 | 7 | import java.util.ArrayList; 8 | import org.opencv.core.Mat; 9 | import org.opencv.core.MatOfInt; 10 | import org.opencv.core.MatOfRect; 11 | 12 | public class Objdetect { 13 | 14 | public static final int 15 | CASCADE_DO_CANNY_PRUNING = 1, 16 | CASCADE_SCALE_IMAGE = 2, 17 | CASCADE_FIND_BIGGEST_OBJECT = 4, 18 | CASCADE_DO_ROUGH_SEARCH = 8; 19 | 20 | 21 | // 22 | // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) 23 | // 24 | 25 | //javadoc: groupRectangles(rectList, weights, groupThreshold, eps) 26 | public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps) 27 | { 28 | Mat rectList_mat = rectList; 29 | Mat weights_mat = weights; 30 | groupRectangles_0(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold, eps); 31 | 32 | return; 33 | } 34 | 35 | //javadoc: groupRectangles(rectList, weights, groupThreshold) 36 | public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold) 37 | { 38 | Mat rectList_mat = rectList; 39 | Mat weights_mat = weights; 40 | groupRectangles_1(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold); 41 | 42 | return; 43 | } 44 | 45 | 46 | 47 | 48 | // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) 49 | private static native void groupRectangles_0(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold, double eps); 50 | private static native void groupRectangles_1(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/photo/AlignExposures.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Algorithm; 10 | import org.opencv.core.Mat; 11 | import org.opencv.utils.Converters; 12 | 13 | // C++: class AlignExposures 14 | //javadoc: AlignExposures 15 | public class AlignExposures extends Algorithm { 16 | 17 | protected AlignExposures(long addr) { super(addr); } 18 | 19 | 20 | // 21 | // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response) 22 | // 23 | 24 | //javadoc: AlignExposures::process(src, dst, times, response) 25 | public void process(List src, List dst, Mat times, Mat response) 26 | { 27 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 28 | Mat dst_mat = Converters.vector_Mat_to_Mat(dst); 29 | process_0(nativeObj, src_mat.nativeObj, dst_mat.nativeObj, times.nativeObj, response.nativeObj); 30 | 31 | return; 32 | } 33 | 34 | 35 | @Override 36 | protected void finalize() throws Throwable { 37 | delete(nativeObj); 38 | } 39 | 40 | 41 | 42 | // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response) 43 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_mat_nativeObj, long times_nativeObj, long response_nativeObj); 44 | 45 | // native support for java finalize() 46 | private static native void delete(long nativeObj); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/photo/CalibrateCRF.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Algorithm; 10 | import org.opencv.core.Mat; 11 | import org.opencv.utils.Converters; 12 | 13 | // C++: class CalibrateCRF 14 | //javadoc: CalibrateCRF 15 | public class CalibrateCRF extends Algorithm { 16 | 17 | protected CalibrateCRF(long addr) { super(addr); } 18 | 19 | 20 | // 21 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 22 | // 23 | 24 | //javadoc: CalibrateCRF::process(src, dst, times) 25 | public void process(List src, Mat dst, Mat times) 26 | { 27 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 28 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj); 29 | 30 | return; 31 | } 32 | 33 | 34 | @Override 35 | protected void finalize() throws Throwable { 36 | delete(nativeObj); 37 | } 38 | 39 | 40 | 41 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 42 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 43 | 44 | // native support for java finalize() 45 | private static native void delete(long nativeObj); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/photo/MergeDebevec.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Mat; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class MergeDebevec 13 | //javadoc: MergeDebevec 14 | public class MergeDebevec extends MergeExposures { 15 | 16 | protected MergeDebevec(long addr) { super(addr); } 17 | 18 | 19 | // 20 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) 21 | // 22 | 23 | //javadoc: MergeDebevec::process(src, dst, times, response) 24 | public void process(List src, Mat dst, Mat times, Mat response) 25 | { 26 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 27 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 28 | 29 | return; 30 | } 31 | 32 | 33 | // 34 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 35 | // 36 | 37 | //javadoc: MergeDebevec::process(src, dst, times) 38 | public void process(List src, Mat dst, Mat times) 39 | { 40 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 41 | process_1(nativeObj, src_mat.nativeObj, dst.nativeObj, times.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 process(vector_Mat src, Mat& dst, Mat times, Mat response) 55 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 56 | 57 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 58 | private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 59 | 60 | // native support for java finalize() 61 | private static native void delete(long nativeObj); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/photo/MergeExposures.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Algorithm; 10 | import org.opencv.core.Mat; 11 | import org.opencv.utils.Converters; 12 | 13 | // C++: class MergeExposures 14 | //javadoc: MergeExposures 15 | public class MergeExposures extends Algorithm { 16 | 17 | protected MergeExposures(long addr) { super(addr); } 18 | 19 | 20 | // 21 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) 22 | // 23 | 24 | //javadoc: MergeExposures::process(src, dst, times, response) 25 | public void process(List src, Mat dst, Mat times, Mat response) 26 | { 27 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 28 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 29 | 30 | return; 31 | } 32 | 33 | 34 | @Override 35 | protected void finalize() throws Throwable { 36 | delete(nativeObj); 37 | } 38 | 39 | 40 | 41 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) 42 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 43 | 44 | // native support for java finalize() 45 | private static native void delete(long nativeObj); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/photo/MergeRobertson.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Mat; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class MergeRobertson 13 | //javadoc: MergeRobertson 14 | public class MergeRobertson extends MergeExposures { 15 | 16 | protected MergeRobertson(long addr) { super(addr); } 17 | 18 | 19 | // 20 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) 21 | // 22 | 23 | //javadoc: MergeRobertson::process(src, dst, times, response) 24 | public void process(List src, Mat dst, Mat times, Mat response) 25 | { 26 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 27 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 28 | 29 | return; 30 | } 31 | 32 | 33 | // 34 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 35 | // 36 | 37 | //javadoc: MergeRobertson::process(src, dst, times) 38 | public void process(List src, Mat dst, Mat times) 39 | { 40 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 41 | process_1(nativeObj, src_mat.nativeObj, dst.nativeObj, times.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 process(vector_Mat src, Mat& dst, Mat times, Mat response) 55 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 56 | 57 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 58 | private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 59 | 60 | // native support for java finalize() 61 | private static native void delete(long nativeObj); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/photo/Tonemap.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | 10 | // C++: class Tonemap 11 | //javadoc: Tonemap 12 | public class Tonemap extends Algorithm { 13 | 14 | protected Tonemap(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: float getGamma() 19 | // 20 | 21 | //javadoc: Tonemap::getGamma() 22 | public float getGamma() 23 | { 24 | 25 | float retVal = getGamma_0(nativeObj); 26 | 27 | return retVal; 28 | } 29 | 30 | 31 | // 32 | // C++: void process(Mat src, Mat& dst) 33 | // 34 | 35 | //javadoc: Tonemap::process(src, dst) 36 | public void process(Mat src, Mat dst) 37 | { 38 | 39 | process_0(nativeObj, src.nativeObj, dst.nativeObj); 40 | 41 | return; 42 | } 43 | 44 | 45 | // 46 | // C++: void setGamma(float gamma) 47 | // 48 | 49 | //javadoc: Tonemap::setGamma(gamma) 50 | public void setGamma(float gamma) 51 | { 52 | 53 | setGamma_0(nativeObj, gamma); 54 | 55 | return; 56 | } 57 | 58 | 59 | @Override 60 | protected void finalize() throws Throwable { 61 | delete(nativeObj); 62 | } 63 | 64 | 65 | 66 | // C++: float getGamma() 67 | private static native float getGamma_0(long nativeObj); 68 | 69 | // C++: void process(Mat src, Mat& dst) 70 | private static native void process_0(long nativeObj, long src_nativeObj, long dst_nativeObj); 71 | 72 | // C++: void setGamma(float gamma) 73 | private static native void setGamma_0(long nativeObj, float gamma); 74 | 75 | // native support for java finalize() 76 | private static native void delete(long nativeObj); 77 | 78 | } 79 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/photo/TonemapDrago.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | 8 | 9 | // C++: class TonemapDrago 10 | //javadoc: TonemapDrago 11 | public class TonemapDrago extends Tonemap { 12 | 13 | protected TonemapDrago(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: float getBias() 18 | // 19 | 20 | //javadoc: TonemapDrago::getBias() 21 | public float getBias() 22 | { 23 | 24 | float retVal = getBias_0(nativeObj); 25 | 26 | return retVal; 27 | } 28 | 29 | 30 | // 31 | // C++: float getSaturation() 32 | // 33 | 34 | //javadoc: TonemapDrago::getSaturation() 35 | public float getSaturation() 36 | { 37 | 38 | float retVal = getSaturation_0(nativeObj); 39 | 40 | return retVal; 41 | } 42 | 43 | 44 | // 45 | // C++: void setBias(float bias) 46 | // 47 | 48 | //javadoc: TonemapDrago::setBias(bias) 49 | public void setBias(float bias) 50 | { 51 | 52 | setBias_0(nativeObj, bias); 53 | 54 | return; 55 | } 56 | 57 | 58 | // 59 | // C++: void setSaturation(float saturation) 60 | // 61 | 62 | //javadoc: TonemapDrago::setSaturation(saturation) 63 | public void setSaturation(float saturation) 64 | { 65 | 66 | setSaturation_0(nativeObj, saturation); 67 | 68 | return; 69 | } 70 | 71 | 72 | @Override 73 | protected void finalize() throws Throwable { 74 | delete(nativeObj); 75 | } 76 | 77 | 78 | 79 | // C++: float getBias() 80 | private static native float getBias_0(long nativeObj); 81 | 82 | // C++: float getSaturation() 83 | private static native float getSaturation_0(long nativeObj); 84 | 85 | // C++: void setBias(float bias) 86 | private static native void setBias_0(long nativeObj, float bias); 87 | 88 | // C++: void setSaturation(float saturation) 89 | private static native void setSaturation_0(long nativeObj, float saturation); 90 | 91 | // native support for java finalize() 92 | private static native void delete(long nativeObj); 93 | 94 | } 95 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/photo/TonemapMantiuk.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | 8 | 9 | // C++: class TonemapMantiuk 10 | //javadoc: TonemapMantiuk 11 | public class TonemapMantiuk extends Tonemap { 12 | 13 | protected TonemapMantiuk(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: float getSaturation() 18 | // 19 | 20 | //javadoc: TonemapMantiuk::getSaturation() 21 | public float getSaturation() 22 | { 23 | 24 | float retVal = getSaturation_0(nativeObj); 25 | 26 | return retVal; 27 | } 28 | 29 | 30 | // 31 | // C++: float getScale() 32 | // 33 | 34 | //javadoc: TonemapMantiuk::getScale() 35 | public float getScale() 36 | { 37 | 38 | float retVal = getScale_0(nativeObj); 39 | 40 | return retVal; 41 | } 42 | 43 | 44 | // 45 | // C++: void setSaturation(float saturation) 46 | // 47 | 48 | //javadoc: TonemapMantiuk::setSaturation(saturation) 49 | public void setSaturation(float saturation) 50 | { 51 | 52 | setSaturation_0(nativeObj, saturation); 53 | 54 | return; 55 | } 56 | 57 | 58 | // 59 | // C++: void setScale(float scale) 60 | // 61 | 62 | //javadoc: TonemapMantiuk::setScale(scale) 63 | public void setScale(float scale) 64 | { 65 | 66 | setScale_0(nativeObj, scale); 67 | 68 | return; 69 | } 70 | 71 | 72 | @Override 73 | protected void finalize() throws Throwable { 74 | delete(nativeObj); 75 | } 76 | 77 | 78 | 79 | // C++: float getSaturation() 80 | private static native float getSaturation_0(long nativeObj); 81 | 82 | // C++: float getScale() 83 | private static native float getScale_0(long nativeObj); 84 | 85 | // C++: void setSaturation(float saturation) 86 | private static native void setSaturation_0(long nativeObj, float saturation); 87 | 88 | // C++: void setScale(float scale) 89 | private static native void setScale_0(long nativeObj, float scale); 90 | 91 | // native support for java finalize() 92 | private static native void delete(long nativeObj); 93 | 94 | } 95 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/video/BackgroundSubtractor.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.video; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | 10 | // C++: class BackgroundSubtractor 11 | //javadoc: BackgroundSubtractor 12 | public class BackgroundSubtractor extends Algorithm { 13 | 14 | protected BackgroundSubtractor(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: void apply(Mat image, Mat& fgmask, double learningRate = -1) 19 | // 20 | 21 | //javadoc: BackgroundSubtractor::apply(image, fgmask, learningRate) 22 | public void apply(Mat image, Mat fgmask, double learningRate) 23 | { 24 | 25 | apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate); 26 | 27 | return; 28 | } 29 | 30 | //javadoc: BackgroundSubtractor::apply(image, fgmask) 31 | public void apply(Mat image, Mat fgmask) 32 | { 33 | 34 | apply_1(nativeObj, image.nativeObj, fgmask.nativeObj); 35 | 36 | return; 37 | } 38 | 39 | 40 | // 41 | // C++: void getBackgroundImage(Mat& backgroundImage) 42 | // 43 | 44 | //javadoc: BackgroundSubtractor::getBackgroundImage(backgroundImage) 45 | public void getBackgroundImage(Mat backgroundImage) 46 | { 47 | 48 | getBackgroundImage_0(nativeObj, backgroundImage.nativeObj); 49 | 50 | return; 51 | } 52 | 53 | 54 | @Override 55 | protected void finalize() throws Throwable { 56 | delete(nativeObj); 57 | } 58 | 59 | 60 | 61 | // C++: void apply(Mat image, Mat& fgmask, double learningRate = -1) 62 | private static native void apply_0(long nativeObj, long image_nativeObj, long fgmask_nativeObj, double learningRate); 63 | private static native void apply_1(long nativeObj, long image_nativeObj, long fgmask_nativeObj); 64 | 65 | // C++: void getBackgroundImage(Mat& backgroundImage) 66 | private static native void getBackgroundImage_0(long nativeObj, long backgroundImage_nativeObj); 67 | 68 | // native support for java finalize() 69 | private static native void delete(long nativeObj); 70 | 71 | } 72 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/video/DenseOpticalFlow.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.video; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | 10 | // C++: class DenseOpticalFlow 11 | //javadoc: DenseOpticalFlow 12 | public class DenseOpticalFlow extends Algorithm { 13 | 14 | protected DenseOpticalFlow(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: void calc(Mat I0, Mat I1, Mat& flow) 19 | // 20 | 21 | //javadoc: DenseOpticalFlow::calc(I0, I1, flow) 22 | public void calc(Mat I0, Mat I1, Mat flow) 23 | { 24 | 25 | calc_0(nativeObj, I0.nativeObj, I1.nativeObj, flow.nativeObj); 26 | 27 | return; 28 | } 29 | 30 | 31 | // 32 | // C++: void collectGarbage() 33 | // 34 | 35 | //javadoc: DenseOpticalFlow::collectGarbage() 36 | public void collectGarbage() 37 | { 38 | 39 | collectGarbage_0(nativeObj); 40 | 41 | return; 42 | } 43 | 44 | 45 | @Override 46 | protected void finalize() throws Throwable { 47 | delete(nativeObj); 48 | } 49 | 50 | 51 | 52 | // C++: void calc(Mat I0, Mat I1, Mat& flow) 53 | private static native void calc_0(long nativeObj, long I0_nativeObj, long I1_nativeObj, long flow_nativeObj); 54 | 55 | // C++: void collectGarbage() 56 | private static native void collectGarbage_0(long nativeObj); 57 | 58 | // native support for java finalize() 59 | private static native void delete(long nativeObj); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/java/org/opencv/video/SparseOpticalFlow.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.video; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | 10 | // C++: class SparseOpticalFlow 11 | //javadoc: SparseOpticalFlow 12 | public class SparseOpticalFlow extends Algorithm { 13 | 14 | protected SparseOpticalFlow(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat& nextPts, Mat& status, Mat& err = cv::Mat()) 19 | // 20 | 21 | //javadoc: SparseOpticalFlow::calc(prevImg, nextImg, prevPts, nextPts, status, err) 22 | public void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status, Mat err) 23 | { 24 | 25 | calc_0(nativeObj, prevImg.nativeObj, nextImg.nativeObj, prevPts.nativeObj, nextPts.nativeObj, status.nativeObj, err.nativeObj); 26 | 27 | return; 28 | } 29 | 30 | //javadoc: SparseOpticalFlow::calc(prevImg, nextImg, prevPts, nextPts, status) 31 | public void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status) 32 | { 33 | 34 | calc_1(nativeObj, prevImg.nativeObj, nextImg.nativeObj, prevPts.nativeObj, nextPts.nativeObj, status.nativeObj); 35 | 36 | return; 37 | } 38 | 39 | 40 | @Override 41 | protected void finalize() throws Throwable { 42 | delete(nativeObj); 43 | } 44 | 45 | 46 | 47 | // C++: void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat& nextPts, Mat& status, Mat& err = cv::Mat()) 48 | 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); 49 | private static native void calc_1(long nativeObj, long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_nativeObj, long nextPts_nativeObj, long status_nativeObj); 50 | 51 | // native support for java finalize() 52 | private static native void delete(long nativeObj); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /android/openCVLibrary320/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':scandoc' 2 | include ':openCVLibrary320' 3 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/java/my/fin/RNScanDocPackage.java: -------------------------------------------------------------------------------- 1 | 2 | package my.fin; 3 | 4 | import java.util.Arrays; 5 | import java.util.Collections; 6 | import java.util.List; 7 | 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.bridge.NativeModule; 10 | import com.facebook.react.bridge.ReactApplicationContext; 11 | import com.facebook.react.uimanager.ViewManager; 12 | import com.facebook.react.bridge.JavaScriptModule; 13 | public class RNScanDocPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new RNScanDocModule(reactContext)); 17 | } 18 | 19 | @Override 20 | public List> createJSModules() { 21 | return Collections.emptyList(); 22 | } 23 | 24 | @Override 25 | public List createViewManagers(ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } -------------------------------------------------------------------------------- /example/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | module.system=haste 26 | 27 | experimental.strict_type_args=true 28 | 29 | munge_underscores=true 30 | 31 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 32 | 33 | suppress_type=$FlowIssue 34 | suppress_type=$FlowFixMe 35 | suppress_type=$FixMe 36 | 37 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-7]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 38 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-7]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 40 | 41 | unsafe.enable_getters_and_setters=true 42 | 43 | [version] 44 | ^0.37.0 45 | -------------------------------------------------------------------------------- /example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | android/app/libs 43 | *.keystore 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/Preview.html 54 | fastlane/screenshots 55 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /example/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.example', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.example', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /example/android/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 /usr/local/Cellar/android-sdk/24.3.3/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 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/LifecycleCallbacks.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | import android.app.Activity; 3 | import android.app.Application; 4 | import android.os.Bundle; 5 | 6 | public class LifecycleCallbacks implements Application.ActivityLifecycleCallbacks { 7 | @Override 8 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) { 9 | 10 | } 11 | 12 | @Override 13 | public void onActivityStarted(Activity activity) { 14 | 15 | } 16 | 17 | @Override 18 | public void onActivityResumed(Activity activity) { 19 | 20 | } 21 | 22 | @Override 23 | public void onActivityPaused(Activity activity) { 24 | 25 | } 26 | 27 | @Override 28 | public void onActivityStopped(Activity activity) { 29 | 30 | } 31 | 32 | @Override 33 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) { 34 | 35 | } 36 | 37 | @Override 38 | public void onActivityDestroyed(Activity activity) { 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.util.Log; 4 | 5 | import com.facebook.react.ReactActivity; 6 | 7 | 8 | public class MainActivity extends ReactActivity { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. 12 | * This is used to schedule rendering of the component. 13 | */ 14 | @Override 15 | protected String getMainComponentName() { 16 | return "example"; 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Activity; 4 | import android.app.Application; 5 | import android.os.Bundle; 6 | import android.util.Log; 7 | 8 | import com.facebook.react.ReactApplication; 9 | import my.fin.RNScanDocPackage; 10 | import com.lwansbrough.RCTCamera.RCTCameraPackage; 11 | import com.facebook.react.ReactInstanceManager; 12 | import com.facebook.react.ReactNativeHost; 13 | import com.facebook.react.ReactPackage; 14 | import com.facebook.react.shell.MainReactPackage; 15 | import com.facebook.soloader.SoLoader; 16 | 17 | import org.opencv.android.BaseLoaderCallback; 18 | import org.opencv.android.LoaderCallbackInterface; 19 | import org.opencv.android.OpenCVLoader; 20 | 21 | import java.util.Arrays; 22 | import java.util.List; 23 | 24 | 25 | 26 | public class MainApplication extends Application implements ReactApplication { 27 | private final RNScanDocPackage scanDocPackage = new RNScanDocPackage(); 28 | 29 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 30 | @Override 31 | public boolean getUseDeveloperSupport() { 32 | return BuildConfig.DEBUG; 33 | } 34 | 35 | @Override 36 | protected List getPackages() { 37 | return Arrays.asList( 38 | new MainReactPackage(), 39 | scanDocPackage, 40 | new RCTCameraPackage() 41 | ); 42 | } 43 | }; 44 | 45 | @Override 46 | public ReactNativeHost getReactNativeHost() { 47 | return mReactNativeHost; 48 | } 49 | 50 | @Override 51 | public void onCreate() { 52 | super.onCreate(); 53 | SoLoader.init(this, /* native exopackage */ false); 54 | registerActivityLifecycleCallbacks(new LifecycleCallbacks(){ 55 | @Override 56 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) { 57 | scanDocPackage.onActivityCreated(activity); 58 | } 59 | }); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-scan-doc/fccaf6bf76a6834798ca0ce3590d640939d04d04/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-scan-doc/fccaf6bf76a6834798ca0ce3590d640939d04d04/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-scan-doc/fccaf6bf76a6834798ca0ce3590d640939d04d04/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-scan-doc/fccaf6bf76a6834798ca0ce3590d640939d04d04/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beast/react-native-scan-doc/fccaf6bf76a6834798ca0ce3590d640939d04d04/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Feb 14 11:12:03 MYT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.1" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 22 10 | } 11 | 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/core/Algorithm.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.core; 6 | 7 | import java.lang.String; 8 | 9 | // C++: class Algorithm 10 | //javadoc: Algorithm 11 | public class Algorithm { 12 | 13 | protected final long nativeObj; 14 | protected Algorithm(long addr) { nativeObj = addr; } 15 | 16 | 17 | // 18 | // C++: String getDefaultName() 19 | // 20 | 21 | //javadoc: Algorithm::getDefaultName() 22 | public String getDefaultName() 23 | { 24 | 25 | String retVal = getDefaultName_0(nativeObj); 26 | 27 | return retVal; 28 | } 29 | 30 | 31 | // 32 | // C++: void clear() 33 | // 34 | 35 | //javadoc: Algorithm::clear() 36 | public void clear() 37 | { 38 | 39 | clear_0(nativeObj); 40 | 41 | return; 42 | } 43 | 44 | 45 | // 46 | // C++: void save(String filename) 47 | // 48 | 49 | //javadoc: Algorithm::save(filename) 50 | public void save(String filename) 51 | { 52 | 53 | save_0(nativeObj, filename); 54 | 55 | return; 56 | } 57 | 58 | 59 | @Override 60 | protected void finalize() throws Throwable { 61 | delete(nativeObj); 62 | } 63 | 64 | 65 | 66 | // C++: String getDefaultName() 67 | private static native String getDefaultName_0(long nativeObj); 68 | 69 | // C++: void clear() 70 | private static native void clear_0(long nativeObj); 71 | 72 | // C++: void save(String filename) 73 | private static native void save_0(long nativeObj, String filename); 74 | 75 | // native support for java finalize() 76 | private static native void delete(long nativeObj); 77 | 78 | } 79 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | /** 49 | * Less is better. 50 | */ 51 | public boolean lessThan(DMatch it) { 52 | return distance < it.distance; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return "DMatch [queryIdx=" + queryIdx + ", trainIdx=" + trainIdx 58 | + ", imgIdx=" + imgIdx + ", distance=" + distance + "]"; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/core/MatOfByte.java: -------------------------------------------------------------------------------- 1 | package org.opencv.core; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class MatOfByte extends Mat { 7 | // 8UC(x) 8 | private static final int _depth = CvType.CV_8U; 9 | private static final int _channels = 1; 10 | 11 | public MatOfByte() { 12 | super(); 13 | } 14 | 15 | protected MatOfByte(long addr) { 16 | super(addr); 17 | if( !empty() && checkVector(_channels, _depth) < 0 ) 18 | throw new IllegalArgumentException("Incompatible Mat"); 19 | //FIXME: do we need release() here? 20 | } 21 | 22 | public static MatOfByte fromNativeAddr(long addr) { 23 | return new MatOfByte(addr); 24 | } 25 | 26 | public MatOfByte(Mat m) { 27 | super(m, Range.all()); 28 | if( !empty() && checkVector(_channels, _depth) < 0 ) 29 | throw new IllegalArgumentException("Incompatible Mat"); 30 | //FIXME: do we need release() here? 31 | } 32 | 33 | public MatOfByte(byte...a) { 34 | super(); 35 | fromArray(a); 36 | } 37 | 38 | public void alloc(int elemNumber) { 39 | if(elemNumber>0) 40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); 41 | } 42 | 43 | public void fromArray(byte...a) { 44 | if(a==null || a.length==0) 45 | return; 46 | int num = a.length / _channels; 47 | alloc(num); 48 | put(0, 0, a); //TODO: check ret val! 49 | } 50 | 51 | public byte[] toArray() { 52 | int num = checkVector(_channels, _depth); 53 | if(num < 0) 54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); 55 | byte[] a = new byte[num * _channels]; 56 | if(num == 0) 57 | return a; 58 | get(0, 0, a); //TODO: check ret val! 59 | return a; 60 | } 61 | 62 | public void fromList(List lb) { 63 | if(lb==null || lb.size()==0) 64 | return; 65 | Byte ab[] = lb.toArray(new Byte[0]); 66 | byte a[] = new byte[ab.length]; 67 | for(int i=0; i toList() { 73 | byte[] a = toArray(); 74 | Byte ab[] = new Byte[a.length]; 75 | for(int i=0; i0) 42 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); 43 | } 44 | 45 | 46 | public void fromArray(DMatch...a) { 47 | if(a==null || a.length==0) 48 | return; 49 | int num = a.length; 50 | alloc(num); 51 | float buff[] = new float[num * _channels]; 52 | for(int i=0; i ldm) { 75 | DMatch adm[] = ldm.toArray(new DMatch[0]); 76 | fromArray(adm); 77 | } 78 | 79 | public List toList() { 80 | DMatch[] adm = toArray(); 81 | return Arrays.asList(adm); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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) 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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/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 Size clone() { 41 | return new Size(width, height); 42 | } 43 | 44 | @Override 45 | public int hashCode() { 46 | final int prime = 31; 47 | int result = 1; 48 | long temp; 49 | temp = Double.doubleToLongBits(height); 50 | result = prime * result + (int) (temp ^ (temp >>> 32)); 51 | temp = Double.doubleToLongBits(width); 52 | result = prime * result + (int) (temp ^ (temp >>> 32)); 53 | return result; 54 | } 55 | 56 | @Override 57 | public boolean equals(Object obj) { 58 | if (this == obj) return true; 59 | if (!(obj instanceof Size)) return false; 60 | Size it = (Size) obj; 61 | return width == it.width && height == it.height; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return (int)width + "x" + (int)height; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/features2d/BFMatcher.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.features2d; 6 | 7 | 8 | 9 | // C++: class BFMatcher 10 | //javadoc: BFMatcher 11 | public class BFMatcher extends DescriptorMatcher { 12 | 13 | protected BFMatcher(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: BFMatcher(int normType = NORM_L2, bool crossCheck = false) 18 | // 19 | 20 | //javadoc: BFMatcher::BFMatcher(normType, crossCheck) 21 | public BFMatcher(int normType, boolean crossCheck) 22 | { 23 | 24 | super( BFMatcher_0(normType, crossCheck) ); 25 | 26 | return; 27 | } 28 | 29 | //javadoc: BFMatcher::BFMatcher() 30 | public BFMatcher() 31 | { 32 | 33 | super( BFMatcher_1() ); 34 | 35 | return; 36 | } 37 | 38 | 39 | // 40 | // C++: static Ptr_BFMatcher create(int normType = NORM_L2, bool crossCheck = false) 41 | // 42 | 43 | //javadoc: BFMatcher::create(normType, crossCheck) 44 | public static BFMatcher create(int normType, boolean crossCheck) 45 | { 46 | 47 | BFMatcher retVal = new BFMatcher(create_0(normType, crossCheck)); 48 | 49 | return retVal; 50 | } 51 | 52 | //javadoc: BFMatcher::create() 53 | public static BFMatcher create() 54 | { 55 | 56 | BFMatcher retVal = new BFMatcher(create_1()); 57 | 58 | return retVal; 59 | } 60 | 61 | 62 | @Override 63 | protected void finalize() throws Throwable { 64 | delete(nativeObj); 65 | } 66 | 67 | 68 | 69 | // C++: BFMatcher(int normType = NORM_L2, bool crossCheck = false) 70 | private static native long BFMatcher_0(int normType, boolean crossCheck); 71 | private static native long BFMatcher_1(); 72 | 73 | // C++: static Ptr_BFMatcher create(int normType = NORM_L2, bool crossCheck = false) 74 | private static native long create_0(int normType, boolean crossCheck); 75 | private static native long create_1(); 76 | 77 | // native support for java finalize() 78 | private static native void delete(long nativeObj); 79 | 80 | } 81 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/features2d/FlannBasedMatcher.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.features2d; 6 | 7 | 8 | 9 | // C++: class FlannBasedMatcher 10 | //javadoc: FlannBasedMatcher 11 | public class FlannBasedMatcher extends DescriptorMatcher { 12 | 13 | protected FlannBasedMatcher(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: FlannBasedMatcher(Ptr_flann_IndexParams indexParams = makePtr(), Ptr_flann_SearchParams searchParams = makePtr()) 18 | // 19 | 20 | //javadoc: FlannBasedMatcher::FlannBasedMatcher() 21 | public FlannBasedMatcher() 22 | { 23 | 24 | super( FlannBasedMatcher_0() ); 25 | 26 | return; 27 | } 28 | 29 | 30 | // 31 | // C++: static Ptr_FlannBasedMatcher create() 32 | // 33 | 34 | //javadoc: FlannBasedMatcher::create() 35 | public static FlannBasedMatcher create() 36 | { 37 | 38 | FlannBasedMatcher retVal = new FlannBasedMatcher(create_0()); 39 | 40 | return retVal; 41 | } 42 | 43 | 44 | @Override 45 | protected void finalize() throws Throwable { 46 | delete(nativeObj); 47 | } 48 | 49 | 50 | 51 | // C++: FlannBasedMatcher(Ptr_flann_IndexParams indexParams = makePtr(), Ptr_flann_SearchParams searchParams = makePtr()) 52 | private static native long FlannBasedMatcher_0(); 53 | 54 | // C++: static Ptr_FlannBasedMatcher create() 55 | private static native long create_0(); 56 | 57 | // native support for java finalize() 58 | private static native void delete(long nativeObj); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/ml/Ml.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | 8 | 9 | public class Ml { 10 | 11 | public static final int 12 | VAR_NUMERICAL = 0, 13 | VAR_ORDERED = 0, 14 | VAR_CATEGORICAL = 1, 15 | TEST_ERROR = 0, 16 | TRAIN_ERROR = 1, 17 | ROW_SAMPLE = 0, 18 | COL_SAMPLE = 1; 19 | 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/ml/NormalBayesClassifier.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.ml; 6 | 7 | import org.opencv.core.Mat; 8 | 9 | // C++: class NormalBayesClassifier 10 | //javadoc: NormalBayesClassifier 11 | public class NormalBayesClassifier extends StatModel { 12 | 13 | protected NormalBayesClassifier(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: static Ptr_NormalBayesClassifier create() 18 | // 19 | 20 | //javadoc: NormalBayesClassifier::create() 21 | public static NormalBayesClassifier create() 22 | { 23 | 24 | NormalBayesClassifier retVal = new NormalBayesClassifier(create_0()); 25 | 26 | return retVal; 27 | } 28 | 29 | 30 | // 31 | // C++: float predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0) 32 | // 33 | 34 | //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs, flags) 35 | public float predictProb(Mat inputs, Mat outputs, Mat outputProbs, int flags) 36 | { 37 | 38 | float retVal = predictProb_0(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj, flags); 39 | 40 | return retVal; 41 | } 42 | 43 | //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs) 44 | public float predictProb(Mat inputs, Mat outputs, Mat outputProbs) 45 | { 46 | 47 | float retVal = predictProb_1(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj); 48 | 49 | return retVal; 50 | } 51 | 52 | 53 | @Override 54 | protected void finalize() throws Throwable { 55 | delete(nativeObj); 56 | } 57 | 58 | 59 | 60 | // C++: static Ptr_NormalBayesClassifier create() 61 | private static native long create_0(); 62 | 63 | // C++: float predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0) 64 | private static native float predictProb_0(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj, int flags); 65 | private static native float predictProb_1(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj); 66 | 67 | // native support for java finalize() 68 | private static native void delete(long nativeObj); 69 | 70 | } 71 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/objdetect/BaseCascadeClassifier.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.objdetect; 6 | 7 | import org.opencv.core.Algorithm; 8 | 9 | // C++: class BaseCascadeClassifier 10 | //javadoc: BaseCascadeClassifier 11 | public class BaseCascadeClassifier extends Algorithm { 12 | 13 | protected BaseCascadeClassifier(long addr) { super(addr); } 14 | 15 | 16 | @Override 17 | protected void finalize() throws Throwable { 18 | delete(nativeObj); 19 | } 20 | 21 | 22 | 23 | // native support for java finalize() 24 | private static native void delete(long nativeObj); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/objdetect/Objdetect.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.objdetect; 6 | 7 | import java.util.ArrayList; 8 | import org.opencv.core.Mat; 9 | import org.opencv.core.MatOfInt; 10 | import org.opencv.core.MatOfRect; 11 | 12 | public class Objdetect { 13 | 14 | public static final int 15 | CASCADE_DO_CANNY_PRUNING = 1, 16 | CASCADE_SCALE_IMAGE = 2, 17 | CASCADE_FIND_BIGGEST_OBJECT = 4, 18 | CASCADE_DO_ROUGH_SEARCH = 8; 19 | 20 | 21 | // 22 | // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) 23 | // 24 | 25 | //javadoc: groupRectangles(rectList, weights, groupThreshold, eps) 26 | public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps) 27 | { 28 | Mat rectList_mat = rectList; 29 | Mat weights_mat = weights; 30 | groupRectangles_0(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold, eps); 31 | 32 | return; 33 | } 34 | 35 | //javadoc: groupRectangles(rectList, weights, groupThreshold) 36 | public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold) 37 | { 38 | Mat rectList_mat = rectList; 39 | Mat weights_mat = weights; 40 | groupRectangles_1(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold); 41 | 42 | return; 43 | } 44 | 45 | 46 | 47 | 48 | // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) 49 | private static native void groupRectangles_0(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold, double eps); 50 | private static native void groupRectangles_1(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/photo/AlignExposures.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Algorithm; 10 | import org.opencv.core.Mat; 11 | import org.opencv.utils.Converters; 12 | 13 | // C++: class AlignExposures 14 | //javadoc: AlignExposures 15 | public class AlignExposures extends Algorithm { 16 | 17 | protected AlignExposures(long addr) { super(addr); } 18 | 19 | 20 | // 21 | // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response) 22 | // 23 | 24 | //javadoc: AlignExposures::process(src, dst, times, response) 25 | public void process(List src, List dst, Mat times, Mat response) 26 | { 27 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 28 | Mat dst_mat = Converters.vector_Mat_to_Mat(dst); 29 | process_0(nativeObj, src_mat.nativeObj, dst_mat.nativeObj, times.nativeObj, response.nativeObj); 30 | 31 | return; 32 | } 33 | 34 | 35 | @Override 36 | protected void finalize() throws Throwable { 37 | delete(nativeObj); 38 | } 39 | 40 | 41 | 42 | // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response) 43 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_mat_nativeObj, long times_nativeObj, long response_nativeObj); 44 | 45 | // native support for java finalize() 46 | private static native void delete(long nativeObj); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/photo/CalibrateCRF.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Algorithm; 10 | import org.opencv.core.Mat; 11 | import org.opencv.utils.Converters; 12 | 13 | // C++: class CalibrateCRF 14 | //javadoc: CalibrateCRF 15 | public class CalibrateCRF extends Algorithm { 16 | 17 | protected CalibrateCRF(long addr) { super(addr); } 18 | 19 | 20 | // 21 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 22 | // 23 | 24 | //javadoc: CalibrateCRF::process(src, dst, times) 25 | public void process(List src, Mat dst, Mat times) 26 | { 27 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 28 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj); 29 | 30 | return; 31 | } 32 | 33 | 34 | @Override 35 | protected void finalize() throws Throwable { 36 | delete(nativeObj); 37 | } 38 | 39 | 40 | 41 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 42 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 43 | 44 | // native support for java finalize() 45 | private static native void delete(long nativeObj); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/photo/MergeDebevec.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Mat; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class MergeDebevec 13 | //javadoc: MergeDebevec 14 | public class MergeDebevec extends MergeExposures { 15 | 16 | protected MergeDebevec(long addr) { super(addr); } 17 | 18 | 19 | // 20 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) 21 | // 22 | 23 | //javadoc: MergeDebevec::process(src, dst, times, response) 24 | public void process(List src, Mat dst, Mat times, Mat response) 25 | { 26 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 27 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 28 | 29 | return; 30 | } 31 | 32 | 33 | // 34 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 35 | // 36 | 37 | //javadoc: MergeDebevec::process(src, dst, times) 38 | public void process(List src, Mat dst, Mat times) 39 | { 40 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 41 | process_1(nativeObj, src_mat.nativeObj, dst.nativeObj, times.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 process(vector_Mat src, Mat& dst, Mat times, Mat response) 55 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 56 | 57 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 58 | private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 59 | 60 | // native support for java finalize() 61 | private static native void delete(long nativeObj); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/photo/MergeExposures.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Algorithm; 10 | import org.opencv.core.Mat; 11 | import org.opencv.utils.Converters; 12 | 13 | // C++: class MergeExposures 14 | //javadoc: MergeExposures 15 | public class MergeExposures extends Algorithm { 16 | 17 | protected MergeExposures(long addr) { super(addr); } 18 | 19 | 20 | // 21 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) 22 | // 23 | 24 | //javadoc: MergeExposures::process(src, dst, times, response) 25 | public void process(List src, Mat dst, Mat times, Mat response) 26 | { 27 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 28 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 29 | 30 | return; 31 | } 32 | 33 | 34 | @Override 35 | protected void finalize() throws Throwable { 36 | delete(nativeObj); 37 | } 38 | 39 | 40 | 41 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) 42 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 43 | 44 | // native support for java finalize() 45 | private static native void delete(long nativeObj); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/photo/MergeRobertson.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import org.opencv.core.Mat; 10 | import org.opencv.utils.Converters; 11 | 12 | // C++: class MergeRobertson 13 | //javadoc: MergeRobertson 14 | public class MergeRobertson extends MergeExposures { 15 | 16 | protected MergeRobertson(long addr) { super(addr); } 17 | 18 | 19 | // 20 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) 21 | // 22 | 23 | //javadoc: MergeRobertson::process(src, dst, times, response) 24 | public void process(List src, Mat dst, Mat times, Mat response) 25 | { 26 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 27 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); 28 | 29 | return; 30 | } 31 | 32 | 33 | // 34 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 35 | // 36 | 37 | //javadoc: MergeRobertson::process(src, dst, times) 38 | public void process(List src, Mat dst, Mat times) 39 | { 40 | Mat src_mat = Converters.vector_Mat_to_Mat(src); 41 | process_1(nativeObj, src_mat.nativeObj, dst.nativeObj, times.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 process(vector_Mat src, Mat& dst, Mat times, Mat response) 55 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); 56 | 57 | // C++: void process(vector_Mat src, Mat& dst, Mat times) 58 | private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); 59 | 60 | // native support for java finalize() 61 | private static native void delete(long nativeObj); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/photo/Tonemap.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | 10 | // C++: class Tonemap 11 | //javadoc: Tonemap 12 | public class Tonemap extends Algorithm { 13 | 14 | protected Tonemap(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: float getGamma() 19 | // 20 | 21 | //javadoc: Tonemap::getGamma() 22 | public float getGamma() 23 | { 24 | 25 | float retVal = getGamma_0(nativeObj); 26 | 27 | return retVal; 28 | } 29 | 30 | 31 | // 32 | // C++: void process(Mat src, Mat& dst) 33 | // 34 | 35 | //javadoc: Tonemap::process(src, dst) 36 | public void process(Mat src, Mat dst) 37 | { 38 | 39 | process_0(nativeObj, src.nativeObj, dst.nativeObj); 40 | 41 | return; 42 | } 43 | 44 | 45 | // 46 | // C++: void setGamma(float gamma) 47 | // 48 | 49 | //javadoc: Tonemap::setGamma(gamma) 50 | public void setGamma(float gamma) 51 | { 52 | 53 | setGamma_0(nativeObj, gamma); 54 | 55 | return; 56 | } 57 | 58 | 59 | @Override 60 | protected void finalize() throws Throwable { 61 | delete(nativeObj); 62 | } 63 | 64 | 65 | 66 | // C++: float getGamma() 67 | private static native float getGamma_0(long nativeObj); 68 | 69 | // C++: void process(Mat src, Mat& dst) 70 | private static native void process_0(long nativeObj, long src_nativeObj, long dst_nativeObj); 71 | 72 | // C++: void setGamma(float gamma) 73 | private static native void setGamma_0(long nativeObj, float gamma); 74 | 75 | // native support for java finalize() 76 | private static native void delete(long nativeObj); 77 | 78 | } 79 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/photo/TonemapDrago.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | 8 | 9 | // C++: class TonemapDrago 10 | //javadoc: TonemapDrago 11 | public class TonemapDrago extends Tonemap { 12 | 13 | protected TonemapDrago(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: float getBias() 18 | // 19 | 20 | //javadoc: TonemapDrago::getBias() 21 | public float getBias() 22 | { 23 | 24 | float retVal = getBias_0(nativeObj); 25 | 26 | return retVal; 27 | } 28 | 29 | 30 | // 31 | // C++: float getSaturation() 32 | // 33 | 34 | //javadoc: TonemapDrago::getSaturation() 35 | public float getSaturation() 36 | { 37 | 38 | float retVal = getSaturation_0(nativeObj); 39 | 40 | return retVal; 41 | } 42 | 43 | 44 | // 45 | // C++: void setBias(float bias) 46 | // 47 | 48 | //javadoc: TonemapDrago::setBias(bias) 49 | public void setBias(float bias) 50 | { 51 | 52 | setBias_0(nativeObj, bias); 53 | 54 | return; 55 | } 56 | 57 | 58 | // 59 | // C++: void setSaturation(float saturation) 60 | // 61 | 62 | //javadoc: TonemapDrago::setSaturation(saturation) 63 | public void setSaturation(float saturation) 64 | { 65 | 66 | setSaturation_0(nativeObj, saturation); 67 | 68 | return; 69 | } 70 | 71 | 72 | @Override 73 | protected void finalize() throws Throwable { 74 | delete(nativeObj); 75 | } 76 | 77 | 78 | 79 | // C++: float getBias() 80 | private static native float getBias_0(long nativeObj); 81 | 82 | // C++: float getSaturation() 83 | private static native float getSaturation_0(long nativeObj); 84 | 85 | // C++: void setBias(float bias) 86 | private static native void setBias_0(long nativeObj, float bias); 87 | 88 | // C++: void setSaturation(float saturation) 89 | private static native void setSaturation_0(long nativeObj, float saturation); 90 | 91 | // native support for java finalize() 92 | private static native void delete(long nativeObj); 93 | 94 | } 95 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/photo/TonemapMantiuk.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.photo; 6 | 7 | 8 | 9 | // C++: class TonemapMantiuk 10 | //javadoc: TonemapMantiuk 11 | public class TonemapMantiuk extends Tonemap { 12 | 13 | protected TonemapMantiuk(long addr) { super(addr); } 14 | 15 | 16 | // 17 | // C++: float getSaturation() 18 | // 19 | 20 | //javadoc: TonemapMantiuk::getSaturation() 21 | public float getSaturation() 22 | { 23 | 24 | float retVal = getSaturation_0(nativeObj); 25 | 26 | return retVal; 27 | } 28 | 29 | 30 | // 31 | // C++: float getScale() 32 | // 33 | 34 | //javadoc: TonemapMantiuk::getScale() 35 | public float getScale() 36 | { 37 | 38 | float retVal = getScale_0(nativeObj); 39 | 40 | return retVal; 41 | } 42 | 43 | 44 | // 45 | // C++: void setSaturation(float saturation) 46 | // 47 | 48 | //javadoc: TonemapMantiuk::setSaturation(saturation) 49 | public void setSaturation(float saturation) 50 | { 51 | 52 | setSaturation_0(nativeObj, saturation); 53 | 54 | return; 55 | } 56 | 57 | 58 | // 59 | // C++: void setScale(float scale) 60 | // 61 | 62 | //javadoc: TonemapMantiuk::setScale(scale) 63 | public void setScale(float scale) 64 | { 65 | 66 | setScale_0(nativeObj, scale); 67 | 68 | return; 69 | } 70 | 71 | 72 | @Override 73 | protected void finalize() throws Throwable { 74 | delete(nativeObj); 75 | } 76 | 77 | 78 | 79 | // C++: float getSaturation() 80 | private static native float getSaturation_0(long nativeObj); 81 | 82 | // C++: float getScale() 83 | private static native float getScale_0(long nativeObj); 84 | 85 | // C++: void setSaturation(float saturation) 86 | private static native void setSaturation_0(long nativeObj, float saturation); 87 | 88 | // C++: void setScale(float scale) 89 | private static native void setScale_0(long nativeObj, float scale); 90 | 91 | // native support for java finalize() 92 | private static native void delete(long nativeObj); 93 | 94 | } 95 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/video/BackgroundSubtractor.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.video; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | 10 | // C++: class BackgroundSubtractor 11 | //javadoc: BackgroundSubtractor 12 | public class BackgroundSubtractor extends Algorithm { 13 | 14 | protected BackgroundSubtractor(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: void apply(Mat image, Mat& fgmask, double learningRate = -1) 19 | // 20 | 21 | //javadoc: BackgroundSubtractor::apply(image, fgmask, learningRate) 22 | public void apply(Mat image, Mat fgmask, double learningRate) 23 | { 24 | 25 | apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate); 26 | 27 | return; 28 | } 29 | 30 | //javadoc: BackgroundSubtractor::apply(image, fgmask) 31 | public void apply(Mat image, Mat fgmask) 32 | { 33 | 34 | apply_1(nativeObj, image.nativeObj, fgmask.nativeObj); 35 | 36 | return; 37 | } 38 | 39 | 40 | // 41 | // C++: void getBackgroundImage(Mat& backgroundImage) 42 | // 43 | 44 | //javadoc: BackgroundSubtractor::getBackgroundImage(backgroundImage) 45 | public void getBackgroundImage(Mat backgroundImage) 46 | { 47 | 48 | getBackgroundImage_0(nativeObj, backgroundImage.nativeObj); 49 | 50 | return; 51 | } 52 | 53 | 54 | @Override 55 | protected void finalize() throws Throwable { 56 | delete(nativeObj); 57 | } 58 | 59 | 60 | 61 | // C++: void apply(Mat image, Mat& fgmask, double learningRate = -1) 62 | private static native void apply_0(long nativeObj, long image_nativeObj, long fgmask_nativeObj, double learningRate); 63 | private static native void apply_1(long nativeObj, long image_nativeObj, long fgmask_nativeObj); 64 | 65 | // C++: void getBackgroundImage(Mat& backgroundImage) 66 | private static native void getBackgroundImage_0(long nativeObj, long backgroundImage_nativeObj); 67 | 68 | // native support for java finalize() 69 | private static native void delete(long nativeObj); 70 | 71 | } 72 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/video/DenseOpticalFlow.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.video; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | 10 | // C++: class DenseOpticalFlow 11 | //javadoc: DenseOpticalFlow 12 | public class DenseOpticalFlow extends Algorithm { 13 | 14 | protected DenseOpticalFlow(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: void calc(Mat I0, Mat I1, Mat& flow) 19 | // 20 | 21 | //javadoc: DenseOpticalFlow::calc(I0, I1, flow) 22 | public void calc(Mat I0, Mat I1, Mat flow) 23 | { 24 | 25 | calc_0(nativeObj, I0.nativeObj, I1.nativeObj, flow.nativeObj); 26 | 27 | return; 28 | } 29 | 30 | 31 | // 32 | // C++: void collectGarbage() 33 | // 34 | 35 | //javadoc: DenseOpticalFlow::collectGarbage() 36 | public void collectGarbage() 37 | { 38 | 39 | collectGarbage_0(nativeObj); 40 | 41 | return; 42 | } 43 | 44 | 45 | @Override 46 | protected void finalize() throws Throwable { 47 | delete(nativeObj); 48 | } 49 | 50 | 51 | 52 | // C++: void calc(Mat I0, Mat I1, Mat& flow) 53 | private static native void calc_0(long nativeObj, long I0_nativeObj, long I1_nativeObj, long flow_nativeObj); 54 | 55 | // C++: void collectGarbage() 56 | private static native void collectGarbage_0(long nativeObj); 57 | 58 | // native support for java finalize() 59 | private static native void delete(long nativeObj); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/java/org/opencv/video/SparseOpticalFlow.java: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // This file is auto-generated. Please don't modify it! 4 | // 5 | package org.opencv.video; 6 | 7 | import org.opencv.core.Algorithm; 8 | import org.opencv.core.Mat; 9 | 10 | // C++: class SparseOpticalFlow 11 | //javadoc: SparseOpticalFlow 12 | public class SparseOpticalFlow extends Algorithm { 13 | 14 | protected SparseOpticalFlow(long addr) { super(addr); } 15 | 16 | 17 | // 18 | // C++: void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat& nextPts, Mat& status, Mat& err = cv::Mat()) 19 | // 20 | 21 | //javadoc: SparseOpticalFlow::calc(prevImg, nextImg, prevPts, nextPts, status, err) 22 | public void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status, Mat err) 23 | { 24 | 25 | calc_0(nativeObj, prevImg.nativeObj, nextImg.nativeObj, prevPts.nativeObj, nextPts.nativeObj, status.nativeObj, err.nativeObj); 26 | 27 | return; 28 | } 29 | 30 | //javadoc: SparseOpticalFlow::calc(prevImg, nextImg, prevPts, nextPts, status) 31 | public void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status) 32 | { 33 | 34 | calc_1(nativeObj, prevImg.nativeObj, nextImg.nativeObj, prevPts.nativeObj, nextPts.nativeObj, status.nativeObj); 35 | 36 | return; 37 | } 38 | 39 | 40 | @Override 41 | protected void finalize() throws Throwable { 42 | delete(nativeObj); 43 | } 44 | 45 | 46 | 47 | // C++: void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat& nextPts, Mat& status, Mat& err = cv::Mat()) 48 | 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); 49 | private static native void calc_1(long nativeObj, long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_nativeObj, long nextPts_nativeObj, long status_nativeObj); 50 | 51 | // native support for java finalize() 52 | private static native void delete(long nativeObj); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /example/android/openCVLibrary320/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | include ':react-native-scan-doc' 3 | project(':react-native-scan-doc').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-scan-doc/android') 4 | include ':react-native-camera' 5 | project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android') 6 | 7 | include ':app' 8 | include ':openCVLibrary320' 9 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | Dimensions, 11 | StyleSheet, 12 | Text, 13 | View 14 | } from 'react-native'; 15 | import Camera from 'react-native-camera'; 16 | import Scanner from 'react-native-scan-doc' 17 | 18 | export default class example extends Component { 19 | constructor(props) { 20 | super(props); 21 | this.path = ''; 22 | } 23 | 24 | render() { 25 | return ( 26 | 27 | { 29 | this.camera = cam; 30 | }} 31 | style={styles.preview} 32 | aspect={Camera.constants.Aspect.fill}> 33 | [CAPTURE] 34 | 35 | 36 | ); 37 | } 38 | 39 | takePicture() { 40 | this.camera.capture() 41 | .then((data) => { 42 | console.warn(data.path); 43 | console.warn(data.data); 44 | Scanner.scan(data.path, 600, 800, 90, 'JPEG', '').then((path) => console.warn(path)) 45 | }) 46 | .catch(err => console.error(err)); 47 | // console.warn(this.path); 48 | // const path = Scanner.scan(this.path, 600, 800, 90, 'JPEG', '') 49 | // console.warn(path); 50 | } 51 | } 52 | 53 | 54 | const styles = StyleSheet.create({ 55 | container: { 56 | flex: 1 57 | }, 58 | preview: { 59 | flex: 1, 60 | justifyContent: 'flex-end', 61 | alignItems: 'center', 62 | height: Dimensions.get('window').height, 63 | width: Dimensions.get('window').width 64 | }, 65 | capture: { 66 | flex: 0, 67 | backgroundColor: '#fff', 68 | borderRadius: 5, 69 | color: '#000', 70 | padding: 10, 71 | margin: 40 72 | } 73 | }); 74 | 75 | AppRegistry.registerComponent('example', () => example); 76 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | export default class example extends Component { 16 | render() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.ios.js 24 | 25 | 26 | Press Cmd+R to reload,{'\n'} 27 | Cmd+D or shake for dev menu 28 | 29 | 30 | ); 31 | } 32 | } 33 | 34 | const styles = StyleSheet.create({ 35 | container: { 36 | flex: 1, 37 | justifyContent: 'center', 38 | alignItems: 'center', 39 | backgroundColor: '#F5FCFF', 40 | }, 41 | welcome: { 42 | fontSize: 20, 43 | textAlign: 'center', 44 | margin: 10, 45 | }, 46 | instructions: { 47 | textAlign: 'center', 48 | color: '#333333', 49 | marginBottom: 5, 50 | }, 51 | }); 52 | 53 | AppRegistry.registerComponent('example', () => example); 54 | -------------------------------------------------------------------------------- /example/ios/example-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /example/ios/example-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"example" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/ios/exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/exampleTests/exampleTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface exampleTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation exampleTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "15.4.2", 11 | "react-native": "0.41.2", 12 | "react-native-camera": "0.6.0", 13 | "react-native-scan-doc": "../" 14 | }, 15 | "devDependencies": { 16 | "babel-jest": "18.0.0", 17 | "babel-preset-react-native": "1.9.1", 18 | "jest": "18.1.0", 19 | "react-test-renderer": "15.4.2" 20 | }, 21 | "jest": { 22 | "preset": "react-native" 23 | } 24 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | import { NativeModules } from 'react-native'; 3 | 4 | const { RNScanDoc } = NativeModules; 5 | 6 | export default RNScanDoc; 7 | -------------------------------------------------------------------------------- /ios/RNScanDoc.h: -------------------------------------------------------------------------------- 1 | 2 | #import "RCTBridgeModule.h" 3 | 4 | @interface RNScanDoc : NSObject 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/RNScanDoc.m: -------------------------------------------------------------------------------- 1 | 2 | #import "RNScanDoc.h" 3 | 4 | @implementation RNScanDoc 5 | 6 | - (dispatch_queue_t)methodQueue 7 | { 8 | return dispatch_get_main_queue(); 9 | } 10 | RCT_EXPORT_MODULE() 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-scan-doc", 3 | "version": "1.0.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "react-native" 11 | ], 12 | "author": "", 13 | "license": "", 14 | "peerDependencies": { 15 | "react-native": "^0.41.2" 16 | } 17 | } --------------------------------------------------------------------------------