├── .gitignore
├── LICENSE
├── README.md
├── build.gradle
├── jar
└── opencv-android.jar
├── lint.xml
└── src
└── main
├── AndroidManifest.xml
├── 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
│ ├── engine
│ └── OpenCVEngineInterface.aidl
│ ├── features2d
│ ├── AKAZE.java
│ ├── AgastFeatureDetector.java
│ ├── BFMatcher.java
│ ├── BOWImgDescriptorExtractor.java
│ ├── BOWKMeansTrainer.java
│ ├── BOWTrainer.java
│ ├── BRISK.java
│ ├── DescriptorExtractor.java
│ ├── DescriptorMatcher.java
│ ├── FastFeatureDetector.java
│ ├── Feature2D.java
│ ├── FeatureDetector.java
│ ├── Features2d.java
│ ├── FlannBasedMatcher.java
│ ├── GFTTDetector.java
│ ├── KAZE.java
│ ├── MSER.java
│ ├── ORB.java
│ └── Params.java
│ ├── imgcodecs
│ └── Imgcodecs.java
│ ├── imgproc
│ ├── CLAHE.java
│ ├── Imgproc.java
│ ├── LineSegmentDetector.java
│ ├── Moments.java
│ └── Subdiv2D.java
│ ├── ml
│ ├── ANN_MLP.java
│ ├── 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
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | # Log Files
26 | *.log
27 |
28 | # Android Studio Navigation editor temp files
29 | .navigation/
30 |
31 | # Android Studio captures folder
32 | captures/
33 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | By downloading, copying, installing or using the software you agree to this license.
2 | If you do not agree to this license, do not download, install,
3 | copy or use the software.
4 |
5 |
6 | License Agreement
7 | For Open Source Computer Vision Library
8 | (3-clause BSD License)
9 |
10 | Copyright (C) 2000-2016, Intel Corporation, all rights reserved.
11 | Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
12 | Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved.
13 | Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
14 | Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved.
15 | Copyright (C) 2015-2016, Itseez Inc., all rights reserved.
16 | Third party copyrights are property of their respective owners.
17 |
18 | Redistribution and use in source and binary forms, with or without modification,
19 | are permitted provided that the following conditions are met:
20 |
21 | * Redistributions of source code must retain the above copyright notice,
22 | this list of conditions and the following disclaimer.
23 |
24 | * Redistributions in binary form must reproduce the above copyright notice,
25 | this list of conditions and the following disclaimer in the documentation
26 | and/or other materials provided with the distribution.
27 |
28 | * Neither the names of the copyright holders nor the names of the contributors
29 | may be used to endorse or promote products derived from this software
30 | without specific prior written permission.
31 |
32 | This software is provided by the copyright holders and contributors "as is" and
33 | any express or implied warranties, including, but not limited to, the implied
34 | warranties of merchantability and fitness for a particular purpose are disclaimed.
35 | In no event shall copyright holders or contributors be liable for any direct,
36 | indirect, incidental, special, exemplary, or consequential damages
37 | (including, but not limited to, procurement of substitute goods or services;
38 | loss of use, data, or profits; or business interruption) however caused
39 | and on any theory of liability, whether in contract, strict liability,
40 | or tort (including negligence or otherwise) arising in any way out of
41 | the use of this software, even if advised of the possibility of such damage.
42 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # opencv-android-gradle
2 | OpenCV Android SDK modified to use in Android Studio
3 |
4 | OpenCV SDK Version
5 | -------
6 | 3.2.0
7 | Download JAR
8 | --------
9 | [JAR][1]
10 |
11 | Usage
12 | --------
13 | 1.Copy the __opencv-android.jar__ to __app->libs__ in your project.
14 |
15 | 2.Open build.gradle and add the following line to the dependencies block.
16 | ```
17 | compile files('libs/opencv-android.jar')
18 | ```
19 | 3.Sync the project.
20 |
21 | To Build JAR in Linux
22 | --------
23 | 1.Create a __local.properties__ file and define Android SDK path.
24 |
25 | ```
26 | sdk.dir=/home/rajamalw/android-sdk-linux
27 | ```
28 | Replace __/home/rajamalw/android-sdk-linux__ with your SDK path.
29 |
30 | 2.Export Gradle path. For example in Ubuntu.
31 | ```shell
32 | export PATH="/home/rajamalw/gradle/gradle-3.3/bin:$PATH"
33 | ```
34 | Replace __/home/rajamalw/gradle/gradle-3.3/bin__ with your Gradle path.
35 |
36 | 3.Use the following Commands to generate JAR.
37 | ```
38 | gradle build
39 | gradle jar
40 | ```
41 | 4.The JAR will be generated in __build/libs__.
42 |
43 |
44 |
45 | [1]:https://github.com/rajamalw/opencv-android-gradle/raw/master/jar/opencv-android.jar
46 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | }
5 | dependencies {
6 | classpath 'com.android.tools.build:gradle:2.3.0'
7 |
8 |
9 | }
10 | }
11 |
12 | apply plugin: 'com.android.library'
13 |
14 | android {
15 | compileSdkVersion 25
16 | buildToolsVersion "25.0.2"
17 |
18 | defaultConfig {
19 | minSdkVersion 19
20 | targetSdkVersion 25
21 | }
22 |
23 | lintOptions {
24 | abortOnError false
25 | }
26 |
27 | }
28 |
29 | task jar(type: Jar) {
30 |
31 | from 'build/intermediates/classes/release/'
32 | archiveName 'opencv-android.jar'
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/jar/opencv-android.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rajamalw/opencv-android-gradle/11a63c161f97bf976e8eeb7bef4352c29c0cda73/jar/opencv-android.jar
--------------------------------------------------------------------------------
/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/main/AndroidManifest.xml~:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/android/CameraGLSurfaceView.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | import org.opencv.R;
4 |
5 | import android.content.Context;
6 | import android.content.res.TypedArray;
7 | import android.opengl.GLSurfaceView;
8 | import android.util.AttributeSet;
9 | import android.util.Log;
10 | import android.view.SurfaceHolder;
11 |
12 | public class CameraGLSurfaceView extends GLSurfaceView {
13 |
14 | private static final String LOGTAG = "CameraGLSurfaceView";
15 |
16 | public interface CameraTextureListener {
17 | /**
18 | * This method is invoked when camera preview has started. After this method is invoked
19 | * the frames will start to be delivered to client via the onCameraFrame() callback.
20 | * @param width - the width of the frames that will be delivered
21 | * @param height - the height of the frames that will be delivered
22 | */
23 | public void onCameraViewStarted(int width, int height);
24 |
25 | /**
26 | * This method is invoked when camera preview has been stopped for some reason.
27 | * No frames will be delivered via onCameraFrame() callback after this method is called.
28 | */
29 | public void onCameraViewStopped();
30 |
31 | /**
32 | * This method is invoked when a new preview frame from Camera is ready.
33 | * @param texIn - the OpenGL texture ID that contains frame in RGBA format
34 | * @param texOut - the OpenGL texture ID that can be used to store modified frame image t display
35 | * @param width - the width of the frame
36 | * @param height - the height of the frame
37 | * @return `true` if `texOut` should be displayed, `false` - to show `texIn`
38 | */
39 | public boolean onCameraTexture(int texIn, int texOut, int width, int height);
40 | };
41 |
42 | private CameraTextureListener mTexListener;
43 | private CameraGLRendererBase mRenderer;
44 |
45 | public CameraGLSurfaceView(Context context, AttributeSet attrs) {
46 | super(context, attrs);
47 |
48 | TypedArray styledAttrs = getContext().obtainStyledAttributes(attrs, R.styleable.CameraBridgeViewBase);
49 | int cameraIndex = styledAttrs.getInt(R.styleable.CameraBridgeViewBase_camera_id, -1);
50 | styledAttrs.recycle();
51 |
52 | if(android.os.Build.VERSION.SDK_INT >= 21)
53 | mRenderer = new Camera2Renderer(this);
54 | else
55 | mRenderer = new CameraRenderer(this);
56 |
57 | setCameraIndex(cameraIndex);
58 |
59 | setEGLContextClientVersion(2);
60 | setRenderer(mRenderer);
61 | setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
62 | }
63 |
64 | public void setCameraTextureListener(CameraTextureListener texListener)
65 | {
66 | mTexListener = texListener;
67 | }
68 |
69 | public CameraTextureListener getCameraTextureListener()
70 | {
71 | return mTexListener;
72 | }
73 |
74 | public void setCameraIndex(int cameraIndex) {
75 | mRenderer.setCameraIndex(cameraIndex);
76 | }
77 |
78 | public void setMaxCameraPreviewSize(int maxWidth, int maxHeight) {
79 | mRenderer.setMaxCameraPreviewSize(maxWidth, maxHeight);
80 | }
81 |
82 | @Override
83 | public void surfaceCreated(SurfaceHolder holder) {
84 | super.surfaceCreated(holder);
85 | }
86 |
87 | @Override
88 | public void surfaceDestroyed(SurfaceHolder holder) {
89 | mRenderer.mHaveSurface = false;
90 | super.surfaceDestroyed(holder);
91 | }
92 |
93 | @Override
94 | public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
95 | super.surfaceChanged(holder, format, w, h);
96 | }
97 |
98 | @Override
99 | public void onResume() {
100 | Log.i(LOGTAG, "onResume");
101 | super.onResume();
102 | mRenderer.onResume();
103 | }
104 |
105 | @Override
106 | public void onPause() {
107 | Log.i(LOGTAG, "onPause");
108 | mRenderer.onPause();
109 | super.onPause();
110 | }
111 |
112 | public void enableView() {
113 | mRenderer.enableView();
114 | }
115 |
116 | public void disableView() {
117 | mRenderer.disableView();
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/android/OpenCVLoader.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * Helper class provides common initialization methods for OpenCV library.
7 | */
8 | public class OpenCVLoader
9 | {
10 | /**
11 | * OpenCV Library version 2.4.2.
12 | */
13 | public static final String OPENCV_VERSION_2_4_2 = "2.4.2";
14 |
15 | /**
16 | * OpenCV Library version 2.4.3.
17 | */
18 | public static final String OPENCV_VERSION_2_4_3 = "2.4.3";
19 |
20 | /**
21 | * OpenCV Library version 2.4.4.
22 | */
23 | public static final String OPENCV_VERSION_2_4_4 = "2.4.4";
24 |
25 | /**
26 | * OpenCV Library version 2.4.5.
27 | */
28 | public static final String OPENCV_VERSION_2_4_5 = "2.4.5";
29 |
30 | /**
31 | * OpenCV Library version 2.4.6.
32 | */
33 | public static final String OPENCV_VERSION_2_4_6 = "2.4.6";
34 |
35 | /**
36 | * OpenCV Library version 2.4.7.
37 | */
38 | public static final String OPENCV_VERSION_2_4_7 = "2.4.7";
39 |
40 | /**
41 | * OpenCV Library version 2.4.8.
42 | */
43 | public static final String OPENCV_VERSION_2_4_8 = "2.4.8";
44 |
45 | /**
46 | * OpenCV Library version 2.4.9.
47 | */
48 | public static final String OPENCV_VERSION_2_4_9 = "2.4.9";
49 |
50 | /**
51 | * OpenCV Library version 2.4.10.
52 | */
53 | public static final String OPENCV_VERSION_2_4_10 = "2.4.10";
54 |
55 | /**
56 | * OpenCV Library version 2.4.11.
57 | */
58 | public static final String OPENCV_VERSION_2_4_11 = "2.4.11";
59 |
60 | /**
61 | * OpenCV Library version 2.4.12.
62 | */
63 | public static final String OPENCV_VERSION_2_4_12 = "2.4.12";
64 |
65 | /**
66 | * OpenCV Library version 2.4.13.
67 | */
68 | public static final String OPENCV_VERSION_2_4_13 = "2.4.13";
69 |
70 | /**
71 | * OpenCV Library version 3.0.0.
72 | */
73 | public static final String OPENCV_VERSION_3_0_0 = "3.0.0";
74 |
75 | /**
76 | * OpenCV Library version 3.1.0.
77 | */
78 | public static final String OPENCV_VERSION_3_1_0 = "3.1.0";
79 |
80 | /**
81 | * OpenCV Library version 3.2.0.
82 | */
83 | public static final String OPENCV_VERSION_3_2_0 = "3.2.0";
84 |
85 | /**
86 | * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
87 | * @return Returns true is initialization of OpenCV was successful.
88 | */
89 | public static boolean initDebug()
90 | {
91 | return StaticHelper.initOpenCV(false);
92 | }
93 |
94 | /**
95 | * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
96 | * @param InitCuda load and initialize CUDA runtime libraries.
97 | * @return Returns true is initialization of OpenCV was successful.
98 | */
99 | public static boolean initDebug(boolean InitCuda)
100 | {
101 | return StaticHelper.initOpenCV(InitCuda);
102 | }
103 |
104 | /**
105 | * Loads and initializes OpenCV library using OpenCV Engine service.
106 | * @param Version OpenCV library version.
107 | * @param AppContext application context for connecting to the service.
108 | * @param Callback object, that implements LoaderCallbackInterface for handling the connection status.
109 | * @return Returns true if initialization of OpenCV is successful.
110 | */
111 | public static boolean initAsync(String Version, Context AppContext,
112 | LoaderCallbackInterface Callback)
113 | {
114 | return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback);
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/android/StaticHelper.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | import org.opencv.core.Core;
4 |
5 | import java.util.StringTokenizer;
6 | import android.util.Log;
7 |
8 | class StaticHelper {
9 |
10 | public static boolean initOpenCV(boolean InitCuda)
11 | {
12 | boolean result;
13 | String libs = "";
14 |
15 | if(InitCuda)
16 | {
17 | loadLibrary("cudart");
18 | loadLibrary("nppc");
19 | loadLibrary("nppi");
20 | loadLibrary("npps");
21 | loadLibrary("cufft");
22 | loadLibrary("cublas");
23 | }
24 |
25 | Log.d(TAG, "Trying to get library list");
26 |
27 | try
28 | {
29 | System.loadLibrary("opencv_info");
30 | libs = getLibraryList();
31 | }
32 | catch(UnsatisfiedLinkError e)
33 | {
34 | Log.e(TAG, "OpenCV error: Cannot load info library for OpenCV");
35 | }
36 |
37 | Log.d(TAG, "Library list: \"" + libs + "\"");
38 | Log.d(TAG, "First attempt to load libs");
39 | if (initOpenCVLibs(libs))
40 | {
41 | Log.d(TAG, "First attempt to load libs is OK");
42 | String eol = System.getProperty("line.separator");
43 | for (String str : Core.getBuildInformation().split(eol))
44 | Log.i(TAG, str);
45 |
46 | result = true;
47 | }
48 | else
49 | {
50 | Log.d(TAG, "First attempt to load libs fails");
51 | result = false;
52 | }
53 |
54 | return result;
55 | }
56 |
57 | private static boolean loadLibrary(String Name)
58 | {
59 | boolean result = true;
60 |
61 | Log.d(TAG, "Trying to load library " + Name);
62 | try
63 | {
64 | System.loadLibrary(Name);
65 | Log.d(TAG, "Library " + Name + " loaded");
66 | }
67 | catch(UnsatisfiedLinkError e)
68 | {
69 | Log.d(TAG, "Cannot load library \"" + Name + "\"");
70 | e.printStackTrace();
71 | result &= false;
72 | }
73 |
74 | return result;
75 | }
76 |
77 | private static boolean initOpenCVLibs(String Libs)
78 | {
79 | Log.d(TAG, "Trying to init OpenCV libs");
80 |
81 | boolean result = true;
82 |
83 | if ((null != Libs) && (Libs.length() != 0))
84 | {
85 | Log.d(TAG, "Trying to load libs by dependency list");
86 | StringTokenizer splitter = new StringTokenizer(Libs, ";");
87 | while(splitter.hasMoreTokens())
88 | {
89 | result &= loadLibrary(splitter.nextToken());
90 | }
91 | }
92 | else
93 | {
94 | // If dependencies list is not defined or empty.
95 | result &= loadLibrary("opencv_java3");
96 | }
97 |
98 | return result;
99 | }
100 |
101 | private static final String TAG = "OpenCV/StaticHelper";
102 |
103 | private static native String getLibraryList();
104 | }
105 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/android/Utils.java:
--------------------------------------------------------------------------------
1 | package org.opencv.android;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 |
6 | import org.opencv.core.CvException;
7 | import org.opencv.core.CvType;
8 | import org.opencv.core.Mat;
9 | import org.opencv.imgcodecs.Imgcodecs;
10 |
11 | import java.io.ByteArrayOutputStream;
12 | import java.io.File;
13 | import java.io.FileOutputStream;
14 | import java.io.IOException;
15 | import java.io.InputStream;
16 |
17 | public class Utils {
18 |
19 | public static String exportResource(Context context, int resourceId) {
20 | return exportResource(context, resourceId, "OpenCV_data");
21 | }
22 |
23 | public static String exportResource(Context context, int resourceId, String dirname) {
24 | String fullname = context.getResources().getString(resourceId);
25 | String resName = fullname.substring(fullname.lastIndexOf("/") + 1);
26 | try {
27 | InputStream is = context.getResources().openRawResource(resourceId);
28 | File resDir = context.getDir(dirname, Context.MODE_PRIVATE);
29 | File resFile = new File(resDir, resName);
30 |
31 | FileOutputStream os = new FileOutputStream(resFile);
32 |
33 | byte[] buffer = new byte[4096];
34 | int bytesRead;
35 | while ((bytesRead = is.read(buffer)) != -1) {
36 | os.write(buffer, 0, bytesRead);
37 | }
38 | is.close();
39 | os.close();
40 |
41 | return resFile.getAbsolutePath();
42 | } catch (IOException e) {
43 | e.printStackTrace();
44 | throw new CvException("Failed to export resource " + resName
45 | + ". Exception thrown: " + e);
46 | }
47 | }
48 |
49 | public static Mat loadResource(Context context, int resourceId) throws IOException
50 | {
51 | return loadResource(context, resourceId, -1);
52 | }
53 |
54 | public static Mat loadResource(Context context, int resourceId, int flags) throws IOException
55 | {
56 | InputStream is = context.getResources().openRawResource(resourceId);
57 | ByteArrayOutputStream os = new ByteArrayOutputStream(is.available());
58 |
59 | byte[] buffer = new byte[4096];
60 | int bytesRead;
61 | while ((bytesRead = is.read(buffer)) != -1) {
62 | os.write(buffer, 0, bytesRead);
63 | }
64 | is.close();
65 |
66 | Mat encoded = new Mat(1, os.size(), CvType.CV_8U);
67 | encoded.put(0, 0, os.toByteArray());
68 | os.close();
69 |
70 | Mat decoded = Imgcodecs.imdecode(encoded, flags);
71 | encoded.release();
72 |
73 | return decoded;
74 | }
75 |
76 | /**
77 | * Converts Android Bitmap to OpenCV Mat.
78 | *
79 | * This function converts an Android Bitmap image to the OpenCV Mat.
80 | *
'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
81 | *
The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
82 | * it keeps the image in RGBA format.
83 | *
This function throws an exception if the conversion fails.
84 | * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
85 | * @param mat is a valid output Mat object, it will be reallocated if needed, so it may be empty.
86 | * @param unPremultiplyAlpha is a flag, that determines, whether the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one; this flag is ignored for 'RGB_565' bitmaps.
87 | */
88 | public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
89 | if (bmp == null)
90 | throw new java.lang.IllegalArgumentException("bmp == null");
91 | if (mat == null)
92 | throw new java.lang.IllegalArgumentException("mat == null");
93 | nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha);
94 | }
95 |
96 | /**
97 | * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
98 | * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
99 | * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty.
100 | */
101 | public static void bitmapToMat(Bitmap bmp, Mat mat) {
102 | bitmapToMat(bmp, mat, false);
103 | }
104 |
105 |
106 | /**
107 | * Converts OpenCV Mat to Android Bitmap.
108 | *
109 | *
This function converts an image in the OpenCV Mat representation to the Android Bitmap.
110 | *
The input Mat object has to be of the types 'CV_8UC1' (gray-scale), 'CV_8UC3' (RGB) or 'CV_8UC4' (RGBA).
111 | *
The output Bitmap object has to be of the same size as the input Mat and of the types 'ARGB_8888' or 'RGB_565'.
112 | *
This function throws an exception if the conversion fails.
113 | *
114 | * @param mat is a valid input Mat object of types 'CV_8UC1', 'CV_8UC3' or 'CV_8UC4'.
115 | * @param bmp is a valid Bitmap object of the same size as the Mat and of type 'ARGB_8888' or 'RGB_565'.
116 | * @param premultiplyAlpha is a flag, that determines, whether the Mat needs to be converted to alpha premultiplied format (like Android keeps 'ARGB_8888' bitmaps); the flag is ignored for 'RGB_565' bitmaps.
117 | */
118 | public static void matToBitmap(Mat mat, Bitmap bmp, boolean premultiplyAlpha) {
119 | if (mat == null)
120 | throw new java.lang.IllegalArgumentException("mat == null");
121 | if (bmp == null)
122 | throw new java.lang.IllegalArgumentException("bmp == null");
123 | nMatToBitmap2(mat.nativeObj, bmp, premultiplyAlpha);
124 | }
125 |
126 | /**
127 | * Short form of the matToBitmap(mat, bmp, premultiplyAlpha=false)
128 | * @param mat is a valid input Mat object of the types 'CV_8UC1', 'CV_8UC3' or 'CV_8UC4'.
129 | * @param bmp is a valid Bitmap object of the same size as the Mat and of type 'ARGB_8888' or 'RGB_565'.
130 | */
131 | public static void matToBitmap(Mat mat, Bitmap bmp) {
132 | matToBitmap(mat, bmp, false);
133 | }
134 |
135 |
136 | private static native void nBitmapToMat2(Bitmap b, long m_addr, boolean unPremultiplyAlpha);
137 |
138 | private static native void nMatToBitmap2(long m_addr, Bitmap b, boolean premultiplyAlpha);
139 | }
140 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/core/CvType.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | public final class CvType {
4 |
5 | // type depth constants
6 | public static final int
7 | CV_8U = 0, CV_8S = 1,
8 | CV_16U = 2, CV_16S = 3,
9 | CV_32S = 4,
10 | CV_32F = 5,
11 | CV_64F = 6,
12 | CV_USRTYPE1 = 7;
13 |
14 | // predefined type constants
15 | public static final int
16 | CV_8UC1 = CV_8UC(1), CV_8UC2 = CV_8UC(2), CV_8UC3 = CV_8UC(3), CV_8UC4 = CV_8UC(4),
17 | CV_8SC1 = CV_8SC(1), CV_8SC2 = CV_8SC(2), CV_8SC3 = CV_8SC(3), CV_8SC4 = CV_8SC(4),
18 | CV_16UC1 = CV_16UC(1), CV_16UC2 = CV_16UC(2), CV_16UC3 = CV_16UC(3), CV_16UC4 = CV_16UC(4),
19 | CV_16SC1 = CV_16SC(1), CV_16SC2 = CV_16SC(2), CV_16SC3 = CV_16SC(3), CV_16SC4 = CV_16SC(4),
20 | CV_32SC1 = CV_32SC(1), CV_32SC2 = CV_32SC(2), CV_32SC3 = CV_32SC(3), CV_32SC4 = CV_32SC(4),
21 | CV_32FC1 = CV_32FC(1), CV_32FC2 = CV_32FC(2), CV_32FC3 = CV_32FC(3), CV_32FC4 = CV_32FC(4),
22 | CV_64FC1 = CV_64FC(1), CV_64FC2 = CV_64FC(2), CV_64FC3 = CV_64FC(3), CV_64FC4 = CV_64FC(4);
23 |
24 | private static final int CV_CN_MAX = 512, CV_CN_SHIFT = 3, CV_DEPTH_MAX = (1 << CV_CN_SHIFT);
25 |
26 | public static final int makeType(int depth, int channels) {
27 | if (channels <= 0 || channels >= CV_CN_MAX) {
28 | throw new java.lang.UnsupportedOperationException(
29 | "Channels count should be 1.." + (CV_CN_MAX - 1));
30 | }
31 | if (depth < 0 || depth >= CV_DEPTH_MAX) {
32 | throw new java.lang.UnsupportedOperationException(
33 | "Data type depth should be 0.." + (CV_DEPTH_MAX - 1));
34 | }
35 | return (depth & (CV_DEPTH_MAX - 1)) + ((channels - 1) << CV_CN_SHIFT);
36 | }
37 |
38 | public static final int CV_8UC(int ch) {
39 | return makeType(CV_8U, ch);
40 | }
41 |
42 | public static final int CV_8SC(int ch) {
43 | return makeType(CV_8S, ch);
44 | }
45 |
46 | public static final int CV_16UC(int ch) {
47 | return makeType(CV_16U, ch);
48 | }
49 |
50 | public static final int CV_16SC(int ch) {
51 | return makeType(CV_16S, ch);
52 | }
53 |
54 | public static final int CV_32SC(int ch) {
55 | return makeType(CV_32S, ch);
56 | }
57 |
58 | public static final int CV_32FC(int ch) {
59 | return makeType(CV_32F, ch);
60 | }
61 |
62 | public static final int CV_64FC(int ch) {
63 | return makeType(CV_64F, ch);
64 | }
65 |
66 | public static final int channels(int type) {
67 | return (type >> CV_CN_SHIFT) + 1;
68 | }
69 |
70 | public static final int depth(int type) {
71 | return type & (CV_DEPTH_MAX - 1);
72 | }
73 |
74 | public static final boolean isInteger(int type) {
75 | return depth(type) < CV_32F;
76 | }
77 |
78 | public static final int ELEM_SIZE(int type) {
79 | switch (depth(type)) {
80 | case CV_8U:
81 | case CV_8S:
82 | return channels(type);
83 | case CV_16U:
84 | case CV_16S:
85 | return 2 * channels(type);
86 | case CV_32S:
87 | case CV_32F:
88 | return 4 * channels(type);
89 | case CV_64F:
90 | return 8 * channels(type);
91 | default:
92 | throw new java.lang.UnsupportedOperationException(
93 | "Unsupported CvType value: " + type);
94 | }
95 | }
96 |
97 | public static final String typeToString(int type) {
98 | String s;
99 | switch (depth(type)) {
100 | case CV_8U:
101 | s = "CV_8U";
102 | break;
103 | case CV_8S:
104 | s = "CV_8S";
105 | break;
106 | case CV_16U:
107 | s = "CV_16U";
108 | break;
109 | case CV_16S:
110 | s = "CV_16S";
111 | break;
112 | case CV_32S:
113 | s = "CV_32S";
114 | break;
115 | case CV_32F:
116 | s = "CV_32F";
117 | break;
118 | case CV_64F:
119 | s = "CV_64F";
120 | break;
121 | case CV_USRTYPE1:
122 | s = "CV_USRTYPE1";
123 | break;
124 | default:
125 | throw new java.lang.UnsupportedOperationException(
126 | "Unsupported CvType value: " + type);
127 | }
128 |
129 | int ch = channels(type);
130 | if (ch <= 4)
131 | return s + "C" + ch;
132 | else
133 | return s + "C(" + ch + ")";
134 | }
135 |
136 | }
137 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/core/MatOfDouble.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | public class MatOfDouble extends Mat {
7 | // 64FC(x)
8 | private static final int _depth = CvType.CV_64F;
9 | private static final int _channels = 1;
10 |
11 | public MatOfDouble() {
12 | super();
13 | }
14 |
15 | protected MatOfDouble(long addr) {
16 | super(addr);
17 | if( !empty() && checkVector(_channels, _depth) < 0 )
18 | throw new IllegalArgumentException("Incompatible Mat");
19 | //FIXME: do we need release() here?
20 | }
21 |
22 | public static MatOfDouble fromNativeAddr(long addr) {
23 | return new MatOfDouble(addr);
24 | }
25 |
26 | public MatOfDouble(Mat m) {
27 | super(m, Range.all());
28 | if( !empty() && checkVector(_channels, _depth) < 0 )
29 | throw new IllegalArgumentException("Incompatible Mat");
30 | //FIXME: do we need release() here?
31 | }
32 |
33 | public MatOfDouble(double...a) {
34 | super();
35 | fromArray(a);
36 | }
37 |
38 | public void alloc(int elemNumber) {
39 | if(elemNumber>0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(double...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public double[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | double[] a = new double[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Double ab[] = lb.toArray(new Double[0]);
66 | double a[] = new double[ab.length];
67 | for(int i=0; i toList() {
73 | double[] a = toArray();
74 | Double ab[] = new Double[a.length];
75 | for(int i=0; i0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(float...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public float[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | float[] a = new float[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Float ab[] = lb.toArray(new Float[0]);
66 | float a[] = new float[ab.length];
67 | for(int i=0; i toList() {
73 | float[] a = toArray();
74 | Float ab[] = new Float[a.length];
75 | for(int i=0; i0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(float...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public float[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | float[] a = new float[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Float ab[] = lb.toArray(new Float[0]);
66 | float a[] = new float[ab.length];
67 | for(int i=0; i toList() {
73 | float[] a = toArray();
74 | Float ab[] = new Float[a.length];
75 | for(int i=0; i0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(float...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length / _channels;
47 | alloc(num);
48 | put(0, 0, a); //TODO: check ret val!
49 | }
50 |
51 | public float[] toArray() {
52 | int num = checkVector(_channels, _depth);
53 | if(num < 0)
54 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
55 | float[] a = new float[num * _channels];
56 | if(num == 0)
57 | return a;
58 | get(0, 0, a); //TODO: check ret val!
59 | return a;
60 | }
61 |
62 | public void fromList(List lb) {
63 | if(lb==null || lb.size()==0)
64 | return;
65 | Float ab[] = lb.toArray(new Float[0]);
66 | float a[] = new float[ab.length];
67 | for(int i=0; i toList() {
73 | float[] a = toArray();
74 | Float ab[] = new Float[a.length];
75 | for(int i=0; i0)
41 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
42 | }
43 |
44 | public void fromArray(int...a) {
45 | if(a==null || a.length==0)
46 | return;
47 | int num = a.length / _channels;
48 | alloc(num);
49 | put(0, 0, a); //TODO: check ret val!
50 | }
51 |
52 | public int[] toArray() {
53 | int num = checkVector(_channels, _depth);
54 | if(num < 0)
55 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
56 | int[] a = new int[num * _channels];
57 | if(num == 0)
58 | return a;
59 | get(0, 0, a); //TODO: check ret val!
60 | return a;
61 | }
62 |
63 | public void fromList(List lb) {
64 | if(lb==null || lb.size()==0)
65 | return;
66 | Integer ab[] = lb.toArray(new Integer[0]);
67 | int a[] = new int[ab.length];
68 | for(int i=0; i toList() {
74 | int[] a = toArray();
75 | Integer ab[] = new Integer[a.length];
76 | for(int i=0; i0)
41 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
42 | }
43 |
44 | public void fromArray(int...a) {
45 | if(a==null || a.length==0)
46 | return;
47 | int num = a.length / _channels;
48 | alloc(num);
49 | put(0, 0, a); //TODO: check ret val!
50 | }
51 |
52 | public int[] toArray() {
53 | int num = checkVector(_channels, _depth);
54 | if(num < 0)
55 | throw new RuntimeException("Native Mat has unexpected type or size: " + toString());
56 | int[] a = new int[num * _channels];
57 | if(num == 0)
58 | return a;
59 | get(0, 0, a); //TODO: check ret val!
60 | return a;
61 | }
62 |
63 | public void fromList(List lb) {
64 | if(lb==null || lb.size()==0)
65 | return;
66 | Integer ab[] = lb.toArray(new Integer[0]);
67 | int a[] = new int[ab.length];
68 | for(int i=0; i toList() {
74 | int[] a = toArray();
75 | Integer ab[] = new Integer[a.length];
76 | for(int i=0; i0)
42 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
43 | }
44 |
45 | public void fromArray(KeyPoint...a) {
46 | if(a==null || a.length==0)
47 | return;
48 | int num = a.length;
49 | alloc(num);
50 | float buff[] = new float[num * _channels];
51 | for(int i=0; i lkp) {
78 | KeyPoint akp[] = lkp.toArray(new KeyPoint[0]);
79 | fromArray(akp);
80 | }
81 |
82 | public List toList() {
83 | KeyPoint[] akp = toArray();
84 | return Arrays.asList(akp);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/core/MatOfPoint.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | public class MatOfPoint extends Mat {
7 | // 32SC2
8 | private static final int _depth = CvType.CV_32S;
9 | private static final int _channels = 2;
10 |
11 | public MatOfPoint() {
12 | super();
13 | }
14 |
15 | protected MatOfPoint(long addr) {
16 | super(addr);
17 | if( !empty() && checkVector(_channels, _depth) < 0 )
18 | throw new IllegalArgumentException("Incompatible Mat");
19 | //FIXME: do we need release() here?
20 | }
21 |
22 | public static MatOfPoint fromNativeAddr(long addr) {
23 | return new MatOfPoint(addr);
24 | }
25 |
26 | public MatOfPoint(Mat m) {
27 | super(m, Range.all());
28 | if( !empty() && checkVector(_channels, _depth) < 0 )
29 | throw new IllegalArgumentException("Incompatible Mat");
30 | //FIXME: do we need release() here?
31 | }
32 |
33 | public MatOfPoint(Point...a) {
34 | super();
35 | fromArray(a);
36 | }
37 |
38 | public void alloc(int elemNumber) {
39 | if(elemNumber>0)
40 | super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
41 | }
42 |
43 | public void fromArray(Point...a) {
44 | if(a==null || a.length==0)
45 | return;
46 | int num = a.length;
47 | alloc(num);
48 | int buff[] = new int[num * _channels];
49 | for(int i=0; i lp) {
70 | Point ap[] = lp.toArray(new Point[0]);
71 | fromArray(ap);
72 | }
73 |
74 | public List toList() {
75 | Point[] ap = toArray();
76 | return Arrays.asList(ap);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/core/Rect.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | //javadoc:Rect_
4 | public class Rect {
5 |
6 | public int x, y, width, height;
7 |
8 | public Rect(int x, int y, int width, int height) {
9 | this.x = x;
10 | this.y = y;
11 | this.width = width;
12 | this.height = height;
13 | }
14 |
15 | public Rect() {
16 | this(0, 0, 0, 0);
17 | }
18 |
19 | public Rect(Point p1, Point p2) {
20 | x = (int) (p1.x < p2.x ? p1.x : p2.x);
21 | y = (int) (p1.y < p2.y ? p1.y : p2.y);
22 | width = (int) (p1.x > p2.x ? p1.x : p2.x) - x;
23 | height = (int) (p1.y > p2.y ? p1.y : p2.y) - y;
24 | }
25 |
26 | public Rect(Point p, Size s) {
27 | this((int) p.x, (int) p.y, (int) s.width, (int) s.height);
28 | }
29 |
30 | public Rect(double[] vals) {
31 | set(vals);
32 | }
33 |
34 | public void set(double[] vals) {
35 | if (vals != null) {
36 | x = vals.length > 0 ? (int) vals[0] : 0;
37 | y = vals.length > 1 ? (int) vals[1] : 0;
38 | width = vals.length > 2 ? (int) vals[2] : 0;
39 | height = vals.length > 3 ? (int) vals[3] : 0;
40 | } else {
41 | x = 0;
42 | y = 0;
43 | width = 0;
44 | height = 0;
45 | }
46 | }
47 |
48 | public Rect clone() {
49 | return new Rect(x, y, width, height);
50 | }
51 |
52 | public Point tl() {
53 | return new Point(x, y);
54 | }
55 |
56 | public Point br() {
57 | return new Point(x + width, y + height);
58 | }
59 |
60 | public Size size() {
61 | return new Size(width, height);
62 | }
63 |
64 | public double area() {
65 | return width * height;
66 | }
67 |
68 | public boolean contains(Point p) {
69 | return x <= p.x && p.x < x + width && y <= p.y && p.y < y + height;
70 | }
71 |
72 | @Override
73 | public int hashCode() {
74 | final int prime = 31;
75 | int result = 1;
76 | long temp;
77 | temp = Double.doubleToLongBits(height);
78 | result = prime * result + (int) (temp ^ (temp >>> 32));
79 | temp = Double.doubleToLongBits(width);
80 | result = prime * result + (int) (temp ^ (temp >>> 32));
81 | temp = Double.doubleToLongBits(x);
82 | result = prime * result + (int) (temp ^ (temp >>> 32));
83 | temp = Double.doubleToLongBits(y);
84 | result = prime * result + (int) (temp ^ (temp >>> 32));
85 | return result;
86 | }
87 |
88 | @Override
89 | public boolean equals(Object obj) {
90 | if (this == obj) return true;
91 | if (!(obj instanceof Rect)) return false;
92 | Rect it = (Rect) obj;
93 | return x == it.x && y == it.y && width == it.width && height == it.height;
94 | }
95 |
96 | @Override
97 | public String toString() {
98 | return "{" + x + ", " + y + ", " + width + "x" + height + "}";
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/core/RotatedRect.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | //javadoc:RotatedRect_
4 | public class RotatedRect {
5 |
6 | public Point center;
7 | public Size size;
8 | public double angle;
9 |
10 | public RotatedRect() {
11 | this.center = new Point();
12 | this.size = new Size();
13 | this.angle = 0;
14 | }
15 |
16 | public RotatedRect(Point c, Size s, double a) {
17 | this.center = c.clone();
18 | this.size = s.clone();
19 | this.angle = a;
20 | }
21 |
22 | public RotatedRect(double[] vals) {
23 | this();
24 | set(vals);
25 | }
26 |
27 | public void set(double[] vals) {
28 | if (vals != null) {
29 | center.x = vals.length > 0 ? (double) vals[0] : 0;
30 | center.y = vals.length > 1 ? (double) vals[1] : 0;
31 | size.width = vals.length > 2 ? (double) vals[2] : 0;
32 | size.height = vals.length > 3 ? (double) vals[3] : 0;
33 | angle = vals.length > 4 ? (double) vals[4] : 0;
34 | } else {
35 | center.x = 0;
36 | center.x = 0;
37 | size.width = 0;
38 | size.height = 0;
39 | angle = 0;
40 | }
41 | }
42 |
43 | public void points(Point pt[])
44 | {
45 | double _angle = angle * Math.PI / 180.0;
46 | double b = (double) Math.cos(_angle) * 0.5f;
47 | double a = (double) Math.sin(_angle) * 0.5f;
48 |
49 | pt[0] = new Point(
50 | center.x - a * size.height - b * size.width,
51 | center.y + b * size.height - a * size.width);
52 |
53 | pt[1] = new Point(
54 | center.x + a * size.height - b * size.width,
55 | center.y - b * size.height - a * size.width);
56 |
57 | pt[2] = new Point(
58 | 2 * center.x - pt[0].x,
59 | 2 * center.y - pt[0].y);
60 |
61 | pt[3] = new Point(
62 | 2 * center.x - pt[1].x,
63 | 2 * center.y - pt[1].y);
64 | }
65 |
66 | public Rect boundingRect()
67 | {
68 | Point pt[] = new Point[4];
69 | points(pt);
70 | Rect r = new Rect((int) Math.floor(Math.min(Math.min(Math.min(pt[0].x, pt[1].x), pt[2].x), pt[3].x)),
71 | (int) Math.floor(Math.min(Math.min(Math.min(pt[0].y, pt[1].y), pt[2].y), pt[3].y)),
72 | (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].x, pt[1].x), pt[2].x), pt[3].x)),
73 | (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].y, pt[1].y), pt[2].y), pt[3].y)));
74 | r.width -= r.x - 1;
75 | r.height -= r.y - 1;
76 | return r;
77 | }
78 |
79 | public RotatedRect clone() {
80 | return new RotatedRect(center, size, angle);
81 | }
82 |
83 | @Override
84 | public int hashCode() {
85 | final int prime = 31;
86 | int result = 1;
87 | long temp;
88 | temp = Double.doubleToLongBits(center.x);
89 | result = prime * result + (int) (temp ^ (temp >>> 32));
90 | temp = Double.doubleToLongBits(center.y);
91 | result = prime * result + (int) (temp ^ (temp >>> 32));
92 | temp = Double.doubleToLongBits(size.width);
93 | result = prime * result + (int) (temp ^ (temp >>> 32));
94 | temp = Double.doubleToLongBits(size.height);
95 | result = prime * result + (int) (temp ^ (temp >>> 32));
96 | temp = Double.doubleToLongBits(angle);
97 | result = prime * result + (int) (temp ^ (temp >>> 32));
98 | return result;
99 | }
100 |
101 | @Override
102 | public boolean equals(Object obj) {
103 | if (this == obj) return true;
104 | if (!(obj instanceof RotatedRect)) return false;
105 | RotatedRect it = (RotatedRect) obj;
106 | return center.equals(it.center) && size.equals(it.size) && angle == it.angle;
107 | }
108 |
109 | @Override
110 | public String toString() {
111 | return "{ " + center + " " + size + " * " + angle + " }";
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/core/TermCriteria.java:
--------------------------------------------------------------------------------
1 | package org.opencv.core;
2 |
3 | //javadoc:TermCriteria
4 | public class TermCriteria {
5 |
6 | /**
7 | * The maximum number of iterations or elements to compute
8 | */
9 | public static final int COUNT = 1;
10 | /**
11 | * The maximum number of iterations or elements to compute
12 | */
13 | public static final int MAX_ITER = COUNT;
14 | /**
15 | * The desired accuracy threshold or change in parameters at which the iterative algorithm is terminated.
16 | */
17 | public static final int EPS = 2;
18 |
19 | public int type;
20 | public int maxCount;
21 | public double epsilon;
22 |
23 | /**
24 | * Termination criteria for iterative algorithms.
25 | *
26 | * @param type
27 | * the type of termination criteria: COUNT, EPS or COUNT + EPS.
28 | * @param maxCount
29 | * the maximum number of iterations/elements.
30 | * @param epsilon
31 | * the desired accuracy.
32 | */
33 | public TermCriteria(int type, int maxCount, double epsilon) {
34 | this.type = type;
35 | this.maxCount = maxCount;
36 | this.epsilon = epsilon;
37 | }
38 |
39 | /**
40 | * Termination criteria for iterative algorithms.
41 | */
42 | public TermCriteria() {
43 | this(0, 0, 0.0);
44 | }
45 |
46 | public TermCriteria(double[] vals) {
47 | set(vals);
48 | }
49 |
50 | public void set(double[] vals) {
51 | if (vals != null) {
52 | type = vals.length > 0 ? (int) vals[0] : 0;
53 | maxCount = vals.length > 1 ? (int) vals[1] : 0;
54 | epsilon = vals.length > 2 ? (double) vals[2] : 0;
55 | } else {
56 | type = 0;
57 | maxCount = 0;
58 | epsilon = 0;
59 | }
60 | }
61 |
62 | public TermCriteria clone() {
63 | return new TermCriteria(type, maxCount, epsilon);
64 | }
65 |
66 | @Override
67 | public int hashCode() {
68 | final int prime = 31;
69 | int result = 1;
70 | long temp;
71 | temp = Double.doubleToLongBits(type);
72 | result = prime * result + (int) (temp ^ (temp >>> 32));
73 | temp = Double.doubleToLongBits(maxCount);
74 | result = prime * result + (int) (temp ^ (temp >>> 32));
75 | temp = Double.doubleToLongBits(epsilon);
76 | result = prime * result + (int) (temp ^ (temp >>> 32));
77 | return result;
78 | }
79 |
80 | @Override
81 | public boolean equals(Object obj) {
82 | if (this == obj) return true;
83 | if (!(obj instanceof TermCriteria)) return false;
84 | TermCriteria it = (TermCriteria) obj;
85 | return type == it.type && maxCount == it.maxCount && epsilon == it.epsilon;
86 | }
87 |
88 | @Override
89 | public String toString() {
90 | return "{ type: " + type + ", maxCount: " + maxCount + ", epsilon: " + epsilon + "}";
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/core/TickMeter.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.core;
6 |
7 |
8 |
9 | // C++: class TickMeter
10 | //javadoc: TickMeter
11 | public class TickMeter {
12 |
13 | protected final long nativeObj;
14 | protected TickMeter(long addr) { nativeObj = addr; }
15 |
16 |
17 | //
18 | // C++: TickMeter()
19 | //
20 |
21 | //javadoc: TickMeter::TickMeter()
22 | public TickMeter()
23 | {
24 |
25 | nativeObj = TickMeter_0();
26 |
27 | return;
28 | }
29 |
30 |
31 | //
32 | // C++: double getTimeMicro()
33 | //
34 |
35 | //javadoc: TickMeter::getTimeMicro()
36 | public double getTimeMicro()
37 | {
38 |
39 | double retVal = getTimeMicro_0(nativeObj);
40 |
41 | return retVal;
42 | }
43 |
44 |
45 | //
46 | // C++: double getTimeMilli()
47 | //
48 |
49 | //javadoc: TickMeter::getTimeMilli()
50 | public double getTimeMilli()
51 | {
52 |
53 | double retVal = getTimeMilli_0(nativeObj);
54 |
55 | return retVal;
56 | }
57 |
58 |
59 | //
60 | // C++: double getTimeSec()
61 | //
62 |
63 | //javadoc: TickMeter::getTimeSec()
64 | public double getTimeSec()
65 | {
66 |
67 | double retVal = getTimeSec_0(nativeObj);
68 |
69 | return retVal;
70 | }
71 |
72 |
73 | //
74 | // C++: int64 getCounter()
75 | //
76 |
77 | //javadoc: TickMeter::getCounter()
78 | public long getCounter()
79 | {
80 |
81 | long retVal = getCounter_0(nativeObj);
82 |
83 | return retVal;
84 | }
85 |
86 |
87 | //
88 | // C++: int64 getTimeTicks()
89 | //
90 |
91 | //javadoc: TickMeter::getTimeTicks()
92 | public long getTimeTicks()
93 | {
94 |
95 | long retVal = getTimeTicks_0(nativeObj);
96 |
97 | return retVal;
98 | }
99 |
100 |
101 | //
102 | // C++: void reset()
103 | //
104 |
105 | //javadoc: TickMeter::reset()
106 | public void reset()
107 | {
108 |
109 | reset_0(nativeObj);
110 |
111 | return;
112 | }
113 |
114 |
115 | //
116 | // C++: void start()
117 | //
118 |
119 | //javadoc: TickMeter::start()
120 | public void start()
121 | {
122 |
123 | start_0(nativeObj);
124 |
125 | return;
126 | }
127 |
128 |
129 | //
130 | // C++: void stop()
131 | //
132 |
133 | //javadoc: TickMeter::stop()
134 | public void stop()
135 | {
136 |
137 | stop_0(nativeObj);
138 |
139 | return;
140 | }
141 |
142 |
143 | @Override
144 | protected void finalize() throws Throwable {
145 | delete(nativeObj);
146 | }
147 |
148 |
149 |
150 | // C++: TickMeter()
151 | private static native long TickMeter_0();
152 |
153 | // C++: double getTimeMicro()
154 | private static native double getTimeMicro_0(long nativeObj);
155 |
156 | // C++: double getTimeMilli()
157 | private static native double getTimeMilli_0(long nativeObj);
158 |
159 | // C++: double getTimeSec()
160 | private static native double getTimeSec_0(long nativeObj);
161 |
162 | // C++: int64 getCounter()
163 | private static native long getCounter_0(long nativeObj);
164 |
165 | // C++: int64 getTimeTicks()
166 | private static native long getTimeTicks_0(long nativeObj);
167 |
168 | // C++: void reset()
169 | private static native void reset_0(long nativeObj);
170 |
171 | // C++: void start()
172 | private static native void start_0(long nativeObj);
173 |
174 | // C++: void stop()
175 | private static native void stop_0(long nativeObj);
176 |
177 | // native support for java finalize()
178 | private static native void delete(long nativeObj);
179 |
180 | }
181 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/engine/OpenCVEngineInterface.aidl:
--------------------------------------------------------------------------------
1 | package org.opencv.engine;
2 |
3 | /**
4 | * Class provides a Java interface for OpenCV Engine Service. It's synchronous with native OpenCVEngine class.
5 | */
6 | interface OpenCVEngineInterface
7 | {
8 | /**
9 | * @return Returns service version.
10 | */
11 | int getEngineVersion();
12 |
13 | /**
14 | * Finds an installed OpenCV library.
15 | * @param OpenCV version.
16 | * @return Returns path to OpenCV native libs or an empty string if OpenCV can not be found.
17 | */
18 | String getLibPathByVersion(String version);
19 |
20 | /**
21 | * Tries to install defined version of OpenCV from Google Play Market.
22 | * @param OpenCV version.
23 | * @return Returns true if installation was successful or OpenCV package has been already installed.
24 | */
25 | boolean installVersion(String version);
26 |
27 | /**
28 | * Returns list of libraries in loading order, separated by semicolon.
29 | * @param OpenCV version.
30 | * @return Returns names of OpenCV libraries, separated by semicolon.
31 | */
32 | String getLibraryList(String version);
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/features2d/AgastFeatureDetector.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.features2d;
6 |
7 | import org.opencv.features2d.Feature2D;
8 |
9 | // C++: class AgastFeatureDetector
10 | //javadoc: AgastFeatureDetector
11 | public class AgastFeatureDetector extends Feature2D {
12 |
13 | protected AgastFeatureDetector(long addr) { super(addr); }
14 |
15 |
16 | public static final int
17 | AGAST_5_8 = 0,
18 | AGAST_7_12d = 1,
19 | AGAST_7_12s = 2,
20 | OAST_9_16 = 3,
21 | THRESHOLD = 10000,
22 | NONMAX_SUPPRESSION = 10001;
23 |
24 |
25 | //
26 | // C++: static Ptr_AgastFeatureDetector create(int threshold = 10, bool nonmaxSuppression = true, int type = AgastFeatureDetector::OAST_9_16)
27 | //
28 |
29 | //javadoc: AgastFeatureDetector::create(threshold, nonmaxSuppression, type)
30 | public static AgastFeatureDetector create(int threshold, boolean nonmaxSuppression, int type)
31 | {
32 |
33 | AgastFeatureDetector retVal = new AgastFeatureDetector(create_0(threshold, nonmaxSuppression, type));
34 |
35 | return retVal;
36 | }
37 |
38 | //javadoc: AgastFeatureDetector::create()
39 | public static AgastFeatureDetector create()
40 | {
41 |
42 | AgastFeatureDetector retVal = new AgastFeatureDetector(create_1());
43 |
44 | return retVal;
45 | }
46 |
47 |
48 | //
49 | // C++: bool getNonmaxSuppression()
50 | //
51 |
52 | //javadoc: AgastFeatureDetector::getNonmaxSuppression()
53 | public boolean getNonmaxSuppression()
54 | {
55 |
56 | boolean retVal = getNonmaxSuppression_0(nativeObj);
57 |
58 | return retVal;
59 | }
60 |
61 |
62 | //
63 | // C++: int getThreshold()
64 | //
65 |
66 | //javadoc: AgastFeatureDetector::getThreshold()
67 | public int getThreshold()
68 | {
69 |
70 | int retVal = getThreshold_0(nativeObj);
71 |
72 | return retVal;
73 | }
74 |
75 |
76 | //
77 | // C++: int getType()
78 | //
79 |
80 | //javadoc: AgastFeatureDetector::getType()
81 | public int getType()
82 | {
83 |
84 | int retVal = getType_0(nativeObj);
85 |
86 | return retVal;
87 | }
88 |
89 |
90 | //
91 | // C++: void setNonmaxSuppression(bool f)
92 | //
93 |
94 | //javadoc: AgastFeatureDetector::setNonmaxSuppression(f)
95 | public void setNonmaxSuppression(boolean f)
96 | {
97 |
98 | setNonmaxSuppression_0(nativeObj, f);
99 |
100 | return;
101 | }
102 |
103 |
104 | //
105 | // C++: void setThreshold(int threshold)
106 | //
107 |
108 | //javadoc: AgastFeatureDetector::setThreshold(threshold)
109 | public void setThreshold(int threshold)
110 | {
111 |
112 | setThreshold_0(nativeObj, threshold);
113 |
114 | return;
115 | }
116 |
117 |
118 | //
119 | // C++: void setType(int type)
120 | //
121 |
122 | //javadoc: AgastFeatureDetector::setType(type)
123 | public void setType(int type)
124 | {
125 |
126 | setType_0(nativeObj, type);
127 |
128 | return;
129 | }
130 |
131 |
132 | @Override
133 | protected void finalize() throws Throwable {
134 | delete(nativeObj);
135 | }
136 |
137 |
138 |
139 | // C++: static Ptr_AgastFeatureDetector create(int threshold = 10, bool nonmaxSuppression = true, int type = AgastFeatureDetector::OAST_9_16)
140 | private static native long create_0(int threshold, boolean nonmaxSuppression, int type);
141 | private static native long create_1();
142 |
143 | // C++: bool getNonmaxSuppression()
144 | private static native boolean getNonmaxSuppression_0(long nativeObj);
145 |
146 | // C++: int getThreshold()
147 | private static native int getThreshold_0(long nativeObj);
148 |
149 | // C++: int getType()
150 | private static native int getType_0(long nativeObj);
151 |
152 | // C++: void setNonmaxSuppression(bool f)
153 | private static native void setNonmaxSuppression_0(long nativeObj, boolean f);
154 |
155 | // C++: void setThreshold(int threshold)
156 | private static native void setThreshold_0(long nativeObj, int threshold);
157 |
158 | // C++: void setType(int type)
159 | private static native void setType_0(long nativeObj, int type);
160 |
161 | // native support for java finalize()
162 | private static native void delete(long nativeObj);
163 |
164 | }
165 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/features2d/BOWImgDescriptorExtractor.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.features2d;
6 |
7 | import java.util.ArrayList;
8 | import org.opencv.core.Mat;
9 | import org.opencv.core.MatOfKeyPoint;
10 |
11 | // C++: class BOWImgDescriptorExtractor
12 | //javadoc: BOWImgDescriptorExtractor
13 | public class BOWImgDescriptorExtractor {
14 |
15 | protected final long nativeObj;
16 | protected BOWImgDescriptorExtractor(long addr) { nativeObj = addr; }
17 |
18 |
19 | //
20 | // C++: BOWImgDescriptorExtractor(Ptr_DescriptorExtractor dextractor, Ptr_DescriptorMatcher dmatcher)
21 | //
22 |
23 | // Unknown type 'Ptr_DescriptorExtractor' (I), skipping the function
24 |
25 |
26 | //
27 | // C++: Mat getVocabulary()
28 | //
29 |
30 | //javadoc: BOWImgDescriptorExtractor::getVocabulary()
31 | public Mat getVocabulary()
32 | {
33 |
34 | Mat retVal = new Mat(getVocabulary_0(nativeObj));
35 |
36 | return retVal;
37 | }
38 |
39 |
40 | //
41 | // C++: int descriptorSize()
42 | //
43 |
44 | //javadoc: BOWImgDescriptorExtractor::descriptorSize()
45 | public int descriptorSize()
46 | {
47 |
48 | int retVal = descriptorSize_0(nativeObj);
49 |
50 | return retVal;
51 | }
52 |
53 |
54 | //
55 | // C++: int descriptorType()
56 | //
57 |
58 | //javadoc: BOWImgDescriptorExtractor::descriptorType()
59 | public int descriptorType()
60 | {
61 |
62 | int retVal = descriptorType_0(nativeObj);
63 |
64 | return retVal;
65 | }
66 |
67 |
68 | //
69 | // C++: void compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor)
70 | //
71 |
72 | //javadoc: BOWImgDescriptorExtractor::compute2(image, keypoints, imgDescriptor)
73 | public void compute(Mat image, MatOfKeyPoint keypoints, Mat imgDescriptor)
74 | {
75 | Mat keypoints_mat = keypoints;
76 | compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, imgDescriptor.nativeObj);
77 |
78 | return;
79 | }
80 |
81 |
82 | //
83 | // C++: void setVocabulary(Mat vocabulary)
84 | //
85 |
86 | //javadoc: BOWImgDescriptorExtractor::setVocabulary(vocabulary)
87 | public void setVocabulary(Mat vocabulary)
88 | {
89 |
90 | setVocabulary_0(nativeObj, vocabulary.nativeObj);
91 |
92 | return;
93 | }
94 |
95 |
96 | @Override
97 | protected void finalize() throws Throwable {
98 | delete(nativeObj);
99 | }
100 |
101 |
102 |
103 | // C++: Mat getVocabulary()
104 | private static native long getVocabulary_0(long nativeObj);
105 |
106 | // C++: int descriptorSize()
107 | private static native int descriptorSize_0(long nativeObj);
108 |
109 | // C++: int descriptorType()
110 | private static native int descriptorType_0(long nativeObj);
111 |
112 | // C++: void compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor)
113 | private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long imgDescriptor_nativeObj);
114 |
115 | // C++: void setVocabulary(Mat vocabulary)
116 | private static native void setVocabulary_0(long nativeObj, long vocabulary_nativeObj);
117 |
118 | // native support for java finalize()
119 | private static native void delete(long nativeObj);
120 |
121 | }
122 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/features2d/BOWKMeansTrainer.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.features2d;
6 |
7 | import org.opencv.core.Mat;
8 | import org.opencv.core.TermCriteria;
9 |
10 | // C++: class BOWKMeansTrainer
11 | //javadoc: BOWKMeansTrainer
12 | public class BOWKMeansTrainer extends BOWTrainer {
13 |
14 | protected BOWKMeansTrainer(long addr) { super(addr); }
15 |
16 |
17 | //
18 | // C++: BOWKMeansTrainer(int clusterCount, TermCriteria termcrit = TermCriteria(), int attempts = 3, int flags = KMEANS_PP_CENTERS)
19 | //
20 |
21 | //javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount, termcrit, attempts, flags)
22 | public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit, int attempts, int flags)
23 | {
24 |
25 | super( BOWKMeansTrainer_0(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon, attempts, flags) );
26 |
27 | return;
28 | }
29 |
30 | //javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount)
31 | public BOWKMeansTrainer(int clusterCount)
32 | {
33 |
34 | super( BOWKMeansTrainer_1(clusterCount) );
35 |
36 | return;
37 | }
38 |
39 |
40 | //
41 | // C++: Mat cluster(Mat descriptors)
42 | //
43 |
44 | //javadoc: BOWKMeansTrainer::cluster(descriptors)
45 | public Mat cluster(Mat descriptors)
46 | {
47 |
48 | Mat retVal = new Mat(cluster_0(nativeObj, descriptors.nativeObj));
49 |
50 | return retVal;
51 | }
52 |
53 |
54 | //
55 | // C++: Mat cluster()
56 | //
57 |
58 | //javadoc: BOWKMeansTrainer::cluster()
59 | public Mat cluster()
60 | {
61 |
62 | Mat retVal = new Mat(cluster_1(nativeObj));
63 |
64 | return retVal;
65 | }
66 |
67 |
68 | @Override
69 | protected void finalize() throws Throwable {
70 | delete(nativeObj);
71 | }
72 |
73 |
74 |
75 | // C++: BOWKMeansTrainer(int clusterCount, TermCriteria termcrit = TermCriteria(), int attempts = 3, int flags = KMEANS_PP_CENTERS)
76 | private static native long BOWKMeansTrainer_0(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon, int attempts, int flags);
77 | private static native long BOWKMeansTrainer_1(int clusterCount);
78 |
79 | // C++: Mat cluster(Mat descriptors)
80 | private static native long cluster_0(long nativeObj, long descriptors_nativeObj);
81 |
82 | // C++: Mat cluster()
83 | private static native long cluster_1(long nativeObj);
84 |
85 | // native support for java finalize()
86 | private static native void delete(long nativeObj);
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/features2d/BOWTrainer.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.features2d;
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 BOWTrainer
13 | //javadoc: BOWTrainer
14 | public class BOWTrainer {
15 |
16 | protected final long nativeObj;
17 | protected BOWTrainer(long addr) { nativeObj = addr; }
18 |
19 |
20 | //
21 | // C++: Mat cluster(Mat descriptors)
22 | //
23 |
24 | //javadoc: BOWTrainer::cluster(descriptors)
25 | public Mat cluster(Mat descriptors)
26 | {
27 |
28 | Mat retVal = new Mat(cluster_0(nativeObj, descriptors.nativeObj));
29 |
30 | return retVal;
31 | }
32 |
33 |
34 | //
35 | // C++: Mat cluster()
36 | //
37 |
38 | //javadoc: BOWTrainer::cluster()
39 | public Mat cluster()
40 | {
41 |
42 | Mat retVal = new Mat(cluster_1(nativeObj));
43 |
44 | return retVal;
45 | }
46 |
47 |
48 | //
49 | // C++: int descriptorsCount()
50 | //
51 |
52 | //javadoc: BOWTrainer::descriptorsCount()
53 | public int descriptorsCount()
54 | {
55 |
56 | int retVal = descriptorsCount_0(nativeObj);
57 |
58 | return retVal;
59 | }
60 |
61 |
62 | //
63 | // C++: vector_Mat getDescriptors()
64 | //
65 |
66 | //javadoc: BOWTrainer::getDescriptors()
67 | public List getDescriptors()
68 | {
69 | List retVal = new ArrayList();
70 | Mat retValMat = new Mat(getDescriptors_0(nativeObj));
71 | Converters.Mat_to_vector_Mat(retValMat, retVal);
72 | return retVal;
73 | }
74 |
75 |
76 | //
77 | // C++: void add(Mat descriptors)
78 | //
79 |
80 | //javadoc: BOWTrainer::add(descriptors)
81 | public void add(Mat descriptors)
82 | {
83 |
84 | add_0(nativeObj, descriptors.nativeObj);
85 |
86 | return;
87 | }
88 |
89 |
90 | //
91 | // C++: void clear()
92 | //
93 |
94 | //javadoc: BOWTrainer::clear()
95 | public void clear()
96 | {
97 |
98 | clear_0(nativeObj);
99 |
100 | return;
101 | }
102 |
103 |
104 | @Override
105 | protected void finalize() throws Throwable {
106 | delete(nativeObj);
107 | }
108 |
109 |
110 |
111 | // C++: Mat cluster(Mat descriptors)
112 | private static native long cluster_0(long nativeObj, long descriptors_nativeObj);
113 |
114 | // C++: Mat cluster()
115 | private static native long cluster_1(long nativeObj);
116 |
117 | // C++: int descriptorsCount()
118 | private static native int descriptorsCount_0(long nativeObj);
119 |
120 | // C++: vector_Mat getDescriptors()
121 | private static native long getDescriptors_0(long nativeObj);
122 |
123 | // C++: void add(Mat descriptors)
124 | private static native void add_0(long nativeObj, long descriptors_nativeObj);
125 |
126 | // C++: void clear()
127 | private static native void clear_0(long nativeObj);
128 |
129 | // native support for java finalize()
130 | private static native void delete(long nativeObj);
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/features2d/BRISK.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.features2d;
6 |
7 | import java.util.ArrayList;
8 | import org.opencv.core.Mat;
9 | import org.opencv.core.MatOfFloat;
10 | import org.opencv.core.MatOfInt;
11 | import org.opencv.features2d.Feature2D;
12 |
13 | // C++: class BRISK
14 | //javadoc: BRISK
15 | public class BRISK extends Feature2D {
16 |
17 | protected BRISK(long addr) { super(addr); }
18 |
19 |
20 | //
21 | // C++: static Ptr_BRISK create(int thresh = 30, int octaves = 3, float patternScale = 1.0f)
22 | //
23 |
24 | //javadoc: BRISK::create(thresh, octaves, patternScale)
25 | public static BRISK create(int thresh, int octaves, float patternScale)
26 | {
27 |
28 | BRISK retVal = new BRISK(create_0(thresh, octaves, patternScale));
29 |
30 | return retVal;
31 | }
32 |
33 | //javadoc: BRISK::create()
34 | public static BRISK create()
35 | {
36 |
37 | BRISK retVal = new BRISK(create_1());
38 |
39 | return retVal;
40 | }
41 |
42 |
43 | //
44 | // C++: static Ptr_BRISK create(vector_float radiusList, vector_int numberList, float dMax = 5.85f, float dMin = 8.2f, vector_int indexChange = std::vector())
45 | //
46 |
47 | //javadoc: BRISK::create(radiusList, numberList, dMax, dMin, indexChange)
48 | public static BRISK create(MatOfFloat radiusList, MatOfInt numberList, float dMax, float dMin, MatOfInt indexChange)
49 | {
50 | Mat radiusList_mat = radiusList;
51 | Mat numberList_mat = numberList;
52 | Mat indexChange_mat = indexChange;
53 | BRISK retVal = new BRISK(create_2(radiusList_mat.nativeObj, numberList_mat.nativeObj, dMax, dMin, indexChange_mat.nativeObj));
54 |
55 | return retVal;
56 | }
57 |
58 | //javadoc: BRISK::create(radiusList, numberList)
59 | public static BRISK create(MatOfFloat radiusList, MatOfInt numberList)
60 | {
61 | Mat radiusList_mat = radiusList;
62 | Mat numberList_mat = numberList;
63 | BRISK retVal = new BRISK(create_3(radiusList_mat.nativeObj, numberList_mat.nativeObj));
64 |
65 | return retVal;
66 | }
67 |
68 |
69 | @Override
70 | protected void finalize() throws Throwable {
71 | delete(nativeObj);
72 | }
73 |
74 |
75 |
76 | // C++: static Ptr_BRISK create(int thresh = 30, int octaves = 3, float patternScale = 1.0f)
77 | private static native long create_0(int thresh, int octaves, float patternScale);
78 | private static native long create_1();
79 |
80 | // C++: static Ptr_BRISK create(vector_float radiusList, vector_int numberList, float dMax = 5.85f, float dMin = 8.2f, vector_int indexChange = std::vector())
81 | private static native long create_2(long radiusList_mat_nativeObj, long numberList_mat_nativeObj, float dMax, float dMin, long indexChange_mat_nativeObj);
82 | private static native long create_3(long radiusList_mat_nativeObj, long numberList_mat_nativeObj);
83 |
84 | // native support for java finalize()
85 | private static native void delete(long nativeObj);
86 |
87 | }
88 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/features2d/DescriptorExtractor.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.features2d;
6 |
7 | import java.lang.String;
8 | import java.util.ArrayList;
9 | import java.util.List;
10 | import org.opencv.core.Mat;
11 | import org.opencv.core.MatOfKeyPoint;
12 | import org.opencv.utils.Converters;
13 |
14 | // C++: class javaDescriptorExtractor
15 | //javadoc: javaDescriptorExtractor
16 | public class DescriptorExtractor {
17 |
18 | protected final long nativeObj;
19 | protected DescriptorExtractor(long addr) { nativeObj = addr; }
20 |
21 |
22 | private static final int
23 | OPPONENTEXTRACTOR = 1000;
24 |
25 |
26 | public static final int
27 | SIFT = 1,
28 | SURF = 2,
29 | ORB = 3,
30 | BRIEF = 4,
31 | BRISK = 5,
32 | FREAK = 6,
33 | AKAZE = 7,
34 | OPPONENT_SIFT = OPPONENTEXTRACTOR + SIFT,
35 | OPPONENT_SURF = OPPONENTEXTRACTOR + SURF,
36 | OPPONENT_ORB = OPPONENTEXTRACTOR + ORB,
37 | OPPONENT_BRIEF = OPPONENTEXTRACTOR + BRIEF,
38 | OPPONENT_BRISK = OPPONENTEXTRACTOR + BRISK,
39 | OPPONENT_FREAK = OPPONENTEXTRACTOR + FREAK,
40 | OPPONENT_AKAZE = OPPONENTEXTRACTOR + AKAZE;
41 |
42 |
43 | //
44 | // C++: static Ptr_javaDescriptorExtractor create(int extractorType)
45 | //
46 |
47 | //javadoc: javaDescriptorExtractor::create(extractorType)
48 | public static DescriptorExtractor create(int extractorType)
49 | {
50 |
51 | DescriptorExtractor retVal = new DescriptorExtractor(create_0(extractorType));
52 |
53 | return retVal;
54 | }
55 |
56 |
57 | //
58 | // C++: bool empty()
59 | //
60 |
61 | //javadoc: javaDescriptorExtractor::empty()
62 | public boolean empty()
63 | {
64 |
65 | boolean retVal = empty_0(nativeObj);
66 |
67 | return retVal;
68 | }
69 |
70 |
71 | //
72 | // C++: int descriptorSize()
73 | //
74 |
75 | //javadoc: javaDescriptorExtractor::descriptorSize()
76 | public int descriptorSize()
77 | {
78 |
79 | int retVal = descriptorSize_0(nativeObj);
80 |
81 | return retVal;
82 | }
83 |
84 |
85 | //
86 | // C++: int descriptorType()
87 | //
88 |
89 | //javadoc: javaDescriptorExtractor::descriptorType()
90 | public int descriptorType()
91 | {
92 |
93 | int retVal = descriptorType_0(nativeObj);
94 |
95 | return retVal;
96 | }
97 |
98 |
99 | //
100 | // C++: void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors)
101 | //
102 |
103 | //javadoc: javaDescriptorExtractor::compute(image, keypoints, descriptors)
104 | public void compute(Mat image, MatOfKeyPoint keypoints, Mat descriptors)
105 | {
106 | Mat keypoints_mat = keypoints;
107 | compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
108 |
109 | return;
110 | }
111 |
112 |
113 | //
114 | // C++: void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
115 | //
116 |
117 | //javadoc: javaDescriptorExtractor::compute(images, keypoints, descriptors)
118 | public void compute(List images, List keypoints, List descriptors)
119 | {
120 | Mat images_mat = Converters.vector_Mat_to_Mat(images);
121 | List keypoints_tmplm = new ArrayList((keypoints != null) ? keypoints.size() : 0);
122 | Mat keypoints_mat = Converters.vector_vector_KeyPoint_to_Mat(keypoints, keypoints_tmplm);
123 | Mat descriptors_mat = new Mat();
124 | compute_1(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, descriptors_mat.nativeObj);
125 | Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
126 | keypoints_mat.release();
127 | Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
128 | descriptors_mat.release();
129 | return;
130 | }
131 |
132 |
133 | //
134 | // C++: void read(String fileName)
135 | //
136 |
137 | //javadoc: javaDescriptorExtractor::read(fileName)
138 | public void read(String fileName)
139 | {
140 |
141 | read_0(nativeObj, fileName);
142 |
143 | return;
144 | }
145 |
146 |
147 | //
148 | // C++: void write(String fileName)
149 | //
150 |
151 | //javadoc: javaDescriptorExtractor::write(fileName)
152 | public void write(String fileName)
153 | {
154 |
155 | write_0(nativeObj, fileName);
156 |
157 | return;
158 | }
159 |
160 |
161 | @Override
162 | protected void finalize() throws Throwable {
163 | delete(nativeObj);
164 | }
165 |
166 |
167 |
168 | // C++: static Ptr_javaDescriptorExtractor create(int extractorType)
169 | private static native long create_0(int extractorType);
170 |
171 | // C++: bool empty()
172 | private static native boolean empty_0(long nativeObj);
173 |
174 | // C++: int descriptorSize()
175 | private static native int descriptorSize_0(long nativeObj);
176 |
177 | // C++: int descriptorType()
178 | private static native int descriptorType_0(long nativeObj);
179 |
180 | // C++: void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors)
181 | private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj);
182 |
183 | // C++: void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
184 | private static native void compute_1(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long descriptors_mat_nativeObj);
185 |
186 | // C++: void read(String fileName)
187 | private static native void read_0(long nativeObj, String fileName);
188 |
189 | // C++: void write(String fileName)
190 | private static native void write_0(long nativeObj, String fileName);
191 |
192 | // native support for java finalize()
193 | private static native void delete(long nativeObj);
194 |
195 | }
196 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/features2d/FastFeatureDetector.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.features2d;
6 |
7 | import org.opencv.features2d.Feature2D;
8 |
9 | // C++: class FastFeatureDetector
10 | //javadoc: FastFeatureDetector
11 | public class FastFeatureDetector extends Feature2D {
12 |
13 | protected FastFeatureDetector(long addr) { super(addr); }
14 |
15 |
16 | public static final int
17 | TYPE_5_8 = 0,
18 | TYPE_7_12 = 1,
19 | TYPE_9_16 = 2,
20 | THRESHOLD = 10000,
21 | NONMAX_SUPPRESSION = 10001,
22 | FAST_N = 10002;
23 |
24 |
25 | //
26 | // C++: static Ptr_FastFeatureDetector create(int threshold = 10, bool nonmaxSuppression = true, int type = FastFeatureDetector::TYPE_9_16)
27 | //
28 |
29 | //javadoc: FastFeatureDetector::create(threshold, nonmaxSuppression, type)
30 | public static FastFeatureDetector create(int threshold, boolean nonmaxSuppression, int type)
31 | {
32 |
33 | FastFeatureDetector retVal = new FastFeatureDetector(create_0(threshold, nonmaxSuppression, type));
34 |
35 | return retVal;
36 | }
37 |
38 | //javadoc: FastFeatureDetector::create()
39 | public static FastFeatureDetector create()
40 | {
41 |
42 | FastFeatureDetector retVal = new FastFeatureDetector(create_1());
43 |
44 | return retVal;
45 | }
46 |
47 |
48 | //
49 | // C++: bool getNonmaxSuppression()
50 | //
51 |
52 | //javadoc: FastFeatureDetector::getNonmaxSuppression()
53 | public boolean getNonmaxSuppression()
54 | {
55 |
56 | boolean retVal = getNonmaxSuppression_0(nativeObj);
57 |
58 | return retVal;
59 | }
60 |
61 |
62 | //
63 | // C++: int getThreshold()
64 | //
65 |
66 | //javadoc: FastFeatureDetector::getThreshold()
67 | public int getThreshold()
68 | {
69 |
70 | int retVal = getThreshold_0(nativeObj);
71 |
72 | return retVal;
73 | }
74 |
75 |
76 | //
77 | // C++: int getType()
78 | //
79 |
80 | //javadoc: FastFeatureDetector::getType()
81 | public int getType()
82 | {
83 |
84 | int retVal = getType_0(nativeObj);
85 |
86 | return retVal;
87 | }
88 |
89 |
90 | //
91 | // C++: void setNonmaxSuppression(bool f)
92 | //
93 |
94 | //javadoc: FastFeatureDetector::setNonmaxSuppression(f)
95 | public void setNonmaxSuppression(boolean f)
96 | {
97 |
98 | setNonmaxSuppression_0(nativeObj, f);
99 |
100 | return;
101 | }
102 |
103 |
104 | //
105 | // C++: void setThreshold(int threshold)
106 | //
107 |
108 | //javadoc: FastFeatureDetector::setThreshold(threshold)
109 | public void setThreshold(int threshold)
110 | {
111 |
112 | setThreshold_0(nativeObj, threshold);
113 |
114 | return;
115 | }
116 |
117 |
118 | //
119 | // C++: void setType(int type)
120 | //
121 |
122 | //javadoc: FastFeatureDetector::setType(type)
123 | public void setType(int type)
124 | {
125 |
126 | setType_0(nativeObj, type);
127 |
128 | return;
129 | }
130 |
131 |
132 | @Override
133 | protected void finalize() throws Throwable {
134 | delete(nativeObj);
135 | }
136 |
137 |
138 |
139 | // C++: static Ptr_FastFeatureDetector create(int threshold = 10, bool nonmaxSuppression = true, int type = FastFeatureDetector::TYPE_9_16)
140 | private static native long create_0(int threshold, boolean nonmaxSuppression, int type);
141 | private static native long create_1();
142 |
143 | // C++: bool getNonmaxSuppression()
144 | private static native boolean getNonmaxSuppression_0(long nativeObj);
145 |
146 | // C++: int getThreshold()
147 | private static native int getThreshold_0(long nativeObj);
148 |
149 | // C++: int getType()
150 | private static native int getType_0(long nativeObj);
151 |
152 | // C++: void setNonmaxSuppression(bool f)
153 | private static native void setNonmaxSuppression_0(long nativeObj, boolean f);
154 |
155 | // C++: void setThreshold(int threshold)
156 | private static native void setThreshold_0(long nativeObj, int threshold);
157 |
158 | // C++: void setType(int type)
159 | private static native void setType_0(long nativeObj, int type);
160 |
161 | // native support for java finalize()
162 | private static native void delete(long nativeObj);
163 |
164 | }
165 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/imgproc/CLAHE.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.imgproc;
6 |
7 | import org.opencv.core.Algorithm;
8 | import org.opencv.core.Mat;
9 | import org.opencv.core.Size;
10 |
11 | // C++: class CLAHE
12 | //javadoc: CLAHE
13 | public class CLAHE extends Algorithm {
14 |
15 | protected CLAHE(long addr) { super(addr); }
16 |
17 |
18 | //
19 | // C++: Size getTilesGridSize()
20 | //
21 |
22 | //javadoc: CLAHE::getTilesGridSize()
23 | public Size getTilesGridSize()
24 | {
25 |
26 | Size retVal = new Size(getTilesGridSize_0(nativeObj));
27 |
28 | return retVal;
29 | }
30 |
31 |
32 | //
33 | // C++: double getClipLimit()
34 | //
35 |
36 | //javadoc: CLAHE::getClipLimit()
37 | public double getClipLimit()
38 | {
39 |
40 | double retVal = getClipLimit_0(nativeObj);
41 |
42 | return retVal;
43 | }
44 |
45 |
46 | //
47 | // C++: void apply(Mat src, Mat& dst)
48 | //
49 |
50 | //javadoc: CLAHE::apply(src, dst)
51 | public void apply(Mat src, Mat dst)
52 | {
53 |
54 | apply_0(nativeObj, src.nativeObj, dst.nativeObj);
55 |
56 | return;
57 | }
58 |
59 |
60 | //
61 | // C++: void collectGarbage()
62 | //
63 |
64 | //javadoc: CLAHE::collectGarbage()
65 | public void collectGarbage()
66 | {
67 |
68 | collectGarbage_0(nativeObj);
69 |
70 | return;
71 | }
72 |
73 |
74 | //
75 | // C++: void setClipLimit(double clipLimit)
76 | //
77 |
78 | //javadoc: CLAHE::setClipLimit(clipLimit)
79 | public void setClipLimit(double clipLimit)
80 | {
81 |
82 | setClipLimit_0(nativeObj, clipLimit);
83 |
84 | return;
85 | }
86 |
87 |
88 | //
89 | // C++: void setTilesGridSize(Size tileGridSize)
90 | //
91 |
92 | //javadoc: CLAHE::setTilesGridSize(tileGridSize)
93 | public void setTilesGridSize(Size tileGridSize)
94 | {
95 |
96 | setTilesGridSize_0(nativeObj, tileGridSize.width, tileGridSize.height);
97 |
98 | return;
99 | }
100 |
101 |
102 | @Override
103 | protected void finalize() throws Throwable {
104 | delete(nativeObj);
105 | }
106 |
107 |
108 |
109 | // C++: Size getTilesGridSize()
110 | private static native double[] getTilesGridSize_0(long nativeObj);
111 |
112 | // C++: double getClipLimit()
113 | private static native double getClipLimit_0(long nativeObj);
114 |
115 | // C++: void apply(Mat src, Mat& dst)
116 | private static native void apply_0(long nativeObj, long src_nativeObj, long dst_nativeObj);
117 |
118 | // C++: void collectGarbage()
119 | private static native void collectGarbage_0(long nativeObj);
120 |
121 | // C++: void setClipLimit(double clipLimit)
122 | private static native void setClipLimit_0(long nativeObj, double clipLimit);
123 |
124 | // C++: void setTilesGridSize(Size tileGridSize)
125 | private static native void setTilesGridSize_0(long nativeObj, double tileGridSize_width, double tileGridSize_height);
126 |
127 | // native support for java finalize()
128 | private static native void delete(long nativeObj);
129 |
130 | }
131 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/imgproc/LineSegmentDetector.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.imgproc;
6 |
7 | import org.opencv.core.Algorithm;
8 | import org.opencv.core.Mat;
9 | import org.opencv.core.Size;
10 |
11 | // C++: class LineSegmentDetector
12 | //javadoc: LineSegmentDetector
13 | public class LineSegmentDetector extends Algorithm {
14 |
15 | protected LineSegmentDetector(long addr) { super(addr); }
16 |
17 |
18 | //
19 | // C++: int compareSegments(Size size, Mat lines1, Mat lines2, Mat& _image = Mat())
20 | //
21 |
22 | //javadoc: LineSegmentDetector::compareSegments(size, lines1, lines2, _image)
23 | public int compareSegments(Size size, Mat lines1, Mat lines2, Mat _image)
24 | {
25 |
26 | int retVal = compareSegments_0(nativeObj, size.width, size.height, lines1.nativeObj, lines2.nativeObj, _image.nativeObj);
27 |
28 | return retVal;
29 | }
30 |
31 | //javadoc: LineSegmentDetector::compareSegments(size, lines1, lines2)
32 | public int compareSegments(Size size, Mat lines1, Mat lines2)
33 | {
34 |
35 | int retVal = compareSegments_1(nativeObj, size.width, size.height, lines1.nativeObj, lines2.nativeObj);
36 |
37 | return retVal;
38 | }
39 |
40 |
41 | //
42 | // C++: void detect(Mat _image, Mat& _lines, Mat& width = Mat(), Mat& prec = Mat(), Mat& nfa = Mat())
43 | //
44 |
45 | //javadoc: LineSegmentDetector::detect(_image, _lines, width, prec, nfa)
46 | public void detect(Mat _image, Mat _lines, Mat width, Mat prec, Mat nfa)
47 | {
48 |
49 | detect_0(nativeObj, _image.nativeObj, _lines.nativeObj, width.nativeObj, prec.nativeObj, nfa.nativeObj);
50 |
51 | return;
52 | }
53 |
54 | //javadoc: LineSegmentDetector::detect(_image, _lines)
55 | public void detect(Mat _image, Mat _lines)
56 | {
57 |
58 | detect_1(nativeObj, _image.nativeObj, _lines.nativeObj);
59 |
60 | return;
61 | }
62 |
63 |
64 | //
65 | // C++: void drawSegments(Mat& _image, Mat lines)
66 | //
67 |
68 | //javadoc: LineSegmentDetector::drawSegments(_image, lines)
69 | public void drawSegments(Mat _image, Mat lines)
70 | {
71 |
72 | drawSegments_0(nativeObj, _image.nativeObj, lines.nativeObj);
73 |
74 | return;
75 | }
76 |
77 |
78 | @Override
79 | protected void finalize() throws Throwable {
80 | delete(nativeObj);
81 | }
82 |
83 |
84 |
85 | // C++: int compareSegments(Size size, Mat lines1, Mat lines2, Mat& _image = Mat())
86 | private static native int compareSegments_0(long nativeObj, double size_width, double size_height, long lines1_nativeObj, long lines2_nativeObj, long _image_nativeObj);
87 | private static native int compareSegments_1(long nativeObj, double size_width, double size_height, long lines1_nativeObj, long lines2_nativeObj);
88 |
89 | // C++: void detect(Mat _image, Mat& _lines, Mat& width = Mat(), Mat& prec = Mat(), Mat& nfa = Mat())
90 | private static native void detect_0(long nativeObj, long _image_nativeObj, long _lines_nativeObj, long width_nativeObj, long prec_nativeObj, long nfa_nativeObj);
91 | private static native void detect_1(long nativeObj, long _image_nativeObj, long _lines_nativeObj);
92 |
93 | // C++: void drawSegments(Mat& _image, Mat lines)
94 | private static native void drawSegments_0(long nativeObj, long _image_nativeObj, long lines_nativeObj);
95 |
96 | // native support for java finalize()
97 | private static native void delete(long nativeObj);
98 |
99 | }
100 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/ml/Boost.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.ml;
6 |
7 |
8 |
9 | // C++: class Boost
10 | //javadoc: Boost
11 | public class Boost extends DTrees {
12 |
13 | protected Boost(long addr) { super(addr); }
14 |
15 |
16 | public static final int
17 | DISCRETE = 0,
18 | REAL = 1,
19 | LOGIT = 2,
20 | GENTLE = 3;
21 |
22 |
23 | //
24 | // C++: static Ptr_Boost create()
25 | //
26 |
27 | //javadoc: Boost::create()
28 | public static Boost create()
29 | {
30 |
31 | Boost retVal = new Boost(create_0());
32 |
33 | return retVal;
34 | }
35 |
36 |
37 | //
38 | // C++: double getWeightTrimRate()
39 | //
40 |
41 | //javadoc: Boost::getWeightTrimRate()
42 | public double getWeightTrimRate()
43 | {
44 |
45 | double retVal = getWeightTrimRate_0(nativeObj);
46 |
47 | return retVal;
48 | }
49 |
50 |
51 | //
52 | // C++: int getBoostType()
53 | //
54 |
55 | //javadoc: Boost::getBoostType()
56 | public int getBoostType()
57 | {
58 |
59 | int retVal = getBoostType_0(nativeObj);
60 |
61 | return retVal;
62 | }
63 |
64 |
65 | //
66 | // C++: int getWeakCount()
67 | //
68 |
69 | //javadoc: Boost::getWeakCount()
70 | public int getWeakCount()
71 | {
72 |
73 | int retVal = getWeakCount_0(nativeObj);
74 |
75 | return retVal;
76 | }
77 |
78 |
79 | //
80 | // C++: void setBoostType(int val)
81 | //
82 |
83 | //javadoc: Boost::setBoostType(val)
84 | public void setBoostType(int val)
85 | {
86 |
87 | setBoostType_0(nativeObj, val);
88 |
89 | return;
90 | }
91 |
92 |
93 | //
94 | // C++: void setWeakCount(int val)
95 | //
96 |
97 | //javadoc: Boost::setWeakCount(val)
98 | public void setWeakCount(int val)
99 | {
100 |
101 | setWeakCount_0(nativeObj, val);
102 |
103 | return;
104 | }
105 |
106 |
107 | //
108 | // C++: void setWeightTrimRate(double val)
109 | //
110 |
111 | //javadoc: Boost::setWeightTrimRate(val)
112 | public void setWeightTrimRate(double val)
113 | {
114 |
115 | setWeightTrimRate_0(nativeObj, val);
116 |
117 | return;
118 | }
119 |
120 |
121 | @Override
122 | protected void finalize() throws Throwable {
123 | delete(nativeObj);
124 | }
125 |
126 |
127 |
128 | // C++: static Ptr_Boost create()
129 | private static native long create_0();
130 |
131 | // C++: double getWeightTrimRate()
132 | private static native double getWeightTrimRate_0(long nativeObj);
133 |
134 | // C++: int getBoostType()
135 | private static native int getBoostType_0(long nativeObj);
136 |
137 | // C++: int getWeakCount()
138 | private static native int getWeakCount_0(long nativeObj);
139 |
140 | // C++: void setBoostType(int val)
141 | private static native void setBoostType_0(long nativeObj, int val);
142 |
143 | // C++: void setWeakCount(int val)
144 | private static native void setWeakCount_0(long nativeObj, int val);
145 |
146 | // C++: void setWeightTrimRate(double val)
147 | private static native void setWeightTrimRate_0(long nativeObj, double val);
148 |
149 | // native support for java finalize()
150 | private static native void delete(long nativeObj);
151 |
152 | }
153 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/ml/KNearest.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 KNearest
10 | //javadoc: KNearest
11 | public class KNearest extends StatModel {
12 |
13 | protected KNearest(long addr) { super(addr); }
14 |
15 |
16 | public static final int
17 | BRUTE_FORCE = 1,
18 | KDTREE = 2;
19 |
20 |
21 | //
22 | // C++: static Ptr_KNearest create()
23 | //
24 |
25 | //javadoc: KNearest::create()
26 | public static KNearest create()
27 | {
28 |
29 | KNearest retVal = new KNearest(create_0());
30 |
31 | return retVal;
32 | }
33 |
34 |
35 | //
36 | // C++: bool getIsClassifier()
37 | //
38 |
39 | //javadoc: KNearest::getIsClassifier()
40 | public boolean getIsClassifier()
41 | {
42 |
43 | boolean retVal = getIsClassifier_0(nativeObj);
44 |
45 | return retVal;
46 | }
47 |
48 |
49 | //
50 | // C++: float findNearest(Mat samples, int k, Mat& results, Mat& neighborResponses = Mat(), Mat& dist = Mat())
51 | //
52 |
53 | //javadoc: KNearest::findNearest(samples, k, results, neighborResponses, dist)
54 | public float findNearest(Mat samples, int k, Mat results, Mat neighborResponses, Mat dist)
55 | {
56 |
57 | float retVal = findNearest_0(nativeObj, samples.nativeObj, k, results.nativeObj, neighborResponses.nativeObj, dist.nativeObj);
58 |
59 | return retVal;
60 | }
61 |
62 | //javadoc: KNearest::findNearest(samples, k, results)
63 | public float findNearest(Mat samples, int k, Mat results)
64 | {
65 |
66 | float retVal = findNearest_1(nativeObj, samples.nativeObj, k, results.nativeObj);
67 |
68 | return retVal;
69 | }
70 |
71 |
72 | //
73 | // C++: int getAlgorithmType()
74 | //
75 |
76 | //javadoc: KNearest::getAlgorithmType()
77 | public int getAlgorithmType()
78 | {
79 |
80 | int retVal = getAlgorithmType_0(nativeObj);
81 |
82 | return retVal;
83 | }
84 |
85 |
86 | //
87 | // C++: int getDefaultK()
88 | //
89 |
90 | //javadoc: KNearest::getDefaultK()
91 | public int getDefaultK()
92 | {
93 |
94 | int retVal = getDefaultK_0(nativeObj);
95 |
96 | return retVal;
97 | }
98 |
99 |
100 | //
101 | // C++: int getEmax()
102 | //
103 |
104 | //javadoc: KNearest::getEmax()
105 | public int getEmax()
106 | {
107 |
108 | int retVal = getEmax_0(nativeObj);
109 |
110 | return retVal;
111 | }
112 |
113 |
114 | //
115 | // C++: void setAlgorithmType(int val)
116 | //
117 |
118 | //javadoc: KNearest::setAlgorithmType(val)
119 | public void setAlgorithmType(int val)
120 | {
121 |
122 | setAlgorithmType_0(nativeObj, val);
123 |
124 | return;
125 | }
126 |
127 |
128 | //
129 | // C++: void setDefaultK(int val)
130 | //
131 |
132 | //javadoc: KNearest::setDefaultK(val)
133 | public void setDefaultK(int val)
134 | {
135 |
136 | setDefaultK_0(nativeObj, val);
137 |
138 | return;
139 | }
140 |
141 |
142 | //
143 | // C++: void setEmax(int val)
144 | //
145 |
146 | //javadoc: KNearest::setEmax(val)
147 | public void setEmax(int val)
148 | {
149 |
150 | setEmax_0(nativeObj, val);
151 |
152 | return;
153 | }
154 |
155 |
156 | //
157 | // C++: void setIsClassifier(bool val)
158 | //
159 |
160 | //javadoc: KNearest::setIsClassifier(val)
161 | public void setIsClassifier(boolean val)
162 | {
163 |
164 | setIsClassifier_0(nativeObj, val);
165 |
166 | return;
167 | }
168 |
169 |
170 | @Override
171 | protected void finalize() throws Throwable {
172 | delete(nativeObj);
173 | }
174 |
175 |
176 |
177 | // C++: static Ptr_KNearest create()
178 | private static native long create_0();
179 |
180 | // C++: bool getIsClassifier()
181 | private static native boolean getIsClassifier_0(long nativeObj);
182 |
183 | // C++: float findNearest(Mat samples, int k, Mat& results, Mat& neighborResponses = Mat(), Mat& dist = Mat())
184 | private static native float findNearest_0(long nativeObj, long samples_nativeObj, int k, long results_nativeObj, long neighborResponses_nativeObj, long dist_nativeObj);
185 | private static native float findNearest_1(long nativeObj, long samples_nativeObj, int k, long results_nativeObj);
186 |
187 | // C++: int getAlgorithmType()
188 | private static native int getAlgorithmType_0(long nativeObj);
189 |
190 | // C++: int getDefaultK()
191 | private static native int getDefaultK_0(long nativeObj);
192 |
193 | // C++: int getEmax()
194 | private static native int getEmax_0(long nativeObj);
195 |
196 | // C++: void setAlgorithmType(int val)
197 | private static native void setAlgorithmType_0(long nativeObj, int val);
198 |
199 | // C++: void setDefaultK(int val)
200 | private static native void setDefaultK_0(long nativeObj, int val);
201 |
202 | // C++: void setEmax(int val)
203 | private static native void setEmax_0(long nativeObj, int val);
204 |
205 | // C++: void setIsClassifier(bool val)
206 | private static native void setIsClassifier_0(long nativeObj, boolean val);
207 |
208 | // native support for java finalize()
209 | private static native void delete(long nativeObj);
210 |
211 | }
212 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/ml/RTrees.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 | import org.opencv.core.TermCriteria;
9 |
10 | // C++: class RTrees
11 | //javadoc: RTrees
12 | public class RTrees extends DTrees {
13 |
14 | protected RTrees(long addr) { super(addr); }
15 |
16 |
17 | //
18 | // C++: Mat getVarImportance()
19 | //
20 |
21 | //javadoc: RTrees::getVarImportance()
22 | public Mat getVarImportance()
23 | {
24 |
25 | Mat retVal = new Mat(getVarImportance_0(nativeObj));
26 |
27 | return retVal;
28 | }
29 |
30 |
31 | //
32 | // C++: static Ptr_RTrees create()
33 | //
34 |
35 | //javadoc: RTrees::create()
36 | public static RTrees create()
37 | {
38 |
39 | RTrees retVal = new RTrees(create_0());
40 |
41 | return retVal;
42 | }
43 |
44 |
45 | //
46 | // C++: TermCriteria getTermCriteria()
47 | //
48 |
49 | //javadoc: RTrees::getTermCriteria()
50 | public TermCriteria getTermCriteria()
51 | {
52 |
53 | TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj));
54 |
55 | return retVal;
56 | }
57 |
58 |
59 | //
60 | // C++: bool getCalculateVarImportance()
61 | //
62 |
63 | //javadoc: RTrees::getCalculateVarImportance()
64 | public boolean getCalculateVarImportance()
65 | {
66 |
67 | boolean retVal = getCalculateVarImportance_0(nativeObj);
68 |
69 | return retVal;
70 | }
71 |
72 |
73 | //
74 | // C++: int getActiveVarCount()
75 | //
76 |
77 | //javadoc: RTrees::getActiveVarCount()
78 | public int getActiveVarCount()
79 | {
80 |
81 | int retVal = getActiveVarCount_0(nativeObj);
82 |
83 | return retVal;
84 | }
85 |
86 |
87 | //
88 | // C++: void setActiveVarCount(int val)
89 | //
90 |
91 | //javadoc: RTrees::setActiveVarCount(val)
92 | public void setActiveVarCount(int val)
93 | {
94 |
95 | setActiveVarCount_0(nativeObj, val);
96 |
97 | return;
98 | }
99 |
100 |
101 | //
102 | // C++: void setCalculateVarImportance(bool val)
103 | //
104 |
105 | //javadoc: RTrees::setCalculateVarImportance(val)
106 | public void setCalculateVarImportance(boolean val)
107 | {
108 |
109 | setCalculateVarImportance_0(nativeObj, val);
110 |
111 | return;
112 | }
113 |
114 |
115 | //
116 | // C++: void setTermCriteria(TermCriteria val)
117 | //
118 |
119 | //javadoc: RTrees::setTermCriteria(val)
120 | public void setTermCriteria(TermCriteria val)
121 | {
122 |
123 | setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon);
124 |
125 | return;
126 | }
127 |
128 |
129 | @Override
130 | protected void finalize() throws Throwable {
131 | delete(nativeObj);
132 | }
133 |
134 |
135 |
136 | // C++: Mat getVarImportance()
137 | private static native long getVarImportance_0(long nativeObj);
138 |
139 | // C++: static Ptr_RTrees create()
140 | private static native long create_0();
141 |
142 | // C++: TermCriteria getTermCriteria()
143 | private static native double[] getTermCriteria_0(long nativeObj);
144 |
145 | // C++: bool getCalculateVarImportance()
146 | private static native boolean getCalculateVarImportance_0(long nativeObj);
147 |
148 | // C++: int getActiveVarCount()
149 | private static native int getActiveVarCount_0(long nativeObj);
150 |
151 | // C++: void setActiveVarCount(int val)
152 | private static native void setActiveVarCount_0(long nativeObj, int val);
153 |
154 | // C++: void setCalculateVarImportance(bool val)
155 | private static native void setCalculateVarImportance_0(long nativeObj, boolean val);
156 |
157 | // C++: void setTermCriteria(TermCriteria val)
158 | private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon);
159 |
160 | // native support for java finalize()
161 | private static native void delete(long nativeObj);
162 |
163 | }
164 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/ml/StatModel.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.Algorithm;
8 | import org.opencv.core.Mat;
9 |
10 | // C++: class StatModel
11 | //javadoc: StatModel
12 | public class StatModel extends Algorithm {
13 |
14 | protected StatModel(long addr) { super(addr); }
15 |
16 |
17 | public static final int
18 | UPDATE_MODEL = 1,
19 | RAW_OUTPUT = 1,
20 | COMPRESSED_INPUT = 2,
21 | PREPROCESSED_INPUT = 4;
22 |
23 |
24 | //
25 | // C++: bool empty()
26 | //
27 |
28 | //javadoc: StatModel::empty()
29 | public boolean empty()
30 | {
31 |
32 | boolean retVal = empty_0(nativeObj);
33 |
34 | return retVal;
35 | }
36 |
37 |
38 | //
39 | // C++: bool isClassifier()
40 | //
41 |
42 | //javadoc: StatModel::isClassifier()
43 | public boolean isClassifier()
44 | {
45 |
46 | boolean retVal = isClassifier_0(nativeObj);
47 |
48 | return retVal;
49 | }
50 |
51 |
52 | //
53 | // C++: bool isTrained()
54 | //
55 |
56 | //javadoc: StatModel::isTrained()
57 | public boolean isTrained()
58 | {
59 |
60 | boolean retVal = isTrained_0(nativeObj);
61 |
62 | return retVal;
63 | }
64 |
65 |
66 | //
67 | // C++: bool train(Mat samples, int layout, Mat responses)
68 | //
69 |
70 | //javadoc: StatModel::train(samples, layout, responses)
71 | public boolean train(Mat samples, int layout, Mat responses)
72 | {
73 |
74 | boolean retVal = train_0(nativeObj, samples.nativeObj, layout, responses.nativeObj);
75 |
76 | return retVal;
77 | }
78 |
79 |
80 | //
81 | // C++: bool train(Ptr_TrainData trainData, int flags = 0)
82 | //
83 |
84 | //javadoc: StatModel::train(trainData, flags)
85 | public boolean train(TrainData trainData, int flags)
86 | {
87 |
88 | boolean retVal = train_1(nativeObj, trainData.nativeObj, flags);
89 |
90 | return retVal;
91 | }
92 |
93 | //javadoc: StatModel::train(trainData)
94 | public boolean train(TrainData trainData)
95 | {
96 |
97 | boolean retVal = train_2(nativeObj, trainData.nativeObj);
98 |
99 | return retVal;
100 | }
101 |
102 |
103 | //
104 | // C++: float calcError(Ptr_TrainData data, bool test, Mat& resp)
105 | //
106 |
107 | //javadoc: StatModel::calcError(data, test, resp)
108 | public float calcError(TrainData data, boolean test, Mat resp)
109 | {
110 |
111 | float retVal = calcError_0(nativeObj, data.nativeObj, test, resp.nativeObj);
112 |
113 | return retVal;
114 | }
115 |
116 |
117 | //
118 | // C++: float predict(Mat samples, Mat& results = Mat(), int flags = 0)
119 | //
120 |
121 | //javadoc: StatModel::predict(samples, results, flags)
122 | public float predict(Mat samples, Mat results, int flags)
123 | {
124 |
125 | float retVal = predict_0(nativeObj, samples.nativeObj, results.nativeObj, flags);
126 |
127 | return retVal;
128 | }
129 |
130 | //javadoc: StatModel::predict(samples)
131 | public float predict(Mat samples)
132 | {
133 |
134 | float retVal = predict_1(nativeObj, samples.nativeObj);
135 |
136 | return retVal;
137 | }
138 |
139 |
140 | //
141 | // C++: int getVarCount()
142 | //
143 |
144 | //javadoc: StatModel::getVarCount()
145 | public int getVarCount()
146 | {
147 |
148 | int retVal = getVarCount_0(nativeObj);
149 |
150 | return retVal;
151 | }
152 |
153 |
154 | @Override
155 | protected void finalize() throws Throwable {
156 | delete(nativeObj);
157 | }
158 |
159 |
160 |
161 | // C++: bool empty()
162 | private static native boolean empty_0(long nativeObj);
163 |
164 | // C++: bool isClassifier()
165 | private static native boolean isClassifier_0(long nativeObj);
166 |
167 | // C++: bool isTrained()
168 | private static native boolean isTrained_0(long nativeObj);
169 |
170 | // C++: bool train(Mat samples, int layout, Mat responses)
171 | private static native boolean train_0(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj);
172 |
173 | // C++: bool train(Ptr_TrainData trainData, int flags = 0)
174 | private static native boolean train_1(long nativeObj, long trainData_nativeObj, int flags);
175 | private static native boolean train_2(long nativeObj, long trainData_nativeObj);
176 |
177 | // C++: float calcError(Ptr_TrainData data, bool test, Mat& resp)
178 | private static native float calcError_0(long nativeObj, long data_nativeObj, boolean test, long resp_nativeObj);
179 |
180 | // C++: float predict(Mat samples, Mat& results = Mat(), int flags = 0)
181 | private static native float predict_0(long nativeObj, long samples_nativeObj, long results_nativeObj, int flags);
182 | private static native float predict_1(long nativeObj, long samples_nativeObj);
183 |
184 | // C++: int getVarCount()
185 | private static native int getVarCount_0(long nativeObj);
186 |
187 | // native support for java finalize()
188 | private static native void delete(long nativeObj);
189 |
190 | }
191 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/photo/AlignMTB.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.core.Point;
11 | import org.opencv.utils.Converters;
12 |
13 | // C++: class AlignMTB
14 | //javadoc: AlignMTB
15 | public class AlignMTB extends AlignExposures {
16 |
17 | protected AlignMTB(long addr) { super(addr); }
18 |
19 |
20 | //
21 | // C++: Point calculateShift(Mat img0, Mat img1)
22 | //
23 |
24 | //javadoc: AlignMTB::calculateShift(img0, img1)
25 | public Point calculateShift(Mat img0, Mat img1)
26 | {
27 |
28 | Point retVal = new Point(calculateShift_0(nativeObj, img0.nativeObj, img1.nativeObj));
29 |
30 | return retVal;
31 | }
32 |
33 |
34 | //
35 | // C++: bool getCut()
36 | //
37 |
38 | //javadoc: AlignMTB::getCut()
39 | public boolean getCut()
40 | {
41 |
42 | boolean retVal = getCut_0(nativeObj);
43 |
44 | return retVal;
45 | }
46 |
47 |
48 | //
49 | // C++: int getExcludeRange()
50 | //
51 |
52 | //javadoc: AlignMTB::getExcludeRange()
53 | public int getExcludeRange()
54 | {
55 |
56 | int retVal = getExcludeRange_0(nativeObj);
57 |
58 | return retVal;
59 | }
60 |
61 |
62 | //
63 | // C++: int getMaxBits()
64 | //
65 |
66 | //javadoc: AlignMTB::getMaxBits()
67 | public int getMaxBits()
68 | {
69 |
70 | int retVal = getMaxBits_0(nativeObj);
71 |
72 | return retVal;
73 | }
74 |
75 |
76 | //
77 | // C++: void computeBitmaps(Mat img, Mat& tb, Mat& eb)
78 | //
79 |
80 | //javadoc: AlignMTB::computeBitmaps(img, tb, eb)
81 | public void computeBitmaps(Mat img, Mat tb, Mat eb)
82 | {
83 |
84 | computeBitmaps_0(nativeObj, img.nativeObj, tb.nativeObj, eb.nativeObj);
85 |
86 | return;
87 | }
88 |
89 |
90 | //
91 | // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response)
92 | //
93 |
94 | //javadoc: AlignMTB::process(src, dst, times, response)
95 | public void process(List src, List dst, Mat times, Mat response)
96 | {
97 | Mat src_mat = Converters.vector_Mat_to_Mat(src);
98 | Mat dst_mat = Converters.vector_Mat_to_Mat(dst);
99 | process_0(nativeObj, src_mat.nativeObj, dst_mat.nativeObj, times.nativeObj, response.nativeObj);
100 |
101 | return;
102 | }
103 |
104 |
105 | //
106 | // C++: void process(vector_Mat src, vector_Mat dst)
107 | //
108 |
109 | //javadoc: AlignMTB::process(src, dst)
110 | public void process(List src, List dst)
111 | {
112 | Mat src_mat = Converters.vector_Mat_to_Mat(src);
113 | Mat dst_mat = Converters.vector_Mat_to_Mat(dst);
114 | process_1(nativeObj, src_mat.nativeObj, dst_mat.nativeObj);
115 |
116 | return;
117 | }
118 |
119 |
120 | //
121 | // C++: void setCut(bool value)
122 | //
123 |
124 | //javadoc: AlignMTB::setCut(value)
125 | public void setCut(boolean value)
126 | {
127 |
128 | setCut_0(nativeObj, value);
129 |
130 | return;
131 | }
132 |
133 |
134 | //
135 | // C++: void setExcludeRange(int exclude_range)
136 | //
137 |
138 | //javadoc: AlignMTB::setExcludeRange(exclude_range)
139 | public void setExcludeRange(int exclude_range)
140 | {
141 |
142 | setExcludeRange_0(nativeObj, exclude_range);
143 |
144 | return;
145 | }
146 |
147 |
148 | //
149 | // C++: void setMaxBits(int max_bits)
150 | //
151 |
152 | //javadoc: AlignMTB::setMaxBits(max_bits)
153 | public void setMaxBits(int max_bits)
154 | {
155 |
156 | setMaxBits_0(nativeObj, max_bits);
157 |
158 | return;
159 | }
160 |
161 |
162 | //
163 | // C++: void shiftMat(Mat src, Mat& dst, Point shift)
164 | //
165 |
166 | //javadoc: AlignMTB::shiftMat(src, dst, shift)
167 | public void shiftMat(Mat src, Mat dst, Point shift)
168 | {
169 |
170 | shiftMat_0(nativeObj, src.nativeObj, dst.nativeObj, shift.x, shift.y);
171 |
172 | return;
173 | }
174 |
175 |
176 | @Override
177 | protected void finalize() throws Throwable {
178 | delete(nativeObj);
179 | }
180 |
181 |
182 |
183 | // C++: Point calculateShift(Mat img0, Mat img1)
184 | private static native double[] calculateShift_0(long nativeObj, long img0_nativeObj, long img1_nativeObj);
185 |
186 | // C++: bool getCut()
187 | private static native boolean getCut_0(long nativeObj);
188 |
189 | // C++: int getExcludeRange()
190 | private static native int getExcludeRange_0(long nativeObj);
191 |
192 | // C++: int getMaxBits()
193 | private static native int getMaxBits_0(long nativeObj);
194 |
195 | // C++: void computeBitmaps(Mat img, Mat& tb, Mat& eb)
196 | private static native void computeBitmaps_0(long nativeObj, long img_nativeObj, long tb_nativeObj, long eb_nativeObj);
197 |
198 | // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response)
199 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_mat_nativeObj, long times_nativeObj, long response_nativeObj);
200 |
201 | // C++: void process(vector_Mat src, vector_Mat dst)
202 | private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_mat_nativeObj);
203 |
204 | // C++: void setCut(bool value)
205 | private static native void setCut_0(long nativeObj, boolean value);
206 |
207 | // C++: void setExcludeRange(int exclude_range)
208 | private static native void setExcludeRange_0(long nativeObj, int exclude_range);
209 |
210 | // C++: void setMaxBits(int max_bits)
211 | private static native void setMaxBits_0(long nativeObj, int max_bits);
212 |
213 | // C++: void shiftMat(Mat src, Mat& dst, Point shift)
214 | private static native void shiftMat_0(long nativeObj, long src_nativeObj, long dst_nativeObj, double shift_x, double shift_y);
215 |
216 | // native support for java finalize()
217 | private static native void delete(long nativeObj);
218 |
219 | }
220 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/photo/CalibrateDebevec.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 CalibrateDebevec
10 | //javadoc: CalibrateDebevec
11 | public class CalibrateDebevec extends CalibrateCRF {
12 |
13 | protected CalibrateDebevec(long addr) { super(addr); }
14 |
15 |
16 | //
17 | // C++: bool getRandom()
18 | //
19 |
20 | //javadoc: CalibrateDebevec::getRandom()
21 | public boolean getRandom()
22 | {
23 |
24 | boolean retVal = getRandom_0(nativeObj);
25 |
26 | return retVal;
27 | }
28 |
29 |
30 | //
31 | // C++: float getLambda()
32 | //
33 |
34 | //javadoc: CalibrateDebevec::getLambda()
35 | public float getLambda()
36 | {
37 |
38 | float retVal = getLambda_0(nativeObj);
39 |
40 | return retVal;
41 | }
42 |
43 |
44 | //
45 | // C++: int getSamples()
46 | //
47 |
48 | //javadoc: CalibrateDebevec::getSamples()
49 | public int getSamples()
50 | {
51 |
52 | int retVal = getSamples_0(nativeObj);
53 |
54 | return retVal;
55 | }
56 |
57 |
58 | //
59 | // C++: void setLambda(float lambda)
60 | //
61 |
62 | //javadoc: CalibrateDebevec::setLambda(lambda)
63 | public void setLambda(float lambda)
64 | {
65 |
66 | setLambda_0(nativeObj, lambda);
67 |
68 | return;
69 | }
70 |
71 |
72 | //
73 | // C++: void setRandom(bool random)
74 | //
75 |
76 | //javadoc: CalibrateDebevec::setRandom(random)
77 | public void setRandom(boolean random)
78 | {
79 |
80 | setRandom_0(nativeObj, random);
81 |
82 | return;
83 | }
84 |
85 |
86 | //
87 | // C++: void setSamples(int samples)
88 | //
89 |
90 | //javadoc: CalibrateDebevec::setSamples(samples)
91 | public void setSamples(int samples)
92 | {
93 |
94 | setSamples_0(nativeObj, samples);
95 |
96 | return;
97 | }
98 |
99 |
100 | @Override
101 | protected void finalize() throws Throwable {
102 | delete(nativeObj);
103 | }
104 |
105 |
106 |
107 | // C++: bool getRandom()
108 | private static native boolean getRandom_0(long nativeObj);
109 |
110 | // C++: float getLambda()
111 | private static native float getLambda_0(long nativeObj);
112 |
113 | // C++: int getSamples()
114 | private static native int getSamples_0(long nativeObj);
115 |
116 | // C++: void setLambda(float lambda)
117 | private static native void setLambda_0(long nativeObj, float lambda);
118 |
119 | // C++: void setRandom(bool random)
120 | private static native void setRandom_0(long nativeObj, boolean random);
121 |
122 | // C++: void setSamples(int samples)
123 | private static native void setSamples_0(long nativeObj, int samples);
124 |
125 | // native support for java finalize()
126 | private static native void delete(long nativeObj);
127 |
128 | }
129 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/photo/CalibrateRobertson.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.Mat;
8 |
9 | // C++: class CalibrateRobertson
10 | //javadoc: CalibrateRobertson
11 | public class CalibrateRobertson extends CalibrateCRF {
12 |
13 | protected CalibrateRobertson(long addr) { super(addr); }
14 |
15 |
16 | //
17 | // C++: Mat getRadiance()
18 | //
19 |
20 | //javadoc: CalibrateRobertson::getRadiance()
21 | public Mat getRadiance()
22 | {
23 |
24 | Mat retVal = new Mat(getRadiance_0(nativeObj));
25 |
26 | return retVal;
27 | }
28 |
29 |
30 | //
31 | // C++: float getThreshold()
32 | //
33 |
34 | //javadoc: CalibrateRobertson::getThreshold()
35 | public float getThreshold()
36 | {
37 |
38 | float retVal = getThreshold_0(nativeObj);
39 |
40 | return retVal;
41 | }
42 |
43 |
44 | //
45 | // C++: int getMaxIter()
46 | //
47 |
48 | //javadoc: CalibrateRobertson::getMaxIter()
49 | public int getMaxIter()
50 | {
51 |
52 | int retVal = getMaxIter_0(nativeObj);
53 |
54 | return retVal;
55 | }
56 |
57 |
58 | //
59 | // C++: void setMaxIter(int max_iter)
60 | //
61 |
62 | //javadoc: CalibrateRobertson::setMaxIter(max_iter)
63 | public void setMaxIter(int max_iter)
64 | {
65 |
66 | setMaxIter_0(nativeObj, max_iter);
67 |
68 | return;
69 | }
70 |
71 |
72 | //
73 | // C++: void setThreshold(float threshold)
74 | //
75 |
76 | //javadoc: CalibrateRobertson::setThreshold(threshold)
77 | public void setThreshold(float threshold)
78 | {
79 |
80 | setThreshold_0(nativeObj, threshold);
81 |
82 | return;
83 | }
84 |
85 |
86 | @Override
87 | protected void finalize() throws Throwable {
88 | delete(nativeObj);
89 | }
90 |
91 |
92 |
93 | // C++: Mat getRadiance()
94 | private static native long getRadiance_0(long nativeObj);
95 |
96 | // C++: float getThreshold()
97 | private static native float getThreshold_0(long nativeObj);
98 |
99 | // C++: int getMaxIter()
100 | private static native int getMaxIter_0(long nativeObj);
101 |
102 | // C++: void setMaxIter(int max_iter)
103 | private static native void setMaxIter_0(long nativeObj, int max_iter);
104 |
105 | // C++: void setThreshold(float threshold)
106 | private static native void setThreshold_0(long nativeObj, float threshold);
107 |
108 | // native support for java finalize()
109 | private static native void delete(long nativeObj);
110 |
111 | }
112 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/photo/MergeMertens.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 MergeMertens
13 | //javadoc: MergeMertens
14 | public class MergeMertens extends MergeExposures {
15 |
16 | protected MergeMertens(long addr) { super(addr); }
17 |
18 |
19 | //
20 | // C++: float getContrastWeight()
21 | //
22 |
23 | //javadoc: MergeMertens::getContrastWeight()
24 | public float getContrastWeight()
25 | {
26 |
27 | float retVal = getContrastWeight_0(nativeObj);
28 |
29 | return retVal;
30 | }
31 |
32 |
33 | //
34 | // C++: float getExposureWeight()
35 | //
36 |
37 | //javadoc: MergeMertens::getExposureWeight()
38 | public float getExposureWeight()
39 | {
40 |
41 | float retVal = getExposureWeight_0(nativeObj);
42 |
43 | return retVal;
44 | }
45 |
46 |
47 | //
48 | // C++: float getSaturationWeight()
49 | //
50 |
51 | //javadoc: MergeMertens::getSaturationWeight()
52 | public float getSaturationWeight()
53 | {
54 |
55 | float retVal = getSaturationWeight_0(nativeObj);
56 |
57 | return retVal;
58 | }
59 |
60 |
61 | //
62 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response)
63 | //
64 |
65 | //javadoc: MergeMertens::process(src, dst, times, response)
66 | public void process(List src, Mat dst, Mat times, Mat response)
67 | {
68 | Mat src_mat = Converters.vector_Mat_to_Mat(src);
69 | process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj);
70 |
71 | return;
72 | }
73 |
74 |
75 | //
76 | // C++: void process(vector_Mat src, Mat& dst)
77 | //
78 |
79 | //javadoc: MergeMertens::process(src, dst)
80 | public void process(List src, Mat dst)
81 | {
82 | Mat src_mat = Converters.vector_Mat_to_Mat(src);
83 | process_1(nativeObj, src_mat.nativeObj, dst.nativeObj);
84 |
85 | return;
86 | }
87 |
88 |
89 | //
90 | // C++: void setContrastWeight(float contrast_weiht)
91 | //
92 |
93 | //javadoc: MergeMertens::setContrastWeight(contrast_weiht)
94 | public void setContrastWeight(float contrast_weiht)
95 | {
96 |
97 | setContrastWeight_0(nativeObj, contrast_weiht);
98 |
99 | return;
100 | }
101 |
102 |
103 | //
104 | // C++: void setExposureWeight(float exposure_weight)
105 | //
106 |
107 | //javadoc: MergeMertens::setExposureWeight(exposure_weight)
108 | public void setExposureWeight(float exposure_weight)
109 | {
110 |
111 | setExposureWeight_0(nativeObj, exposure_weight);
112 |
113 | return;
114 | }
115 |
116 |
117 | //
118 | // C++: void setSaturationWeight(float saturation_weight)
119 | //
120 |
121 | //javadoc: MergeMertens::setSaturationWeight(saturation_weight)
122 | public void setSaturationWeight(float saturation_weight)
123 | {
124 |
125 | setSaturationWeight_0(nativeObj, saturation_weight);
126 |
127 | return;
128 | }
129 |
130 |
131 | @Override
132 | protected void finalize() throws Throwable {
133 | delete(nativeObj);
134 | }
135 |
136 |
137 |
138 | // C++: float getContrastWeight()
139 | private static native float getContrastWeight_0(long nativeObj);
140 |
141 | // C++: float getExposureWeight()
142 | private static native float getExposureWeight_0(long nativeObj);
143 |
144 | // C++: float getSaturationWeight()
145 | private static native float getSaturationWeight_0(long nativeObj);
146 |
147 | // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response)
148 | private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj);
149 |
150 | // C++: void process(vector_Mat src, Mat& dst)
151 | private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj);
152 |
153 | // C++: void setContrastWeight(float contrast_weiht)
154 | private static native void setContrastWeight_0(long nativeObj, float contrast_weiht);
155 |
156 | // C++: void setExposureWeight(float exposure_weight)
157 | private static native void setExposureWeight_0(long nativeObj, float exposure_weight);
158 |
159 | // C++: void setSaturationWeight(float saturation_weight)
160 | private static native void setSaturationWeight_0(long nativeObj, float saturation_weight);
161 |
162 | // native support for java finalize()
163 | private static native void delete(long nativeObj);
164 |
165 | }
166 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/photo/TonemapDurand.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 TonemapDurand
10 | //javadoc: TonemapDurand
11 | public class TonemapDurand extends Tonemap {
12 |
13 | protected TonemapDurand(long addr) { super(addr); }
14 |
15 |
16 | //
17 | // C++: float getContrast()
18 | //
19 |
20 | //javadoc: TonemapDurand::getContrast()
21 | public float getContrast()
22 | {
23 |
24 | float retVal = getContrast_0(nativeObj);
25 |
26 | return retVal;
27 | }
28 |
29 |
30 | //
31 | // C++: float getSaturation()
32 | //
33 |
34 | //javadoc: TonemapDurand::getSaturation()
35 | public float getSaturation()
36 | {
37 |
38 | float retVal = getSaturation_0(nativeObj);
39 |
40 | return retVal;
41 | }
42 |
43 |
44 | //
45 | // C++: float getSigmaColor()
46 | //
47 |
48 | //javadoc: TonemapDurand::getSigmaColor()
49 | public float getSigmaColor()
50 | {
51 |
52 | float retVal = getSigmaColor_0(nativeObj);
53 |
54 | return retVal;
55 | }
56 |
57 |
58 | //
59 | // C++: float getSigmaSpace()
60 | //
61 |
62 | //javadoc: TonemapDurand::getSigmaSpace()
63 | public float getSigmaSpace()
64 | {
65 |
66 | float retVal = getSigmaSpace_0(nativeObj);
67 |
68 | return retVal;
69 | }
70 |
71 |
72 | //
73 | // C++: void setContrast(float contrast)
74 | //
75 |
76 | //javadoc: TonemapDurand::setContrast(contrast)
77 | public void setContrast(float contrast)
78 | {
79 |
80 | setContrast_0(nativeObj, contrast);
81 |
82 | return;
83 | }
84 |
85 |
86 | //
87 | // C++: void setSaturation(float saturation)
88 | //
89 |
90 | //javadoc: TonemapDurand::setSaturation(saturation)
91 | public void setSaturation(float saturation)
92 | {
93 |
94 | setSaturation_0(nativeObj, saturation);
95 |
96 | return;
97 | }
98 |
99 |
100 | //
101 | // C++: void setSigmaColor(float sigma_color)
102 | //
103 |
104 | //javadoc: TonemapDurand::setSigmaColor(sigma_color)
105 | public void setSigmaColor(float sigma_color)
106 | {
107 |
108 | setSigmaColor_0(nativeObj, sigma_color);
109 |
110 | return;
111 | }
112 |
113 |
114 | //
115 | // C++: void setSigmaSpace(float sigma_space)
116 | //
117 |
118 | //javadoc: TonemapDurand::setSigmaSpace(sigma_space)
119 | public void setSigmaSpace(float sigma_space)
120 | {
121 |
122 | setSigmaSpace_0(nativeObj, sigma_space);
123 |
124 | return;
125 | }
126 |
127 |
128 | @Override
129 | protected void finalize() throws Throwable {
130 | delete(nativeObj);
131 | }
132 |
133 |
134 |
135 | // C++: float getContrast()
136 | private static native float getContrast_0(long nativeObj);
137 |
138 | // C++: float getSaturation()
139 | private static native float getSaturation_0(long nativeObj);
140 |
141 | // C++: float getSigmaColor()
142 | private static native float getSigmaColor_0(long nativeObj);
143 |
144 | // C++: float getSigmaSpace()
145 | private static native float getSigmaSpace_0(long nativeObj);
146 |
147 | // C++: void setContrast(float contrast)
148 | private static native void setContrast_0(long nativeObj, float contrast);
149 |
150 | // C++: void setSaturation(float saturation)
151 | private static native void setSaturation_0(long nativeObj, float saturation);
152 |
153 | // C++: void setSigmaColor(float sigma_color)
154 | private static native void setSigmaColor_0(long nativeObj, float sigma_color);
155 |
156 | // C++: void setSigmaSpace(float sigma_space)
157 | private static native void setSigmaSpace_0(long nativeObj, float sigma_space);
158 |
159 | // native support for java finalize()
160 | private static native void delete(long nativeObj);
161 |
162 | }
163 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/photo/TonemapReinhard.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 TonemapReinhard
10 | //javadoc: TonemapReinhard
11 | public class TonemapReinhard extends Tonemap {
12 |
13 | protected TonemapReinhard(long addr) { super(addr); }
14 |
15 |
16 | //
17 | // C++: float getColorAdaptation()
18 | //
19 |
20 | //javadoc: TonemapReinhard::getColorAdaptation()
21 | public float getColorAdaptation()
22 | {
23 |
24 | float retVal = getColorAdaptation_0(nativeObj);
25 |
26 | return retVal;
27 | }
28 |
29 |
30 | //
31 | // C++: float getIntensity()
32 | //
33 |
34 | //javadoc: TonemapReinhard::getIntensity()
35 | public float getIntensity()
36 | {
37 |
38 | float retVal = getIntensity_0(nativeObj);
39 |
40 | return retVal;
41 | }
42 |
43 |
44 | //
45 | // C++: float getLightAdaptation()
46 | //
47 |
48 | //javadoc: TonemapReinhard::getLightAdaptation()
49 | public float getLightAdaptation()
50 | {
51 |
52 | float retVal = getLightAdaptation_0(nativeObj);
53 |
54 | return retVal;
55 | }
56 |
57 |
58 | //
59 | // C++: void setColorAdaptation(float color_adapt)
60 | //
61 |
62 | //javadoc: TonemapReinhard::setColorAdaptation(color_adapt)
63 | public void setColorAdaptation(float color_adapt)
64 | {
65 |
66 | setColorAdaptation_0(nativeObj, color_adapt);
67 |
68 | return;
69 | }
70 |
71 |
72 | //
73 | // C++: void setIntensity(float intensity)
74 | //
75 |
76 | //javadoc: TonemapReinhard::setIntensity(intensity)
77 | public void setIntensity(float intensity)
78 | {
79 |
80 | setIntensity_0(nativeObj, intensity);
81 |
82 | return;
83 | }
84 |
85 |
86 | //
87 | // C++: void setLightAdaptation(float light_adapt)
88 | //
89 |
90 | //javadoc: TonemapReinhard::setLightAdaptation(light_adapt)
91 | public void setLightAdaptation(float light_adapt)
92 | {
93 |
94 | setLightAdaptation_0(nativeObj, light_adapt);
95 |
96 | return;
97 | }
98 |
99 |
100 | @Override
101 | protected void finalize() throws Throwable {
102 | delete(nativeObj);
103 | }
104 |
105 |
106 |
107 | // C++: float getColorAdaptation()
108 | private static native float getColorAdaptation_0(long nativeObj);
109 |
110 | // C++: float getIntensity()
111 | private static native float getIntensity_0(long nativeObj);
112 |
113 | // C++: float getLightAdaptation()
114 | private static native float getLightAdaptation_0(long nativeObj);
115 |
116 | // C++: void setColorAdaptation(float color_adapt)
117 | private static native void setColorAdaptation_0(long nativeObj, float color_adapt);
118 |
119 | // C++: void setIntensity(float intensity)
120 | private static native void setIntensity_0(long nativeObj, float intensity);
121 |
122 | // C++: void setLightAdaptation(float light_adapt)
123 | private static native void setLightAdaptation_0(long nativeObj, float light_adapt);
124 |
125 | // native support for java finalize()
126 | private static native void delete(long nativeObj);
127 |
128 | }
129 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/main/java/org/opencv/videoio/VideoWriter.java:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file is auto-generated. Please don't modify it!
4 | //
5 | package org.opencv.videoio;
6 |
7 | import java.lang.String;
8 | import org.opencv.core.Mat;
9 | import org.opencv.core.Size;
10 |
11 | // C++: class VideoWriter
12 | //javadoc: VideoWriter
13 | public class VideoWriter {
14 |
15 | protected final long nativeObj;
16 | protected VideoWriter(long addr) { nativeObj = addr; }
17 |
18 |
19 | //
20 | // C++: VideoWriter(String filename, int fourcc, double fps, Size frameSize, bool isColor = true)
21 | //
22 |
23 | //javadoc: VideoWriter::VideoWriter(filename, fourcc, fps, frameSize, isColor)
24 | public VideoWriter(String filename, int fourcc, double fps, Size frameSize, boolean isColor)
25 | {
26 |
27 | nativeObj = VideoWriter_0(filename, fourcc, fps, frameSize.width, frameSize.height, isColor);
28 |
29 | return;
30 | }
31 |
32 | //javadoc: VideoWriter::VideoWriter(filename, fourcc, fps, frameSize)
33 | public VideoWriter(String filename, int fourcc, double fps, Size frameSize)
34 | {
35 |
36 | nativeObj = VideoWriter_1(filename, fourcc, fps, frameSize.width, frameSize.height);
37 |
38 | return;
39 | }
40 |
41 |
42 | //
43 | // C++: VideoWriter()
44 | //
45 |
46 | //javadoc: VideoWriter::VideoWriter()
47 | public VideoWriter()
48 | {
49 |
50 | nativeObj = VideoWriter_2();
51 |
52 | return;
53 | }
54 |
55 |
56 | //
57 | // C++: bool isOpened()
58 | //
59 |
60 | //javadoc: VideoWriter::isOpened()
61 | public boolean isOpened()
62 | {
63 |
64 | boolean retVal = isOpened_0(nativeObj);
65 |
66 | return retVal;
67 | }
68 |
69 |
70 | //
71 | // C++: bool open(String filename, int fourcc, double fps, Size frameSize, bool isColor = true)
72 | //
73 |
74 | //javadoc: VideoWriter::open(filename, fourcc, fps, frameSize, isColor)
75 | public boolean open(String filename, int fourcc, double fps, Size frameSize, boolean isColor)
76 | {
77 |
78 | boolean retVal = open_0(nativeObj, filename, fourcc, fps, frameSize.width, frameSize.height, isColor);
79 |
80 | return retVal;
81 | }
82 |
83 | //javadoc: VideoWriter::open(filename, fourcc, fps, frameSize)
84 | public boolean open(String filename, int fourcc, double fps, Size frameSize)
85 | {
86 |
87 | boolean retVal = open_1(nativeObj, filename, fourcc, fps, frameSize.width, frameSize.height);
88 |
89 | return retVal;
90 | }
91 |
92 |
93 | //
94 | // C++: bool set(int propId, double value)
95 | //
96 |
97 | //javadoc: VideoWriter::set(propId, value)
98 | public boolean set(int propId, double value)
99 | {
100 |
101 | boolean retVal = set_0(nativeObj, propId, value);
102 |
103 | return retVal;
104 | }
105 |
106 |
107 | //
108 | // C++: double get(int propId)
109 | //
110 |
111 | //javadoc: VideoWriter::get(propId)
112 | public double get(int propId)
113 | {
114 |
115 | double retVal = get_0(nativeObj, propId);
116 |
117 | return retVal;
118 | }
119 |
120 |
121 | //
122 | // C++: static int fourcc(char c1, char c2, char c3, char c4)
123 | //
124 |
125 | //javadoc: VideoWriter::fourcc(c1, c2, c3, c4)
126 | public static int fourcc(char c1, char c2, char c3, char c4)
127 | {
128 |
129 | int retVal = fourcc_0(c1, c2, c3, c4);
130 |
131 | return retVal;
132 | }
133 |
134 |
135 | //
136 | // C++: void release()
137 | //
138 |
139 | //javadoc: VideoWriter::release()
140 | public void release()
141 | {
142 |
143 | release_0(nativeObj);
144 |
145 | return;
146 | }
147 |
148 |
149 | //
150 | // C++: void write(Mat image)
151 | //
152 |
153 | //javadoc: VideoWriter::write(image)
154 | public void write(Mat image)
155 | {
156 |
157 | write_0(nativeObj, image.nativeObj);
158 |
159 | return;
160 | }
161 |
162 |
163 | @Override
164 | protected void finalize() throws Throwable {
165 | delete(nativeObj);
166 | }
167 |
168 |
169 |
170 | // C++: VideoWriter(String filename, int fourcc, double fps, Size frameSize, bool isColor = true)
171 | private static native long VideoWriter_0(String filename, int fourcc, double fps, double frameSize_width, double frameSize_height, boolean isColor);
172 | private static native long VideoWriter_1(String filename, int fourcc, double fps, double frameSize_width, double frameSize_height);
173 |
174 | // C++: VideoWriter()
175 | private static native long VideoWriter_2();
176 |
177 | // C++: bool isOpened()
178 | private static native boolean isOpened_0(long nativeObj);
179 |
180 | // C++: bool open(String filename, int fourcc, double fps, Size frameSize, bool isColor = true)
181 | private static native boolean open_0(long nativeObj, String filename, int fourcc, double fps, double frameSize_width, double frameSize_height, boolean isColor);
182 | private static native boolean open_1(long nativeObj, String filename, int fourcc, double fps, double frameSize_width, double frameSize_height);
183 |
184 | // C++: bool set(int propId, double value)
185 | private static native boolean set_0(long nativeObj, int propId, double value);
186 |
187 | // C++: double get(int propId)
188 | private static native double get_0(long nativeObj, int propId);
189 |
190 | // C++: static int fourcc(char c1, char c2, char c3, char c4)
191 | private static native int fourcc_0(char c1, char c2, char c3, char c4);
192 |
193 | // C++: void release()
194 | private static native void release_0(long nativeObj);
195 |
196 | // C++: void write(Mat image)
197 | private static native void write_0(long nativeObj, long image_nativeObj);
198 |
199 | // native support for java finalize()
200 | private static native void delete(long nativeObj);
201 |
202 | }
203 |
--------------------------------------------------------------------------------
/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------