diff --git a/README.md b/README.md index 9358dce..cab539a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,18 @@ Automatically plays the android game named "∞ Loop" (com.balysv.loop) adb install ∞\ Loop_v3_0.apk +### Install OpenCV Manager application: +If you have the Play Store on the device you can skip this step +as the application should (in theory) prompt you to install it. + +Either get it from the Play Store or install it from the SDK +http://sourceforge.net/projects/opencvlibrary/files/opencv-android/ +eg. + + adb install OpenCV-android-sdk/apk/OpenCV_3.1.0_Manager_3.10_x86.apk + +Make sure to pick the right architecture apk for the target device + ### Install the application (debug works fine): ./gradlew installDebug diff --git a/app/build.gradle b/app/build.gradle index 7f55b4b..e20e06b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,4 +25,5 @@ dependencies { compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:design:23.1.1' + compile project(':openCVLibrary310') } diff --git a/app/src/main/java/efokschaner/infinityloopsolver/Debug.java b/app/src/main/java/efokschaner/infinityloopsolver/Debug.java new file mode 100644 index 0000000..2641e33 --- /dev/null +++ b/app/src/main/java/efokschaner/infinityloopsolver/Debug.java @@ -0,0 +1,76 @@ +package efokschaner.infinityloopsolver; + + +import android.app.UiAutomation; +import android.graphics.Bitmap; + +import org.opencv.android.Utils; +import org.opencv.core.Mat; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.ProtocolException; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class Debug { + public static void sendBitmap(Bitmap bitmap) { + try { + String timestamp = new SimpleDateFormat("HH_mm_ss").format(new Date()); + URL url = new URL("http://10.0.2.2:8888/" + timestamp + ".png"); + try { + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + try { + conn.setDoOutput(true); + conn.setChunkedStreamingMode(0); + conn.setRequestMethod("POST"); + conn.setRequestProperty("Content-Type", "application/octet-stream"); + try (OutputStream ostream = conn.getOutputStream()) { + bitmap.compress(Bitmap.CompressFormat.PNG, 100, ostream); + } catch (IOException e) { + e.printStackTrace(); + } + final int responseCode = conn.getResponseCode(); + if (!(responseCode >= 200 && responseCode < 300)) { + throw new AssertionError(String.format("Http response was: %d", responseCode)); + } + conn.getResponseMessage(); + BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); + while (in.readLine() != null){ + // ignore contents + } + in.close(); + } catch (ProtocolException e) { + e.printStackTrace(); + } finally { + conn.disconnect(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } catch (MalformedURLException e) { + e.printStackTrace(); + } + } + + public static void sendMatrix(Mat m) { + Bitmap b2 = Bitmap.createBitmap(m.width(), m.height(), Bitmap.Config.ARGB_8888); + Utils.matToBitmap(m, b2); + sendBitmap(b2); + b2.recycle(); + } + + public static void sendScreenshot(UiAutomation uiAutomation) { + Bitmap b = uiAutomation.takeScreenshot(); + try{ + sendBitmap(b); + } finally { + b.recycle(); + } + } +} diff --git a/app/src/main/java/efokschaner/infinityloopsolver/GameState.java b/app/src/main/java/efokschaner/infinityloopsolver/GameState.java new file mode 100644 index 0000000..d7a5c4a --- /dev/null +++ b/app/src/main/java/efokschaner/infinityloopsolver/GameState.java @@ -0,0 +1,92 @@ +package efokschaner.infinityloopsolver; + + +public class GameState { + public static class Direction { + public static final int NONE = 0; + public static final int UP = 1; + public static final int RIGHT = 1 << 1; + public static final int DOWN = 1 << 2; + public static final int LEFT = 1 << 3; + + public static final int[] ALL = {UP, RIGHT, DOWN, LEFT}; + } + + // Represents offset from the canonical orientations + public static class TileOrientation { + public static final TileOrientation ZERO = new TileOrientation(0); + public static final TileOrientation QUARTER = new TileOrientation(1); + public static final TileOrientation HALF = new TileOrientation(2); + public static final TileOrientation THREE_QUARTERS = new TileOrientation(3); + + private int mValue; + + TileOrientation(int value) { + mValue = value; + } + + public TileOrientation rotate(int num) { + return new TileOrientation((mValue + num) % 3); + } + + public TileOrientation rotate() { + return new TileOrientation(0); + } + } + + public enum TileType { + EMPTY(Direction.NONE, new TileOrientation[]{ + TileOrientation.ZERO + }), + END(Direction.UP, new TileOrientation[]{ + TileOrientation.ZERO, + TileOrientation.QUARTER, + TileOrientation.HALF, + TileOrientation.THREE_QUARTERS + }), + LINE(Direction.UP| Direction.DOWN, new TileOrientation[]{ + TileOrientation.ZERO, + TileOrientation.QUARTER + }), + CORNER(Direction.UP| Direction.RIGHT, new TileOrientation[]{ + TileOrientation.ZERO, + TileOrientation.QUARTER, + TileOrientation.HALF, + TileOrientation.THREE_QUARTERS + }), + TEE(Direction.UP| Direction.RIGHT| Direction.DOWN, new TileOrientation[]{ + TileOrientation.ZERO, + TileOrientation.QUARTER, + TileOrientation.HALF, + TileOrientation.THREE_QUARTERS + }), + CROSS(Direction.UP| Direction.RIGHT| Direction.DOWN| Direction.LEFT, new TileOrientation[]{ + TileOrientation.ZERO + }); + + + private final int mConnectionDirections; + private final TileOrientation[] mPossibleOrientations; + + // connectionDirections are which directions the tile connects to in its default orientation + // possibleOrientations allows us to cull orientations that are the same for the purposes of the game + TileType(int connectionDirections, TileOrientation[] possibleOrientations) { + mConnectionDirections = connectionDirections; + mPossibleOrientations = possibleOrientations; + } + } + + public static class TileState { + TileType type; + TileOrientation orientation; + boolean isOrientationSolved = false; + } + + private TileState[][] mGrid; + + public GameState(TileState[][] grid) { + mGrid = grid; + } + + +} diff --git a/app/src/main/java/efokschaner/infinityloopsolver/ImageProcessor.java b/app/src/main/java/efokschaner/infinityloopsolver/ImageProcessor.java new file mode 100644 index 0000000..5a30d9b --- /dev/null +++ b/app/src/main/java/efokschaner/infinityloopsolver/ImageProcessor.java @@ -0,0 +1,16 @@ +package efokschaner.infinityloopsolver; + +import android.graphics.Bitmap; + +import org.opencv.android.Utils; +import org.opencv.core.Mat; + + +public class ImageProcessor { + public static GameState getGameStateFromImage(Bitmap b) { + Mat m = new Mat(); + Utils.bitmapToMat(b, m); + Debug.sendMatrix(m); + return new GameState(new GameState.TileState[2][2]); + } +} diff --git a/app/src/main/java/efokschaner/infinityloopsolver/MainActivity.java b/app/src/main/java/efokschaner/infinityloopsolver/MainActivity.java index af6a411..911d47b 100644 --- a/app/src/main/java/efokschaner/infinityloopsolver/MainActivity.java +++ b/app/src/main/java/efokschaner/infinityloopsolver/MainActivity.java @@ -2,21 +2,65 @@ import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.util.Log; import android.widget.CompoundButton; import android.widget.Switch; +import org.opencv.android.BaseLoaderCallback; +import org.opencv.android.LoaderCallbackInterface; +import org.opencv.android.OpenCVLoader; + public class MainActivity extends AppCompatActivity { + private static final String TAG = MainActivity.class.getSimpleName(); + + Switch mEnabledSwitch; + + private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) { + @Override + public void onManagerConnected(int status) { + switch(status) { + case LoaderCallbackInterface.SUCCESS: + Log.i(TAG, "OpenCV Manager Connected"); + mEnabledSwitch.setEnabled(true); + break; + case LoaderCallbackInterface.INIT_FAILED: + Log.i(TAG,"Init Failed"); + break; + case LoaderCallbackInterface.INSTALL_CANCELED: + Log.i(TAG,"Install Cancelled"); + break; + case LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION: + Log.i(TAG,"Incompatible Version"); + break; + case LoaderCallbackInterface.MARKET_ERROR: + Log.i(TAG,"Market Error"); + break; + default: + Log.i(TAG,"OpenCV Manager Install"); + super.onManagerConnected(status); + break; + } + } + }; + + @Override + protected void onResume() { + super.onResume(); + //initialize OpenCV manager + OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_1_0, this, mLoaderCallback); + } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final SolverApplication app = (SolverApplication) getApplication(); setContentView(R.layout.activity_main); - final Switch enabledSwitch = (Switch) findViewById(R.id.switch_solver_enabled); - enabledSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + mEnabledSwitch = (Switch) findViewById(R.id.switch_solver_enabled); + mEnabledSwitch.setEnabled(false); + mEnabledSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if(isChecked) { + if (isChecked) { app.enableSolver(); } else { app.disableSolver(); diff --git a/app/src/main/java/efokschaner/infinityloopsolver/Solver.java b/app/src/main/java/efokschaner/infinityloopsolver/Solver.java index 440e462..2351058 100644 --- a/app/src/main/java/efokschaner/infinityloopsolver/Solver.java +++ b/app/src/main/java/efokschaner/infinityloopsolver/Solver.java @@ -3,7 +3,6 @@ import android.app.UiAutomation; import android.graphics.Bitmap; -import android.graphics.Rect; import android.os.SystemClock; import android.util.Log; import android.view.InputDevice; @@ -13,16 +12,6 @@ import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityWindowInfo; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.ProtocolException; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.List; public class Solver { @@ -31,7 +20,7 @@ public class Solver { private final UiAutomation mUiAutomation; private Thread mSolverThread; - public Solver(UiAutomation uiAutomation, Runnable launchInfinityLoop) { + public Solver(UiAutomation uiAutomation) { mUiAutomation = uiAutomation; mUiAutomation.setOnAccessibilityEventListener(new UiAutomation.OnAccessibilityEventListener() { @Override @@ -42,18 +31,15 @@ public void onAccessibilityEvent(AccessibilityEvent event) { mSolverThread.start(); } } else { - if(mSolverThread != null) { - shutdown(); - } + stopSolver(); } } }); - launchInfinityLoop.run(); } - public void shutdown() { - Log.d(TAG, "Shutting down"); + private void stopSolver() { if(mSolverThread != null) { + Log.d(TAG, "Shutting down"); mSolverThread.interrupt(); try { mSolverThread.join(); @@ -65,55 +51,12 @@ public void shutdown() { } } - private static final Runnable NOOP = new Runnable() { public void run() {} }; - - private static void sendBitmap(Bitmap bitmap) { - try { - String timestamp = new SimpleDateFormat("HH_mm_ss").format(new Date()); - URL url = new URL("http://10.0.2.2:8888/" + timestamp + ".png"); - try { - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - try { - conn.setDoOutput(true); - conn.setChunkedStreamingMode(0); - conn.setRequestMethod("POST"); - conn.setRequestProperty("Content-Type", "application/octet-stream"); - try (OutputStream ostream = conn.getOutputStream()) { - bitmap.compress(Bitmap.CompressFormat.PNG, 100, ostream); - } catch (IOException e) { - e.printStackTrace(); - } - final int responseCode = conn.getResponseCode(); - if (!(responseCode >= 200 && responseCode < 300)) { - throw new AssertionError(String.format("Http response was: %d", responseCode)); - } - conn.getResponseMessage(); - BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); - while (in.readLine() != null){ - // ignore contents - } - in.close(); - } catch (ProtocolException e) { - e.printStackTrace(); - } finally { - conn.disconnect(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } catch (MalformedURLException e) { - e.printStackTrace(); - } + public void shutdown() { + mUiAutomation.setOnAccessibilityEventListener(null); + stopSolver(); } - private static void sendScreenshot(UiAutomation uiAutomation) { - Bitmap b = uiAutomation.takeScreenshot(); - try{ - sendBitmap(b); - } finally { - b.recycle(); - } - } + private static final Runnable NOOP = new Runnable() { public void run() {} }; private static AccessibilityNodeInfo findInfinityLoopView(AccessibilityNodeInfo node) { final String viewIdResourceName = node.getViewIdResourceName(); @@ -187,16 +130,17 @@ private static void injectClickEvent(float x, float y, UiAutomation automation){ public void run() { Log.d(TAG, "run()"); try { - sendScreenshot(mUiAutomation); - for(int i = 0; i < 10; ++i) - { - Rect windowBounds = new Rect(); - mUiAutomation.getWindows().get(0).getBoundsInScreen(windowBounds); - final float xpos = windowBounds.exactCenterX() + 20; - final float ypos = windowBounds.exactCenterY() + 20; - injectClickEvent(xpos, ypos, mUiAutomation); - Thread.sleep(1000); - sendScreenshot(mUiAutomation); + while(!Thread.interrupted()) { + Bitmap b = mUiAutomation.takeScreenshot(); + try{ + final GameState gameStateFromImage = ImageProcessor.getGameStateFromImage(b); + // Perform moves... + // using injectClickEvent(xpos, ypos, mUiAutomation); + // and some sleeps / waits between moves + Thread.sleep(1000); + } finally { + b.recycle(); + } } } catch (InterruptedException e) { // ignore @@ -204,6 +148,4 @@ public void run() { } }; - - } diff --git a/app/src/main/java/efokschaner/infinityloopsolver/SolverApplication.java b/app/src/main/java/efokschaner/infinityloopsolver/SolverApplication.java index ed801fa..2891104 100644 --- a/app/src/main/java/efokschaner/infinityloopsolver/SolverApplication.java +++ b/app/src/main/java/efokschaner/infinityloopsolver/SolverApplication.java @@ -8,10 +8,6 @@ public class SolverApplication extends Application { private UiAutomation mUiAutomation; - public UiAutomation getUiAutomation() { - return mUiAutomation; - } - public void setUiAutomation(UiAutomation mUiAutomation) { this.mUiAutomation = mUiAutomation; } @@ -20,16 +16,12 @@ public void setUiAutomation(UiAutomation mUiAutomation) { public void enableSolver() { if(mSolver == null) { - mSolver = new Solver(mUiAutomation, new Runnable() { - @Override - public void run() { - final PackageManager packageManager = SolverApplication.this.getPackageManager(); - final Intent launchIntent = packageManager.getLaunchIntentForPackage("com.balysv.loop"); - if(launchIntent != null) { - SolverApplication.this.startActivity(launchIntent); - } - } - }); + mSolver = new Solver(mUiAutomation); + final PackageManager packageManager = SolverApplication.this.getPackageManager(); + final Intent launchIntent = packageManager.getLaunchIntentForPackage("com.balysv.loop"); + if(launchIntent != null) { + SolverApplication.this.startActivity(launchIntent); + } } } diff --git a/app/src/main/java/efokschaner/infinityloopsolver/SolverInstrumentation.java b/app/src/main/java/efokschaner/infinityloopsolver/SolverInstrumentation.java index 2d06727..ae3ec90 100644 --- a/app/src/main/java/efokschaner/infinityloopsolver/SolverInstrumentation.java +++ b/app/src/main/java/efokschaner/infinityloopsolver/SolverInstrumentation.java @@ -5,16 +5,10 @@ import android.app.Instrumentation; import android.app.UiAutomation; import android.content.Intent; -import android.os.Bundle; public class SolverInstrumentation extends Instrumentation { private static final String TAG = SolverInstrumentation.class.getSimpleName(); - @Override - public void onCreate(Bundle arguments) { - super.onCreate(arguments); - } - @Override public void callApplicationOnCreate(final Application app) { super.callApplicationOnCreate(app); diff --git a/openCVLibrary310/build.gradle b/openCVLibrary310/build.gradle new file mode 100644 index 0000000..ab0ab17 --- /dev/null +++ b/openCVLibrary310/build.gradle @@ -0,0 +1,18 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 23 + buildToolsVersion "19.1.0" + + defaultConfig { + minSdkVersion 23 + targetSdkVersion 23 + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' + } + } +} diff --git a/openCVLibrary310/lint.xml b/openCVLibrary310/lint.xml new file mode 100644 index 0000000..6a5c9c6 --- /dev/null +++ b/openCVLibrary310/lint.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/openCVLibrary310/src/main/AndroidManifest.xml b/openCVLibrary310/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f6fcc8f --- /dev/null +++ b/openCVLibrary310/src/main/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/openCVLibrary310/src/main/aidl/org/opencv/engine/OpenCVEngineInterface.aidl b/openCVLibrary310/src/main/aidl/org/opencv/engine/OpenCVEngineInterface.aidl new file mode 100644 index 0000000..21fe5f7 --- /dev/null +++ b/openCVLibrary310/src/main/aidl/org/opencv/engine/OpenCVEngineInterface.aidl @@ -0,0 +1,33 @@ +package org.opencv.engine; + +/** +* Class provides a Java interface for OpenCV Engine Service. It's synchronous with native OpenCVEngine class. +*/ +interface OpenCVEngineInterface +{ + /** + * @return Returns service version. + */ + int getEngineVersion(); + + /** + * Finds an installed OpenCV library. + * @param OpenCV version. + * @return Returns path to OpenCV native libs or an empty string if OpenCV can not be found. + */ + String getLibPathByVersion(String version); + + /** + * Tries to install defined version of OpenCV from Google Play Market. + * @param OpenCV version. + * @return Returns true if installation was successful or OpenCV package has been already installed. + */ + boolean installVersion(String version); + + /** + * Returns list of libraries in loading order, separated by semicolon. + * @param OpenCV version. + * @return Returns names of OpenCV libraries, separated by semicolon. + */ + String getLibraryList(String version); +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/AsyncServiceHelper.java b/openCVLibrary310/src/main/java/org/opencv/android/AsyncServiceHelper.java new file mode 100644 index 0000000..4d9d115 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/AsyncServiceHelper.java @@ -0,0 +1,391 @@ +package org.opencv.android; + +import java.io.File; +import java.util.StringTokenizer; + +import org.opencv.core.Core; +import org.opencv.engine.OpenCVEngineInterface; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.net.Uri; +import android.os.IBinder; +import android.os.RemoteException; +import android.util.Log; + +class AsyncServiceHelper +{ + public static boolean initOpenCV(String Version, final Context AppContext, + final LoaderCallbackInterface Callback) + { + AsyncServiceHelper helper = new AsyncServiceHelper(Version, AppContext, Callback); + Intent intent = new Intent("org.opencv.engine.BIND"); + intent.setPackage("org.opencv.engine"); + if (AppContext.bindService(intent, helper.mServiceConnection, Context.BIND_AUTO_CREATE)) + { + return true; + } + else + { + AppContext.unbindService(helper.mServiceConnection); + InstallService(AppContext, Callback); + return false; + } + } + + protected AsyncServiceHelper(String Version, Context AppContext, LoaderCallbackInterface Callback) + { + mOpenCVersion = Version; + mUserAppCallback = Callback; + mAppContext = AppContext; + } + + protected static final String TAG = "OpenCVManager/Helper"; + protected static final int MINIMUM_ENGINE_VERSION = 2; + protected OpenCVEngineInterface mEngineService; + protected LoaderCallbackInterface mUserAppCallback; + protected String mOpenCVersion; + protected Context mAppContext; + protected static boolean mServiceInstallationProgress = false; + protected static boolean mLibraryInstallationProgress = false; + + protected static boolean InstallServiceQuiet(Context context) + { + boolean result = true; + try + { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(OPEN_CV_SERVICE_URL)); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + } + catch(Exception e) + { + result = false; + } + + return result; + } + + protected static void InstallService(final Context AppContext, final LoaderCallbackInterface Callback) + { + if (!mServiceInstallationProgress) + { + Log.d(TAG, "Request new service installation"); + InstallCallbackInterface InstallQuery = new InstallCallbackInterface() { + private LoaderCallbackInterface mUserAppCallback = Callback; + public String getPackageName() + { + return "OpenCV Manager"; + } + public void install() { + Log.d(TAG, "Trying to install OpenCV Manager via Google Play"); + + boolean result = InstallServiceQuiet(AppContext); + if (result) + { + mServiceInstallationProgress = true; + Log.d(TAG, "Package installation started"); + } + else + { + Log.d(TAG, "OpenCV package was not installed!"); + int Status = LoaderCallbackInterface.MARKET_ERROR; + Log.d(TAG, "Init finished with status " + Status); + Log.d(TAG, "Unbind from service"); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(Status); + } + } + + public void cancel() + { + Log.d(TAG, "OpenCV library installation was canceled"); + int Status = LoaderCallbackInterface.INSTALL_CANCELED; + Log.d(TAG, "Init finished with status " + Status); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(Status); + } + + public void wait_install() + { + Log.e(TAG, "Instalation was not started! Nothing to wait!"); + } + }; + + Callback.onPackageInstall(InstallCallbackInterface.NEW_INSTALLATION, InstallQuery); + } + else + { + Log.d(TAG, "Waiting current installation process"); + InstallCallbackInterface WaitQuery = new InstallCallbackInterface() { + private LoaderCallbackInterface mUserAppCallback = Callback; + public String getPackageName() + { + return "OpenCV Manager"; + } + public void install() + { + Log.e(TAG, "Nothing to install we just wait current installation"); + } + public void cancel() + { + Log.d(TAG, "Wating for OpenCV canceled by user"); + mServiceInstallationProgress = false; + int Status = LoaderCallbackInterface.INSTALL_CANCELED; + Log.d(TAG, "Init finished with status " + Status); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(Status); + } + public void wait_install() + { + InstallServiceQuiet(AppContext); + } + }; + + Callback.onPackageInstall(InstallCallbackInterface.INSTALLATION_PROGRESS, WaitQuery); + } + } + + /** + * URL of OpenCV Manager page on Google Play Market. + */ + protected static final String OPEN_CV_SERVICE_URL = "market://details?id=org.opencv.engine"; + + protected ServiceConnection mServiceConnection = new ServiceConnection() + { + public void onServiceConnected(ComponentName className, IBinder service) + { + Log.d(TAG, "Service connection created"); + mEngineService = OpenCVEngineInterface.Stub.asInterface(service); + if (null == mEngineService) + { + Log.d(TAG, "OpenCV Manager Service connection fails. May be service was not installed?"); + InstallService(mAppContext, mUserAppCallback); + } + else + { + mServiceInstallationProgress = false; + try + { + if (mEngineService.getEngineVersion() < MINIMUM_ENGINE_VERSION) + { + Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION); + return; + } + + Log.d(TAG, "Trying to get library path"); + String path = mEngineService.getLibPathByVersion(mOpenCVersion); + if ((null == path) || (path.length() == 0)) + { + if (!mLibraryInstallationProgress) + { + InstallCallbackInterface InstallQuery = new InstallCallbackInterface() { + public String getPackageName() + { + return "OpenCV library"; + } + public void install() { + Log.d(TAG, "Trying to install OpenCV lib via Google Play"); + try + { + if (mEngineService.installVersion(mOpenCVersion)) + { + mLibraryInstallationProgress = true; + Log.d(TAG, "Package installation statred"); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + } + else + { + Log.d(TAG, "OpenCV package was not installed!"); + Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.MARKET_ERROR); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(LoaderCallbackInterface.MARKET_ERROR); + } + } catch (RemoteException e) { + e.printStackTrace();; + Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INIT_FAILED); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INIT_FAILED); + } + } + public void cancel() { + Log.d(TAG, "OpenCV library installation was canceled"); + Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INSTALL_CANCELED); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INSTALL_CANCELED); + } + public void wait_install() { + Log.e(TAG, "Instalation was not started! Nothing to wait!"); + } + }; + + mUserAppCallback.onPackageInstall(InstallCallbackInterface.NEW_INSTALLATION, InstallQuery); + } + else + { + InstallCallbackInterface WaitQuery = new InstallCallbackInterface() { + public String getPackageName() + { + return "OpenCV library"; + } + + public void install() { + Log.e(TAG, "Nothing to install we just wait current installation"); + } + public void cancel() + { + Log.d(TAG, "OpenCV library installation was canceled"); + mLibraryInstallationProgress = false; + Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INSTALL_CANCELED); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INSTALL_CANCELED); + } + public void wait_install() { + Log.d(TAG, "Waiting for current installation"); + try + { + if (!mEngineService.installVersion(mOpenCVersion)) + { + Log.d(TAG, "OpenCV package was not installed!"); + Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.MARKET_ERROR); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(LoaderCallbackInterface.MARKET_ERROR); + } + else + { + Log.d(TAG, "Wating for package installation"); + } + + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + + } catch (RemoteException e) { + e.printStackTrace(); + Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INIT_FAILED); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INIT_FAILED); + } + } + }; + + mUserAppCallback.onPackageInstall(InstallCallbackInterface.INSTALLATION_PROGRESS, WaitQuery); + } + return; + } + else + { + Log.d(TAG, "Trying to get library list"); + mLibraryInstallationProgress = false; + String libs = mEngineService.getLibraryList(mOpenCVersion); + Log.d(TAG, "Library list: \"" + libs + "\""); + Log.d(TAG, "First attempt to load libs"); + int status; + if (initOpenCVLibs(path, libs)) + { + Log.d(TAG, "First attempt to load libs is OK"); + String eol = System.getProperty("line.separator"); + for (String str : Core.getBuildInformation().split(eol)) + Log.i(TAG, str); + + status = LoaderCallbackInterface.SUCCESS; + } + else + { + Log.d(TAG, "First attempt to load libs fails"); + status = LoaderCallbackInterface.INIT_FAILED; + } + + Log.d(TAG, "Init finished with status " + status); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(status); + } + } + catch (RemoteException e) + { + e.printStackTrace(); + Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INIT_FAILED); + Log.d(TAG, "Unbind from service"); + mAppContext.unbindService(mServiceConnection); + Log.d(TAG, "Calling using callback"); + mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INIT_FAILED); + } + } + } + + public void onServiceDisconnected(ComponentName className) + { + mEngineService = null; + } + }; + + private boolean loadLibrary(String AbsPath) + { + boolean result = true; + + Log.d(TAG, "Trying to load library " + AbsPath); + try + { + System.load(AbsPath); + Log.d(TAG, "OpenCV libs init was ok!"); + } + catch(UnsatisfiedLinkError e) + { + Log.d(TAG, "Cannot load library \"" + AbsPath + "\""); + e.printStackTrace(); + result &= false; + } + + return result; + } + + private boolean initOpenCVLibs(String Path, String Libs) + { + Log.d(TAG, "Trying to init OpenCV libs"); + if ((null != Path) && (Path.length() != 0)) + { + boolean result = true; + if ((null != Libs) && (Libs.length() != 0)) + { + Log.d(TAG, "Trying to load libs by dependency list"); + StringTokenizer splitter = new StringTokenizer(Libs, ";"); + while(splitter.hasMoreTokens()) + { + String AbsLibraryPath = Path + File.separator + splitter.nextToken(); + result &= loadLibrary(AbsLibraryPath); + } + } + else + { + // If the dependencies list is not defined or empty. + String AbsLibraryPath = Path + File.separator + "libopencv_java3.so"; + result &= loadLibrary(AbsLibraryPath); + } + + return result; + } + else + { + Log.d(TAG, "Library path \"" + Path + "\" is empty"); + return false; + } + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/BaseLoaderCallback.java b/openCVLibrary310/src/main/java/org/opencv/android/BaseLoaderCallback.java new file mode 100644 index 0000000..6d6a9b8 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/BaseLoaderCallback.java @@ -0,0 +1,141 @@ +package org.opencv.android; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.DialogInterface.OnClickListener; +import android.util.Log; + +/** + * Basic implementation of LoaderCallbackInterface. + */ +public abstract class BaseLoaderCallback implements LoaderCallbackInterface { + + public BaseLoaderCallback(Context AppContext) { + mAppContext = AppContext; + } + + public void onManagerConnected(int status) + { + switch (status) + { + /** OpenCV initialization was successful. **/ + case LoaderCallbackInterface.SUCCESS: + { + /** Application must override this method to handle successful library initialization. **/ + } break; + /** OpenCV loader can not start Google Play Market. **/ + case LoaderCallbackInterface.MARKET_ERROR: + { + Log.e(TAG, "Package installation failed!"); + AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); + MarketErrorMessage.setTitle("OpenCV Manager"); + MarketErrorMessage.setMessage("Package installation failed!"); + MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button + MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + finish(); + } + }); + MarketErrorMessage.show(); + } break; + /** Package installation has been canceled. **/ + case LoaderCallbackInterface.INSTALL_CANCELED: + { + Log.d(TAG, "OpenCV library instalation was canceled by user"); + finish(); + } break; + /** Application is incompatible with this version of OpenCV Manager. Possibly, a service update is required. **/ + case LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION: + { + Log.d(TAG, "OpenCV Manager Service is uncompatible with this app!"); + AlertDialog IncomatibilityMessage = new AlertDialog.Builder(mAppContext).create(); + IncomatibilityMessage.setTitle("OpenCV Manager"); + IncomatibilityMessage.setMessage("OpenCV Manager service is incompatible with this app. Try to update it via Google Play."); + IncomatibilityMessage.setCancelable(false); // This blocks the 'BACK' button + IncomatibilityMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + finish(); + } + }); + IncomatibilityMessage.show(); + } break; + /** Other status, i.e. INIT_FAILED. **/ + default: + { + Log.e(TAG, "OpenCV loading failed!"); + AlertDialog InitFailedDialog = new AlertDialog.Builder(mAppContext).create(); + InitFailedDialog.setTitle("OpenCV error"); + InitFailedDialog.setMessage("OpenCV was not initialised correctly. Application will be shut down"); + InitFailedDialog.setCancelable(false); // This blocks the 'BACK' button + InitFailedDialog.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new OnClickListener() { + + public void onClick(DialogInterface dialog, int which) { + finish(); + } + }); + + InitFailedDialog.show(); + } break; + } + } + + public void onPackageInstall(final int operation, final InstallCallbackInterface callback) + { + switch (operation) + { + case InstallCallbackInterface.NEW_INSTALLATION: + { + AlertDialog InstallMessage = new AlertDialog.Builder(mAppContext).create(); + InstallMessage.setTitle("Package not found"); + InstallMessage.setMessage(callback.getPackageName() + " package was not found! Try to install it?"); + InstallMessage.setCancelable(false); // This blocks the 'BACK' button + InstallMessage.setButton(AlertDialog.BUTTON_POSITIVE, "Yes", new OnClickListener() + { + public void onClick(DialogInterface dialog, int which) + { + callback.install(); + } + }); + + InstallMessage.setButton(AlertDialog.BUTTON_NEGATIVE, "No", new OnClickListener() { + + public void onClick(DialogInterface dialog, int which) + { + callback.cancel(); + } + }); + + InstallMessage.show(); + } break; + case InstallCallbackInterface.INSTALLATION_PROGRESS: + { + AlertDialog WaitMessage = new AlertDialog.Builder(mAppContext).create(); + WaitMessage.setTitle("OpenCV is not ready"); + WaitMessage.setMessage("Installation is in progress. Wait or exit?"); + WaitMessage.setCancelable(false); // This blocks the 'BACK' button + WaitMessage.setButton(AlertDialog.BUTTON_POSITIVE, "Wait", new OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + callback.wait_install(); + } + }); + WaitMessage.setButton(AlertDialog.BUTTON_NEGATIVE, "Exit", new OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + callback.cancel(); + } + }); + + WaitMessage.show(); + } break; + } + } + + void finish() + { + ((Activity) mAppContext).finish(); + } + + protected Context mAppContext; + private final static String TAG = "OpenCVLoader/BaseLoaderCallback"; +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/Camera2Renderer.java b/openCVLibrary310/src/main/java/org/opencv/android/Camera2Renderer.java new file mode 100644 index 0000000..4082140 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/Camera2Renderer.java @@ -0,0 +1,302 @@ +package org.opencv.android; + +import java.util.Arrays; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; +import android.annotation.TargetApi; +import android.content.Context; +import android.graphics.SurfaceTexture; +import android.hardware.camera2.CameraAccessException; +import android.hardware.camera2.CameraCaptureSession; +import android.hardware.camera2.CameraCharacteristics; +import android.hardware.camera2.CameraDevice; +import android.hardware.camera2.CameraManager; +import android.hardware.camera2.CaptureRequest; +import android.hardware.camera2.params.StreamConfigurationMap; +import android.os.Handler; +import android.os.HandlerThread; +import android.util.Log; +import android.util.Size; +import android.view.Surface; + +@TargetApi(21) +public class Camera2Renderer extends CameraGLRendererBase { + + protected final String LOGTAG = "Camera2Renderer"; + private CameraDevice mCameraDevice; + private CameraCaptureSession mCaptureSession; + private CaptureRequest.Builder mPreviewRequestBuilder; + private String mCameraID; + private Size mPreviewSize = new Size(-1, -1); + + private HandlerThread mBackgroundThread; + private Handler mBackgroundHandler; + private Semaphore mCameraOpenCloseLock = new Semaphore(1); + + Camera2Renderer(CameraGLSurfaceView view) { + super(view); + } + + @Override + protected void doStart() { + Log.d(LOGTAG, "doStart"); + startBackgroundThread(); + super.doStart(); + } + + + @Override + protected void doStop() { + Log.d(LOGTAG, "doStop"); + super.doStop(); + stopBackgroundThread(); + } + + boolean cacPreviewSize(final int width, final int height) { + Log.i(LOGTAG, "cacPreviewSize: "+width+"x"+height); + if(mCameraID == null) { + Log.e(LOGTAG, "Camera isn't initialized!"); + return false; + } + CameraManager manager = (CameraManager) mView.getContext() + .getSystemService(Context.CAMERA_SERVICE); + try { + CameraCharacteristics characteristics = manager + .getCameraCharacteristics(mCameraID); + StreamConfigurationMap map = characteristics + .get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); + int bestWidth = 0, bestHeight = 0; + float aspect = (float)width / height; + for (Size psize : map.getOutputSizes(SurfaceTexture.class)) { + int w = psize.getWidth(), h = psize.getHeight(); + Log.d(LOGTAG, "trying size: "+w+"x"+h); + if ( width >= w && height >= h && + bestWidth <= w && bestHeight <= h && + Math.abs(aspect - (float)w/h) < 0.2 ) { + bestWidth = w; + bestHeight = h; + } + } + Log.i(LOGTAG, "best size: "+bestWidth+"x"+bestHeight); + if( bestWidth == 0 || bestHeight == 0 || + mPreviewSize.getWidth() == bestWidth && + mPreviewSize.getHeight() == bestHeight ) + return false; + else { + mPreviewSize = new Size(bestWidth, bestHeight); + return true; + } + } catch (CameraAccessException e) { + Log.e(LOGTAG, "cacPreviewSize - Camera Access Exception"); + } catch (IllegalArgumentException e) { + Log.e(LOGTAG, "cacPreviewSize - Illegal Argument Exception"); + } catch (SecurityException e) { + Log.e(LOGTAG, "cacPreviewSize - Security Exception"); + } + return false; + } + + @Override + protected void openCamera(int id) { + Log.i(LOGTAG, "openCamera"); + CameraManager manager = (CameraManager) mView.getContext().getSystemService(Context.CAMERA_SERVICE); + try { + String camList[] = manager.getCameraIdList(); + if(camList.length == 0) { + Log.e(LOGTAG, "Error: camera isn't detected."); + return; + } + if(id == CameraBridgeViewBase.CAMERA_ID_ANY) { + mCameraID = camList[0]; + } else { + for (String cameraID : camList) { + CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraID); + if( id == CameraBridgeViewBase.CAMERA_ID_BACK && + characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_BACK || + id == CameraBridgeViewBase.CAMERA_ID_FRONT && + characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT) { + mCameraID = cameraID; + break; + } + } + } + if(mCameraID != null) { + if (!mCameraOpenCloseLock.tryAcquire(2500, TimeUnit.MILLISECONDS)) { + throw new RuntimeException( + "Time out waiting to lock camera opening."); + } + Log.i(LOGTAG, "Opening camera: " + mCameraID); + manager.openCamera(mCameraID, mStateCallback, mBackgroundHandler); + } + } catch (CameraAccessException e) { + Log.e(LOGTAG, "OpenCamera - Camera Access Exception"); + } catch (IllegalArgumentException e) { + Log.e(LOGTAG, "OpenCamera - Illegal Argument Exception"); + } catch (SecurityException e) { + Log.e(LOGTAG, "OpenCamera - Security Exception"); + } catch (InterruptedException e) { + Log.e(LOGTAG, "OpenCamera - Interrupted Exception"); + } + } + + @Override + protected void closeCamera() { + Log.i(LOGTAG, "closeCamera"); + try { + mCameraOpenCloseLock.acquire(); + if (null != mCaptureSession) { + mCaptureSession.close(); + mCaptureSession = null; + } + if (null != mCameraDevice) { + mCameraDevice.close(); + mCameraDevice = null; + } + } catch (InterruptedException e) { + throw new RuntimeException("Interrupted while trying to lock camera closing.", e); + } finally { + mCameraOpenCloseLock.release(); + } + } + + private final CameraDevice.StateCallback mStateCallback = new CameraDevice.StateCallback() { + + @Override + public void onOpened(CameraDevice cameraDevice) { + mCameraDevice = cameraDevice; + mCameraOpenCloseLock.release(); + createCameraPreviewSession(); + } + + @Override + public void onDisconnected(CameraDevice cameraDevice) { + cameraDevice.close(); + mCameraDevice = null; + mCameraOpenCloseLock.release(); + } + + @Override + public void onError(CameraDevice cameraDevice, int error) { + cameraDevice.close(); + mCameraDevice = null; + mCameraOpenCloseLock.release(); + } + + }; + + private void createCameraPreviewSession() { + int w=mPreviewSize.getWidth(), h=mPreviewSize.getHeight(); + Log.i(LOGTAG, "createCameraPreviewSession("+w+"x"+h+")"); + if(w<0 || h<0) + return; + try { + mCameraOpenCloseLock.acquire(); + if (null == mCameraDevice) { + mCameraOpenCloseLock.release(); + Log.e(LOGTAG, "createCameraPreviewSession: camera isn't opened"); + return; + } + if (null != mCaptureSession) { + mCameraOpenCloseLock.release(); + Log.e(LOGTAG, "createCameraPreviewSession: mCaptureSession is already started"); + return; + } + if(null == mSTexture) { + mCameraOpenCloseLock.release(); + Log.e(LOGTAG, "createCameraPreviewSession: preview SurfaceTexture is null"); + return; + } + mSTexture.setDefaultBufferSize(w, h); + + Surface surface = new Surface(mSTexture); + + mPreviewRequestBuilder = mCameraDevice + .createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); + mPreviewRequestBuilder.addTarget(surface); + + mCameraDevice.createCaptureSession(Arrays.asList(surface), + new CameraCaptureSession.StateCallback() { + @Override + public void onConfigured( CameraCaptureSession cameraCaptureSession) { + mCaptureSession = cameraCaptureSession; + try { + mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE); + mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH); + + mCaptureSession.setRepeatingRequest(mPreviewRequestBuilder.build(), null, mBackgroundHandler); + Log.i(LOGTAG, "CameraPreviewSession has been started"); + } catch (CameraAccessException e) { + Log.e(LOGTAG, "createCaptureSession failed"); + } + mCameraOpenCloseLock.release(); + } + + @Override + public void onConfigureFailed( + CameraCaptureSession cameraCaptureSession) { + Log.e(LOGTAG, "createCameraPreviewSession failed"); + mCameraOpenCloseLock.release(); + } + }, mBackgroundHandler); + } catch (CameraAccessException e) { + Log.e(LOGTAG, "createCameraPreviewSession"); + } catch (InterruptedException e) { + throw new RuntimeException( + "Interrupted while createCameraPreviewSession", e); + } + finally { + //mCameraOpenCloseLock.release(); + } + } + + private void startBackgroundThread() { + Log.i(LOGTAG, "startBackgroundThread"); + stopBackgroundThread(); + mBackgroundThread = new HandlerThread("CameraBackground"); + mBackgroundThread.start(); + mBackgroundHandler = new Handler(mBackgroundThread.getLooper()); + } + + private void stopBackgroundThread() { + Log.i(LOGTAG, "stopBackgroundThread"); + if(mBackgroundThread == null) + return; + mBackgroundThread.quitSafely(); + try { + mBackgroundThread.join(); + mBackgroundThread = null; + mBackgroundHandler = null; + } catch (InterruptedException e) { + Log.e(LOGTAG, "stopBackgroundThread"); + } + } + + @Override + protected void setCameraPreviewSize(int width, int height) { + Log.i(LOGTAG, "setCameraPreviewSize("+width+"x"+height+")"); + if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; + if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; + try { + mCameraOpenCloseLock.acquire(); + + boolean needReconfig = cacPreviewSize(width, height); + mCameraWidth = mPreviewSize.getWidth(); + mCameraHeight = mPreviewSize.getHeight(); + + if( !needReconfig ) { + mCameraOpenCloseLock.release(); + return; + } + if (null != mCaptureSession) { + Log.d(LOGTAG, "closing existing previewSession"); + mCaptureSession.close(); + mCaptureSession = null; + } + mCameraOpenCloseLock.release(); + createCameraPreviewSession(); + } catch (InterruptedException e) { + mCameraOpenCloseLock.release(); + throw new RuntimeException("Interrupted while setCameraPreviewSize.", e); + } + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/CameraBridgeViewBase.java b/openCVLibrary310/src/main/java/org/opencv/android/CameraBridgeViewBase.java new file mode 100644 index 0000000..14e0411 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/CameraBridgeViewBase.java @@ -0,0 +1,493 @@ +package org.opencv.android; + +import java.util.List; + +import org.opencv.R; +import org.opencv.core.Mat; +import org.opencv.core.Size; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Rect; +import android.util.AttributeSet; +import android.util.Log; +import android.view.SurfaceHolder; +import android.view.SurfaceView; + +/** + * This is a basic class, implementing the interaction with Camera and OpenCV library. + * The main responsibility of it - is to control when camera can be enabled, process the frame, + * call external listener to make any adjustments to the frame and then draw the resulting + * frame to the screen. + * The clients shall implement CvCameraViewListener. + */ +public abstract class CameraBridgeViewBase extends SurfaceView implements SurfaceHolder.Callback { + + private static final String TAG = "CameraBridge"; + private static final int MAX_UNSPECIFIED = -1; + private static final int STOPPED = 0; + private static final int STARTED = 1; + + private int mState = STOPPED; + private Bitmap mCacheBitmap; + private CvCameraViewListener2 mListener; + private boolean mSurfaceExist; + private Object mSyncObject = new Object(); + + protected int mFrameWidth; + protected int mFrameHeight; + protected int mMaxHeight; + protected int mMaxWidth; + protected float mScale = 0; + protected int mPreviewFormat = RGBA; + protected int mCameraIndex = CAMERA_ID_ANY; + protected boolean mEnabled; + protected FpsMeter mFpsMeter = null; + + public static final int CAMERA_ID_ANY = -1; + public static final int CAMERA_ID_BACK = 99; + public static final int CAMERA_ID_FRONT = 98; + public static final int RGBA = 1; + public static final int GRAY = 2; + + public CameraBridgeViewBase(Context context, int cameraId) { + super(context); + mCameraIndex = cameraId; + getHolder().addCallback(this); + mMaxWidth = MAX_UNSPECIFIED; + mMaxHeight = MAX_UNSPECIFIED; + } + + public CameraBridgeViewBase(Context context, AttributeSet attrs) { + super(context, attrs); + + int count = attrs.getAttributeCount(); + Log.d(TAG, "Attr count: " + Integer.valueOf(count)); + + TypedArray styledAttrs = getContext().obtainStyledAttributes(attrs, R.styleable.CameraBridgeViewBase); + if (styledAttrs.getBoolean(R.styleable.CameraBridgeViewBase_show_fps, false)) + enableFpsMeter(); + + mCameraIndex = styledAttrs.getInt(R.styleable.CameraBridgeViewBase_camera_id, -1); + + getHolder().addCallback(this); + mMaxWidth = MAX_UNSPECIFIED; + mMaxHeight = MAX_UNSPECIFIED; + styledAttrs.recycle(); + } + + /** + * Sets the camera index + * @param cameraIndex new camera index + */ + public void setCameraIndex(int cameraIndex) { + this.mCameraIndex = cameraIndex; + } + + public interface CvCameraViewListener { + /** + * This method is invoked when camera preview has started. After this method is invoked + * the frames will start to be delivered to client via the onCameraFrame() callback. + * @param width - the width of the frames that will be delivered + * @param height - the height of the frames that will be delivered + */ + public void onCameraViewStarted(int width, int height); + + /** + * This method is invoked when camera preview has been stopped for some reason. + * No frames will be delivered via onCameraFrame() callback after this method is called. + */ + public void onCameraViewStopped(); + + /** + * This method is invoked when delivery of the frame needs to be done. + * The returned values - is a modified frame which needs to be displayed on the screen. + * TODO: pass the parameters specifying the format of the frame (BPP, YUV or RGB and etc) + */ + public Mat onCameraFrame(Mat inputFrame); + } + + public interface CvCameraViewListener2 { + /** + * This method is invoked when camera preview has started. After this method is invoked + * the frames will start to be delivered to client via the onCameraFrame() callback. + * @param width - the width of the frames that will be delivered + * @param height - the height of the frames that will be delivered + */ + public void onCameraViewStarted(int width, int height); + + /** + * This method is invoked when camera preview has been stopped for some reason. + * No frames will be delivered via onCameraFrame() callback after this method is called. + */ + public void onCameraViewStopped(); + + /** + * This method is invoked when delivery of the frame needs to be done. + * The returned values - is a modified frame which needs to be displayed on the screen. + * TODO: pass the parameters specifying the format of the frame (BPP, YUV or RGB and etc) + */ + public Mat onCameraFrame(CvCameraViewFrame inputFrame); + }; + + protected class CvCameraViewListenerAdapter implements CvCameraViewListener2 { + public CvCameraViewListenerAdapter(CvCameraViewListener oldStypeListener) { + mOldStyleListener = oldStypeListener; + } + + public void onCameraViewStarted(int width, int height) { + mOldStyleListener.onCameraViewStarted(width, height); + } + + public void onCameraViewStopped() { + mOldStyleListener.onCameraViewStopped(); + } + + public Mat onCameraFrame(CvCameraViewFrame inputFrame) { + Mat result = null; + switch (mPreviewFormat) { + case RGBA: + result = mOldStyleListener.onCameraFrame(inputFrame.rgba()); + break; + case GRAY: + result = mOldStyleListener.onCameraFrame(inputFrame.gray()); + break; + default: + Log.e(TAG, "Invalid frame format! Only RGBA and Gray Scale are supported!"); + }; + + return result; + } + + public void setFrameFormat(int format) { + mPreviewFormat = format; + } + + private int mPreviewFormat = RGBA; + private CvCameraViewListener mOldStyleListener; + }; + + /** + * This class interface is abstract representation of single frame from camera for onCameraFrame callback + * Attention: Do not use objects, that represents this interface out of onCameraFrame callback! + */ + public interface CvCameraViewFrame { + + /** + * This method returns RGBA Mat with frame + */ + public Mat rgba(); + + /** + * This method returns single channel gray scale Mat with frame + */ + public Mat gray(); + }; + + public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) { + Log.d(TAG, "call surfaceChanged event"); + synchronized(mSyncObject) { + if (!mSurfaceExist) { + mSurfaceExist = true; + checkCurrentState(); + } else { + /** Surface changed. We need to stop camera and restart with new parameters */ + /* Pretend that old surface has been destroyed */ + mSurfaceExist = false; + checkCurrentState(); + /* Now use new surface. Say we have it now */ + mSurfaceExist = true; + checkCurrentState(); + } + } + } + + public void surfaceCreated(SurfaceHolder holder) { + /* Do nothing. Wait until surfaceChanged delivered */ + } + + public void surfaceDestroyed(SurfaceHolder holder) { + synchronized(mSyncObject) { + mSurfaceExist = false; + checkCurrentState(); + } + } + + /** + * This method is provided for clients, so they can enable the camera connection. + * The actual onCameraViewStarted callback will be delivered only after both this method is called and surface is available + */ + public void enableView() { + synchronized(mSyncObject) { + mEnabled = true; + checkCurrentState(); + } + } + + /** + * This method is provided for clients, so they can disable camera connection and stop + * the delivery of frames even though the surface view itself is not destroyed and still stays on the scren + */ + public void disableView() { + synchronized(mSyncObject) { + mEnabled = false; + checkCurrentState(); + } + } + + /** + * This method enables label with fps value on the screen + */ + public void enableFpsMeter() { + if (mFpsMeter == null) { + mFpsMeter = new FpsMeter(); + mFpsMeter.setResolution(mFrameWidth, mFrameHeight); + } + } + + public void disableFpsMeter() { + mFpsMeter = null; + } + + /** + * + * @param listener + */ + + public void setCvCameraViewListener(CvCameraViewListener2 listener) { + mListener = listener; + } + + public void setCvCameraViewListener(CvCameraViewListener listener) { + CvCameraViewListenerAdapter adapter = new CvCameraViewListenerAdapter(listener); + adapter.setFrameFormat(mPreviewFormat); + mListener = adapter; + } + + /** + * This method sets the maximum size that camera frame is allowed to be. When selecting + * size - the biggest size which less or equal the size set will be selected. + * As an example - we set setMaxFrameSize(200,200) and we have 176x152 and 320x240 sizes. The + * preview frame will be selected with 176x152 size. + * This method is useful when need to restrict the size of preview frame for some reason (for example for video recording) + * @param maxWidth - the maximum width allowed for camera frame. + * @param maxHeight - the maximum height allowed for camera frame + */ + public void setMaxFrameSize(int maxWidth, int maxHeight) { + mMaxWidth = maxWidth; + mMaxHeight = maxHeight; + } + + public void SetCaptureFormat(int format) + { + mPreviewFormat = format; + if (mListener instanceof CvCameraViewListenerAdapter) { + CvCameraViewListenerAdapter adapter = (CvCameraViewListenerAdapter) mListener; + adapter.setFrameFormat(mPreviewFormat); + } + } + + /** + * Called when mSyncObject lock is held + */ + private void checkCurrentState() { + Log.d(TAG, "call checkCurrentState"); + int targetState; + + if (mEnabled && mSurfaceExist && getVisibility() == VISIBLE) { + targetState = STARTED; + } else { + targetState = STOPPED; + } + + if (targetState != mState) { + /* The state change detected. Need to exit the current state and enter target state */ + processExitState(mState); + mState = targetState; + processEnterState(mState); + } + } + + private void processEnterState(int state) { + Log.d(TAG, "call processEnterState: " + state); + switch(state) { + case STARTED: + onEnterStartedState(); + if (mListener != null) { + mListener.onCameraViewStarted(mFrameWidth, mFrameHeight); + } + break; + case STOPPED: + onEnterStoppedState(); + if (mListener != null) { + mListener.onCameraViewStopped(); + } + break; + }; + } + + private void processExitState(int state) { + Log.d(TAG, "call processExitState: " + state); + switch(state) { + case STARTED: + onExitStartedState(); + break; + case STOPPED: + onExitStoppedState(); + break; + }; + } + + private void onEnterStoppedState() { + /* nothing to do */ + } + + private void onExitStoppedState() { + /* nothing to do */ + } + + // NOTE: The order of bitmap constructor and camera connection is important for android 4.1.x + // Bitmap must be constructed before surface + private void onEnterStartedState() { + Log.d(TAG, "call onEnterStartedState"); + /* Connect camera */ + if (!connectCamera(getWidth(), getHeight())) { + AlertDialog ad = new AlertDialog.Builder(getContext()).create(); + ad.setCancelable(false); // This blocks the 'BACK' button + ad.setMessage("It seems that you device does not support camera (or it is locked). Application will be closed."); + ad.setButton(DialogInterface.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + ((Activity) getContext()).finish(); + } + }); + ad.show(); + + } + } + + private void onExitStartedState() { + disconnectCamera(); + if (mCacheBitmap != null) { + mCacheBitmap.recycle(); + } + } + + /** + * This method shall be called by the subclasses when they have valid + * object and want it to be delivered to external client (via callback) and + * then displayed on the screen. + * @param frame - the current frame to be delivered + */ + protected void deliverAndDrawFrame(CvCameraViewFrame frame) { + Mat modified; + + if (mListener != null) { + modified = mListener.onCameraFrame(frame); + } else { + modified = frame.rgba(); + } + + boolean bmpValid = true; + if (modified != null) { + try { + Utils.matToBitmap(modified, mCacheBitmap); + } catch(Exception e) { + Log.e(TAG, "Mat type: " + modified); + Log.e(TAG, "Bitmap type: " + mCacheBitmap.getWidth() + "*" + mCacheBitmap.getHeight()); + Log.e(TAG, "Utils.matToBitmap() throws an exception: " + e.getMessage()); + bmpValid = false; + } + } + + if (bmpValid && mCacheBitmap != null) { + Canvas canvas = getHolder().lockCanvas(); + if (canvas != null) { + canvas.drawColor(0, android.graphics.PorterDuff.Mode.CLEAR); + Log.d(TAG, "mStretch value: " + mScale); + + if (mScale != 0) { + canvas.drawBitmap(mCacheBitmap, new Rect(0,0,mCacheBitmap.getWidth(), mCacheBitmap.getHeight()), + new Rect((int)((canvas.getWidth() - mScale*mCacheBitmap.getWidth()) / 2), + (int)((canvas.getHeight() - mScale*mCacheBitmap.getHeight()) / 2), + (int)((canvas.getWidth() - mScale*mCacheBitmap.getWidth()) / 2 + mScale*mCacheBitmap.getWidth()), + (int)((canvas.getHeight() - mScale*mCacheBitmap.getHeight()) / 2 + mScale*mCacheBitmap.getHeight())), null); + } else { + canvas.drawBitmap(mCacheBitmap, new Rect(0,0,mCacheBitmap.getWidth(), mCacheBitmap.getHeight()), + new Rect((canvas.getWidth() - mCacheBitmap.getWidth()) / 2, + (canvas.getHeight() - mCacheBitmap.getHeight()) / 2, + (canvas.getWidth() - mCacheBitmap.getWidth()) / 2 + mCacheBitmap.getWidth(), + (canvas.getHeight() - mCacheBitmap.getHeight()) / 2 + mCacheBitmap.getHeight()), null); + } + + if (mFpsMeter != null) { + mFpsMeter.measure(); + mFpsMeter.draw(canvas, 20, 30); + } + getHolder().unlockCanvasAndPost(canvas); + } + } + } + + /** + * This method is invoked shall perform concrete operation to initialize the camera. + * CONTRACT: as a result of this method variables mFrameWidth and mFrameHeight MUST be + * initialized with the size of the Camera frames that will be delivered to external processor. + * @param width - the width of this SurfaceView + * @param height - the height of this SurfaceView + */ + protected abstract boolean connectCamera(int width, int height); + + /** + * Disconnects and release the particular camera object being connected to this surface view. + * Called when syncObject lock is held + */ + protected abstract void disconnectCamera(); + + // NOTE: On Android 4.1.x the function must be called before SurfaceTexture constructor! + protected void AllocateCache() + { + mCacheBitmap = Bitmap.createBitmap(mFrameWidth, mFrameHeight, Bitmap.Config.ARGB_8888); + } + + public interface ListItemAccessor { + public int getWidth(Object obj); + public int getHeight(Object obj); + }; + + /** + * This helper method can be called by subclasses to select camera preview size. + * It goes over the list of the supported preview sizes and selects the maximum one which + * fits both values set via setMaxFrameSize() and surface frame allocated for this view + * @param supportedSizes + * @param surfaceWidth + * @param surfaceHeight + * @return optimal frame size + */ + protected Size calculateCameraFrameSize(List supportedSizes, ListItemAccessor accessor, int surfaceWidth, int surfaceHeight) { + int calcWidth = 0; + int calcHeight = 0; + + int maxAllowedWidth = (mMaxWidth != MAX_UNSPECIFIED && mMaxWidth < surfaceWidth)? mMaxWidth : surfaceWidth; + int maxAllowedHeight = (mMaxHeight != MAX_UNSPECIFIED && mMaxHeight < surfaceHeight)? mMaxHeight : surfaceHeight; + + for (Object size : supportedSizes) { + int width = accessor.getWidth(size); + int height = accessor.getHeight(size); + + if (width <= maxAllowedWidth && height <= maxAllowedHeight) { + if (width >= calcWidth && height >= calcHeight) { + calcWidth = (int) width; + calcHeight = (int) height; + } + } + } + + return new Size(calcWidth, calcHeight); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/CameraGLRendererBase.java b/openCVLibrary310/src/main/java/org/opencv/android/CameraGLRendererBase.java new file mode 100644 index 0000000..60c37c3 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/CameraGLRendererBase.java @@ -0,0 +1,440 @@ +package org.opencv.android; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +import org.opencv.android.CameraGLSurfaceView.CameraTextureListener; + +import android.annotation.TargetApi; +import android.graphics.SurfaceTexture; +import android.opengl.GLES11Ext; +import android.opengl.GLES20; +import android.opengl.GLSurfaceView; +import android.util.Log; +import android.view.View; + +@TargetApi(15) +public abstract class CameraGLRendererBase implements GLSurfaceView.Renderer, SurfaceTexture.OnFrameAvailableListener { + + protected final String LOGTAG = "CameraGLRendererBase"; + + // shaders + private final String vss = "" + + "attribute vec2 vPosition;\n" + + "attribute vec2 vTexCoord;\n" + "varying vec2 texCoord;\n" + + "void main() {\n" + " texCoord = vTexCoord;\n" + + " gl_Position = vec4 ( vPosition.x, vPosition.y, 0.0, 1.0 );\n" + + "}"; + + private final String fssOES = "" + + "#extension GL_OES_EGL_image_external : require\n" + + "precision mediump float;\n" + + "uniform samplerExternalOES sTexture;\n" + + "varying vec2 texCoord;\n" + + "void main() {\n" + + " gl_FragColor = texture2D(sTexture,texCoord);\n" + "}"; + + private final String fss2D = "" + + "precision mediump float;\n" + + "uniform sampler2D sTexture;\n" + + "varying vec2 texCoord;\n" + + "void main() {\n" + + " gl_FragColor = texture2D(sTexture,texCoord);\n" + "}"; + + // coord-s + private final float vertices[] = { + -1, -1, + -1, 1, + 1, -1, + 1, 1 }; + private final float texCoordOES[] = { + 0, 1, + 0, 0, + 1, 1, + 1, 0 }; + private final float texCoord2D[] = { + 0, 0, + 0, 1, + 1, 0, + 1, 1 }; + + private int[] texCamera = {0}, texFBO = {0}, texDraw = {0}; + private int[] FBO = {0}; + private int progOES = -1, prog2D = -1; + private int vPosOES, vTCOES, vPos2D, vTC2D; + + private FloatBuffer vert, texOES, tex2D; + + protected int mCameraWidth = -1, mCameraHeight = -1; + protected int mFBOWidth = -1, mFBOHeight = -1; + protected int mMaxCameraWidth = -1, mMaxCameraHeight = -1; + protected int mCameraIndex = CameraBridgeViewBase.CAMERA_ID_ANY; + + protected SurfaceTexture mSTexture; + + protected boolean mHaveSurface = false; + protected boolean mHaveFBO = false; + protected boolean mUpdateST = false; + protected boolean mEnabled = true; + protected boolean mIsStarted = false; + + protected CameraGLSurfaceView mView; + + protected abstract void openCamera(int id); + protected abstract void closeCamera(); + protected abstract void setCameraPreviewSize(int width, int height); // updates mCameraWidth & mCameraHeight + + public CameraGLRendererBase(CameraGLSurfaceView view) { + mView = view; + int bytes = vertices.length * Float.SIZE / Byte.SIZE; + vert = ByteBuffer.allocateDirect(bytes).order(ByteOrder.nativeOrder()).asFloatBuffer(); + texOES = ByteBuffer.allocateDirect(bytes).order(ByteOrder.nativeOrder()).asFloatBuffer(); + tex2D = ByteBuffer.allocateDirect(bytes).order(ByteOrder.nativeOrder()).asFloatBuffer(); + vert.put(vertices).position(0); + texOES.put(texCoordOES).position(0); + tex2D.put(texCoord2D).position(0); + } + + @Override + public synchronized void onFrameAvailable(SurfaceTexture surfaceTexture) { + //Log.i(LOGTAG, "onFrameAvailable"); + mUpdateST = true; + mView.requestRender(); + } + + @Override + public void onDrawFrame(GL10 gl) { + //Log.i(LOGTAG, "onDrawFrame start"); + + if (!mHaveFBO) + return; + + synchronized(this) { + if (mUpdateST) { + mSTexture.updateTexImage(); + mUpdateST = false; + } + + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); + + CameraTextureListener texListener = mView.getCameraTextureListener(); + if(texListener != null) { + //Log.d(LOGTAG, "haveUserCallback"); + // texCamera(OES) -> texFBO + drawTex(texCamera[0], true, FBO[0]); + + // call user code (texFBO -> texDraw) + boolean modified = texListener.onCameraTexture(texFBO[0], texDraw[0], mCameraWidth, mCameraHeight); + + if(modified) { + // texDraw -> screen + drawTex(texDraw[0], false, 0); + } else { + // texFBO -> screen + drawTex(texFBO[0], false, 0); + } + } else { + Log.d(LOGTAG, "texCamera(OES) -> screen"); + // texCamera(OES) -> screen + drawTex(texCamera[0], true, 0); + } + //Log.i(LOGTAG, "onDrawFrame end"); + } + } + + @Override + public void onSurfaceChanged(GL10 gl, int surfaceWidth, int surfaceHeight) { + Log.i(LOGTAG, "onSurfaceChanged("+surfaceWidth+"x"+surfaceHeight+")"); + mHaveSurface = true; + updateState(); + setPreviewSize(surfaceWidth, surfaceHeight); + } + + @Override + public void onSurfaceCreated(GL10 gl, EGLConfig config) { + Log.i(LOGTAG, "onSurfaceCreated"); + initShaders(); + } + + private void initShaders() { + String strGLVersion = GLES20.glGetString(GLES20.GL_VERSION); + if (strGLVersion != null) + Log.i(LOGTAG, "OpenGL ES version: " + strGLVersion); + + GLES20.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); + + progOES = loadShader(vss, fssOES); + vPosOES = GLES20.glGetAttribLocation(progOES, "vPosition"); + vTCOES = GLES20.glGetAttribLocation(progOES, "vTexCoord"); + GLES20.glEnableVertexAttribArray(vPosOES); + GLES20.glEnableVertexAttribArray(vTCOES); + + prog2D = loadShader(vss, fss2D); + vPos2D = GLES20.glGetAttribLocation(prog2D, "vPosition"); + vTC2D = GLES20.glGetAttribLocation(prog2D, "vTexCoord"); + GLES20.glEnableVertexAttribArray(vPos2D); + GLES20.glEnableVertexAttribArray(vTC2D); + } + + private void initSurfaceTexture() { + Log.d(LOGTAG, "initSurfaceTexture"); + deleteSurfaceTexture(); + initTexOES(texCamera); + mSTexture = new SurfaceTexture(texCamera[0]); + mSTexture.setOnFrameAvailableListener(this); + } + + private void deleteSurfaceTexture() { + Log.d(LOGTAG, "deleteSurfaceTexture"); + if(mSTexture != null) { + mSTexture.release(); + mSTexture = null; + deleteTex(texCamera); + } + } + + private void initTexOES(int[] tex) { + if(tex.length == 1) { + GLES20.glGenTextures(1, tex, 0); + GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, tex[0]); + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); + } + } + + private static void deleteTex(int[] tex) { + if(tex.length == 1) { + GLES20.glDeleteTextures(1, tex, 0); + } + } + + private static int loadShader(String vss, String fss) { + Log.d("CameraGLRendererBase", "loadShader"); + int vshader = GLES20.glCreateShader(GLES20.GL_VERTEX_SHADER); + GLES20.glShaderSource(vshader, vss); + GLES20.glCompileShader(vshader); + int[] status = new int[1]; + GLES20.glGetShaderiv(vshader, GLES20.GL_COMPILE_STATUS, status, 0); + if (status[0] == 0) { + Log.e("CameraGLRendererBase", "Could not compile vertex shader: "+GLES20.glGetShaderInfoLog(vshader)); + GLES20.glDeleteShader(vshader); + vshader = 0; + return 0; + } + + int fshader = GLES20.glCreateShader(GLES20.GL_FRAGMENT_SHADER); + GLES20.glShaderSource(fshader, fss); + GLES20.glCompileShader(fshader); + GLES20.glGetShaderiv(fshader, GLES20.GL_COMPILE_STATUS, status, 0); + if (status[0] == 0) { + Log.e("CameraGLRendererBase", "Could not compile fragment shader:"+GLES20.glGetShaderInfoLog(fshader)); + GLES20.glDeleteShader(vshader); + GLES20.glDeleteShader(fshader); + fshader = 0; + return 0; + } + + int program = GLES20.glCreateProgram(); + GLES20.glAttachShader(program, vshader); + GLES20.glAttachShader(program, fshader); + GLES20.glLinkProgram(program); + GLES20.glDeleteShader(vshader); + GLES20.glDeleteShader(fshader); + GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, status, 0); + if (status[0] == 0) { + Log.e("CameraGLRendererBase", "Could not link shader program: "+GLES20.glGetProgramInfoLog(program)); + program = 0; + return 0; + } + GLES20.glValidateProgram(program); + GLES20.glGetProgramiv(program, GLES20.GL_VALIDATE_STATUS, status, 0); + if (status[0] == 0) + { + Log.e("CameraGLRendererBase", "Shader program validation error: "+GLES20.glGetProgramInfoLog(program)); + GLES20.glDeleteProgram(program); + program = 0; + return 0; + } + + Log.d("CameraGLRendererBase", "Shader program is built OK"); + + return program; + } + + private void deleteFBO() + { + Log.d(LOGTAG, "deleteFBO("+mFBOWidth+"x"+mFBOHeight+")"); + GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); + GLES20.glDeleteFramebuffers(1, FBO, 0); + + deleteTex(texFBO); + deleteTex(texDraw); + mFBOWidth = mFBOHeight = 0; + } + + private void initFBO(int width, int height) + { + Log.d(LOGTAG, "initFBO("+width+"x"+height+")"); + + deleteFBO(); + + GLES20.glGenTextures(1, texDraw, 0); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texDraw[0]); + GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); + + GLES20.glGenTextures(1, texFBO, 0); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texFBO[0]); + GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); + + //int hFBO; + GLES20.glGenFramebuffers(1, FBO, 0); + GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, FBO[0]); + GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, texFBO[0], 0); + Log.d(LOGTAG, "initFBO error status: " + GLES20.glGetError()); + + int FBOstatus = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER); + if (FBOstatus != GLES20.GL_FRAMEBUFFER_COMPLETE) + Log.e(LOGTAG, "initFBO failed, status: " + FBOstatus); + + mFBOWidth = width; + mFBOHeight = height; + } + + // draw texture to FBO or to screen if fbo == 0 + private void drawTex(int tex, boolean isOES, int fbo) + { + GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fbo); + + if(fbo == 0) + GLES20.glViewport(0, 0, mView.getWidth(), mView.getHeight()); + else + GLES20.glViewport(0, 0, mFBOWidth, mFBOHeight); + + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); + + if(isOES) { + GLES20.glUseProgram(progOES); + GLES20.glVertexAttribPointer(vPosOES, 2, GLES20.GL_FLOAT, false, 4*2, vert); + GLES20.glVertexAttribPointer(vTCOES, 2, GLES20.GL_FLOAT, false, 4*2, texOES); + } else { + GLES20.glUseProgram(prog2D); + GLES20.glVertexAttribPointer(vPos2D, 2, GLES20.GL_FLOAT, false, 4*2, vert); + GLES20.glVertexAttribPointer(vTC2D, 2, GLES20.GL_FLOAT, false, 4*2, tex2D); + } + + GLES20.glActiveTexture(GLES20.GL_TEXTURE0); + + if(isOES) { + GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, tex); + GLES20.glUniform1i(GLES20.glGetUniformLocation(progOES, "sTexture"), 0); + } else { + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tex); + GLES20.glUniform1i(GLES20.glGetUniformLocation(prog2D, "sTexture"), 0); + } + + GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); + GLES20.glFlush(); + } + + public synchronized void enableView() { + Log.d(LOGTAG, "enableView"); + mEnabled = true; + updateState(); + } + + public synchronized void disableView() { + Log.d(LOGTAG, "disableView"); + mEnabled = false; + updateState(); + } + + protected void updateState() { + Log.d(LOGTAG, "updateState"); + Log.d(LOGTAG, "mEnabled="+mEnabled+", mHaveSurface="+mHaveSurface); + boolean willStart = mEnabled && mHaveSurface && mView.getVisibility() == View.VISIBLE; + if (willStart != mIsStarted) { + if(willStart) doStart(); + else doStop(); + } else { + Log.d(LOGTAG, "keeping State unchanged"); + } + Log.d(LOGTAG, "updateState end"); + } + + protected synchronized void doStart() { + Log.d(LOGTAG, "doStart"); + initSurfaceTexture(); + openCamera(mCameraIndex); + mIsStarted = true; + if(mCameraWidth>0 && mCameraHeight>0) + setPreviewSize(mCameraWidth, mCameraHeight); // start preview and call listener.onCameraViewStarted() + } + + + protected void doStop() { + Log.d(LOGTAG, "doStop"); + synchronized(this) { + mUpdateST = false; + mIsStarted = false; + mHaveFBO = false; + closeCamera(); + deleteSurfaceTexture(); + } + CameraTextureListener listener = mView.getCameraTextureListener(); + if(listener != null) listener.onCameraViewStopped(); + + } + + protected void setPreviewSize(int width, int height) { + synchronized(this) { + mHaveFBO = false; + mCameraWidth = width; + mCameraHeight = height; + setCameraPreviewSize(width, height); // can change mCameraWidth & mCameraHeight + initFBO(mCameraWidth, mCameraHeight); + mHaveFBO = true; + } + + CameraTextureListener listener = mView.getCameraTextureListener(); + if(listener != null) listener.onCameraViewStarted(mCameraWidth, mCameraHeight); + } + + public void setCameraIndex(int cameraIndex) { + disableView(); + mCameraIndex = cameraIndex; + enableView(); + } + + public void setMaxCameraPreviewSize(int maxWidth, int maxHeight) { + disableView(); + mMaxCameraWidth = maxWidth; + mMaxCameraHeight = maxHeight; + enableView(); + } + + public void onResume() { + Log.i(LOGTAG, "onResume"); + } + + public void onPause() { + Log.i(LOGTAG, "onPause"); + mHaveSurface = false; + updateState(); + mCameraWidth = mCameraHeight = -1; + } + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/CameraGLSurfaceView.java b/openCVLibrary310/src/main/java/org/opencv/android/CameraGLSurfaceView.java new file mode 100644 index 0000000..05f950b --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/CameraGLSurfaceView.java @@ -0,0 +1,119 @@ +package org.opencv.android; + +import org.opencv.R; + +import android.content.Context; +import android.content.res.TypedArray; +import android.opengl.GLSurfaceView; +import android.util.AttributeSet; +import android.util.Log; +import android.view.SurfaceHolder; + +public class CameraGLSurfaceView extends GLSurfaceView { + + private static final String LOGTAG = "CameraGLSurfaceView"; + + public interface CameraTextureListener { + /** + * This method is invoked when camera preview has started. After this method is invoked + * the frames will start to be delivered to client via the onCameraFrame() callback. + * @param width - the width of the frames that will be delivered + * @param height - the height of the frames that will be delivered + */ + public void onCameraViewStarted(int width, int height); + + /** + * This method is invoked when camera preview has been stopped for some reason. + * No frames will be delivered via onCameraFrame() callback after this method is called. + */ + public void onCameraViewStopped(); + + /** + * This method is invoked when a new preview frame from Camera is ready. + * @param texIn - the OpenGL texture ID that contains frame in RGBA format + * @param texOut - the OpenGL texture ID that can be used to store modified frame image t display + * @param width - the width of the frame + * @param height - the height of the frame + * @return `true` if `texOut` should be displayed, `false` - to show `texIn` + */ + public boolean onCameraTexture(int texIn, int texOut, int width, int height); + }; + + private CameraTextureListener mTexListener; + private CameraGLRendererBase mRenderer; + + public CameraGLSurfaceView(Context context, AttributeSet attrs) { + super(context, attrs); + + TypedArray styledAttrs = getContext().obtainStyledAttributes(attrs, R.styleable.CameraBridgeViewBase); + int cameraIndex = styledAttrs.getInt(R.styleable.CameraBridgeViewBase_camera_id, -1); + styledAttrs.recycle(); + + if(android.os.Build.VERSION.SDK_INT >= 21) + mRenderer = new Camera2Renderer(this); + else + mRenderer = new CameraRenderer(this); + + setCameraIndex(cameraIndex); + + setEGLContextClientVersion(2); + setRenderer(mRenderer); + setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); + } + + public void setCameraTextureListener(CameraTextureListener texListener) + { + mTexListener = texListener; + } + + public CameraTextureListener getCameraTextureListener() + { + return mTexListener; + } + + public void setCameraIndex(int cameraIndex) { + mRenderer.setCameraIndex(cameraIndex); + } + + public void setMaxCameraPreviewSize(int maxWidth, int maxHeight) { + mRenderer.setMaxCameraPreviewSize(maxWidth, maxHeight); + } + + @Override + public void surfaceCreated(SurfaceHolder holder) { + super.surfaceCreated(holder); + } + + @Override + public void surfaceDestroyed(SurfaceHolder holder) { + mRenderer.mHaveSurface = false; + super.surfaceDestroyed(holder); + } + + @Override + public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { + super.surfaceChanged(holder, format, w, h); + } + + @Override + public void onResume() { + Log.i(LOGTAG, "onResume"); + super.onResume(); + mRenderer.onResume(); + } + + @Override + public void onPause() { + Log.i(LOGTAG, "onPause"); + mRenderer.onPause(); + super.onPause(); + } + + public void enableView() { + mRenderer.enableView(); + } + + public void disableView() { + mRenderer.disableView(); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/CameraRenderer.java b/openCVLibrary310/src/main/java/org/opencv/android/CameraRenderer.java new file mode 100644 index 0000000..2d668ff --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/CameraRenderer.java @@ -0,0 +1,166 @@ +package org.opencv.android; + +import java.io.IOException; +import java.util.List; + +import android.annotation.TargetApi; +import android.hardware.Camera; +import android.hardware.Camera.Size; +import android.os.Build; +import android.util.Log; + +@TargetApi(15) +@SuppressWarnings("deprecation") +public class CameraRenderer extends CameraGLRendererBase { + + public static final String LOGTAG = "CameraRenderer"; + + private Camera mCamera; + private boolean mPreviewStarted = false; + + CameraRenderer(CameraGLSurfaceView view) { + super(view); + } + + @Override + protected synchronized void closeCamera() { + Log.i(LOGTAG, "closeCamera"); + if(mCamera != null) { + mCamera.stopPreview(); + mPreviewStarted = false; + mCamera.release(); + mCamera = null; + } + } + + @Override + protected synchronized void openCamera(int id) { + Log.i(LOGTAG, "openCamera"); + closeCamera(); + if (id == CameraBridgeViewBase.CAMERA_ID_ANY) { + Log.d(LOGTAG, "Trying to open camera with old open()"); + try { + mCamera = Camera.open(); + } + catch (Exception e){ + Log.e(LOGTAG, "Camera is not available (in use or does not exist): " + e.getLocalizedMessage()); + } + + if(mCamera == null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + boolean connected = false; + for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) { + Log.d(LOGTAG, "Trying to open camera with new open(" + camIdx + ")"); + try { + mCamera = Camera.open(camIdx); + connected = true; + } catch (RuntimeException e) { + Log.e(LOGTAG, "Camera #" + camIdx + "failed to open: " + e.getLocalizedMessage()); + } + if (connected) break; + } + } + } else { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + int localCameraIndex = mCameraIndex; + if (mCameraIndex == CameraBridgeViewBase.CAMERA_ID_BACK) { + Log.i(LOGTAG, "Trying to open BACK camera"); + Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); + for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) { + Camera.getCameraInfo( camIdx, cameraInfo ); + if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) { + localCameraIndex = camIdx; + break; + } + } + } else if (mCameraIndex == CameraBridgeViewBase.CAMERA_ID_FRONT) { + Log.i(LOGTAG, "Trying to open FRONT camera"); + Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); + for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) { + Camera.getCameraInfo( camIdx, cameraInfo ); + if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { + localCameraIndex = camIdx; + break; + } + } + } + if (localCameraIndex == CameraBridgeViewBase.CAMERA_ID_BACK) { + Log.e(LOGTAG, "Back camera not found!"); + } else if (localCameraIndex == CameraBridgeViewBase.CAMERA_ID_FRONT) { + Log.e(LOGTAG, "Front camera not found!"); + } else { + Log.d(LOGTAG, "Trying to open camera with new open(" + localCameraIndex + ")"); + try { + mCamera = Camera.open(localCameraIndex); + } catch (RuntimeException e) { + Log.e(LOGTAG, "Camera #" + localCameraIndex + "failed to open: " + e.getLocalizedMessage()); + } + } + } + } + if(mCamera == null) { + Log.e(LOGTAG, "Error: can't open camera"); + return; + } + Camera.Parameters params = mCamera.getParameters(); + List FocusModes = params.getSupportedFocusModes(); + if (FocusModes != null && FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) + { + params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); + } + mCamera.setParameters(params); + + try { + mCamera.setPreviewTexture(mSTexture); + } catch (IOException ioe) { + Log.e(LOGTAG, "setPreviewTexture() failed: " + ioe.getMessage()); + } + } + + @Override + public synchronized void setCameraPreviewSize(int width, int height) { + Log.i(LOGTAG, "setCameraPreviewSize: "+width+"x"+height); + if(mCamera == null) { + Log.e(LOGTAG, "Camera isn't initialized!"); + return; + } + + if(mMaxCameraWidth > 0 && mMaxCameraWidth < width) width = mMaxCameraWidth; + if(mMaxCameraHeight > 0 && mMaxCameraHeight < height) height = mMaxCameraHeight; + + Camera.Parameters param = mCamera.getParameters(); + List psize = param.getSupportedPreviewSizes(); + int bestWidth = 0, bestHeight = 0; + if (psize.size() > 0) { + float aspect = (float)width / height; + for (Size size : psize) { + int w = size.width, h = size.height; + Log.d(LOGTAG, "checking camera preview size: "+w+"x"+h); + if ( w <= width && h <= height && + w >= bestWidth && h >= bestHeight && + Math.abs(aspect - (float)w/h) < 0.2 ) { + bestWidth = w; + bestHeight = h; + } + } + if(bestWidth <= 0 || bestHeight <= 0) { + bestWidth = psize.get(0).width; + bestHeight = psize.get(0).height; + Log.e(LOGTAG, "Error: best size was not selected, using "+bestWidth+" x "+bestHeight); + } else { + Log.i(LOGTAG, "Selected best size: "+bestWidth+" x "+bestHeight); + } + + if(mPreviewStarted) { + mCamera.stopPreview(); + mPreviewStarted = false; + } + mCameraWidth = bestWidth; + mCameraHeight = bestHeight; + param.setPreviewSize(bestWidth, bestHeight); + } + param.set("orientation", "landscape"); + mCamera.setParameters(param); + mCamera.startPreview(); + mPreviewStarted = true; + } +} \ No newline at end of file diff --git a/openCVLibrary310/src/main/java/org/opencv/android/FpsMeter.java b/openCVLibrary310/src/main/java/org/opencv/android/FpsMeter.java new file mode 100644 index 0000000..88e826c --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/FpsMeter.java @@ -0,0 +1,66 @@ +package org.opencv.android; + +import java.text.DecimalFormat; + +import org.opencv.core.Core; + +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.util.Log; + +public class FpsMeter { + private static final String TAG = "FpsMeter"; + private static final int STEP = 20; + private static final DecimalFormat FPS_FORMAT = new DecimalFormat("0.00"); + + private int mFramesCouner; + private double mFrequency; + private long mprevFrameTime; + private String mStrfps; + Paint mPaint; + boolean mIsInitialized = false; + int mWidth = 0; + int mHeight = 0; + + public void init() { + mFramesCouner = 0; + mFrequency = Core.getTickFrequency(); + mprevFrameTime = Core.getTickCount(); + mStrfps = ""; + + mPaint = new Paint(); + mPaint.setColor(Color.BLUE); + mPaint.setTextSize(20); + } + + public void measure() { + if (!mIsInitialized) { + init(); + mIsInitialized = true; + } else { + mFramesCouner++; + if (mFramesCouner % STEP == 0) { + long time = Core.getTickCount(); + double fps = STEP * mFrequency / (time - mprevFrameTime); + mprevFrameTime = time; + if (mWidth != 0 && mHeight != 0) + mStrfps = FPS_FORMAT.format(fps) + " FPS@" + Integer.valueOf(mWidth) + "x" + Integer.valueOf(mHeight); + else + mStrfps = FPS_FORMAT.format(fps) + " FPS"; + Log.i(TAG, mStrfps); + } + } + } + + public void setResolution(int width, int height) { + mWidth = width; + mHeight = height; + } + + public void draw(Canvas canvas, float offsetx, float offsety) { + Log.d(TAG, mStrfps); + canvas.drawText(mStrfps, offsetx, offsety, mPaint); + } + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/InstallCallbackInterface.java b/openCVLibrary310/src/main/java/org/opencv/android/InstallCallbackInterface.java new file mode 100644 index 0000000..f68027a --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/InstallCallbackInterface.java @@ -0,0 +1,34 @@ +package org.opencv.android; + +/** + * Installation callback interface. + */ +public interface InstallCallbackInterface +{ + /** + * New package installation is required. + */ + static final int NEW_INSTALLATION = 0; + /** + * Current package installation is in progress. + */ + static final int INSTALLATION_PROGRESS = 1; + + /** + * Target package name. + * @return Return target package name. + */ + public String getPackageName(); + /** + * Installation is approved. + */ + public void install(); + /** + * Installation is canceled. + */ + public void cancel(); + /** + * Wait for package installation. + */ + public void wait_install(); +}; diff --git a/openCVLibrary310/src/main/java/org/opencv/android/JavaCameraView.java b/openCVLibrary310/src/main/java/org/opencv/android/JavaCameraView.java new file mode 100644 index 0000000..f4405c3 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/JavaCameraView.java @@ -0,0 +1,356 @@ +package org.opencv.android; + +import java.util.List; + +import android.content.Context; +import android.graphics.ImageFormat; +import android.graphics.SurfaceTexture; +import android.hardware.Camera; +import android.hardware.Camera.PreviewCallback; +import android.os.Build; +import android.util.AttributeSet; +import android.util.Log; +import android.view.ViewGroup.LayoutParams; + +import org.opencv.core.CvType; +import org.opencv.core.Mat; +import org.opencv.core.Size; +import org.opencv.imgproc.Imgproc; + +/** + * This class is an implementation of the Bridge View between OpenCV and Java Camera. + * This class relays on the functionality available in base class and only implements + * required functions: + * connectCamera - opens Java camera and sets the PreviewCallback to be delivered. + * disconnectCamera - closes the camera and stops preview. + * When frame is delivered via callback from Camera - it processed via OpenCV to be + * converted to RGBA32 and then passed to the external callback for modifications if required. + */ +public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallback { + + private static final int MAGIC_TEXTURE_ID = 10; + private static final String TAG = "JavaCameraView"; + + private byte mBuffer[]; + private Mat[] mFrameChain; + private int mChainIdx = 0; + private Thread mThread; + private boolean mStopThread; + + protected Camera mCamera; + protected JavaCameraFrame[] mCameraFrame; + private SurfaceTexture mSurfaceTexture; + + public static class JavaCameraSizeAccessor implements ListItemAccessor { + + @Override + public int getWidth(Object obj) { + Camera.Size size = (Camera.Size) obj; + return size.width; + } + + @Override + public int getHeight(Object obj) { + Camera.Size size = (Camera.Size) obj; + return size.height; + } + } + + public JavaCameraView(Context context, int cameraId) { + super(context, cameraId); + } + + public JavaCameraView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + protected boolean initializeCamera(int width, int height) { + Log.d(TAG, "Initialize java camera"); + boolean result = true; + synchronized (this) { + mCamera = null; + + if (mCameraIndex == CAMERA_ID_ANY) { + Log.d(TAG, "Trying to open camera with old open()"); + try { + mCamera = Camera.open(); + } + catch (Exception e){ + Log.e(TAG, "Camera is not available (in use or does not exist): " + e.getLocalizedMessage()); + } + + if(mCamera == null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + boolean connected = false; + for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) { + Log.d(TAG, "Trying to open camera with new open(" + Integer.valueOf(camIdx) + ")"); + try { + mCamera = Camera.open(camIdx); + connected = true; + } catch (RuntimeException e) { + Log.e(TAG, "Camera #" + camIdx + "failed to open: " + e.getLocalizedMessage()); + } + if (connected) break; + } + } + } else { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + int localCameraIndex = mCameraIndex; + if (mCameraIndex == CAMERA_ID_BACK) { + Log.i(TAG, "Trying to open back camera"); + Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); + for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) { + Camera.getCameraInfo( camIdx, cameraInfo ); + if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) { + localCameraIndex = camIdx; + break; + } + } + } else if (mCameraIndex == CAMERA_ID_FRONT) { + Log.i(TAG, "Trying to open front camera"); + Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); + for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) { + Camera.getCameraInfo( camIdx, cameraInfo ); + if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { + localCameraIndex = camIdx; + break; + } + } + } + if (localCameraIndex == CAMERA_ID_BACK) { + Log.e(TAG, "Back camera not found!"); + } else if (localCameraIndex == CAMERA_ID_FRONT) { + Log.e(TAG, "Front camera not found!"); + } else { + Log.d(TAG, "Trying to open camera with new open(" + Integer.valueOf(localCameraIndex) + ")"); + try { + mCamera = Camera.open(localCameraIndex); + } catch (RuntimeException e) { + Log.e(TAG, "Camera #" + localCameraIndex + "failed to open: " + e.getLocalizedMessage()); + } + } + } + } + + if (mCamera == null) + return false; + + /* Now set camera parameters */ + try { + Camera.Parameters params = mCamera.getParameters(); + Log.d(TAG, "getSupportedPreviewSizes()"); + List sizes = params.getSupportedPreviewSizes(); + + if (sizes != null) { + /* Select the size that fits surface considering maximum size allowed */ + Size frameSize = calculateCameraFrameSize(sizes, new JavaCameraSizeAccessor(), width, height); + + params.setPreviewFormat(ImageFormat.NV21); + Log.d(TAG, "Set preview size to " + Integer.valueOf((int)frameSize.width) + "x" + Integer.valueOf((int)frameSize.height)); + params.setPreviewSize((int)frameSize.width, (int)frameSize.height); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && !android.os.Build.MODEL.equals("GT-I9100")) + params.setRecordingHint(true); + + List FocusModes = params.getSupportedFocusModes(); + if (FocusModes != null && FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) + { + params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); + } + + mCamera.setParameters(params); + params = mCamera.getParameters(); + + mFrameWidth = params.getPreviewSize().width; + mFrameHeight = params.getPreviewSize().height; + + if ((getLayoutParams().width == LayoutParams.MATCH_PARENT) && (getLayoutParams().height == LayoutParams.MATCH_PARENT)) + mScale = Math.min(((float)height)/mFrameHeight, ((float)width)/mFrameWidth); + else + mScale = 0; + + if (mFpsMeter != null) { + mFpsMeter.setResolution(mFrameWidth, mFrameHeight); + } + + int size = mFrameWidth * mFrameHeight; + size = size * ImageFormat.getBitsPerPixel(params.getPreviewFormat()) / 8; + mBuffer = new byte[size]; + + mCamera.addCallbackBuffer(mBuffer); + mCamera.setPreviewCallbackWithBuffer(this); + + mFrameChain = new Mat[2]; + mFrameChain[0] = new Mat(mFrameHeight + (mFrameHeight/2), mFrameWidth, CvType.CV_8UC1); + mFrameChain[1] = new Mat(mFrameHeight + (mFrameHeight/2), mFrameWidth, CvType.CV_8UC1); + + AllocateCache(); + + mCameraFrame = new JavaCameraFrame[2]; + mCameraFrame[0] = new JavaCameraFrame(mFrameChain[0], mFrameWidth, mFrameHeight); + mCameraFrame[1] = new JavaCameraFrame(mFrameChain[1], mFrameWidth, mFrameHeight); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + mSurfaceTexture = new SurfaceTexture(MAGIC_TEXTURE_ID); + mCamera.setPreviewTexture(mSurfaceTexture); + } else + mCamera.setPreviewDisplay(null); + + /* Finally we are ready to start the preview */ + Log.d(TAG, "startPreview"); + mCamera.startPreview(); + } + else + result = false; + } catch (Exception e) { + result = false; + e.printStackTrace(); + } + } + + return result; + } + + protected void releaseCamera() { + synchronized (this) { + if (mCamera != null) { + mCamera.stopPreview(); + mCamera.setPreviewCallback(null); + + mCamera.release(); + } + mCamera = null; + if (mFrameChain != null) { + mFrameChain[0].release(); + mFrameChain[1].release(); + } + if (mCameraFrame != null) { + mCameraFrame[0].release(); + mCameraFrame[1].release(); + } + } + } + + private boolean mCameraFrameReady = false; + + @Override + protected boolean connectCamera(int width, int height) { + + /* 1. We need to instantiate camera + * 2. We need to start thread which will be getting frames + */ + /* First step - initialize camera connection */ + Log.d(TAG, "Connecting to camera"); + if (!initializeCamera(width, height)) + return false; + + mCameraFrameReady = false; + + /* now we can start update thread */ + Log.d(TAG, "Starting processing thread"); + mStopThread = false; + mThread = new Thread(new CameraWorker()); + mThread.start(); + + return true; + } + + @Override + protected void disconnectCamera() { + /* 1. We need to stop thread which updating the frames + * 2. Stop camera and release it + */ + Log.d(TAG, "Disconnecting from camera"); + try { + mStopThread = true; + Log.d(TAG, "Notify thread"); + synchronized (this) { + this.notify(); + } + Log.d(TAG, "Wating for thread"); + if (mThread != null) + mThread.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + mThread = null; + } + + /* Now release camera */ + releaseCamera(); + + mCameraFrameReady = false; + } + + @Override + public void onPreviewFrame(byte[] frame, Camera arg1) { + Log.d(TAG, "Preview Frame received. Frame size: " + frame.length); + synchronized (this) { + mFrameChain[mChainIdx].put(0, 0, frame); + mCameraFrameReady = true; + this.notify(); + } + if (mCamera != null) + mCamera.addCallbackBuffer(mBuffer); + } + + private class JavaCameraFrame implements CvCameraViewFrame { + @Override + public Mat gray() { + return mYuvFrameData.submat(0, mHeight, 0, mWidth); + } + + @Override + public Mat rgba() { + Imgproc.cvtColor(mYuvFrameData, mRgba, Imgproc.COLOR_YUV2RGBA_NV21, 4); + return mRgba; + } + + public JavaCameraFrame(Mat Yuv420sp, int width, int height) { + super(); + mWidth = width; + mHeight = height; + mYuvFrameData = Yuv420sp; + mRgba = new Mat(); + } + + public void release() { + mRgba.release(); + } + + private Mat mYuvFrameData; + private Mat mRgba; + private int mWidth; + private int mHeight; + }; + + private class CameraWorker implements Runnable { + + @Override + public void run() { + do { + boolean hasFrame = false; + synchronized (JavaCameraView.this) { + try { + while (!mCameraFrameReady && !mStopThread) { + JavaCameraView.this.wait(); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + if (mCameraFrameReady) + { + mChainIdx = 1 - mChainIdx; + mCameraFrameReady = false; + hasFrame = true; + } + } + + if (!mStopThread && hasFrame) { + if (!mFrameChain[1 - mChainIdx].empty()) + deliverAndDrawFrame(mCameraFrame[1 - mChainIdx]); + } + } while (!mStopThread); + Log.d(TAG, "Finish processing thread"); + } + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/LoaderCallbackInterface.java b/openCVLibrary310/src/main/java/org/opencv/android/LoaderCallbackInterface.java new file mode 100644 index 0000000..a941e83 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/LoaderCallbackInterface.java @@ -0,0 +1,40 @@ +package org.opencv.android; + +/** + * Interface for callback object in case of asynchronous initialization of OpenCV. + */ +public interface LoaderCallbackInterface +{ + /** + * OpenCV initialization finished successfully. + */ + static final int SUCCESS = 0; + /** + * Google Play Market cannot be invoked. + */ + static final int MARKET_ERROR = 2; + /** + * OpenCV library installation has been canceled by the user. + */ + static final int INSTALL_CANCELED = 3; + /** + * This version of OpenCV Manager Service is incompatible with the app. Possibly, a service update is required. + */ + static final int INCOMPATIBLE_MANAGER_VERSION = 4; + /** + * OpenCV library initialization has failed. + */ + static final int INIT_FAILED = 0xff; + + /** + * Callback method, called after OpenCV library initialization. + * @param status status of initialization (see initialization status constants). + */ + public void onManagerConnected(int status); + + /** + * Callback method, called in case the package installation is needed. + * @param callback answer object with approve and cancel methods and the package description. + */ + public void onPackageInstall(final int operation, InstallCallbackInterface callback); +}; diff --git a/openCVLibrary310/src/main/java/org/opencv/android/OpenCVLoader.java b/openCVLibrary310/src/main/java/org/opencv/android/OpenCVLoader.java new file mode 100644 index 0000000..b8a9705 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/OpenCVLoader.java @@ -0,0 +1,102 @@ +package org.opencv.android; + +import android.content.Context; + +/** + * Helper class provides common initialization methods for OpenCV library. + */ +public class OpenCVLoader +{ + /** + * OpenCV Library version 2.4.2. + */ + public static final String OPENCV_VERSION_2_4_2 = "2.4.2"; + + /** + * OpenCV Library version 2.4.3. + */ + public static final String OPENCV_VERSION_2_4_3 = "2.4.3"; + + /** + * OpenCV Library version 2.4.4. + */ + public static final String OPENCV_VERSION_2_4_4 = "2.4.4"; + + /** + * OpenCV Library version 2.4.5. + */ + public static final String OPENCV_VERSION_2_4_5 = "2.4.5"; + + /** + * OpenCV Library version 2.4.6. + */ + public static final String OPENCV_VERSION_2_4_6 = "2.4.6"; + + /** + * OpenCV Library version 2.4.7. + */ + public static final String OPENCV_VERSION_2_4_7 = "2.4.7"; + + /** + * OpenCV Library version 2.4.8. + */ + public static final String OPENCV_VERSION_2_4_8 = "2.4.8"; + + /** + * OpenCV Library version 2.4.9. + */ + public static final String OPENCV_VERSION_2_4_9 = "2.4.9"; + + /** + * OpenCV Library version 2.4.10. + */ + public static final String OPENCV_VERSION_2_4_10 = "2.4.10"; + + /** + * OpenCV Library version 2.4.11. + */ + public static final String OPENCV_VERSION_2_4_11 = "2.4.11"; + + /** + * OpenCV Library version 3.0.0. + */ + public static final String OPENCV_VERSION_3_0_0 = "3.0.0"; + + /** + * OpenCV Library version 3.1.0. + */ + public static final String OPENCV_VERSION_3_1_0 = "3.1.0"; + + + /** + * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java"). + * @return Returns true is initialization of OpenCV was successful. + */ + public static boolean initDebug() + { + return StaticHelper.initOpenCV(false); + } + + /** + * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java"). + * @param InitCuda load and initialize CUDA runtime libraries. + * @return Returns true is initialization of OpenCV was successful. + */ + public static boolean initDebug(boolean InitCuda) + { + return StaticHelper.initOpenCV(InitCuda); + } + + /** + * Loads and initializes OpenCV library using OpenCV Engine service. + * @param Version OpenCV library version. + * @param AppContext application context for connecting to the service. + * @param Callback object, that implements LoaderCallbackInterface for handling the connection status. + * @return Returns true if initialization of OpenCV is successful. + */ + public static boolean initAsync(String Version, Context AppContext, + LoaderCallbackInterface Callback) + { + return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/StaticHelper.java b/openCVLibrary310/src/main/java/org/opencv/android/StaticHelper.java new file mode 100644 index 0000000..36f9f6f --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/StaticHelper.java @@ -0,0 +1,104 @@ +package org.opencv.android; + +import org.opencv.core.Core; + +import java.util.StringTokenizer; +import android.util.Log; + +class StaticHelper { + + public static boolean initOpenCV(boolean InitCuda) + { + boolean result; + String libs = ""; + + if(InitCuda) + { + loadLibrary("cudart"); + loadLibrary("nppc"); + loadLibrary("nppi"); + loadLibrary("npps"); + loadLibrary("cufft"); + loadLibrary("cublas"); + } + + Log.d(TAG, "Trying to get library list"); + + try + { + System.loadLibrary("opencv_info"); + libs = getLibraryList(); + } + catch(UnsatisfiedLinkError e) + { + Log.e(TAG, "OpenCV error: Cannot load info library for OpenCV"); + } + + Log.d(TAG, "Library list: \"" + libs + "\""); + Log.d(TAG, "First attempt to load libs"); + if (initOpenCVLibs(libs)) + { + Log.d(TAG, "First attempt to load libs is OK"); + String eol = System.getProperty("line.separator"); + for (String str : Core.getBuildInformation().split(eol)) + Log.i(TAG, str); + + result = true; + } + else + { + Log.d(TAG, "First attempt to load libs fails"); + result = false; + } + + return result; + } + + private static boolean loadLibrary(String Name) + { + boolean result = true; + + Log.d(TAG, "Trying to load library " + Name); + try + { + System.loadLibrary(Name); + Log.d(TAG, "Library " + Name + " loaded"); + } + catch(UnsatisfiedLinkError e) + { + Log.d(TAG, "Cannot load library \"" + Name + "\""); + e.printStackTrace(); + result &= false; + } + + return result; + } + + private static boolean initOpenCVLibs(String Libs) + { + Log.d(TAG, "Trying to init OpenCV libs"); + + boolean result = true; + + if ((null != Libs) && (Libs.length() != 0)) + { + Log.d(TAG, "Trying to load libs by dependency list"); + StringTokenizer splitter = new StringTokenizer(Libs, ";"); + while(splitter.hasMoreTokens()) + { + result &= loadLibrary(splitter.nextToken()); + } + } + else + { + // If dependencies list is not defined or empty. + result &= loadLibrary("opencv_java3"); + } + + return result; + } + + private static final String TAG = "OpenCV/StaticHelper"; + + private static native String getLibraryList(); +} diff --git a/openCVLibrary310/src/main/java/org/opencv/android/Utils.java b/openCVLibrary310/src/main/java/org/opencv/android/Utils.java new file mode 100644 index 0000000..404c986 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/android/Utils.java @@ -0,0 +1,139 @@ +package org.opencv.android; + +import android.content.Context; +import android.graphics.Bitmap; + +import org.opencv.core.CvException; +import org.opencv.core.CvType; +import org.opencv.core.Mat; +import org.opencv.imgcodecs.Imgcodecs; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; + +public class Utils { + + public static String exportResource(Context context, int resourceId) { + return exportResource(context, resourceId, "OpenCV_data"); + } + + public static String exportResource(Context context, int resourceId, String dirname) { + String fullname = context.getResources().getString(resourceId); + String resName = fullname.substring(fullname.lastIndexOf("/") + 1); + try { + InputStream is = context.getResources().openRawResource(resourceId); + File resDir = context.getDir(dirname, Context.MODE_PRIVATE); + File resFile = new File(resDir, resName); + + FileOutputStream os = new FileOutputStream(resFile); + + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + os.write(buffer, 0, bytesRead); + } + is.close(); + os.close(); + + return resFile.getAbsolutePath(); + } catch (IOException e) { + e.printStackTrace(); + throw new CvException("Failed to export resource " + resName + + ". Exception thrown: " + e); + } + } + + public static Mat loadResource(Context context, int resourceId) throws IOException + { + return loadResource(context, resourceId, -1); + } + + public static Mat loadResource(Context context, int resourceId, int flags) throws IOException + { + InputStream is = context.getResources().openRawResource(resourceId); + ByteArrayOutputStream os = new ByteArrayOutputStream(is.available()); + + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + os.write(buffer, 0, bytesRead); + } + is.close(); + + Mat encoded = new Mat(1, os.size(), CvType.CV_8U); + encoded.put(0, 0, os.toByteArray()); + os.close(); + + Mat decoded = Imgcodecs.imdecode(encoded, flags); + encoded.release(); + + return decoded; + } + + /** + * Converts Android Bitmap to OpenCV Mat. + *

+ * This function converts an Android Bitmap image to the OpenCV Mat. + *
'ARGB_8888' and 'RGB_565' input Bitmap formats are supported. + *
The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type, + * it keeps the image in RGBA format. + *
This function throws an exception if the conversion fails. + * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'. + * @param mat is a valid output Mat object, it will be reallocated if needed, so it may be empty. + * @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. + */ + public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) { + if (bmp == null) + throw new java.lang.IllegalArgumentException("bmp == null"); + if (mat == null) + throw new java.lang.IllegalArgumentException("mat == null"); + nBitmapToMat2(bmp, mat.nativeObj, unPremultiplyAlpha); + } + + /** + * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false). + * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'. + * @param mat is a valid output Mat object, it will be reallocated if needed, so Mat may be empty. + */ + public static void bitmapToMat(Bitmap bmp, Mat mat) { + bitmapToMat(bmp, mat, false); + } + + + /** + * Converts OpenCV Mat to Android Bitmap. + *

+ *
This function converts an image in the OpenCV Mat representation to the Android Bitmap. + *
The input Mat object has to be of the types 'CV_8UC1' (gray-scale), 'CV_8UC3' (RGB) or 'CV_8UC4' (RGBA). + *
The output Bitmap object has to be of the same size as the input Mat and of the types 'ARGB_8888' or 'RGB_565'. + *
This function throws an exception if the conversion fails. + * + * @param mat is a valid input Mat object of types 'CV_8UC1', 'CV_8UC3' or 'CV_8UC4'. + * @param bmp is a valid Bitmap object of the same size as the Mat and of type 'ARGB_8888' or 'RGB_565'. + * @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. + */ + public static void matToBitmap(Mat mat, Bitmap bmp, boolean premultiplyAlpha) { + if (mat == null) + throw new java.lang.IllegalArgumentException("mat == null"); + if (bmp == null) + throw new java.lang.IllegalArgumentException("bmp == null"); + nMatToBitmap2(mat.nativeObj, bmp, premultiplyAlpha); + } + + /** + * Short form of the matToBitmap(mat, bmp, premultiplyAlpha=false) + * @param mat is a valid input Mat object of the types 'CV_8UC1', 'CV_8UC3' or 'CV_8UC4'. + * @param bmp is a valid Bitmap object of the same size as the Mat and of type 'ARGB_8888' or 'RGB_565'. + */ + public static void matToBitmap(Mat mat, Bitmap bmp) { + matToBitmap(mat, bmp, false); + } + + + private static native void nBitmapToMat2(Bitmap b, long m_addr, boolean unPremultiplyAlpha); + + private static native void nMatToBitmap2(long m_addr, Bitmap b, boolean premultiplyAlpha); +} diff --git a/openCVLibrary310/src/main/java/org/opencv/calib3d/Calib3d.java b/openCVLibrary310/src/main/java/org/opencv/calib3d/Calib3d.java new file mode 100644 index 0000000..00e12bf --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/calib3d/Calib3d.java @@ -0,0 +1,1396 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.calib3d; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfDouble; +import org.opencv.core.MatOfPoint2f; +import org.opencv.core.MatOfPoint3f; +import org.opencv.core.Point; +import org.opencv.core.Rect; +import org.opencv.core.Size; +import org.opencv.core.TermCriteria; +import org.opencv.utils.Converters; + +public class Calib3d { + + public static final int + CALIB_USE_INTRINSIC_GUESS = 1, + CALIB_RECOMPUTE_EXTRINSIC = 2, + CALIB_CHECK_COND = 4, + CALIB_FIX_SKEW = 8, + CALIB_FIX_K1 = 16, + CALIB_FIX_K2 = 32, + CALIB_FIX_K3 = 64, + CALIB_FIX_K4 = 128, + CALIB_FIX_INTRINSIC = 256, + CV_ITERATIVE = 0, + CV_EPNP = 1, + CV_P3P = 2, + CV_DLS = 3, + LMEDS = 4, + RANSAC = 8, + RHO = 16, + SOLVEPNP_ITERATIVE = 0, + SOLVEPNP_EPNP = 1, + SOLVEPNP_P3P = 2, + SOLVEPNP_DLS = 3, + SOLVEPNP_UPNP = 4, + CALIB_CB_ADAPTIVE_THRESH = 1, + CALIB_CB_NORMALIZE_IMAGE = 2, + CALIB_CB_FILTER_QUADS = 4, + CALIB_CB_FAST_CHECK = 8, + CALIB_CB_SYMMETRIC_GRID = 1, + CALIB_CB_ASYMMETRIC_GRID = 2, + CALIB_CB_CLUSTERING = 4, + CALIB_FIX_ASPECT_RATIO = 0x00002, + CALIB_FIX_PRINCIPAL_POINT = 0x00004, + CALIB_ZERO_TANGENT_DIST = 0x00008, + CALIB_FIX_FOCAL_LENGTH = 0x00010, + CALIB_FIX_K5 = 0x01000, + CALIB_FIX_K6 = 0x02000, + CALIB_RATIONAL_MODEL = 0x04000, + CALIB_THIN_PRISM_MODEL = 0x08000, + CALIB_FIX_S1_S2_S3_S4 = 0x10000, + CALIB_TILTED_MODEL = 0x40000, + CALIB_FIX_TAUX_TAUY = 0x80000, + CALIB_SAME_FOCAL_LENGTH = 0x00200, + CALIB_ZERO_DISPARITY = 0x00400, + CALIB_USE_LU = (1 << 17), + FM_7POINT = 1, + FM_8POINT = 2, + FM_LMEDS = 4, + FM_RANSAC = 8; + + + // + // C++: Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix, int method = RANSAC, double prob = 0.999, double threshold = 1.0, Mat& mask = Mat()) + // + + //javadoc: findEssentialMat(points1, points2, cameraMatrix, method, prob, threshold, mask) + public static Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold, Mat mask) + { + + Mat retVal = new Mat(findEssentialMat_0(points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, method, prob, threshold, mask.nativeObj)); + + return retVal; + } + + //javadoc: findEssentialMat(points1, points2, cameraMatrix, method, prob, threshold) + public static Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold) + { + + Mat retVal = new Mat(findEssentialMat_1(points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, method, prob, threshold)); + + return retVal; + } + + //javadoc: findEssentialMat(points1, points2, cameraMatrix) + public static Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix) + { + + Mat retVal = new Mat(findEssentialMat_2(points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj)); + + return retVal; + } + + + // + // C++: Mat findEssentialMat(Mat points1, Mat points2, double focal = 1.0, Point2d pp = Point2d(0, 0), int method = RANSAC, double prob = 0.999, double threshold = 1.0, Mat& mask = Mat()) + // + + //javadoc: findEssentialMat(points1, points2, focal, pp, method, prob, threshold, mask) + public static Mat findEssentialMat(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold, Mat mask) + { + + Mat retVal = new Mat(findEssentialMat_3(points1.nativeObj, points2.nativeObj, focal, pp.x, pp.y, method, prob, threshold, mask.nativeObj)); + + return retVal; + } + + //javadoc: findEssentialMat(points1, points2, focal, pp, method, prob, threshold) + public static Mat findEssentialMat(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold) + { + + Mat retVal = new Mat(findEssentialMat_4(points1.nativeObj, points2.nativeObj, focal, pp.x, pp.y, method, prob, threshold)); + + return retVal; + } + + //javadoc: findEssentialMat(points1, points2) + public static Mat findEssentialMat(Mat points1, Mat points2) + { + + Mat retVal = new Mat(findEssentialMat_5(points1.nativeObj, points2.nativeObj)); + + return retVal; + } + + + // + // C++: Mat findFundamentalMat(vector_Point2f points1, vector_Point2f points2, int method = FM_RANSAC, double param1 = 3., double param2 = 0.99, Mat& mask = Mat()) + // + + //javadoc: findFundamentalMat(points1, points2, method, param1, param2, mask) + public static Mat findFundamentalMat(MatOfPoint2f points1, MatOfPoint2f points2, int method, double param1, double param2, Mat mask) + { + Mat points1_mat = points1; + Mat points2_mat = points2; + Mat retVal = new Mat(findFundamentalMat_0(points1_mat.nativeObj, points2_mat.nativeObj, method, param1, param2, mask.nativeObj)); + + return retVal; + } + + //javadoc: findFundamentalMat(points1, points2, method, param1, param2) + public static Mat findFundamentalMat(MatOfPoint2f points1, MatOfPoint2f points2, int method, double param1, double param2) + { + Mat points1_mat = points1; + Mat points2_mat = points2; + Mat retVal = new Mat(findFundamentalMat_1(points1_mat.nativeObj, points2_mat.nativeObj, method, param1, param2)); + + return retVal; + } + + //javadoc: findFundamentalMat(points1, points2) + public static Mat findFundamentalMat(MatOfPoint2f points1, MatOfPoint2f points2) + { + Mat points1_mat = points1; + Mat points2_mat = points2; + Mat retVal = new Mat(findFundamentalMat_2(points1_mat.nativeObj, points2_mat.nativeObj)); + + return retVal; + } + + + // + // C++: Mat findHomography(vector_Point2f srcPoints, vector_Point2f dstPoints, int method = 0, double ransacReprojThreshold = 3, Mat& mask = Mat(), int maxIters = 2000, double confidence = 0.995) + // + + //javadoc: findHomography(srcPoints, dstPoints, method, ransacReprojThreshold, mask, maxIters, confidence) + public static Mat findHomography(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask, int maxIters, double confidence) + { + Mat srcPoints_mat = srcPoints; + Mat dstPoints_mat = dstPoints; + Mat retVal = new Mat(findHomography_0(srcPoints_mat.nativeObj, dstPoints_mat.nativeObj, method, ransacReprojThreshold, mask.nativeObj, maxIters, confidence)); + + return retVal; + } + + //javadoc: findHomography(srcPoints, dstPoints, method, ransacReprojThreshold) + public static Mat findHomography(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold) + { + Mat srcPoints_mat = srcPoints; + Mat dstPoints_mat = dstPoints; + Mat retVal = new Mat(findHomography_1(srcPoints_mat.nativeObj, dstPoints_mat.nativeObj, method, ransacReprojThreshold)); + + return retVal; + } + + //javadoc: findHomography(srcPoints, dstPoints) + public static Mat findHomography(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints) + { + Mat srcPoints_mat = srcPoints; + Mat dstPoints_mat = dstPoints; + Mat retVal = new Mat(findHomography_2(srcPoints_mat.nativeObj, dstPoints_mat.nativeObj)); + + return retVal; + } + + + // + // C++: Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize = Size(), Rect* validPixROI = 0, bool centerPrincipalPoint = false) + // + + //javadoc: getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha, newImgSize, validPixROI, centerPrincipalPoint) + public static Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize, Rect validPixROI, boolean centerPrincipalPoint) + { + double[] validPixROI_out = new double[4]; + Mat retVal = new Mat(getOptimalNewCameraMatrix_0(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, alpha, newImgSize.width, newImgSize.height, validPixROI_out, centerPrincipalPoint)); + if(validPixROI!=null){ validPixROI.x = (int)validPixROI_out[0]; validPixROI.y = (int)validPixROI_out[1]; validPixROI.width = (int)validPixROI_out[2]; validPixROI.height = (int)validPixROI_out[3]; } + return retVal; + } + + //javadoc: getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha) + public static Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha) + { + + Mat retVal = new Mat(getOptimalNewCameraMatrix_1(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, alpha)); + + return retVal; + } + + + // + // C++: Mat initCameraMatrix2D(vector_vector_Point3f objectPoints, vector_vector_Point2f imagePoints, Size imageSize, double aspectRatio = 1.0) + // + + //javadoc: initCameraMatrix2D(objectPoints, imagePoints, imageSize, aspectRatio) + public static Mat initCameraMatrix2D(List objectPoints, List imagePoints, Size imageSize, double aspectRatio) + { + List objectPoints_tmplm = new ArrayList((objectPoints != null) ? objectPoints.size() : 0); + Mat objectPoints_mat = Converters.vector_vector_Point3f_to_Mat(objectPoints, objectPoints_tmplm); + List imagePoints_tmplm = new ArrayList((imagePoints != null) ? imagePoints.size() : 0); + Mat imagePoints_mat = Converters.vector_vector_Point2f_to_Mat(imagePoints, imagePoints_tmplm); + Mat retVal = new Mat(initCameraMatrix2D_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, aspectRatio)); + + return retVal; + } + + //javadoc: initCameraMatrix2D(objectPoints, imagePoints, imageSize) + public static Mat initCameraMatrix2D(List objectPoints, List imagePoints, Size imageSize) + { + List objectPoints_tmplm = new ArrayList((objectPoints != null) ? objectPoints.size() : 0); + Mat objectPoints_mat = Converters.vector_vector_Point3f_to_Mat(objectPoints, objectPoints_tmplm); + List imagePoints_tmplm = new ArrayList((imagePoints != null) ? imagePoints.size() : 0); + Mat imagePoints_mat = Converters.vector_vector_Point2f_to_Mat(imagePoints, imagePoints_tmplm); + Mat retVal = new Mat(initCameraMatrix2D_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height)); + + return retVal; + } + + + // + // C++: Rect getValidDisparityROI(Rect roi1, Rect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize) + // + + //javadoc: getValidDisparityROI(roi1, roi2, minDisparity, numberOfDisparities, SADWindowSize) + public static Rect getValidDisparityROI(Rect roi1, Rect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize) + { + + Rect retVal = new Rect(getValidDisparityROI_0(roi1.x, roi1.y, roi1.width, roi1.height, roi2.x, roi2.y, roi2.width, roi2.height, minDisparity, numberOfDisparities, SADWindowSize)); + + return retVal; + } + + + // + // C++: Vec3d RQDecomp3x3(Mat src, Mat& mtxR, Mat& mtxQ, Mat& Qx = Mat(), Mat& Qy = Mat(), Mat& Qz = Mat()) + // + + //javadoc: RQDecomp3x3(src, mtxR, mtxQ, Qx, Qy, Qz) + public static double[] RQDecomp3x3(Mat src, Mat mtxR, Mat mtxQ, Mat Qx, Mat Qy, Mat Qz) + { + + double[] retVal = RQDecomp3x3_0(src.nativeObj, mtxR.nativeObj, mtxQ.nativeObj, Qx.nativeObj, Qy.nativeObj, Qz.nativeObj); + + return retVal; + } + + //javadoc: RQDecomp3x3(src, mtxR, mtxQ) + public static double[] RQDecomp3x3(Mat src, Mat mtxR, Mat mtxQ) + { + + double[] retVal = RQDecomp3x3_1(src.nativeObj, mtxR.nativeObj, mtxQ.nativeObj); + + return retVal; + } + + + // + // C++: bool findChessboardCorners(Mat image, Size patternSize, vector_Point2f& corners, int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE) + // + + //javadoc: findChessboardCorners(image, patternSize, corners, flags) + public static boolean findChessboardCorners(Mat image, Size patternSize, MatOfPoint2f corners, int flags) + { + Mat corners_mat = corners; + boolean retVal = findChessboardCorners_0(image.nativeObj, patternSize.width, patternSize.height, corners_mat.nativeObj, flags); + + return retVal; + } + + //javadoc: findChessboardCorners(image, patternSize, corners) + public static boolean findChessboardCorners(Mat image, Size patternSize, MatOfPoint2f corners) + { + Mat corners_mat = corners; + boolean retVal = findChessboardCorners_1(image.nativeObj, patternSize.width, patternSize.height, corners_mat.nativeObj); + + return retVal; + } + + + // + // C++: bool findCirclesGrid(Mat image, Size patternSize, Mat& centers, int flags = CALIB_CB_SYMMETRIC_GRID, Ptr_FeatureDetector blobDetector = SimpleBlobDetector::create()) + // + + //javadoc: findCirclesGrid(image, patternSize, centers, flags) + public static boolean findCirclesGrid(Mat image, Size patternSize, Mat centers, int flags) + { + + boolean retVal = findCirclesGrid_0(image.nativeObj, patternSize.width, patternSize.height, centers.nativeObj, flags); + + return retVal; + } + + //javadoc: findCirclesGrid(image, patternSize, centers) + public static boolean findCirclesGrid(Mat image, Size patternSize, Mat centers) + { + + boolean retVal = findCirclesGrid_1(image.nativeObj, patternSize.width, patternSize.height, centers.nativeObj); + + return retVal; + } + + + // + // C++: bool solvePnP(vector_Point3f objectPoints, vector_Point2f imagePoints, Mat cameraMatrix, vector_double distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE) + // + + //javadoc: solvePnP(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess, flags) + public static boolean solvePnP(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int flags) + { + Mat objectPoints_mat = objectPoints; + Mat imagePoints_mat = imagePoints; + Mat distCoeffs_mat = distCoeffs; + boolean retVal = solvePnP_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess, flags); + + return retVal; + } + + //javadoc: solvePnP(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec) + public static boolean solvePnP(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec) + { + Mat objectPoints_mat = objectPoints; + Mat imagePoints_mat = imagePoints; + Mat distCoeffs_mat = distCoeffs; + boolean retVal = solvePnP_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj); + + return retVal; + } + + + // + // C++: bool solvePnPRansac(vector_Point3f objectPoints, vector_Point2f imagePoints, Mat cameraMatrix, vector_double distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false, int iterationsCount = 100, float reprojectionError = 8.0, double confidence = 0.99, Mat& inliers = Mat(), int flags = SOLVEPNP_ITERATIVE) + // + + //javadoc: solvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess, iterationsCount, reprojectionError, confidence, inliers, flags) + public static boolean solvePnPRansac(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags) + { + Mat objectPoints_mat = objectPoints; + Mat imagePoints_mat = imagePoints; + Mat distCoeffs_mat = distCoeffs; + boolean retVal = solvePnPRansac_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess, iterationsCount, reprojectionError, confidence, inliers.nativeObj, flags); + + return retVal; + } + + //javadoc: solvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec) + public static boolean solvePnPRansac(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec) + { + Mat objectPoints_mat = objectPoints; + Mat imagePoints_mat = imagePoints; + Mat distCoeffs_mat = distCoeffs; + boolean retVal = solvePnPRansac_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj); + + return retVal; + } + + + // + // C++: bool stereoRectifyUncalibrated(Mat points1, Mat points2, Mat F, Size imgSize, Mat& H1, Mat& H2, double threshold = 5) + // + + //javadoc: stereoRectifyUncalibrated(points1, points2, F, imgSize, H1, H2, threshold) + public static boolean stereoRectifyUncalibrated(Mat points1, Mat points2, Mat F, Size imgSize, Mat H1, Mat H2, double threshold) + { + + boolean retVal = stereoRectifyUncalibrated_0(points1.nativeObj, points2.nativeObj, F.nativeObj, imgSize.width, imgSize.height, H1.nativeObj, H2.nativeObj, threshold); + + return retVal; + } + + //javadoc: stereoRectifyUncalibrated(points1, points2, F, imgSize, H1, H2) + public static boolean stereoRectifyUncalibrated(Mat points1, Mat points2, Mat F, Size imgSize, Mat H1, Mat H2) + { + + boolean retVal = stereoRectifyUncalibrated_1(points1.nativeObj, points2.nativeObj, F.nativeObj, imgSize.width, imgSize.height, H1.nativeObj, H2.nativeObj); + + return retVal; + } + + + // + // C++: double calibrateCamera(vector_Mat objectPoints, vector_Mat imagePoints, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, int flags = 0, TermCriteria criteria = TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)) + // + + //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags, criteria) + public static double calibrateCamera(List objectPoints, List imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List rvecs, List tvecs, int flags, TermCriteria criteria) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); + Mat rvecs_mat = new Mat(); + Mat tvecs_mat = new Mat(); + double retVal = calibrateCamera_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); + Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); + rvecs_mat.release(); + Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); + tvecs_mat.release(); + return retVal; + } + + //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags) + public static double calibrateCamera(List objectPoints, List imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List rvecs, List tvecs, int flags) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); + Mat rvecs_mat = new Mat(); + Mat tvecs_mat = new Mat(); + double retVal = calibrateCamera_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags); + Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); + rvecs_mat.release(); + Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); + tvecs_mat.release(); + return retVal; + } + + //javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs) + public static double calibrateCamera(List objectPoints, List imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List rvecs, List tvecs) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); + Mat rvecs_mat = new Mat(); + Mat tvecs_mat = new Mat(); + double retVal = calibrateCamera_2(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj); + Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); + rvecs_mat.release(); + Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); + tvecs_mat.release(); + return retVal; + } + + + // + // C++: double sampsonDistance(Mat pt1, Mat pt2, Mat F) + // + + //javadoc: sampsonDistance(pt1, pt2, F) + public static double sampsonDistance(Mat pt1, Mat pt2, Mat F) + { + + double retVal = sampsonDistance_0(pt1.nativeObj, pt2.nativeObj, F.nativeObj); + + return retVal; + } + + + // + // C++: double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& cameraMatrix1, Mat& distCoeffs1, Mat& cameraMatrix2, Mat& distCoeffs2, Size imageSize, Mat& R, Mat& T, Mat& E, Mat& F, int flags = CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6)) + // + + //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E, F, flags, criteria) + public static double stereoCalibrate(List objectPoints, List imagePoints1, List imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat E, Mat F, int flags, TermCriteria criteria) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); + Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); + double retVal = stereoCalibrate_0(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, E.nativeObj, F.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); + + return retVal; + } + + //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E, F, flags) + public static double stereoCalibrate(List objectPoints, List imagePoints1, List imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat E, Mat F, int flags) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); + Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); + double retVal = stereoCalibrate_1(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, E.nativeObj, F.nativeObj, flags); + + return retVal; + } + + //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E, F) + public static double stereoCalibrate(List objectPoints, List imagePoints1, List imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat E, Mat F) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); + Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); + double retVal = stereoCalibrate_2(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, E.nativeObj, F.nativeObj); + + return retVal; + } + + + // + // C++: double calibrate(vector_Mat objectPoints, vector_Mat imagePoints, Size image_size, Mat& K, Mat& D, vector_Mat& rvecs, vector_Mat& tvecs, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)) + // + + //javadoc: calibrate(objectPoints, imagePoints, image_size, K, D, rvecs, tvecs, flags, criteria) + public static double calibrate(List objectPoints, List imagePoints, Size image_size, Mat K, Mat D, List rvecs, List tvecs, int flags, TermCriteria criteria) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); + Mat rvecs_mat = new Mat(); + Mat tvecs_mat = new Mat(); + double retVal = calibrate_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, image_size.width, image_size.height, K.nativeObj, D.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); + Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); + rvecs_mat.release(); + Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); + tvecs_mat.release(); + return retVal; + } + + //javadoc: calibrate(objectPoints, imagePoints, image_size, K, D, rvecs, tvecs, flags) + public static double calibrate(List objectPoints, List imagePoints, Size image_size, Mat K, Mat D, List rvecs, List tvecs, int flags) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); + Mat rvecs_mat = new Mat(); + Mat tvecs_mat = new Mat(); + double retVal = calibrate_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, image_size.width, image_size.height, K.nativeObj, D.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags); + Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); + rvecs_mat.release(); + Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); + tvecs_mat.release(); + return retVal; + } + + //javadoc: calibrate(objectPoints, imagePoints, image_size, K, D, rvecs, tvecs) + public static double calibrate(List objectPoints, List imagePoints, Size image_size, Mat K, Mat D, List rvecs, List tvecs) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints); + Mat rvecs_mat = new Mat(); + Mat tvecs_mat = new Mat(); + double retVal = calibrate_2(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, image_size.width, image_size.height, K.nativeObj, D.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj); + Converters.Mat_to_vector_Mat(rvecs_mat, rvecs); + rvecs_mat.release(); + Converters.Mat_to_vector_Mat(tvecs_mat, tvecs); + tvecs_mat.release(); + return retVal; + } + + + // + // C++: double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& K1, Mat& D1, Mat& K2, Mat& D2, Size imageSize, Mat& R, Mat& T, int flags = fisheye::CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)) + // + + //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, K1, D1, K2, D2, imageSize, R, T, flags, criteria) + public static double stereoCalibrate(List objectPoints, List imagePoints1, List imagePoints2, Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat T, int flags, TermCriteria criteria) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); + Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); + double retVal = stereoCalibrate_3(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon); + + return retVal; + } + + //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, K1, D1, K2, D2, imageSize, R, T, flags) + public static double stereoCalibrate(List objectPoints, List imagePoints1, List imagePoints2, Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat T, int flags) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); + Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); + double retVal = stereoCalibrate_4(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, flags); + + return retVal; + } + + //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, K1, D1, K2, D2, imageSize, R, T) + public static double stereoCalibrate(List objectPoints, List imagePoints1, List imagePoints2, Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat T) + { + Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints); + Mat imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1); + Mat imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2); + double retVal = stereoCalibrate_5(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj); + + return retVal; + } + + + // + // C++: float rectify3Collinear(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat cameraMatrix3, Mat distCoeffs3, vector_Mat imgpt1, vector_Mat imgpt3, Size imageSize, Mat R12, Mat T12, Mat R13, Mat T13, Mat& R1, Mat& R2, Mat& R3, Mat& P1, Mat& P2, Mat& P3, Mat& Q, double alpha, Size newImgSize, Rect* roi1, Rect* roi2, int flags) + // + + //javadoc: rectify3Collinear(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, cameraMatrix3, distCoeffs3, imgpt1, imgpt3, imageSize, R12, T12, R13, T13, R1, R2, R3, P1, P2, P3, Q, alpha, newImgSize, roi1, roi2, flags) + public static float rectify3Collinear(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat cameraMatrix3, Mat distCoeffs3, List imgpt1, List imgpt3, Size imageSize, Mat R12, Mat T12, Mat R13, Mat T13, Mat R1, Mat R2, Mat R3, Mat P1, Mat P2, Mat P3, Mat Q, double alpha, Size newImgSize, Rect roi1, Rect roi2, int flags) + { + Mat imgpt1_mat = Converters.vector_Mat_to_Mat(imgpt1); + Mat imgpt3_mat = Converters.vector_Mat_to_Mat(imgpt3); + double[] roi1_out = new double[4]; + double[] roi2_out = new double[4]; + float retVal = rectify3Collinear_0(cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, cameraMatrix3.nativeObj, distCoeffs3.nativeObj, imgpt1_mat.nativeObj, imgpt3_mat.nativeObj, imageSize.width, imageSize.height, R12.nativeObj, T12.nativeObj, R13.nativeObj, T13.nativeObj, R1.nativeObj, R2.nativeObj, R3.nativeObj, P1.nativeObj, P2.nativeObj, P3.nativeObj, Q.nativeObj, alpha, newImgSize.width, newImgSize.height, roi1_out, roi2_out, flags); + if(roi1!=null){ roi1.x = (int)roi1_out[0]; roi1.y = (int)roi1_out[1]; roi1.width = (int)roi1_out[2]; roi1.height = (int)roi1_out[3]; } + if(roi2!=null){ roi2.x = (int)roi2_out[0]; roi2.y = (int)roi2_out[1]; roi2.width = (int)roi2_out[2]; roi2.height = (int)roi2_out[3]; } + return retVal; + } + + + // + // C++: int decomposeHomographyMat(Mat H, Mat K, vector_Mat& rotations, vector_Mat& translations, vector_Mat& normals) + // + + //javadoc: decomposeHomographyMat(H, K, rotations, translations, normals) + public static int decomposeHomographyMat(Mat H, Mat K, List rotations, List translations, List normals) + { + Mat rotations_mat = new Mat(); + Mat translations_mat = new Mat(); + Mat normals_mat = new Mat(); + int retVal = decomposeHomographyMat_0(H.nativeObj, K.nativeObj, rotations_mat.nativeObj, translations_mat.nativeObj, normals_mat.nativeObj); + Converters.Mat_to_vector_Mat(rotations_mat, rotations); + rotations_mat.release(); + Converters.Mat_to_vector_Mat(translations_mat, translations); + translations_mat.release(); + Converters.Mat_to_vector_Mat(normals_mat, normals); + normals_mat.release(); + return retVal; + } + + + // + // C++: int estimateAffine3D(Mat src, Mat dst, Mat& out, Mat& inliers, double ransacThreshold = 3, double confidence = 0.99) + // + + //javadoc: estimateAffine3D(src, dst, out, inliers, ransacThreshold, confidence) + public static int estimateAffine3D(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold, double confidence) + { + + int retVal = estimateAffine3D_0(src.nativeObj, dst.nativeObj, out.nativeObj, inliers.nativeObj, ransacThreshold, confidence); + + return retVal; + } + + //javadoc: estimateAffine3D(src, dst, out, inliers) + public static int estimateAffine3D(Mat src, Mat dst, Mat out, Mat inliers) + { + + int retVal = estimateAffine3D_1(src.nativeObj, dst.nativeObj, out.nativeObj, inliers.nativeObj); + + return retVal; + } + + + // + // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat& R, Mat& t, double focal = 1.0, Point2d pp = Point2d(0, 0), Mat& mask = Mat()) + // + + //javadoc: recoverPose(E, points1, points2, R, t, focal, pp, mask) + public static int recoverPose(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal, Point pp, Mat mask) + { + + int retVal = recoverPose_0(E.nativeObj, points1.nativeObj, points2.nativeObj, R.nativeObj, t.nativeObj, focal, pp.x, pp.y, mask.nativeObj); + + return retVal; + } + + //javadoc: recoverPose(E, points1, points2, R, t, focal, pp) + public static int recoverPose(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal, Point pp) + { + + int retVal = recoverPose_1(E.nativeObj, points1.nativeObj, points2.nativeObj, R.nativeObj, t.nativeObj, focal, pp.x, pp.y); + + return retVal; + } + + //javadoc: recoverPose(E, points1, points2, R, t) + public static int recoverPose(Mat E, Mat points1, Mat points2, Mat R, Mat t) + { + + int retVal = recoverPose_2(E.nativeObj, points1.nativeObj, points2.nativeObj, R.nativeObj, t.nativeObj); + + return retVal; + } + + + // + // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat& R, Mat& t, Mat& mask = Mat()) + // + + //javadoc: recoverPose(E, points1, points2, cameraMatrix, R, t, mask) + public static int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, Mat mask) + { + + int retVal = recoverPose_3(E.nativeObj, points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, R.nativeObj, t.nativeObj, mask.nativeObj); + + return retVal; + } + + //javadoc: recoverPose(E, points1, points2, cameraMatrix, R, t) + public static int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t) + { + + int retVal = recoverPose_4(E.nativeObj, points1.nativeObj, points2.nativeObj, cameraMatrix.nativeObj, R.nativeObj, t.nativeObj); + + return retVal; + } + + + // + // C++: void Rodrigues(Mat src, Mat& dst, Mat& jacobian = Mat()) + // + + //javadoc: Rodrigues(src, dst, jacobian) + public static void Rodrigues(Mat src, Mat dst, Mat jacobian) + { + + Rodrigues_0(src.nativeObj, dst.nativeObj, jacobian.nativeObj); + + return; + } + + //javadoc: Rodrigues(src, dst) + public static void Rodrigues(Mat src, Mat dst) + { + + Rodrigues_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void calibrationMatrixValues(Mat cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double& fovx, double& fovy, double& focalLength, Point2d& principalPoint, double& aspectRatio) + // + + //javadoc: calibrationMatrixValues(cameraMatrix, imageSize, apertureWidth, apertureHeight, fovx, fovy, focalLength, principalPoint, aspectRatio) + public static void calibrationMatrixValues(Mat cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double[] fovx, double[] fovy, double[] focalLength, Point principalPoint, double[] aspectRatio) + { + double[] fovx_out = new double[1]; + double[] fovy_out = new double[1]; + double[] focalLength_out = new double[1]; + double[] principalPoint_out = new double[2]; + double[] aspectRatio_out = new double[1]; + calibrationMatrixValues_0(cameraMatrix.nativeObj, imageSize.width, imageSize.height, apertureWidth, apertureHeight, fovx_out, fovy_out, focalLength_out, principalPoint_out, aspectRatio_out); + if(fovx!=null) fovx[0] = (double)fovx_out[0]; + if(fovy!=null) fovy[0] = (double)fovy_out[0]; + if(focalLength!=null) focalLength[0] = (double)focalLength_out[0]; + if(principalPoint!=null){ principalPoint.x = principalPoint_out[0]; principalPoint.y = principalPoint_out[1]; } + if(aspectRatio!=null) aspectRatio[0] = (double)aspectRatio_out[0]; + return; + } + + + // + // C++: void composeRT(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat& rvec3, Mat& tvec3, Mat& dr3dr1 = Mat(), Mat& dr3dt1 = Mat(), Mat& dr3dr2 = Mat(), Mat& dr3dt2 = Mat(), Mat& dt3dr1 = Mat(), Mat& dt3dt1 = Mat(), Mat& dt3dr2 = Mat(), Mat& dt3dt2 = Mat()) + // + + //javadoc: composeRT(rvec1, tvec1, rvec2, tvec2, rvec3, tvec3, dr3dr1, dr3dt1, dr3dr2, dr3dt2, dt3dr1, dt3dt1, dt3dr2, dt3dt2) + public static void composeRT(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1, Mat dt3dt1, Mat dt3dr2, Mat dt3dt2) + { + + composeRT_0(rvec1.nativeObj, tvec1.nativeObj, rvec2.nativeObj, tvec2.nativeObj, rvec3.nativeObj, tvec3.nativeObj, dr3dr1.nativeObj, dr3dt1.nativeObj, dr3dr2.nativeObj, dr3dt2.nativeObj, dt3dr1.nativeObj, dt3dt1.nativeObj, dt3dr2.nativeObj, dt3dt2.nativeObj); + + return; + } + + //javadoc: composeRT(rvec1, tvec1, rvec2, tvec2, rvec3, tvec3) + public static void composeRT(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3) + { + + composeRT_1(rvec1.nativeObj, tvec1.nativeObj, rvec2.nativeObj, tvec2.nativeObj, rvec3.nativeObj, tvec3.nativeObj); + + return; + } + + + // + // C++: void computeCorrespondEpilines(Mat points, int whichImage, Mat F, Mat& lines) + // + + //javadoc: computeCorrespondEpilines(points, whichImage, F, lines) + public static void computeCorrespondEpilines(Mat points, int whichImage, Mat F, Mat lines) + { + + computeCorrespondEpilines_0(points.nativeObj, whichImage, F.nativeObj, lines.nativeObj); + + return; + } + + + // + // C++: void convertPointsFromHomogeneous(Mat src, Mat& dst) + // + + //javadoc: convertPointsFromHomogeneous(src, dst) + public static void convertPointsFromHomogeneous(Mat src, Mat dst) + { + + convertPointsFromHomogeneous_0(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void convertPointsToHomogeneous(Mat src, Mat& dst) + // + + //javadoc: convertPointsToHomogeneous(src, dst) + public static void convertPointsToHomogeneous(Mat src, Mat dst) + { + + convertPointsToHomogeneous_0(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void correctMatches(Mat F, Mat points1, Mat points2, Mat& newPoints1, Mat& newPoints2) + // + + //javadoc: correctMatches(F, points1, points2, newPoints1, newPoints2) + public static void correctMatches(Mat F, Mat points1, Mat points2, Mat newPoints1, Mat newPoints2) + { + + correctMatches_0(F.nativeObj, points1.nativeObj, points2.nativeObj, newPoints1.nativeObj, newPoints2.nativeObj); + + return; + } + + + // + // C++: void decomposeEssentialMat(Mat E, Mat& R1, Mat& R2, Mat& t) + // + + //javadoc: decomposeEssentialMat(E, R1, R2, t) + public static void decomposeEssentialMat(Mat E, Mat R1, Mat R2, Mat t) + { + + decomposeEssentialMat_0(E.nativeObj, R1.nativeObj, R2.nativeObj, t.nativeObj); + + return; + } + + + // + // C++: void decomposeProjectionMatrix(Mat projMatrix, Mat& cameraMatrix, Mat& rotMatrix, Mat& transVect, Mat& rotMatrixX = Mat(), Mat& rotMatrixY = Mat(), Mat& rotMatrixZ = Mat(), Mat& eulerAngles = Mat()) + // + + //javadoc: decomposeProjectionMatrix(projMatrix, cameraMatrix, rotMatrix, transVect, rotMatrixX, rotMatrixY, rotMatrixZ, eulerAngles) + public static void decomposeProjectionMatrix(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX, Mat rotMatrixY, Mat rotMatrixZ, Mat eulerAngles) + { + + decomposeProjectionMatrix_0(projMatrix.nativeObj, cameraMatrix.nativeObj, rotMatrix.nativeObj, transVect.nativeObj, rotMatrixX.nativeObj, rotMatrixY.nativeObj, rotMatrixZ.nativeObj, eulerAngles.nativeObj); + + return; + } + + //javadoc: decomposeProjectionMatrix(projMatrix, cameraMatrix, rotMatrix, transVect) + public static void decomposeProjectionMatrix(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect) + { + + decomposeProjectionMatrix_1(projMatrix.nativeObj, cameraMatrix.nativeObj, rotMatrix.nativeObj, transVect.nativeObj); + + return; + } + + + // + // C++: void drawChessboardCorners(Mat& image, Size patternSize, vector_Point2f corners, bool patternWasFound) + // + + //javadoc: drawChessboardCorners(image, patternSize, corners, patternWasFound) + public static void drawChessboardCorners(Mat image, Size patternSize, MatOfPoint2f corners, boolean patternWasFound) + { + Mat corners_mat = corners; + drawChessboardCorners_0(image.nativeObj, patternSize.width, patternSize.height, corners_mat.nativeObj, patternWasFound); + + return; + } + + + // + // C++: void filterSpeckles(Mat& img, double newVal, int maxSpeckleSize, double maxDiff, Mat& buf = Mat()) + // + + //javadoc: filterSpeckles(img, newVal, maxSpeckleSize, maxDiff, buf) + public static void filterSpeckles(Mat img, double newVal, int maxSpeckleSize, double maxDiff, Mat buf) + { + + filterSpeckles_0(img.nativeObj, newVal, maxSpeckleSize, maxDiff, buf.nativeObj); + + return; + } + + //javadoc: filterSpeckles(img, newVal, maxSpeckleSize, maxDiff) + public static void filterSpeckles(Mat img, double newVal, int maxSpeckleSize, double maxDiff) + { + + filterSpeckles_1(img.nativeObj, newVal, maxSpeckleSize, maxDiff); + + return; + } + + + // + // C++: void matMulDeriv(Mat A, Mat B, Mat& dABdA, Mat& dABdB) + // + + //javadoc: matMulDeriv(A, B, dABdA, dABdB) + public static void matMulDeriv(Mat A, Mat B, Mat dABdA, Mat dABdB) + { + + matMulDeriv_0(A.nativeObj, B.nativeObj, dABdA.nativeObj, dABdB.nativeObj); + + return; + } + + + // + // C++: void projectPoints(vector_Point3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, vector_double distCoeffs, vector_Point2f& imagePoints, Mat& jacobian = Mat(), double aspectRatio = 0) + // + + //javadoc: projectPoints(objectPoints, rvec, tvec, cameraMatrix, distCoeffs, imagePoints, jacobian, aspectRatio) + public static void projectPoints(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints, Mat jacobian, double aspectRatio) + { + Mat objectPoints_mat = objectPoints; + Mat distCoeffs_mat = distCoeffs; + Mat imagePoints_mat = imagePoints; + projectPoints_0(objectPoints_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, imagePoints_mat.nativeObj, jacobian.nativeObj, aspectRatio); + + return; + } + + //javadoc: projectPoints(objectPoints, rvec, tvec, cameraMatrix, distCoeffs, imagePoints) + public static void projectPoints(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints) + { + Mat objectPoints_mat = objectPoints; + Mat distCoeffs_mat = distCoeffs; + Mat imagePoints_mat = imagePoints; + projectPoints_1(objectPoints_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, imagePoints_mat.nativeObj); + + return; + } + + + // + // C++: void reprojectImageTo3D(Mat disparity, Mat& _3dImage, Mat Q, bool handleMissingValues = false, int ddepth = -1) + // + + //javadoc: reprojectImageTo3D(disparity, _3dImage, Q, handleMissingValues, ddepth) + public static void reprojectImageTo3D(Mat disparity, Mat _3dImage, Mat Q, boolean handleMissingValues, int ddepth) + { + + reprojectImageTo3D_0(disparity.nativeObj, _3dImage.nativeObj, Q.nativeObj, handleMissingValues, ddepth); + + return; + } + + //javadoc: reprojectImageTo3D(disparity, _3dImage, Q, handleMissingValues) + public static void reprojectImageTo3D(Mat disparity, Mat _3dImage, Mat Q, boolean handleMissingValues) + { + + reprojectImageTo3D_1(disparity.nativeObj, _3dImage.nativeObj, Q.nativeObj, handleMissingValues); + + return; + } + + //javadoc: reprojectImageTo3D(disparity, _3dImage, Q) + public static void reprojectImageTo3D(Mat disparity, Mat _3dImage, Mat Q) + { + + reprojectImageTo3D_2(disparity.nativeObj, _3dImage.nativeObj, Q.nativeObj); + + return; + } + + + // + // C++: void stereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags = CALIB_ZERO_DISPARITY, double alpha = -1, Size newImageSize = Size(), Rect* validPixROI1 = 0, Rect* validPixROI2 = 0) + // + + //javadoc: stereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q, flags, alpha, newImageSize, validPixROI1, validPixROI2) + public static void stereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q, int flags, double alpha, Size newImageSize, Rect validPixROI1, Rect validPixROI2) + { + double[] validPixROI1_out = new double[4]; + double[] validPixROI2_out = new double[4]; + stereoRectify_0(cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, R1.nativeObj, R2.nativeObj, P1.nativeObj, P2.nativeObj, Q.nativeObj, flags, alpha, newImageSize.width, newImageSize.height, validPixROI1_out, validPixROI2_out); + if(validPixROI1!=null){ validPixROI1.x = (int)validPixROI1_out[0]; validPixROI1.y = (int)validPixROI1_out[1]; validPixROI1.width = (int)validPixROI1_out[2]; validPixROI1.height = (int)validPixROI1_out[3]; } + if(validPixROI2!=null){ validPixROI2.x = (int)validPixROI2_out[0]; validPixROI2.y = (int)validPixROI2_out[1]; validPixROI2.width = (int)validPixROI2_out[2]; validPixROI2.height = (int)validPixROI2_out[3]; } + return; + } + + //javadoc: stereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q) + public static void stereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q) + { + + stereoRectify_1(cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, R1.nativeObj, R2.nativeObj, P1.nativeObj, P2.nativeObj, Q.nativeObj); + + return; + } + + + // + // C++: void triangulatePoints(Mat projMatr1, Mat projMatr2, Mat projPoints1, Mat projPoints2, Mat& points4D) + // + + //javadoc: triangulatePoints(projMatr1, projMatr2, projPoints1, projPoints2, points4D) + public static void triangulatePoints(Mat projMatr1, Mat projMatr2, Mat projPoints1, Mat projPoints2, Mat points4D) + { + + triangulatePoints_0(projMatr1.nativeObj, projMatr2.nativeObj, projPoints1.nativeObj, projPoints2.nativeObj, points4D.nativeObj); + + return; + } + + + // + // C++: void validateDisparity(Mat& disparity, Mat cost, int minDisparity, int numberOfDisparities, int disp12MaxDisp = 1) + // + + //javadoc: validateDisparity(disparity, cost, minDisparity, numberOfDisparities, disp12MaxDisp) + public static void validateDisparity(Mat disparity, Mat cost, int minDisparity, int numberOfDisparities, int disp12MaxDisp) + { + + validateDisparity_0(disparity.nativeObj, cost.nativeObj, minDisparity, numberOfDisparities, disp12MaxDisp); + + return; + } + + //javadoc: validateDisparity(disparity, cost, minDisparity, numberOfDisparities) + public static void validateDisparity(Mat disparity, Mat cost, int minDisparity, int numberOfDisparities) + { + + validateDisparity_1(disparity.nativeObj, cost.nativeObj, minDisparity, numberOfDisparities); + + return; + } + + + // + // C++: void distortPoints(Mat undistorted, Mat& distorted, Mat K, Mat D, double alpha = 0) + // + + //javadoc: distortPoints(undistorted, distorted, K, D, alpha) + public static void distortPoints(Mat undistorted, Mat distorted, Mat K, Mat D, double alpha) + { + + distortPoints_0(undistorted.nativeObj, distorted.nativeObj, K.nativeObj, D.nativeObj, alpha); + + return; + } + + //javadoc: distortPoints(undistorted, distorted, K, D) + public static void distortPoints(Mat undistorted, Mat distorted, Mat K, Mat D) + { + + distortPoints_1(undistorted.nativeObj, distorted.nativeObj, K.nativeObj, D.nativeObj); + + return; + } + + + // + // C++: void estimateNewCameraMatrixForUndistortRectify(Mat K, Mat D, Size image_size, Mat R, Mat& P, double balance = 0.0, Size new_size = Size(), double fov_scale = 1.0) + // + + //javadoc: estimateNewCameraMatrixForUndistortRectify(K, D, image_size, R, P, balance, new_size, fov_scale) + public static void estimateNewCameraMatrixForUndistortRectify(Mat K, Mat D, Size image_size, Mat R, Mat P, double balance, Size new_size, double fov_scale) + { + + estimateNewCameraMatrixForUndistortRectify_0(K.nativeObj, D.nativeObj, image_size.width, image_size.height, R.nativeObj, P.nativeObj, balance, new_size.width, new_size.height, fov_scale); + + return; + } + + //javadoc: estimateNewCameraMatrixForUndistortRectify(K, D, image_size, R, P) + public static void estimateNewCameraMatrixForUndistortRectify(Mat K, Mat D, Size image_size, Mat R, Mat P) + { + + estimateNewCameraMatrixForUndistortRectify_1(K.nativeObj, D.nativeObj, image_size.width, image_size.height, R.nativeObj, P.nativeObj); + + return; + } + + + // + // C++: void initUndistortRectifyMap(Mat K, Mat D, Mat R, Mat P, Size size, int m1type, Mat& map1, Mat& map2) + // + + //javadoc: initUndistortRectifyMap(K, D, R, P, size, m1type, map1, map2) + public static void initUndistortRectifyMap(Mat K, Mat D, Mat R, Mat P, Size size, int m1type, Mat map1, Mat map2) + { + + initUndistortRectifyMap_0(K.nativeObj, D.nativeObj, R.nativeObj, P.nativeObj, size.width, size.height, m1type, map1.nativeObj, map2.nativeObj); + + return; + } + + + // + // C++: void projectPoints(vector_Point3f objectPoints, vector_Point2f& imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha = 0, Mat& jacobian = Mat()) + // + + //javadoc: projectPoints(objectPoints, imagePoints, rvec, tvec, K, D, alpha, jacobian) + public static void projectPoints(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha, Mat jacobian) + { + Mat objectPoints_mat = objectPoints; + Mat imagePoints_mat = imagePoints; + projectPoints_2(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, K.nativeObj, D.nativeObj, alpha, jacobian.nativeObj); + + return; + } + + //javadoc: projectPoints(objectPoints, imagePoints, rvec, tvec, K, D) + public static void projectPoints(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat rvec, Mat tvec, Mat K, Mat D) + { + Mat objectPoints_mat = objectPoints; + Mat imagePoints_mat = imagePoints; + projectPoints_3(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, K.nativeObj, D.nativeObj); + + return; + } + + + // + // C++: void stereoRectify(Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat tvec, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags, Size newImageSize = Size(), double balance = 0.0, double fov_scale = 1.0) + // + + //javadoc: stereoRectify(K1, D1, K2, D2, imageSize, R, tvec, R1, R2, P1, P2, Q, flags, newImageSize, balance, fov_scale) + public static void stereoRectify(Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat tvec, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q, int flags, Size newImageSize, double balance, double fov_scale) + { + + stereoRectify_2(K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, tvec.nativeObj, R1.nativeObj, R2.nativeObj, P1.nativeObj, P2.nativeObj, Q.nativeObj, flags, newImageSize.width, newImageSize.height, balance, fov_scale); + + return; + } + + //javadoc: stereoRectify(K1, D1, K2, D2, imageSize, R, tvec, R1, R2, P1, P2, Q, flags) + public static void stereoRectify(Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat tvec, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q, int flags) + { + + stereoRectify_3(K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, tvec.nativeObj, R1.nativeObj, R2.nativeObj, P1.nativeObj, P2.nativeObj, Q.nativeObj, flags); + + return; + } + + + // + // C++: void undistortImage(Mat distorted, Mat& undistorted, Mat K, Mat D, Mat Knew = cv::Mat(), Size new_size = Size()) + // + + //javadoc: undistortImage(distorted, undistorted, K, D, Knew, new_size) + public static void undistortImage(Mat distorted, Mat undistorted, Mat K, Mat D, Mat Knew, Size new_size) + { + + undistortImage_0(distorted.nativeObj, undistorted.nativeObj, K.nativeObj, D.nativeObj, Knew.nativeObj, new_size.width, new_size.height); + + return; + } + + //javadoc: undistortImage(distorted, undistorted, K, D) + public static void undistortImage(Mat distorted, Mat undistorted, Mat K, Mat D) + { + + undistortImage_1(distorted.nativeObj, undistorted.nativeObj, K.nativeObj, D.nativeObj); + + return; + } + + + // + // C++: void undistortPoints(Mat distorted, Mat& undistorted, Mat K, Mat D, Mat R = Mat(), Mat P = Mat()) + // + + //javadoc: undistortPoints(distorted, undistorted, K, D, R, P) + public static void undistortPoints(Mat distorted, Mat undistorted, Mat K, Mat D, Mat R, Mat P) + { + + undistortPoints_0(distorted.nativeObj, undistorted.nativeObj, K.nativeObj, D.nativeObj, R.nativeObj, P.nativeObj); + + return; + } + + //javadoc: undistortPoints(distorted, undistorted, K, D) + public static void undistortPoints(Mat distorted, Mat undistorted, Mat K, Mat D) + { + + undistortPoints_1(distorted.nativeObj, undistorted.nativeObj, K.nativeObj, D.nativeObj); + + return; + } + + + + + // C++: Mat findEssentialMat(Mat points1, Mat points2, Mat cameraMatrix, int method = RANSAC, double prob = 0.999, double threshold = 1.0, Mat& mask = Mat()) + private static native long findEssentialMat_0(long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, int method, double prob, double threshold, long mask_nativeObj); + private static native long findEssentialMat_1(long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, int method, double prob, double threshold); + private static native long findEssentialMat_2(long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj); + + // C++: Mat findEssentialMat(Mat points1, Mat points2, double focal = 1.0, Point2d pp = Point2d(0, 0), int method = RANSAC, double prob = 0.999, double threshold = 1.0, Mat& mask = Mat()) + private static native long findEssentialMat_3(long points1_nativeObj, long points2_nativeObj, double focal, double pp_x, double pp_y, int method, double prob, double threshold, long mask_nativeObj); + private static native long findEssentialMat_4(long points1_nativeObj, long points2_nativeObj, double focal, double pp_x, double pp_y, int method, double prob, double threshold); + private static native long findEssentialMat_5(long points1_nativeObj, long points2_nativeObj); + + // C++: Mat findFundamentalMat(vector_Point2f points1, vector_Point2f points2, int method = FM_RANSAC, double param1 = 3., double param2 = 0.99, Mat& mask = Mat()) + private static native long findFundamentalMat_0(long points1_mat_nativeObj, long points2_mat_nativeObj, int method, double param1, double param2, long mask_nativeObj); + private static native long findFundamentalMat_1(long points1_mat_nativeObj, long points2_mat_nativeObj, int method, double param1, double param2); + private static native long findFundamentalMat_2(long points1_mat_nativeObj, long points2_mat_nativeObj); + + // C++: Mat findHomography(vector_Point2f srcPoints, vector_Point2f dstPoints, int method = 0, double ransacReprojThreshold = 3, Mat& mask = Mat(), int maxIters = 2000, double confidence = 0.995) + private static native long findHomography_0(long srcPoints_mat_nativeObj, long dstPoints_mat_nativeObj, int method, double ransacReprojThreshold, long mask_nativeObj, int maxIters, double confidence); + private static native long findHomography_1(long srcPoints_mat_nativeObj, long dstPoints_mat_nativeObj, int method, double ransacReprojThreshold); + private static native long findHomography_2(long srcPoints_mat_nativeObj, long dstPoints_mat_nativeObj); + + // C++: Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize = Size(), Rect* validPixROI = 0, bool centerPrincipalPoint = false) + private static native long getOptimalNewCameraMatrix_0(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, double imageSize_width, double imageSize_height, double alpha, double newImgSize_width, double newImgSize_height, double[] validPixROI_out, boolean centerPrincipalPoint); + private static native long getOptimalNewCameraMatrix_1(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, double imageSize_width, double imageSize_height, double alpha); + + // C++: Mat initCameraMatrix2D(vector_vector_Point3f objectPoints, vector_vector_Point2f imagePoints, Size imageSize, double aspectRatio = 1.0) + private static native long initCameraMatrix2D_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, double aspectRatio); + private static native long initCameraMatrix2D_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height); + + // C++: Rect getValidDisparityROI(Rect roi1, Rect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize) + private static native double[] getValidDisparityROI_0(int roi1_x, int roi1_y, int roi1_width, int roi1_height, int roi2_x, int roi2_y, int roi2_width, int roi2_height, int minDisparity, int numberOfDisparities, int SADWindowSize); + + // C++: Vec3d RQDecomp3x3(Mat src, Mat& mtxR, Mat& mtxQ, Mat& Qx = Mat(), Mat& Qy = Mat(), Mat& Qz = Mat()) + private static native double[] RQDecomp3x3_0(long src_nativeObj, long mtxR_nativeObj, long mtxQ_nativeObj, long Qx_nativeObj, long Qy_nativeObj, long Qz_nativeObj); + private static native double[] RQDecomp3x3_1(long src_nativeObj, long mtxR_nativeObj, long mtxQ_nativeObj); + + // C++: bool findChessboardCorners(Mat image, Size patternSize, vector_Point2f& corners, int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE) + private static native boolean findChessboardCorners_0(long image_nativeObj, double patternSize_width, double patternSize_height, long corners_mat_nativeObj, int flags); + private static native boolean findChessboardCorners_1(long image_nativeObj, double patternSize_width, double patternSize_height, long corners_mat_nativeObj); + + // C++: bool findCirclesGrid(Mat image, Size patternSize, Mat& centers, int flags = CALIB_CB_SYMMETRIC_GRID, Ptr_FeatureDetector blobDetector = SimpleBlobDetector::create()) + private static native boolean findCirclesGrid_0(long image_nativeObj, double patternSize_width, double patternSize_height, long centers_nativeObj, int flags); + private static native boolean findCirclesGrid_1(long image_nativeObj, double patternSize_width, double patternSize_height, long centers_nativeObj); + + // C++: bool solvePnP(vector_Point3f objectPoints, vector_Point2f imagePoints, Mat cameraMatrix, vector_double distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE) + private static native boolean solvePnP_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, boolean useExtrinsicGuess, int flags); + private static native boolean solvePnP_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj); + + // C++: bool solvePnPRansac(vector_Point3f objectPoints, vector_Point2f imagePoints, Mat cameraMatrix, vector_double distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false, int iterationsCount = 100, float reprojectionError = 8.0, double confidence = 0.99, Mat& inliers = Mat(), int flags = SOLVEPNP_ITERATIVE) + private static native boolean solvePnPRansac_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, long inliers_nativeObj, int flags); + private static native boolean solvePnPRansac_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj); + + // C++: bool stereoRectifyUncalibrated(Mat points1, Mat points2, Mat F, Size imgSize, Mat& H1, Mat& H2, double threshold = 5) + private static native boolean stereoRectifyUncalibrated_0(long points1_nativeObj, long points2_nativeObj, long F_nativeObj, double imgSize_width, double imgSize_height, long H1_nativeObj, long H2_nativeObj, double threshold); + private static native boolean stereoRectifyUncalibrated_1(long points1_nativeObj, long points2_nativeObj, long F_nativeObj, double imgSize_width, double imgSize_height, long H1_nativeObj, long H2_nativeObj); + + // C++: double calibrateCamera(vector_Mat objectPoints, vector_Mat imagePoints, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, int flags = 0, TermCriteria criteria = TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)) + private static native double calibrateCamera_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); + private static native double calibrateCamera_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags); + private static native double calibrateCamera_2(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj); + + // C++: double sampsonDistance(Mat pt1, Mat pt2, Mat F) + private static native double sampsonDistance_0(long pt1_nativeObj, long pt2_nativeObj, long F_nativeObj); + + // C++: double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& cameraMatrix1, Mat& distCoeffs1, Mat& cameraMatrix2, Mat& distCoeffs2, Size imageSize, Mat& R, Mat& T, Mat& E, Mat& F, int flags = CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6)) + private static native double stereoCalibrate_0(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long E_nativeObj, long F_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); + private static native double stereoCalibrate_1(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long E_nativeObj, long F_nativeObj, int flags); + private static native double stereoCalibrate_2(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long E_nativeObj, long F_nativeObj); + + // C++: double calibrate(vector_Mat objectPoints, vector_Mat imagePoints, Size image_size, Mat& K, Mat& D, vector_Mat& rvecs, vector_Mat& tvecs, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)) + private static native double calibrate_0(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double image_size_width, double image_size_height, long K_nativeObj, long D_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); + private static native double calibrate_1(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double image_size_width, double image_size_height, long K_nativeObj, long D_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, int flags); + private static native double calibrate_2(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, double image_size_width, double image_size_height, long K_nativeObj, long D_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj); + + // C++: double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& K1, Mat& D1, Mat& K2, Mat& D2, Size imageSize, Mat& R, Mat& T, int flags = fisheye::CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)) + private static native double stereoCalibrate_3(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon); + private static native double stereoCalibrate_4(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, int flags); + private static native double stereoCalibrate_5(long objectPoints_mat_nativeObj, long imagePoints1_mat_nativeObj, long imagePoints2_mat_nativeObj, long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj); + + // C++: float rectify3Collinear(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat cameraMatrix3, Mat distCoeffs3, vector_Mat imgpt1, vector_Mat imgpt3, Size imageSize, Mat R12, Mat T12, Mat R13, Mat T13, Mat& R1, Mat& R2, Mat& R3, Mat& P1, Mat& P2, Mat& P3, Mat& Q, double alpha, Size newImgSize, Rect* roi1, Rect* roi2, int flags) + private static native float rectify3Collinear_0(long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, long cameraMatrix3_nativeObj, long distCoeffs3_nativeObj, long imgpt1_mat_nativeObj, long imgpt3_mat_nativeObj, double imageSize_width, double imageSize_height, long R12_nativeObj, long T12_nativeObj, long R13_nativeObj, long T13_nativeObj, long R1_nativeObj, long R2_nativeObj, long R3_nativeObj, long P1_nativeObj, long P2_nativeObj, long P3_nativeObj, long Q_nativeObj, double alpha, double newImgSize_width, double newImgSize_height, double[] roi1_out, double[] roi2_out, int flags); + + // C++: int decomposeHomographyMat(Mat H, Mat K, vector_Mat& rotations, vector_Mat& translations, vector_Mat& normals) + private static native int decomposeHomographyMat_0(long H_nativeObj, long K_nativeObj, long rotations_mat_nativeObj, long translations_mat_nativeObj, long normals_mat_nativeObj); + + // C++: int estimateAffine3D(Mat src, Mat dst, Mat& out, Mat& inliers, double ransacThreshold = 3, double confidence = 0.99) + private static native int estimateAffine3D_0(long src_nativeObj, long dst_nativeObj, long out_nativeObj, long inliers_nativeObj, double ransacThreshold, double confidence); + private static native int estimateAffine3D_1(long src_nativeObj, long dst_nativeObj, long out_nativeObj, long inliers_nativeObj); + + // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat& R, Mat& t, double focal = 1.0, Point2d pp = Point2d(0, 0), Mat& mask = Mat()) + private static native int recoverPose_0(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long R_nativeObj, long t_nativeObj, double focal, double pp_x, double pp_y, long mask_nativeObj); + private static native int recoverPose_1(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long R_nativeObj, long t_nativeObj, double focal, double pp_x, double pp_y); + private static native int recoverPose_2(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long R_nativeObj, long t_nativeObj); + + // C++: int recoverPose(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat& R, Mat& t, Mat& mask = Mat()) + private static native int recoverPose_3(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, long R_nativeObj, long t_nativeObj, long mask_nativeObj); + private static native int recoverPose_4(long E_nativeObj, long points1_nativeObj, long points2_nativeObj, long cameraMatrix_nativeObj, long R_nativeObj, long t_nativeObj); + + // C++: void Rodrigues(Mat src, Mat& dst, Mat& jacobian = Mat()) + private static native void Rodrigues_0(long src_nativeObj, long dst_nativeObj, long jacobian_nativeObj); + private static native void Rodrigues_1(long src_nativeObj, long dst_nativeObj); + + // C++: void calibrationMatrixValues(Mat cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double& fovx, double& fovy, double& focalLength, Point2d& principalPoint, double& aspectRatio) + private static native void calibrationMatrixValues_0(long cameraMatrix_nativeObj, double imageSize_width, double imageSize_height, double apertureWidth, double apertureHeight, double[] fovx_out, double[] fovy_out, double[] focalLength_out, double[] principalPoint_out, double[] aspectRatio_out); + + // C++: void composeRT(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat& rvec3, Mat& tvec3, Mat& dr3dr1 = Mat(), Mat& dr3dt1 = Mat(), Mat& dr3dr2 = Mat(), Mat& dr3dt2 = Mat(), Mat& dt3dr1 = Mat(), Mat& dt3dt1 = Mat(), Mat& dt3dr2 = Mat(), Mat& dt3dt2 = Mat()) + private static native void composeRT_0(long rvec1_nativeObj, long tvec1_nativeObj, long rvec2_nativeObj, long tvec2_nativeObj, long rvec3_nativeObj, long tvec3_nativeObj, long dr3dr1_nativeObj, long dr3dt1_nativeObj, long dr3dr2_nativeObj, long dr3dt2_nativeObj, long dt3dr1_nativeObj, long dt3dt1_nativeObj, long dt3dr2_nativeObj, long dt3dt2_nativeObj); + private static native void composeRT_1(long rvec1_nativeObj, long tvec1_nativeObj, long rvec2_nativeObj, long tvec2_nativeObj, long rvec3_nativeObj, long tvec3_nativeObj); + + // C++: void computeCorrespondEpilines(Mat points, int whichImage, Mat F, Mat& lines) + private static native void computeCorrespondEpilines_0(long points_nativeObj, int whichImage, long F_nativeObj, long lines_nativeObj); + + // C++: void convertPointsFromHomogeneous(Mat src, Mat& dst) + private static native void convertPointsFromHomogeneous_0(long src_nativeObj, long dst_nativeObj); + + // C++: void convertPointsToHomogeneous(Mat src, Mat& dst) + private static native void convertPointsToHomogeneous_0(long src_nativeObj, long dst_nativeObj); + + // C++: void correctMatches(Mat F, Mat points1, Mat points2, Mat& newPoints1, Mat& newPoints2) + private static native void correctMatches_0(long F_nativeObj, long points1_nativeObj, long points2_nativeObj, long newPoints1_nativeObj, long newPoints2_nativeObj); + + // C++: void decomposeEssentialMat(Mat E, Mat& R1, Mat& R2, Mat& t) + private static native void decomposeEssentialMat_0(long E_nativeObj, long R1_nativeObj, long R2_nativeObj, long t_nativeObj); + + // C++: void decomposeProjectionMatrix(Mat projMatrix, Mat& cameraMatrix, Mat& rotMatrix, Mat& transVect, Mat& rotMatrixX = Mat(), Mat& rotMatrixY = Mat(), Mat& rotMatrixZ = Mat(), Mat& eulerAngles = Mat()) + private static native void decomposeProjectionMatrix_0(long projMatrix_nativeObj, long cameraMatrix_nativeObj, long rotMatrix_nativeObj, long transVect_nativeObj, long rotMatrixX_nativeObj, long rotMatrixY_nativeObj, long rotMatrixZ_nativeObj, long eulerAngles_nativeObj); + private static native void decomposeProjectionMatrix_1(long projMatrix_nativeObj, long cameraMatrix_nativeObj, long rotMatrix_nativeObj, long transVect_nativeObj); + + // C++: void drawChessboardCorners(Mat& image, Size patternSize, vector_Point2f corners, bool patternWasFound) + private static native void drawChessboardCorners_0(long image_nativeObj, double patternSize_width, double patternSize_height, long corners_mat_nativeObj, boolean patternWasFound); + + // C++: void filterSpeckles(Mat& img, double newVal, int maxSpeckleSize, double maxDiff, Mat& buf = Mat()) + private static native void filterSpeckles_0(long img_nativeObj, double newVal, int maxSpeckleSize, double maxDiff, long buf_nativeObj); + private static native void filterSpeckles_1(long img_nativeObj, double newVal, int maxSpeckleSize, double maxDiff); + + // C++: void matMulDeriv(Mat A, Mat B, Mat& dABdA, Mat& dABdB) + private static native void matMulDeriv_0(long A_nativeObj, long B_nativeObj, long dABdA_nativeObj, long dABdB_nativeObj); + + // C++: void projectPoints(vector_Point3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, vector_double distCoeffs, vector_Point2f& imagePoints, Mat& jacobian = Mat(), double aspectRatio = 0) + private static native void projectPoints_0(long objectPoints_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long imagePoints_mat_nativeObj, long jacobian_nativeObj, double aspectRatio); + private static native void projectPoints_1(long objectPoints_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_mat_nativeObj, long imagePoints_mat_nativeObj); + + // C++: void reprojectImageTo3D(Mat disparity, Mat& _3dImage, Mat Q, bool handleMissingValues = false, int ddepth = -1) + private static native void reprojectImageTo3D_0(long disparity_nativeObj, long _3dImage_nativeObj, long Q_nativeObj, boolean handleMissingValues, int ddepth); + private static native void reprojectImageTo3D_1(long disparity_nativeObj, long _3dImage_nativeObj, long Q_nativeObj, boolean handleMissingValues); + private static native void reprojectImageTo3D_2(long disparity_nativeObj, long _3dImage_nativeObj, long Q_nativeObj); + + // C++: void stereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags = CALIB_ZERO_DISPARITY, double alpha = -1, Size newImageSize = Size(), Rect* validPixROI1 = 0, Rect* validPixROI2 = 0) + private static native void stereoRectify_0(long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long R1_nativeObj, long R2_nativeObj, long P1_nativeObj, long P2_nativeObj, long Q_nativeObj, int flags, double alpha, double newImageSize_width, double newImageSize_height, double[] validPixROI1_out, double[] validPixROI2_out); + private static native void stereoRectify_1(long cameraMatrix1_nativeObj, long distCoeffs1_nativeObj, long cameraMatrix2_nativeObj, long distCoeffs2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long T_nativeObj, long R1_nativeObj, long R2_nativeObj, long P1_nativeObj, long P2_nativeObj, long Q_nativeObj); + + // C++: void triangulatePoints(Mat projMatr1, Mat projMatr2, Mat projPoints1, Mat projPoints2, Mat& points4D) + private static native void triangulatePoints_0(long projMatr1_nativeObj, long projMatr2_nativeObj, long projPoints1_nativeObj, long projPoints2_nativeObj, long points4D_nativeObj); + + // C++: void validateDisparity(Mat& disparity, Mat cost, int minDisparity, int numberOfDisparities, int disp12MaxDisp = 1) + private static native void validateDisparity_0(long disparity_nativeObj, long cost_nativeObj, int minDisparity, int numberOfDisparities, int disp12MaxDisp); + private static native void validateDisparity_1(long disparity_nativeObj, long cost_nativeObj, int minDisparity, int numberOfDisparities); + + // C++: void distortPoints(Mat undistorted, Mat& distorted, Mat K, Mat D, double alpha = 0) + private static native void distortPoints_0(long undistorted_nativeObj, long distorted_nativeObj, long K_nativeObj, long D_nativeObj, double alpha); + private static native void distortPoints_1(long undistorted_nativeObj, long distorted_nativeObj, long K_nativeObj, long D_nativeObj); + + // C++: void estimateNewCameraMatrixForUndistortRectify(Mat K, Mat D, Size image_size, Mat R, Mat& P, double balance = 0.0, Size new_size = Size(), double fov_scale = 1.0) + private static native void estimateNewCameraMatrixForUndistortRectify_0(long K_nativeObj, long D_nativeObj, double image_size_width, double image_size_height, long R_nativeObj, long P_nativeObj, double balance, double new_size_width, double new_size_height, double fov_scale); + private static native void estimateNewCameraMatrixForUndistortRectify_1(long K_nativeObj, long D_nativeObj, double image_size_width, double image_size_height, long R_nativeObj, long P_nativeObj); + + // C++: void initUndistortRectifyMap(Mat K, Mat D, Mat R, Mat P, Size size, int m1type, Mat& map1, Mat& map2) + private static native void initUndistortRectifyMap_0(long K_nativeObj, long D_nativeObj, long R_nativeObj, long P_nativeObj, double size_width, double size_height, int m1type, long map1_nativeObj, long map2_nativeObj); + + // C++: void projectPoints(vector_Point3f objectPoints, vector_Point2f& imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha = 0, Mat& jacobian = Mat()) + private static native void projectPoints_2(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, long K_nativeObj, long D_nativeObj, double alpha, long jacobian_nativeObj); + private static native void projectPoints_3(long objectPoints_mat_nativeObj, long imagePoints_mat_nativeObj, long rvec_nativeObj, long tvec_nativeObj, long K_nativeObj, long D_nativeObj); + + // C++: void stereoRectify(Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat tvec, Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q, int flags, Size newImageSize = Size(), double balance = 0.0, double fov_scale = 1.0) + private static native void stereoRectify_2(long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long tvec_nativeObj, long R1_nativeObj, long R2_nativeObj, long P1_nativeObj, long P2_nativeObj, long Q_nativeObj, int flags, double newImageSize_width, double newImageSize_height, double balance, double fov_scale); + private static native void stereoRectify_3(long K1_nativeObj, long D1_nativeObj, long K2_nativeObj, long D2_nativeObj, double imageSize_width, double imageSize_height, long R_nativeObj, long tvec_nativeObj, long R1_nativeObj, long R2_nativeObj, long P1_nativeObj, long P2_nativeObj, long Q_nativeObj, int flags); + + // C++: void undistortImage(Mat distorted, Mat& undistorted, Mat K, Mat D, Mat Knew = cv::Mat(), Size new_size = Size()) + private static native void undistortImage_0(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj, long Knew_nativeObj, double new_size_width, double new_size_height); + private static native void undistortImage_1(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj); + + // C++: void undistortPoints(Mat distorted, Mat& undistorted, Mat K, Mat D, Mat R = Mat(), Mat P = Mat()) + private static native void undistortPoints_0(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj, long R_nativeObj, long P_nativeObj); + private static native void undistortPoints_1(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoBM.java b/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoBM.java new file mode 100644 index 0000000..18aba05 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoBM.java @@ -0,0 +1,330 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.calib3d; + +import org.opencv.core.Rect; + +// C++: class StereoBM +//javadoc: StereoBM +public class StereoBM extends StereoMatcher { + + protected StereoBM(long addr) { super(addr); } + + + public static final int + PREFILTER_NORMALIZED_RESPONSE = 0, + PREFILTER_XSOBEL = 1; + + + // + // C++: static Ptr_StereoBM create(int numDisparities = 0, int blockSize = 21) + // + + //javadoc: StereoBM::create(numDisparities, blockSize) + public static StereoBM create(int numDisparities, int blockSize) + { + + StereoBM retVal = new StereoBM(create_0(numDisparities, blockSize)); + + return retVal; + } + + //javadoc: StereoBM::create() + public static StereoBM create() + { + + StereoBM retVal = new StereoBM(create_1()); + + return retVal; + } + + + // + // C++: Rect getROI1() + // + + //javadoc: StereoBM::getROI1() + public Rect getROI1() + { + + Rect retVal = new Rect(getROI1_0(nativeObj)); + + return retVal; + } + + + // + // C++: Rect getROI2() + // + + //javadoc: StereoBM::getROI2() + public Rect getROI2() + { + + Rect retVal = new Rect(getROI2_0(nativeObj)); + + return retVal; + } + + + // + // C++: int getPreFilterCap() + // + + //javadoc: StereoBM::getPreFilterCap() + public int getPreFilterCap() + { + + int retVal = getPreFilterCap_0(nativeObj); + + return retVal; + } + + + // + // C++: int getPreFilterSize() + // + + //javadoc: StereoBM::getPreFilterSize() + public int getPreFilterSize() + { + + int retVal = getPreFilterSize_0(nativeObj); + + return retVal; + } + + + // + // C++: int getPreFilterType() + // + + //javadoc: StereoBM::getPreFilterType() + public int getPreFilterType() + { + + int retVal = getPreFilterType_0(nativeObj); + + return retVal; + } + + + // + // C++: int getSmallerBlockSize() + // + + //javadoc: StereoBM::getSmallerBlockSize() + public int getSmallerBlockSize() + { + + int retVal = getSmallerBlockSize_0(nativeObj); + + return retVal; + } + + + // + // C++: int getTextureThreshold() + // + + //javadoc: StereoBM::getTextureThreshold() + public int getTextureThreshold() + { + + int retVal = getTextureThreshold_0(nativeObj); + + return retVal; + } + + + // + // C++: int getUniquenessRatio() + // + + //javadoc: StereoBM::getUniquenessRatio() + public int getUniquenessRatio() + { + + int retVal = getUniquenessRatio_0(nativeObj); + + return retVal; + } + + + // + // C++: void setPreFilterCap(int preFilterCap) + // + + //javadoc: StereoBM::setPreFilterCap(preFilterCap) + public void setPreFilterCap(int preFilterCap) + { + + setPreFilterCap_0(nativeObj, preFilterCap); + + return; + } + + + // + // C++: void setPreFilterSize(int preFilterSize) + // + + //javadoc: StereoBM::setPreFilterSize(preFilterSize) + public void setPreFilterSize(int preFilterSize) + { + + setPreFilterSize_0(nativeObj, preFilterSize); + + return; + } + + + // + // C++: void setPreFilterType(int preFilterType) + // + + //javadoc: StereoBM::setPreFilterType(preFilterType) + public void setPreFilterType(int preFilterType) + { + + setPreFilterType_0(nativeObj, preFilterType); + + return; + } + + + // + // C++: void setROI1(Rect roi1) + // + + //javadoc: StereoBM::setROI1(roi1) + public void setROI1(Rect roi1) + { + + setROI1_0(nativeObj, roi1.x, roi1.y, roi1.width, roi1.height); + + return; + } + + + // + // C++: void setROI2(Rect roi2) + // + + //javadoc: StereoBM::setROI2(roi2) + public void setROI2(Rect roi2) + { + + setROI2_0(nativeObj, roi2.x, roi2.y, roi2.width, roi2.height); + + return; + } + + + // + // C++: void setSmallerBlockSize(int blockSize) + // + + //javadoc: StereoBM::setSmallerBlockSize(blockSize) + public void setSmallerBlockSize(int blockSize) + { + + setSmallerBlockSize_0(nativeObj, blockSize); + + return; + } + + + // + // C++: void setTextureThreshold(int textureThreshold) + // + + //javadoc: StereoBM::setTextureThreshold(textureThreshold) + public void setTextureThreshold(int textureThreshold) + { + + setTextureThreshold_0(nativeObj, textureThreshold); + + return; + } + + + // + // C++: void setUniquenessRatio(int uniquenessRatio) + // + + //javadoc: StereoBM::setUniquenessRatio(uniquenessRatio) + public void setUniquenessRatio(int uniquenessRatio) + { + + setUniquenessRatio_0(nativeObj, uniquenessRatio); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: static Ptr_StereoBM create(int numDisparities = 0, int blockSize = 21) + private static native long create_0(int numDisparities, int blockSize); + private static native long create_1(); + + // C++: Rect getROI1() + private static native double[] getROI1_0(long nativeObj); + + // C++: Rect getROI2() + private static native double[] getROI2_0(long nativeObj); + + // C++: int getPreFilterCap() + private static native int getPreFilterCap_0(long nativeObj); + + // C++: int getPreFilterSize() + private static native int getPreFilterSize_0(long nativeObj); + + // C++: int getPreFilterType() + private static native int getPreFilterType_0(long nativeObj); + + // C++: int getSmallerBlockSize() + private static native int getSmallerBlockSize_0(long nativeObj); + + // C++: int getTextureThreshold() + private static native int getTextureThreshold_0(long nativeObj); + + // C++: int getUniquenessRatio() + private static native int getUniquenessRatio_0(long nativeObj); + + // C++: void setPreFilterCap(int preFilterCap) + private static native void setPreFilterCap_0(long nativeObj, int preFilterCap); + + // C++: void setPreFilterSize(int preFilterSize) + private static native void setPreFilterSize_0(long nativeObj, int preFilterSize); + + // C++: void setPreFilterType(int preFilterType) + private static native void setPreFilterType_0(long nativeObj, int preFilterType); + + // C++: void setROI1(Rect roi1) + private static native void setROI1_0(long nativeObj, int roi1_x, int roi1_y, int roi1_width, int roi1_height); + + // C++: void setROI2(Rect roi2) + private static native void setROI2_0(long nativeObj, int roi2_x, int roi2_y, int roi2_width, int roi2_height); + + // C++: void setSmallerBlockSize(int blockSize) + private static native void setSmallerBlockSize_0(long nativeObj, int blockSize); + + // C++: void setTextureThreshold(int textureThreshold) + private static native void setTextureThreshold_0(long nativeObj, int textureThreshold); + + // C++: void setUniquenessRatio(int uniquenessRatio) + private static native void setUniquenessRatio_0(long nativeObj, int uniquenessRatio); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoMatcher.java b/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoMatcher.java new file mode 100644 index 0000000..6b3c4f6 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoMatcher.java @@ -0,0 +1,253 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.calib3d; + +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; + +// C++: class StereoMatcher +//javadoc: StereoMatcher +public class StereoMatcher extends Algorithm { + + protected StereoMatcher(long addr) { super(addr); } + + + public static final int + DISP_SHIFT = 4, + DISP_SCALE = (1 << DISP_SHIFT); + + + // + // C++: int getBlockSize() + // + + //javadoc: StereoMatcher::getBlockSize() + public int getBlockSize() + { + + int retVal = getBlockSize_0(nativeObj); + + return retVal; + } + + + // + // C++: int getDisp12MaxDiff() + // + + //javadoc: StereoMatcher::getDisp12MaxDiff() + public int getDisp12MaxDiff() + { + + int retVal = getDisp12MaxDiff_0(nativeObj); + + return retVal; + } + + + // + // C++: int getMinDisparity() + // + + //javadoc: StereoMatcher::getMinDisparity() + public int getMinDisparity() + { + + int retVal = getMinDisparity_0(nativeObj); + + return retVal; + } + + + // + // C++: int getNumDisparities() + // + + //javadoc: StereoMatcher::getNumDisparities() + public int getNumDisparities() + { + + int retVal = getNumDisparities_0(nativeObj); + + return retVal; + } + + + // + // C++: int getSpeckleRange() + // + + //javadoc: StereoMatcher::getSpeckleRange() + public int getSpeckleRange() + { + + int retVal = getSpeckleRange_0(nativeObj); + + return retVal; + } + + + // + // C++: int getSpeckleWindowSize() + // + + //javadoc: StereoMatcher::getSpeckleWindowSize() + public int getSpeckleWindowSize() + { + + int retVal = getSpeckleWindowSize_0(nativeObj); + + return retVal; + } + + + // + // C++: void compute(Mat left, Mat right, Mat& disparity) + // + + //javadoc: StereoMatcher::compute(left, right, disparity) + public void compute(Mat left, Mat right, Mat disparity) + { + + compute_0(nativeObj, left.nativeObj, right.nativeObj, disparity.nativeObj); + + return; + } + + + // + // C++: void setBlockSize(int blockSize) + // + + //javadoc: StereoMatcher::setBlockSize(blockSize) + public void setBlockSize(int blockSize) + { + + setBlockSize_0(nativeObj, blockSize); + + return; + } + + + // + // C++: void setDisp12MaxDiff(int disp12MaxDiff) + // + + //javadoc: StereoMatcher::setDisp12MaxDiff(disp12MaxDiff) + public void setDisp12MaxDiff(int disp12MaxDiff) + { + + setDisp12MaxDiff_0(nativeObj, disp12MaxDiff); + + return; + } + + + // + // C++: void setMinDisparity(int minDisparity) + // + + //javadoc: StereoMatcher::setMinDisparity(minDisparity) + public void setMinDisparity(int minDisparity) + { + + setMinDisparity_0(nativeObj, minDisparity); + + return; + } + + + // + // C++: void setNumDisparities(int numDisparities) + // + + //javadoc: StereoMatcher::setNumDisparities(numDisparities) + public void setNumDisparities(int numDisparities) + { + + setNumDisparities_0(nativeObj, numDisparities); + + return; + } + + + // + // C++: void setSpeckleRange(int speckleRange) + // + + //javadoc: StereoMatcher::setSpeckleRange(speckleRange) + public void setSpeckleRange(int speckleRange) + { + + setSpeckleRange_0(nativeObj, speckleRange); + + return; + } + + + // + // C++: void setSpeckleWindowSize(int speckleWindowSize) + // + + //javadoc: StereoMatcher::setSpeckleWindowSize(speckleWindowSize) + public void setSpeckleWindowSize(int speckleWindowSize) + { + + setSpeckleWindowSize_0(nativeObj, speckleWindowSize); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: int getBlockSize() + private static native int getBlockSize_0(long nativeObj); + + // C++: int getDisp12MaxDiff() + private static native int getDisp12MaxDiff_0(long nativeObj); + + // C++: int getMinDisparity() + private static native int getMinDisparity_0(long nativeObj); + + // C++: int getNumDisparities() + private static native int getNumDisparities_0(long nativeObj); + + // C++: int getSpeckleRange() + private static native int getSpeckleRange_0(long nativeObj); + + // C++: int getSpeckleWindowSize() + private static native int getSpeckleWindowSize_0(long nativeObj); + + // C++: void compute(Mat left, Mat right, Mat& disparity) + private static native void compute_0(long nativeObj, long left_nativeObj, long right_nativeObj, long disparity_nativeObj); + + // C++: void setBlockSize(int blockSize) + private static native void setBlockSize_0(long nativeObj, int blockSize); + + // C++: void setDisp12MaxDiff(int disp12MaxDiff) + private static native void setDisp12MaxDiff_0(long nativeObj, int disp12MaxDiff); + + // C++: void setMinDisparity(int minDisparity) + private static native void setMinDisparity_0(long nativeObj, int minDisparity); + + // C++: void setNumDisparities(int numDisparities) + private static native void setNumDisparities_0(long nativeObj, int numDisparities); + + // C++: void setSpeckleRange(int speckleRange) + private static native void setSpeckleRange_0(long nativeObj, int speckleRange); + + // C++: void setSpeckleWindowSize(int speckleWindowSize) + private static native void setSpeckleWindowSize_0(long nativeObj, int speckleWindowSize); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoSGBM.java b/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoSGBM.java new file mode 100644 index 0000000..435830c --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/calib3d/StereoSGBM.java @@ -0,0 +1,229 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.calib3d; + + + +// C++: class StereoSGBM +//javadoc: StereoSGBM +public class StereoSGBM extends StereoMatcher { + + protected StereoSGBM(long addr) { super(addr); } + + + public static final int + MODE_SGBM = 0, + MODE_HH = 1, + MODE_SGBM_3WAY = 2; + + + // + // C++: static Ptr_StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1 = 0, int P2 = 0, int disp12MaxDiff = 0, int preFilterCap = 0, int uniquenessRatio = 0, int speckleWindowSize = 0, int speckleRange = 0, int mode = StereoSGBM::MODE_SGBM) + // + + //javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio, speckleWindowSize, speckleRange, mode) + public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize, int speckleRange, int mode) + { + + StereoSGBM retVal = new StereoSGBM(create_0(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio, speckleWindowSize, speckleRange, mode)); + + return retVal; + } + + //javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize) + public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize) + { + + StereoSGBM retVal = new StereoSGBM(create_1(minDisparity, numDisparities, blockSize)); + + return retVal; + } + + + // + // C++: int getMode() + // + + //javadoc: StereoSGBM::getMode() + public int getMode() + { + + int retVal = getMode_0(nativeObj); + + return retVal; + } + + + // + // C++: int getP1() + // + + //javadoc: StereoSGBM::getP1() + public int getP1() + { + + int retVal = getP1_0(nativeObj); + + return retVal; + } + + + // + // C++: int getP2() + // + + //javadoc: StereoSGBM::getP2() + public int getP2() + { + + int retVal = getP2_0(nativeObj); + + return retVal; + } + + + // + // C++: int getPreFilterCap() + // + + //javadoc: StereoSGBM::getPreFilterCap() + public int getPreFilterCap() + { + + int retVal = getPreFilterCap_0(nativeObj); + + return retVal; + } + + + // + // C++: int getUniquenessRatio() + // + + //javadoc: StereoSGBM::getUniquenessRatio() + public int getUniquenessRatio() + { + + int retVal = getUniquenessRatio_0(nativeObj); + + return retVal; + } + + + // + // C++: void setMode(int mode) + // + + //javadoc: StereoSGBM::setMode(mode) + public void setMode(int mode) + { + + setMode_0(nativeObj, mode); + + return; + } + + + // + // C++: void setP1(int P1) + // + + //javadoc: StereoSGBM::setP1(P1) + public void setP1(int P1) + { + + setP1_0(nativeObj, P1); + + return; + } + + + // + // C++: void setP2(int P2) + // + + //javadoc: StereoSGBM::setP2(P2) + public void setP2(int P2) + { + + setP2_0(nativeObj, P2); + + return; + } + + + // + // C++: void setPreFilterCap(int preFilterCap) + // + + //javadoc: StereoSGBM::setPreFilterCap(preFilterCap) + public void setPreFilterCap(int preFilterCap) + { + + setPreFilterCap_0(nativeObj, preFilterCap); + + return; + } + + + // + // C++: void setUniquenessRatio(int uniquenessRatio) + // + + //javadoc: StereoSGBM::setUniquenessRatio(uniquenessRatio) + public void setUniquenessRatio(int uniquenessRatio) + { + + setUniquenessRatio_0(nativeObj, uniquenessRatio); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: static Ptr_StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1 = 0, int P2 = 0, int disp12MaxDiff = 0, int preFilterCap = 0, int uniquenessRatio = 0, int speckleWindowSize = 0, int speckleRange = 0, int mode = StereoSGBM::MODE_SGBM) + private static native long create_0(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize, int speckleRange, int mode); + private static native long create_1(int minDisparity, int numDisparities, int blockSize); + + // C++: int getMode() + private static native int getMode_0(long nativeObj); + + // C++: int getP1() + private static native int getP1_0(long nativeObj); + + // C++: int getP2() + private static native int getP2_0(long nativeObj); + + // C++: int getPreFilterCap() + private static native int getPreFilterCap_0(long nativeObj); + + // C++: int getUniquenessRatio() + private static native int getUniquenessRatio_0(long nativeObj); + + // C++: void setMode(int mode) + private static native void setMode_0(long nativeObj, int mode); + + // C++: void setP1(int P1) + private static native void setP1_0(long nativeObj, int P1); + + // C++: void setP2(int P2) + private static native void setP2_0(long nativeObj, int P2); + + // C++: void setPreFilterCap(int preFilterCap) + private static native void setPreFilterCap_0(long nativeObj, int preFilterCap); + + // C++: void setUniquenessRatio(int uniquenessRatio) + private static native void setUniquenessRatio_0(long nativeObj, int uniquenessRatio); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Algorithm.java b/openCVLibrary310/src/main/java/org/opencv/core/Algorithm.java new file mode 100644 index 0000000..23551ea --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Algorithm.java @@ -0,0 +1,78 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.core; + +import java.lang.String; + +// C++: class Algorithm +//javadoc: Algorithm +public class Algorithm { + + protected final long nativeObj; + protected Algorithm(long addr) { nativeObj = addr; } + + + // + // C++: String getDefaultName() + // + + //javadoc: Algorithm::getDefaultName() + public String getDefaultName() + { + + String retVal = getDefaultName_0(nativeObj); + + return retVal; + } + + + // + // C++: void clear() + // + + //javadoc: Algorithm::clear() + public void clear() + { + + clear_0(nativeObj); + + return; + } + + + // + // C++: void save(String filename) + // + + //javadoc: Algorithm::save(filename) + public void save(String filename) + { + + save_0(nativeObj, filename); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: String getDefaultName() + private static native String getDefaultName_0(long nativeObj); + + // C++: void clear() + private static native void clear_0(long nativeObj); + + // C++: void save(String filename) + private static native void save_0(long nativeObj, String filename); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Core.java b/openCVLibrary310/src/main/java/org/opencv/core/Core.java new file mode 100644 index 0000000..e58f962 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Core.java @@ -0,0 +1,2574 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.core; + +import java.lang.String; +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfDouble; +import org.opencv.core.MatOfInt; +import org.opencv.core.Scalar; +import org.opencv.core.TermCriteria; +import org.opencv.utils.Converters; + +public class Core { + + // these constants are wrapped inside functions to prevent inlining + private static String getVersion() { return "3.1.0"; } + private static String getNativeLibraryName() { return "opencv_java310"; } + private static int getVersionMajor() { return 3; } + private static int getVersionMinor() { return 1; } + private static int getVersionRevision() { return 0; } + private static String getVersionStatus() { return ""; } + + public static final String VERSION = getVersion(); + public static final String NATIVE_LIBRARY_NAME = getNativeLibraryName(); + public static final int VERSION_MAJOR = getVersionMajor(); + public static final int VERSION_MINOR = getVersionMinor(); + public static final int VERSION_REVISION = getVersionRevision(); + public static final String VERSION_STATUS = getVersionStatus(); + + private static final int + CV_8U = 0, + CV_8S = 1, + CV_16U = 2, + CV_16S = 3, + CV_32S = 4, + CV_32F = 5, + CV_64F = 6, + CV_USRTYPE1 = 7; + + + public static final int + SVD_MODIFY_A = 1, + SVD_NO_UV = 2, + SVD_FULL_UV = 4, + FILLED = -1, + REDUCE_SUM = 0, + REDUCE_AVG = 1, + REDUCE_MAX = 2, + REDUCE_MIN = 3, + StsOk = 0, + StsBackTrace = -1, + StsError = -2, + StsInternal = -3, + StsNoMem = -4, + StsBadArg = -5, + StsBadFunc = -6, + StsNoConv = -7, + StsAutoTrace = -8, + HeaderIsNull = -9, + BadImageSize = -10, + BadOffset = -11, + BadDataPtr = -12, + BadStep = -13, + BadModelOrChSeq = -14, + BadNumChannels = -15, + BadNumChannel1U = -16, + BadDepth = -17, + BadAlphaChannel = -18, + BadOrder = -19, + BadOrigin = -20, + BadAlign = -21, + BadCallBack = -22, + BadTileSize = -23, + BadCOI = -24, + BadROISize = -25, + MaskIsTiled = -26, + StsNullPtr = -27, + StsVecLengthErr = -28, + StsFilterStructContentErr = -29, + StsKernelStructContentErr = -30, + StsFilterOffsetErr = -31, + StsBadSize = -201, + StsDivByZero = -202, + StsInplaceNotSupported = -203, + StsObjectNotFound = -204, + StsUnmatchedFormats = -205, + StsBadFlag = -206, + StsBadPoint = -207, + StsBadMask = -208, + StsUnmatchedSizes = -209, + StsUnsupportedFormat = -210, + StsOutOfRange = -211, + StsParseError = -212, + StsNotImplemented = -213, + StsBadMemBlock = -214, + StsAssert = -215, + GpuNotSupported = -216, + GpuApiCallError = -217, + OpenGlNotSupported = -218, + OpenGlApiCallError = -219, + OpenCLApiCallError = -220, + OpenCLDoubleNotSupported = -221, + OpenCLInitError = -222, + OpenCLNoAMDBlasFft = -223, + DECOMP_LU = 0, + DECOMP_SVD = 1, + DECOMP_EIG = 2, + DECOMP_CHOLESKY = 3, + DECOMP_QR = 4, + DECOMP_NORMAL = 16, + NORM_INF = 1, + NORM_L1 = 2, + NORM_L2 = 4, + NORM_L2SQR = 5, + NORM_HAMMING = 6, + NORM_HAMMING2 = 7, + NORM_TYPE_MASK = 7, + NORM_RELATIVE = 8, + NORM_MINMAX = 32, + CMP_EQ = 0, + CMP_GT = 1, + CMP_GE = 2, + CMP_LT = 3, + CMP_LE = 4, + CMP_NE = 5, + GEMM_1_T = 1, + GEMM_2_T = 2, + GEMM_3_T = 4, + DFT_INVERSE = 1, + DFT_SCALE = 2, + DFT_ROWS = 4, + DFT_COMPLEX_OUTPUT = 16, + DFT_REAL_OUTPUT = 32, + DCT_INVERSE = DFT_INVERSE, + DCT_ROWS = DFT_ROWS, + BORDER_CONSTANT = 0, + BORDER_REPLICATE = 1, + BORDER_REFLECT = 2, + BORDER_WRAP = 3, + BORDER_REFLECT_101 = 4, + BORDER_TRANSPARENT = 5, + BORDER_REFLECT101 = BORDER_REFLECT_101, + BORDER_DEFAULT = BORDER_REFLECT_101, + BORDER_ISOLATED = 16, + SORT_EVERY_ROW = 0, + SORT_EVERY_COLUMN = 1, + SORT_ASCENDING = 0, + SORT_DESCENDING = 16, + COVAR_SCRAMBLED = 0, + COVAR_NORMAL = 1, + COVAR_USE_AVG = 2, + COVAR_SCALE = 4, + COVAR_ROWS = 8, + COVAR_COLS = 16, + KMEANS_RANDOM_CENTERS = 0, + KMEANS_PP_CENTERS = 2, + KMEANS_USE_INITIAL_LABELS = 1, + LINE_4 = 4, + LINE_8 = 8, + LINE_AA = 16, + FONT_HERSHEY_SIMPLEX = 0, + FONT_HERSHEY_PLAIN = 1, + FONT_HERSHEY_DUPLEX = 2, + FONT_HERSHEY_COMPLEX = 3, + FONT_HERSHEY_TRIPLEX = 4, + FONT_HERSHEY_COMPLEX_SMALL = 5, + FONT_HERSHEY_SCRIPT_SIMPLEX = 6, + FONT_HERSHEY_SCRIPT_COMPLEX = 7, + FONT_ITALIC = 16; + + + // + // C++: Scalar mean(Mat src, Mat mask = Mat()) + // + + //javadoc: mean(src, mask) + public static Scalar mean(Mat src, Mat mask) + { + + Scalar retVal = new Scalar(mean_0(src.nativeObj, mask.nativeObj)); + + return retVal; + } + + //javadoc: mean(src) + public static Scalar mean(Mat src) + { + + Scalar retVal = new Scalar(mean_1(src.nativeObj)); + + return retVal; + } + + + // + // C++: Scalar sum(Mat src) + // + + //javadoc: sum(src) + public static Scalar sumElems(Mat src) + { + + Scalar retVal = new Scalar(sumElems_0(src.nativeObj)); + + return retVal; + } + + + // + // C++: Scalar trace(Mat mtx) + // + + //javadoc: trace(mtx) + public static Scalar trace(Mat mtx) + { + + Scalar retVal = new Scalar(trace_0(mtx.nativeObj)); + + return retVal; + } + + + // + // C++: String getBuildInformation() + // + + //javadoc: getBuildInformation() + public static String getBuildInformation() + { + + String retVal = getBuildInformation_0(); + + return retVal; + } + + + // + // C++: bool checkRange(Mat a, bool quiet = true, _hidden_ * pos = 0, double minVal = -DBL_MAX, double maxVal = DBL_MAX) + // + + //javadoc: checkRange(a, quiet, minVal, maxVal) + public static boolean checkRange(Mat a, boolean quiet, double minVal, double maxVal) + { + + boolean retVal = checkRange_0(a.nativeObj, quiet, minVal, maxVal); + + return retVal; + } + + //javadoc: checkRange(a) + public static boolean checkRange(Mat a) + { + + boolean retVal = checkRange_1(a.nativeObj); + + return retVal; + } + + + // + // C++: bool eigen(Mat src, Mat& eigenvalues, Mat& eigenvectors = Mat()) + // + + //javadoc: eigen(src, eigenvalues, eigenvectors) + public static boolean eigen(Mat src, Mat eigenvalues, Mat eigenvectors) + { + + boolean retVal = eigen_0(src.nativeObj, eigenvalues.nativeObj, eigenvectors.nativeObj); + + return retVal; + } + + //javadoc: eigen(src, eigenvalues) + public static boolean eigen(Mat src, Mat eigenvalues) + { + + boolean retVal = eigen_1(src.nativeObj, eigenvalues.nativeObj); + + return retVal; + } + + + // + // C++: bool solve(Mat src1, Mat src2, Mat& dst, int flags = DECOMP_LU) + // + + //javadoc: solve(src1, src2, dst, flags) + public static boolean solve(Mat src1, Mat src2, Mat dst, int flags) + { + + boolean retVal = solve_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, flags); + + return retVal; + } + + //javadoc: solve(src1, src2, dst) + public static boolean solve(Mat src1, Mat src2, Mat dst) + { + + boolean retVal = solve_1(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return retVal; + } + + + // + // C++: double Mahalanobis(Mat v1, Mat v2, Mat icovar) + // + + //javadoc: Mahalanobis(v1, v2, icovar) + public static double Mahalanobis(Mat v1, Mat v2, Mat icovar) + { + + double retVal = Mahalanobis_0(v1.nativeObj, v2.nativeObj, icovar.nativeObj); + + return retVal; + } + + + // + // C++: double PSNR(Mat src1, Mat src2) + // + + //javadoc: PSNR(src1, src2) + public static double PSNR(Mat src1, Mat src2) + { + + double retVal = PSNR_0(src1.nativeObj, src2.nativeObj); + + return retVal; + } + + + // + // C++: double determinant(Mat mtx) + // + + //javadoc: determinant(mtx) + public static double determinant(Mat mtx) + { + + double retVal = determinant_0(mtx.nativeObj); + + return retVal; + } + + + // + // C++: double getTickFrequency() + // + + //javadoc: getTickFrequency() + public static double getTickFrequency() + { + + double retVal = getTickFrequency_0(); + + return retVal; + } + + + // + // C++: double invert(Mat src, Mat& dst, int flags = DECOMP_LU) + // + + //javadoc: invert(src, dst, flags) + public static double invert(Mat src, Mat dst, int flags) + { + + double retVal = invert_0(src.nativeObj, dst.nativeObj, flags); + + return retVal; + } + + //javadoc: invert(src, dst) + public static double invert(Mat src, Mat dst) + { + + double retVal = invert_1(src.nativeObj, dst.nativeObj); + + return retVal; + } + + + // + // C++: double kmeans(Mat data, int K, Mat& bestLabels, TermCriteria criteria, int attempts, int flags, Mat& centers = Mat()) + // + + //javadoc: kmeans(data, K, bestLabels, criteria, attempts, flags, centers) + public static double kmeans(Mat data, int K, Mat bestLabels, TermCriteria criteria, int attempts, int flags, Mat centers) + { + + double retVal = kmeans_0(data.nativeObj, K, bestLabels.nativeObj, criteria.type, criteria.maxCount, criteria.epsilon, attempts, flags, centers.nativeObj); + + return retVal; + } + + //javadoc: kmeans(data, K, bestLabels, criteria, attempts, flags) + public static double kmeans(Mat data, int K, Mat bestLabels, TermCriteria criteria, int attempts, int flags) + { + + double retVal = kmeans_1(data.nativeObj, K, bestLabels.nativeObj, criteria.type, criteria.maxCount, criteria.epsilon, attempts, flags); + + return retVal; + } + + + // + // C++: double norm(Mat src1, Mat src2, int normType = NORM_L2, Mat mask = Mat()) + // + + //javadoc: norm(src1, src2, normType, mask) + public static double norm(Mat src1, Mat src2, int normType, Mat mask) + { + + double retVal = norm_0(src1.nativeObj, src2.nativeObj, normType, mask.nativeObj); + + return retVal; + } + + //javadoc: norm(src1, src2, normType) + public static double norm(Mat src1, Mat src2, int normType) + { + + double retVal = norm_1(src1.nativeObj, src2.nativeObj, normType); + + return retVal; + } + + //javadoc: norm(src1, src2) + public static double norm(Mat src1, Mat src2) + { + + double retVal = norm_2(src1.nativeObj, src2.nativeObj); + + return retVal; + } + + + // + // C++: double norm(Mat src1, int normType = NORM_L2, Mat mask = Mat()) + // + + //javadoc: norm(src1, normType, mask) + public static double norm(Mat src1, int normType, Mat mask) + { + + double retVal = norm_3(src1.nativeObj, normType, mask.nativeObj); + + return retVal; + } + + //javadoc: norm(src1, normType) + public static double norm(Mat src1, int normType) + { + + double retVal = norm_4(src1.nativeObj, normType); + + return retVal; + } + + //javadoc: norm(src1) + public static double norm(Mat src1) + { + + double retVal = norm_5(src1.nativeObj); + + return retVal; + } + + + // + // C++: double solvePoly(Mat coeffs, Mat& roots, int maxIters = 300) + // + + //javadoc: solvePoly(coeffs, roots, maxIters) + public static double solvePoly(Mat coeffs, Mat roots, int maxIters) + { + + double retVal = solvePoly_0(coeffs.nativeObj, roots.nativeObj, maxIters); + + return retVal; + } + + //javadoc: solvePoly(coeffs, roots) + public static double solvePoly(Mat coeffs, Mat roots) + { + + double retVal = solvePoly_1(coeffs.nativeObj, roots.nativeObj); + + return retVal; + } + + + // + // C++: float cubeRoot(float val) + // + + //javadoc: cubeRoot(val) + public static float cubeRoot(float val) + { + + float retVal = cubeRoot_0(val); + + return retVal; + } + + + // + // C++: float fastAtan2(float y, float x) + // + + //javadoc: fastAtan2(y, x) + public static float fastAtan2(float y, float x) + { + + float retVal = fastAtan2_0(y, x); + + return retVal; + } + + + // + // C++: int borderInterpolate(int p, int len, int borderType) + // + + //javadoc: borderInterpolate(p, len, borderType) + public static int borderInterpolate(int p, int len, int borderType) + { + + int retVal = borderInterpolate_0(p, len, borderType); + + return retVal; + } + + + // + // C++: int countNonZero(Mat src) + // + + //javadoc: countNonZero(src) + public static int countNonZero(Mat src) + { + + int retVal = countNonZero_0(src.nativeObj); + + return retVal; + } + + + // + // C++: int getNumThreads() + // + + //javadoc: getNumThreads() + public static int getNumThreads() + { + + int retVal = getNumThreads_0(); + + return retVal; + } + + + // + // C++: int getNumberOfCPUs() + // + + //javadoc: getNumberOfCPUs() + public static int getNumberOfCPUs() + { + + int retVal = getNumberOfCPUs_0(); + + return retVal; + } + + + // + // C++: int getOptimalDFTSize(int vecsize) + // + + //javadoc: getOptimalDFTSize(vecsize) + public static int getOptimalDFTSize(int vecsize) + { + + int retVal = getOptimalDFTSize_0(vecsize); + + return retVal; + } + + + // + // C++: int getThreadNum() + // + + //javadoc: getThreadNum() + public static int getThreadNum() + { + + int retVal = getThreadNum_0(); + + return retVal; + } + + + // + // C++: int solveCubic(Mat coeffs, Mat& roots) + // + + //javadoc: solveCubic(coeffs, roots) + public static int solveCubic(Mat coeffs, Mat roots) + { + + int retVal = solveCubic_0(coeffs.nativeObj, roots.nativeObj); + + return retVal; + } + + + // + // C++: int64 getCPUTickCount() + // + + //javadoc: getCPUTickCount() + public static long getCPUTickCount() + { + + long retVal = getCPUTickCount_0(); + + return retVal; + } + + + // + // C++: int64 getTickCount() + // + + //javadoc: getTickCount() + public static long getTickCount() + { + + long retVal = getTickCount_0(); + + return retVal; + } + + + // + // C++: void LUT(Mat src, Mat lut, Mat& dst) + // + + //javadoc: LUT(src, lut, dst) + public static void LUT(Mat src, Mat lut, Mat dst) + { + + LUT_0(src.nativeObj, lut.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void PCABackProject(Mat data, Mat mean, Mat eigenvectors, Mat& result) + // + + //javadoc: PCABackProject(data, mean, eigenvectors, result) + public static void PCABackProject(Mat data, Mat mean, Mat eigenvectors, Mat result) + { + + PCABackProject_0(data.nativeObj, mean.nativeObj, eigenvectors.nativeObj, result.nativeObj); + + return; + } + + + // + // C++: void PCACompute(Mat data, Mat& mean, Mat& eigenvectors, double retainedVariance) + // + + //javadoc: PCACompute(data, mean, eigenvectors, retainedVariance) + public static void PCACompute(Mat data, Mat mean, Mat eigenvectors, double retainedVariance) + { + + PCACompute_0(data.nativeObj, mean.nativeObj, eigenvectors.nativeObj, retainedVariance); + + return; + } + + + // + // C++: void PCACompute(Mat data, Mat& mean, Mat& eigenvectors, int maxComponents = 0) + // + + //javadoc: PCACompute(data, mean, eigenvectors, maxComponents) + public static void PCACompute(Mat data, Mat mean, Mat eigenvectors, int maxComponents) + { + + PCACompute_1(data.nativeObj, mean.nativeObj, eigenvectors.nativeObj, maxComponents); + + return; + } + + //javadoc: PCACompute(data, mean, eigenvectors) + public static void PCACompute(Mat data, Mat mean, Mat eigenvectors) + { + + PCACompute_2(data.nativeObj, mean.nativeObj, eigenvectors.nativeObj); + + return; + } + + + // + // C++: void PCAProject(Mat data, Mat mean, Mat eigenvectors, Mat& result) + // + + //javadoc: PCAProject(data, mean, eigenvectors, result) + public static void PCAProject(Mat data, Mat mean, Mat eigenvectors, Mat result) + { + + PCAProject_0(data.nativeObj, mean.nativeObj, eigenvectors.nativeObj, result.nativeObj); + + return; + } + + + // + // C++: void SVBackSubst(Mat w, Mat u, Mat vt, Mat rhs, Mat& dst) + // + + //javadoc: SVBackSubst(w, u, vt, rhs, dst) + public static void SVBackSubst(Mat w, Mat u, Mat vt, Mat rhs, Mat dst) + { + + SVBackSubst_0(w.nativeObj, u.nativeObj, vt.nativeObj, rhs.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void SVDecomp(Mat src, Mat& w, Mat& u, Mat& vt, int flags = 0) + // + + //javadoc: SVDecomp(src, w, u, vt, flags) + public static void SVDecomp(Mat src, Mat w, Mat u, Mat vt, int flags) + { + + SVDecomp_0(src.nativeObj, w.nativeObj, u.nativeObj, vt.nativeObj, flags); + + return; + } + + //javadoc: SVDecomp(src, w, u, vt) + public static void SVDecomp(Mat src, Mat w, Mat u, Mat vt) + { + + SVDecomp_1(src.nativeObj, w.nativeObj, u.nativeObj, vt.nativeObj); + + return; + } + + + // + // C++: void absdiff(Mat src1, Mat src2, Mat& dst) + // + + //javadoc: absdiff(src1, src2, dst) + public static void absdiff(Mat src1, Mat src2, Mat dst) + { + + absdiff_0(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void absdiff(Mat src1, Scalar src2, Mat& dst) + // + + //javadoc: absdiff(src1, src2, dst) + public static void absdiff(Mat src1, Scalar src2, Mat dst) + { + + absdiff_1(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj); + + return; + } + + + // + // C++: void add(Mat src1, Mat src2, Mat& dst, Mat mask = Mat(), int dtype = -1) + // + + //javadoc: add(src1, src2, dst, mask, dtype) + public static void add(Mat src1, Mat src2, Mat dst, Mat mask, int dtype) + { + + add_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj, dtype); + + return; + } + + //javadoc: add(src1, src2, dst, mask) + public static void add(Mat src1, Mat src2, Mat dst, Mat mask) + { + + add_1(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: add(src1, src2, dst) + public static void add(Mat src1, Mat src2, Mat dst) + { + + add_2(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void add(Mat src1, Scalar src2, Mat& dst, Mat mask = Mat(), int dtype = -1) + // + + //javadoc: add(src1, src2, dst, mask, dtype) + public static void add(Mat src1, Scalar src2, Mat dst, Mat mask, int dtype) + { + + add_3(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, mask.nativeObj, dtype); + + return; + } + + //javadoc: add(src1, src2, dst, mask) + public static void add(Mat src1, Scalar src2, Mat dst, Mat mask) + { + + add_4(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: add(src1, src2, dst) + public static void add(Mat src1, Scalar src2, Mat dst) + { + + add_5(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj); + + return; + } + + + // + // C++: void addWeighted(Mat src1, double alpha, Mat src2, double beta, double gamma, Mat& dst, int dtype = -1) + // + + //javadoc: addWeighted(src1, alpha, src2, beta, gamma, dst, dtype) + public static void addWeighted(Mat src1, double alpha, Mat src2, double beta, double gamma, Mat dst, int dtype) + { + + addWeighted_0(src1.nativeObj, alpha, src2.nativeObj, beta, gamma, dst.nativeObj, dtype); + + return; + } + + //javadoc: addWeighted(src1, alpha, src2, beta, gamma, dst) + public static void addWeighted(Mat src1, double alpha, Mat src2, double beta, double gamma, Mat dst) + { + + addWeighted_1(src1.nativeObj, alpha, src2.nativeObj, beta, gamma, dst.nativeObj); + + return; + } + + + // + // C++: void batchDistance(Mat src1, Mat src2, Mat& dist, int dtype, Mat& nidx, int normType = NORM_L2, int K = 0, Mat mask = Mat(), int update = 0, bool crosscheck = false) + // + + //javadoc: batchDistance(src1, src2, dist, dtype, nidx, normType, K, mask, update, crosscheck) + public static void batchDistance(Mat src1, Mat src2, Mat dist, int dtype, Mat nidx, int normType, int K, Mat mask, int update, boolean crosscheck) + { + + batchDistance_0(src1.nativeObj, src2.nativeObj, dist.nativeObj, dtype, nidx.nativeObj, normType, K, mask.nativeObj, update, crosscheck); + + return; + } + + //javadoc: batchDistance(src1, src2, dist, dtype, nidx, normType, K) + public static void batchDistance(Mat src1, Mat src2, Mat dist, int dtype, Mat nidx, int normType, int K) + { + + batchDistance_1(src1.nativeObj, src2.nativeObj, dist.nativeObj, dtype, nidx.nativeObj, normType, K); + + return; + } + + //javadoc: batchDistance(src1, src2, dist, dtype, nidx) + public static void batchDistance(Mat src1, Mat src2, Mat dist, int dtype, Mat nidx) + { + + batchDistance_2(src1.nativeObj, src2.nativeObj, dist.nativeObj, dtype, nidx.nativeObj); + + return; + } + + + // + // C++: void bitwise_and(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) + // + + //javadoc: bitwise_and(src1, src2, dst, mask) + public static void bitwise_and(Mat src1, Mat src2, Mat dst, Mat mask) + { + + bitwise_and_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: bitwise_and(src1, src2, dst) + public static void bitwise_and(Mat src1, Mat src2, Mat dst) + { + + bitwise_and_1(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void bitwise_not(Mat src, Mat& dst, Mat mask = Mat()) + // + + //javadoc: bitwise_not(src, dst, mask) + public static void bitwise_not(Mat src, Mat dst, Mat mask) + { + + bitwise_not_0(src.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: bitwise_not(src, dst) + public static void bitwise_not(Mat src, Mat dst) + { + + bitwise_not_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void bitwise_or(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) + // + + //javadoc: bitwise_or(src1, src2, dst, mask) + public static void bitwise_or(Mat src1, Mat src2, Mat dst, Mat mask) + { + + bitwise_or_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: bitwise_or(src1, src2, dst) + public static void bitwise_or(Mat src1, Mat src2, Mat dst) + { + + bitwise_or_1(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void bitwise_xor(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) + // + + //javadoc: bitwise_xor(src1, src2, dst, mask) + public static void bitwise_xor(Mat src1, Mat src2, Mat dst, Mat mask) + { + + bitwise_xor_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: bitwise_xor(src1, src2, dst) + public static void bitwise_xor(Mat src1, Mat src2, Mat dst) + { + + bitwise_xor_1(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void calcCovarMatrix(Mat samples, Mat& covar, Mat& mean, int flags, int ctype = CV_64F) + // + + //javadoc: calcCovarMatrix(samples, covar, mean, flags, ctype) + public static void calcCovarMatrix(Mat samples, Mat covar, Mat mean, int flags, int ctype) + { + + calcCovarMatrix_0(samples.nativeObj, covar.nativeObj, mean.nativeObj, flags, ctype); + + return; + } + + //javadoc: calcCovarMatrix(samples, covar, mean, flags) + public static void calcCovarMatrix(Mat samples, Mat covar, Mat mean, int flags) + { + + calcCovarMatrix_1(samples.nativeObj, covar.nativeObj, mean.nativeObj, flags); + + return; + } + + + // + // C++: void cartToPolar(Mat x, Mat y, Mat& magnitude, Mat& angle, bool angleInDegrees = false) + // + + //javadoc: cartToPolar(x, y, magnitude, angle, angleInDegrees) + public static void cartToPolar(Mat x, Mat y, Mat magnitude, Mat angle, boolean angleInDegrees) + { + + cartToPolar_0(x.nativeObj, y.nativeObj, magnitude.nativeObj, angle.nativeObj, angleInDegrees); + + return; + } + + //javadoc: cartToPolar(x, y, magnitude, angle) + public static void cartToPolar(Mat x, Mat y, Mat magnitude, Mat angle) + { + + cartToPolar_1(x.nativeObj, y.nativeObj, magnitude.nativeObj, angle.nativeObj); + + return; + } + + + // + // C++: void compare(Mat src1, Mat src2, Mat& dst, int cmpop) + // + + //javadoc: compare(src1, src2, dst, cmpop) + public static void compare(Mat src1, Mat src2, Mat dst, int cmpop) + { + + compare_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, cmpop); + + return; + } + + + // + // C++: void compare(Mat src1, Scalar src2, Mat& dst, int cmpop) + // + + //javadoc: compare(src1, src2, dst, cmpop) + public static void compare(Mat src1, Scalar src2, Mat dst, int cmpop) + { + + compare_1(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, cmpop); + + return; + } + + + // + // C++: void completeSymm(Mat& mtx, bool lowerToUpper = false) + // + + //javadoc: completeSymm(mtx, lowerToUpper) + public static void completeSymm(Mat mtx, boolean lowerToUpper) + { + + completeSymm_0(mtx.nativeObj, lowerToUpper); + + return; + } + + //javadoc: completeSymm(mtx) + public static void completeSymm(Mat mtx) + { + + completeSymm_1(mtx.nativeObj); + + return; + } + + + // + // C++: void convertScaleAbs(Mat src, Mat& dst, double alpha = 1, double beta = 0) + // + + //javadoc: convertScaleAbs(src, dst, alpha, beta) + public static void convertScaleAbs(Mat src, Mat dst, double alpha, double beta) + { + + convertScaleAbs_0(src.nativeObj, dst.nativeObj, alpha, beta); + + return; + } + + //javadoc: convertScaleAbs(src, dst) + public static void convertScaleAbs(Mat src, Mat dst) + { + + convertScaleAbs_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void copyMakeBorder(Mat src, Mat& dst, int top, int bottom, int left, int right, int borderType, Scalar value = Scalar()) + // + + //javadoc: copyMakeBorder(src, dst, top, bottom, left, right, borderType, value) + public static void copyMakeBorder(Mat src, Mat dst, int top, int bottom, int left, int right, int borderType, Scalar value) + { + + copyMakeBorder_0(src.nativeObj, dst.nativeObj, top, bottom, left, right, borderType, value.val[0], value.val[1], value.val[2], value.val[3]); + + return; + } + + //javadoc: copyMakeBorder(src, dst, top, bottom, left, right, borderType) + public static void copyMakeBorder(Mat src, Mat dst, int top, int bottom, int left, int right, int borderType) + { + + copyMakeBorder_1(src.nativeObj, dst.nativeObj, top, bottom, left, right, borderType); + + return; + } + + + // + // C++: void dct(Mat src, Mat& dst, int flags = 0) + // + + //javadoc: dct(src, dst, flags) + public static void dct(Mat src, Mat dst, int flags) + { + + dct_0(src.nativeObj, dst.nativeObj, flags); + + return; + } + + //javadoc: dct(src, dst) + public static void dct(Mat src, Mat dst) + { + + dct_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void dft(Mat src, Mat& dst, int flags = 0, int nonzeroRows = 0) + // + + //javadoc: dft(src, dst, flags, nonzeroRows) + public static void dft(Mat src, Mat dst, int flags, int nonzeroRows) + { + + dft_0(src.nativeObj, dst.nativeObj, flags, nonzeroRows); + + return; + } + + //javadoc: dft(src, dst) + public static void dft(Mat src, Mat dst) + { + + dft_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void divide(Mat src1, Mat src2, Mat& dst, double scale = 1, int dtype = -1) + // + + //javadoc: divide(src1, src2, dst, scale, dtype) + public static void divide(Mat src1, Mat src2, Mat dst, double scale, int dtype) + { + + divide_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, scale, dtype); + + return; + } + + //javadoc: divide(src1, src2, dst, scale) + public static void divide(Mat src1, Mat src2, Mat dst, double scale) + { + + divide_1(src1.nativeObj, src2.nativeObj, dst.nativeObj, scale); + + return; + } + + //javadoc: divide(src1, src2, dst) + public static void divide(Mat src1, Mat src2, Mat dst) + { + + divide_2(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void divide(Mat src1, Scalar src2, Mat& dst, double scale = 1, int dtype = -1) + // + + //javadoc: divide(src1, src2, dst, scale, dtype) + public static void divide(Mat src1, Scalar src2, Mat dst, double scale, int dtype) + { + + divide_3(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, scale, dtype); + + return; + } + + //javadoc: divide(src1, src2, dst, scale) + public static void divide(Mat src1, Scalar src2, Mat dst, double scale) + { + + divide_4(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, scale); + + return; + } + + //javadoc: divide(src1, src2, dst) + public static void divide(Mat src1, Scalar src2, Mat dst) + { + + divide_5(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj); + + return; + } + + + // + // C++: void divide(double scale, Mat src2, Mat& dst, int dtype = -1) + // + + //javadoc: divide(scale, src2, dst, dtype) + public static void divide(double scale, Mat src2, Mat dst, int dtype) + { + + divide_6(scale, src2.nativeObj, dst.nativeObj, dtype); + + return; + } + + //javadoc: divide(scale, src2, dst) + public static void divide(double scale, Mat src2, Mat dst) + { + + divide_7(scale, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void exp(Mat src, Mat& dst) + // + + //javadoc: exp(src, dst) + public static void exp(Mat src, Mat dst) + { + + exp_0(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void extractChannel(Mat src, Mat& dst, int coi) + // + + //javadoc: extractChannel(src, dst, coi) + public static void extractChannel(Mat src, Mat dst, int coi) + { + + extractChannel_0(src.nativeObj, dst.nativeObj, coi); + + return; + } + + + // + // C++: void findNonZero(Mat src, Mat& idx) + // + + //javadoc: findNonZero(src, idx) + public static void findNonZero(Mat src, Mat idx) + { + + findNonZero_0(src.nativeObj, idx.nativeObj); + + return; + } + + + // + // C++: void flip(Mat src, Mat& dst, int flipCode) + // + + //javadoc: flip(src, dst, flipCode) + public static void flip(Mat src, Mat dst, int flipCode) + { + + flip_0(src.nativeObj, dst.nativeObj, flipCode); + + return; + } + + + // + // C++: void gemm(Mat src1, Mat src2, double alpha, Mat src3, double beta, Mat& dst, int flags = 0) + // + + //javadoc: gemm(src1, src2, alpha, src3, beta, dst, flags) + public static void gemm(Mat src1, Mat src2, double alpha, Mat src3, double beta, Mat dst, int flags) + { + + gemm_0(src1.nativeObj, src2.nativeObj, alpha, src3.nativeObj, beta, dst.nativeObj, flags); + + return; + } + + //javadoc: gemm(src1, src2, alpha, src3, beta, dst) + public static void gemm(Mat src1, Mat src2, double alpha, Mat src3, double beta, Mat dst) + { + + gemm_1(src1.nativeObj, src2.nativeObj, alpha, src3.nativeObj, beta, dst.nativeObj); + + return; + } + + + // + // C++: void hconcat(vector_Mat src, Mat& dst) + // + + //javadoc: hconcat(src, dst) + public static void hconcat(List src, Mat dst) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + hconcat_0(src_mat.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void idct(Mat src, Mat& dst, int flags = 0) + // + + //javadoc: idct(src, dst, flags) + public static void idct(Mat src, Mat dst, int flags) + { + + idct_0(src.nativeObj, dst.nativeObj, flags); + + return; + } + + //javadoc: idct(src, dst) + public static void idct(Mat src, Mat dst) + { + + idct_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void idft(Mat src, Mat& dst, int flags = 0, int nonzeroRows = 0) + // + + //javadoc: idft(src, dst, flags, nonzeroRows) + public static void idft(Mat src, Mat dst, int flags, int nonzeroRows) + { + + idft_0(src.nativeObj, dst.nativeObj, flags, nonzeroRows); + + return; + } + + //javadoc: idft(src, dst) + public static void idft(Mat src, Mat dst) + { + + idft_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void inRange(Mat src, Scalar lowerb, Scalar upperb, Mat& dst) + // + + //javadoc: inRange(src, lowerb, upperb, dst) + public static void inRange(Mat src, Scalar lowerb, Scalar upperb, Mat dst) + { + + inRange_0(src.nativeObj, lowerb.val[0], lowerb.val[1], lowerb.val[2], lowerb.val[3], upperb.val[0], upperb.val[1], upperb.val[2], upperb.val[3], dst.nativeObj); + + return; + } + + + // + // C++: void insertChannel(Mat src, Mat& dst, int coi) + // + + //javadoc: insertChannel(src, dst, coi) + public static void insertChannel(Mat src, Mat dst, int coi) + { + + insertChannel_0(src.nativeObj, dst.nativeObj, coi); + + return; + } + + + // + // C++: void log(Mat src, Mat& dst) + // + + //javadoc: log(src, dst) + public static void log(Mat src, Mat dst) + { + + log_0(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void magnitude(Mat x, Mat y, Mat& magnitude) + // + + //javadoc: magnitude(x, y, magnitude) + public static void magnitude(Mat x, Mat y, Mat magnitude) + { + + magnitude_0(x.nativeObj, y.nativeObj, magnitude.nativeObj); + + return; + } + + + // + // C++: void max(Mat src1, Mat src2, Mat& dst) + // + + //javadoc: max(src1, src2, dst) + public static void max(Mat src1, Mat src2, Mat dst) + { + + max_0(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void max(Mat src1, Scalar src2, Mat& dst) + // + + //javadoc: max(src1, src2, dst) + public static void max(Mat src1, Scalar src2, Mat dst) + { + + max_1(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj); + + return; + } + + + // + // C++: void meanStdDev(Mat src, vector_double& mean, vector_double& stddev, Mat mask = Mat()) + // + + //javadoc: meanStdDev(src, mean, stddev, mask) + public static void meanStdDev(Mat src, MatOfDouble mean, MatOfDouble stddev, Mat mask) + { + Mat mean_mat = mean; + Mat stddev_mat = stddev; + meanStdDev_0(src.nativeObj, mean_mat.nativeObj, stddev_mat.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: meanStdDev(src, mean, stddev) + public static void meanStdDev(Mat src, MatOfDouble mean, MatOfDouble stddev) + { + Mat mean_mat = mean; + Mat stddev_mat = stddev; + meanStdDev_1(src.nativeObj, mean_mat.nativeObj, stddev_mat.nativeObj); + + return; + } + + + // + // C++: void merge(vector_Mat mv, Mat& dst) + // + + //javadoc: merge(mv, dst) + public static void merge(List mv, Mat dst) + { + Mat mv_mat = Converters.vector_Mat_to_Mat(mv); + merge_0(mv_mat.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void min(Mat src1, Mat src2, Mat& dst) + // + + //javadoc: min(src1, src2, dst) + public static void min(Mat src1, Mat src2, Mat dst) + { + + min_0(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void min(Mat src1, Scalar src2, Mat& dst) + // + + //javadoc: min(src1, src2, dst) + public static void min(Mat src1, Scalar src2, Mat dst) + { + + min_1(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj); + + return; + } + + + // + // C++: void mixChannels(vector_Mat src, vector_Mat dst, vector_int fromTo) + // + + //javadoc: mixChannels(src, dst, fromTo) + public static void mixChannels(List src, List dst, MatOfInt fromTo) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + Mat dst_mat = Converters.vector_Mat_to_Mat(dst); + Mat fromTo_mat = fromTo; + mixChannels_0(src_mat.nativeObj, dst_mat.nativeObj, fromTo_mat.nativeObj); + + return; + } + + + // + // C++: void mulSpectrums(Mat a, Mat b, Mat& c, int flags, bool conjB = false) + // + + //javadoc: mulSpectrums(a, b, c, flags, conjB) + public static void mulSpectrums(Mat a, Mat b, Mat c, int flags, boolean conjB) + { + + mulSpectrums_0(a.nativeObj, b.nativeObj, c.nativeObj, flags, conjB); + + return; + } + + //javadoc: mulSpectrums(a, b, c, flags) + public static void mulSpectrums(Mat a, Mat b, Mat c, int flags) + { + + mulSpectrums_1(a.nativeObj, b.nativeObj, c.nativeObj, flags); + + return; + } + + + // + // C++: void mulTransposed(Mat src, Mat& dst, bool aTa, Mat delta = Mat(), double scale = 1, int dtype = -1) + // + + //javadoc: mulTransposed(src, dst, aTa, delta, scale, dtype) + public static void mulTransposed(Mat src, Mat dst, boolean aTa, Mat delta, double scale, int dtype) + { + + mulTransposed_0(src.nativeObj, dst.nativeObj, aTa, delta.nativeObj, scale, dtype); + + return; + } + + //javadoc: mulTransposed(src, dst, aTa, delta, scale) + public static void mulTransposed(Mat src, Mat dst, boolean aTa, Mat delta, double scale) + { + + mulTransposed_1(src.nativeObj, dst.nativeObj, aTa, delta.nativeObj, scale); + + return; + } + + //javadoc: mulTransposed(src, dst, aTa) + public static void mulTransposed(Mat src, Mat dst, boolean aTa) + { + + mulTransposed_2(src.nativeObj, dst.nativeObj, aTa); + + return; + } + + + // + // C++: void multiply(Mat src1, Mat src2, Mat& dst, double scale = 1, int dtype = -1) + // + + //javadoc: multiply(src1, src2, dst, scale, dtype) + public static void multiply(Mat src1, Mat src2, Mat dst, double scale, int dtype) + { + + multiply_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, scale, dtype); + + return; + } + + //javadoc: multiply(src1, src2, dst, scale) + public static void multiply(Mat src1, Mat src2, Mat dst, double scale) + { + + multiply_1(src1.nativeObj, src2.nativeObj, dst.nativeObj, scale); + + return; + } + + //javadoc: multiply(src1, src2, dst) + public static void multiply(Mat src1, Mat src2, Mat dst) + { + + multiply_2(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void multiply(Mat src1, Scalar src2, Mat& dst, double scale = 1, int dtype = -1) + // + + //javadoc: multiply(src1, src2, dst, scale, dtype) + public static void multiply(Mat src1, Scalar src2, Mat dst, double scale, int dtype) + { + + multiply_3(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, scale, dtype); + + return; + } + + //javadoc: multiply(src1, src2, dst, scale) + public static void multiply(Mat src1, Scalar src2, Mat dst, double scale) + { + + multiply_4(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, scale); + + return; + } + + //javadoc: multiply(src1, src2, dst) + public static void multiply(Mat src1, Scalar src2, Mat dst) + { + + multiply_5(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj); + + return; + } + + + // + // C++: void normalize(Mat src, Mat& dst, double alpha = 1, double beta = 0, int norm_type = NORM_L2, int dtype = -1, Mat mask = Mat()) + // + + //javadoc: normalize(src, dst, alpha, beta, norm_type, dtype, mask) + public static void normalize(Mat src, Mat dst, double alpha, double beta, int norm_type, int dtype, Mat mask) + { + + normalize_0(src.nativeObj, dst.nativeObj, alpha, beta, norm_type, dtype, mask.nativeObj); + + return; + } + + //javadoc: normalize(src, dst, alpha, beta, norm_type, dtype) + public static void normalize(Mat src, Mat dst, double alpha, double beta, int norm_type, int dtype) + { + + normalize_1(src.nativeObj, dst.nativeObj, alpha, beta, norm_type, dtype); + + return; + } + + //javadoc: normalize(src, dst, alpha, beta, norm_type) + public static void normalize(Mat src, Mat dst, double alpha, double beta, int norm_type) + { + + normalize_2(src.nativeObj, dst.nativeObj, alpha, beta, norm_type); + + return; + } + + //javadoc: normalize(src, dst) + public static void normalize(Mat src, Mat dst) + { + + normalize_3(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void patchNaNs(Mat& a, double val = 0) + // + + //javadoc: patchNaNs(a, val) + public static void patchNaNs(Mat a, double val) + { + + patchNaNs_0(a.nativeObj, val); + + return; + } + + //javadoc: patchNaNs(a) + public static void patchNaNs(Mat a) + { + + patchNaNs_1(a.nativeObj); + + return; + } + + + // + // C++: void perspectiveTransform(Mat src, Mat& dst, Mat m) + // + + //javadoc: perspectiveTransform(src, dst, m) + public static void perspectiveTransform(Mat src, Mat dst, Mat m) + { + + perspectiveTransform_0(src.nativeObj, dst.nativeObj, m.nativeObj); + + return; + } + + + // + // C++: void phase(Mat x, Mat y, Mat& angle, bool angleInDegrees = false) + // + + //javadoc: phase(x, y, angle, angleInDegrees) + public static void phase(Mat x, Mat y, Mat angle, boolean angleInDegrees) + { + + phase_0(x.nativeObj, y.nativeObj, angle.nativeObj, angleInDegrees); + + return; + } + + //javadoc: phase(x, y, angle) + public static void phase(Mat x, Mat y, Mat angle) + { + + phase_1(x.nativeObj, y.nativeObj, angle.nativeObj); + + return; + } + + + // + // C++: void polarToCart(Mat magnitude, Mat angle, Mat& x, Mat& y, bool angleInDegrees = false) + // + + //javadoc: polarToCart(magnitude, angle, x, y, angleInDegrees) + public static void polarToCart(Mat magnitude, Mat angle, Mat x, Mat y, boolean angleInDegrees) + { + + polarToCart_0(magnitude.nativeObj, angle.nativeObj, x.nativeObj, y.nativeObj, angleInDegrees); + + return; + } + + //javadoc: polarToCart(magnitude, angle, x, y) + public static void polarToCart(Mat magnitude, Mat angle, Mat x, Mat y) + { + + polarToCart_1(magnitude.nativeObj, angle.nativeObj, x.nativeObj, y.nativeObj); + + return; + } + + + // + // C++: void pow(Mat src, double power, Mat& dst) + // + + //javadoc: pow(src, power, dst) + public static void pow(Mat src, double power, Mat dst) + { + + pow_0(src.nativeObj, power, dst.nativeObj); + + return; + } + + + // + // C++: void randShuffle(Mat& dst, double iterFactor = 1., RNG* rng = 0) + // + + //javadoc: randShuffle(dst, iterFactor) + public static void randShuffle(Mat dst, double iterFactor) + { + + randShuffle_0(dst.nativeObj, iterFactor); + + return; + } + + //javadoc: randShuffle(dst) + public static void randShuffle(Mat dst) + { + + randShuffle_1(dst.nativeObj); + + return; + } + + + // + // C++: void randn(Mat& dst, double mean, double stddev) + // + + //javadoc: randn(dst, mean, stddev) + public static void randn(Mat dst, double mean, double stddev) + { + + randn_0(dst.nativeObj, mean, stddev); + + return; + } + + + // + // C++: void randu(Mat& dst, double low, double high) + // + + //javadoc: randu(dst, low, high) + public static void randu(Mat dst, double low, double high) + { + + randu_0(dst.nativeObj, low, high); + + return; + } + + + // + // C++: void reduce(Mat src, Mat& dst, int dim, int rtype, int dtype = -1) + // + + //javadoc: reduce(src, dst, dim, rtype, dtype) + public static void reduce(Mat src, Mat dst, int dim, int rtype, int dtype) + { + + reduce_0(src.nativeObj, dst.nativeObj, dim, rtype, dtype); + + return; + } + + //javadoc: reduce(src, dst, dim, rtype) + public static void reduce(Mat src, Mat dst, int dim, int rtype) + { + + reduce_1(src.nativeObj, dst.nativeObj, dim, rtype); + + return; + } + + + // + // C++: void repeat(Mat src, int ny, int nx, Mat& dst) + // + + //javadoc: repeat(src, ny, nx, dst) + public static void repeat(Mat src, int ny, int nx, Mat dst) + { + + repeat_0(src.nativeObj, ny, nx, dst.nativeObj); + + return; + } + + + // + // C++: void scaleAdd(Mat src1, double alpha, Mat src2, Mat& dst) + // + + //javadoc: scaleAdd(src1, alpha, src2, dst) + public static void scaleAdd(Mat src1, double alpha, Mat src2, Mat dst) + { + + scaleAdd_0(src1.nativeObj, alpha, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void setErrorVerbosity(bool verbose) + // + + //javadoc: setErrorVerbosity(verbose) + public static void setErrorVerbosity(boolean verbose) + { + + setErrorVerbosity_0(verbose); + + return; + } + + + // + // C++: void setIdentity(Mat& mtx, Scalar s = Scalar(1)) + // + + //javadoc: setIdentity(mtx, s) + public static void setIdentity(Mat mtx, Scalar s) + { + + setIdentity_0(mtx.nativeObj, s.val[0], s.val[1], s.val[2], s.val[3]); + + return; + } + + //javadoc: setIdentity(mtx) + public static void setIdentity(Mat mtx) + { + + setIdentity_1(mtx.nativeObj); + + return; + } + + + // + // C++: void setNumThreads(int nthreads) + // + + //javadoc: setNumThreads(nthreads) + public static void setNumThreads(int nthreads) + { + + setNumThreads_0(nthreads); + + return; + } + + + // + // C++: void sort(Mat src, Mat& dst, int flags) + // + + //javadoc: sort(src, dst, flags) + public static void sort(Mat src, Mat dst, int flags) + { + + sort_0(src.nativeObj, dst.nativeObj, flags); + + return; + } + + + // + // C++: void sortIdx(Mat src, Mat& dst, int flags) + // + + //javadoc: sortIdx(src, dst, flags) + public static void sortIdx(Mat src, Mat dst, int flags) + { + + sortIdx_0(src.nativeObj, dst.nativeObj, flags); + + return; + } + + + // + // C++: void split(Mat m, vector_Mat& mv) + // + + //javadoc: split(m, mv) + public static void split(Mat m, List mv) + { + Mat mv_mat = new Mat(); + split_0(m.nativeObj, mv_mat.nativeObj); + Converters.Mat_to_vector_Mat(mv_mat, mv); + mv_mat.release(); + return; + } + + + // + // C++: void sqrt(Mat src, Mat& dst) + // + + //javadoc: sqrt(src, dst) + public static void sqrt(Mat src, Mat dst) + { + + sqrt_0(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void subtract(Mat src1, Mat src2, Mat& dst, Mat mask = Mat(), int dtype = -1) + // + + //javadoc: subtract(src1, src2, dst, mask, dtype) + public static void subtract(Mat src1, Mat src2, Mat dst, Mat mask, int dtype) + { + + subtract_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj, dtype); + + return; + } + + //javadoc: subtract(src1, src2, dst, mask) + public static void subtract(Mat src1, Mat src2, Mat dst, Mat mask) + { + + subtract_1(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: subtract(src1, src2, dst) + public static void subtract(Mat src1, Mat src2, Mat dst) + { + + subtract_2(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void subtract(Mat src1, Scalar src2, Mat& dst, Mat mask = Mat(), int dtype = -1) + // + + //javadoc: subtract(src1, src2, dst, mask, dtype) + public static void subtract(Mat src1, Scalar src2, Mat dst, Mat mask, int dtype) + { + + subtract_3(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, mask.nativeObj, dtype); + + return; + } + + //javadoc: subtract(src1, src2, dst, mask) + public static void subtract(Mat src1, Scalar src2, Mat dst, Mat mask) + { + + subtract_4(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: subtract(src1, src2, dst) + public static void subtract(Mat src1, Scalar src2, Mat dst) + { + + subtract_5(src1.nativeObj, src2.val[0], src2.val[1], src2.val[2], src2.val[3], dst.nativeObj); + + return; + } + + + // + // C++: void transform(Mat src, Mat& dst, Mat m) + // + + //javadoc: transform(src, dst, m) + public static void transform(Mat src, Mat dst, Mat m) + { + + transform_0(src.nativeObj, dst.nativeObj, m.nativeObj); + + return; + } + + + // + // C++: void transpose(Mat src, Mat& dst) + // + + //javadoc: transpose(src, dst) + public static void transpose(Mat src, Mat dst) + { + + transpose_0(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void vconcat(vector_Mat src, Mat& dst) + // + + //javadoc: vconcat(src, dst) + public static void vconcat(List src, Mat dst) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + vconcat_0(src_mat.nativeObj, dst.nativeObj); + + return; + } + + + // manual port + public static class MinMaxLocResult { + public double minVal; + public double maxVal; + public Point minLoc; + public Point maxLoc; + + public MinMaxLocResult() { + minVal=0; maxVal=0; + minLoc=new Point(); + maxLoc=new Point(); + } + } + + // C++: minMaxLoc(Mat src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, InputArray mask=noArray()) + + //javadoc: minMaxLoc(src, mask) + public static MinMaxLocResult minMaxLoc(Mat src, Mat mask) { + MinMaxLocResult res = new MinMaxLocResult(); + long maskNativeObj=0; + if (mask != null) { + maskNativeObj=mask.nativeObj; + } + double resarr[] = n_minMaxLocManual(src.nativeObj, maskNativeObj); + res.minVal=resarr[0]; + res.maxVal=resarr[1]; + res.minLoc.x=resarr[2]; + res.minLoc.y=resarr[3]; + res.maxLoc.x=resarr[4]; + res.maxLoc.y=resarr[5]; + return res; + } + + //javadoc: minMaxLoc(src) + public static MinMaxLocResult minMaxLoc(Mat src) { + return minMaxLoc(src, null); + } + + + + + // C++: Scalar mean(Mat src, Mat mask = Mat()) + private static native double[] mean_0(long src_nativeObj, long mask_nativeObj); + private static native double[] mean_1(long src_nativeObj); + + // C++: Scalar sum(Mat src) + private static native double[] sumElems_0(long src_nativeObj); + + // C++: Scalar trace(Mat mtx) + private static native double[] trace_0(long mtx_nativeObj); + + // C++: String getBuildInformation() + private static native String getBuildInformation_0(); + + // C++: bool checkRange(Mat a, bool quiet = true, _hidden_ * pos = 0, double minVal = -DBL_MAX, double maxVal = DBL_MAX) + private static native boolean checkRange_0(long a_nativeObj, boolean quiet, double minVal, double maxVal); + private static native boolean checkRange_1(long a_nativeObj); + + // C++: bool eigen(Mat src, Mat& eigenvalues, Mat& eigenvectors = Mat()) + private static native boolean eigen_0(long src_nativeObj, long eigenvalues_nativeObj, long eigenvectors_nativeObj); + private static native boolean eigen_1(long src_nativeObj, long eigenvalues_nativeObj); + + // C++: bool solve(Mat src1, Mat src2, Mat& dst, int flags = DECOMP_LU) + private static native boolean solve_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, int flags); + private static native boolean solve_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: double Mahalanobis(Mat v1, Mat v2, Mat icovar) + private static native double Mahalanobis_0(long v1_nativeObj, long v2_nativeObj, long icovar_nativeObj); + + // C++: double PSNR(Mat src1, Mat src2) + private static native double PSNR_0(long src1_nativeObj, long src2_nativeObj); + + // C++: double determinant(Mat mtx) + private static native double determinant_0(long mtx_nativeObj); + + // C++: double getTickFrequency() + private static native double getTickFrequency_0(); + + // C++: double invert(Mat src, Mat& dst, int flags = DECOMP_LU) + private static native double invert_0(long src_nativeObj, long dst_nativeObj, int flags); + private static native double invert_1(long src_nativeObj, long dst_nativeObj); + + // C++: double kmeans(Mat data, int K, Mat& bestLabels, TermCriteria criteria, int attempts, int flags, Mat& centers = Mat()) + private static native double kmeans_0(long data_nativeObj, int K, long bestLabels_nativeObj, int criteria_type, int criteria_maxCount, double criteria_epsilon, int attempts, int flags, long centers_nativeObj); + private static native double kmeans_1(long data_nativeObj, int K, long bestLabels_nativeObj, int criteria_type, int criteria_maxCount, double criteria_epsilon, int attempts, int flags); + + // C++: double norm(Mat src1, Mat src2, int normType = NORM_L2, Mat mask = Mat()) + private static native double norm_0(long src1_nativeObj, long src2_nativeObj, int normType, long mask_nativeObj); + private static native double norm_1(long src1_nativeObj, long src2_nativeObj, int normType); + private static native double norm_2(long src1_nativeObj, long src2_nativeObj); + + // C++: double norm(Mat src1, int normType = NORM_L2, Mat mask = Mat()) + private static native double norm_3(long src1_nativeObj, int normType, long mask_nativeObj); + private static native double norm_4(long src1_nativeObj, int normType); + private static native double norm_5(long src1_nativeObj); + + // C++: double solvePoly(Mat coeffs, Mat& roots, int maxIters = 300) + private static native double solvePoly_0(long coeffs_nativeObj, long roots_nativeObj, int maxIters); + private static native double solvePoly_1(long coeffs_nativeObj, long roots_nativeObj); + + // C++: float cubeRoot(float val) + private static native float cubeRoot_0(float val); + + // C++: float fastAtan2(float y, float x) + private static native float fastAtan2_0(float y, float x); + + // C++: int borderInterpolate(int p, int len, int borderType) + private static native int borderInterpolate_0(int p, int len, int borderType); + + // C++: int countNonZero(Mat src) + private static native int countNonZero_0(long src_nativeObj); + + // C++: int getNumThreads() + private static native int getNumThreads_0(); + + // C++: int getNumberOfCPUs() + private static native int getNumberOfCPUs_0(); + + // C++: int getOptimalDFTSize(int vecsize) + private static native int getOptimalDFTSize_0(int vecsize); + + // C++: int getThreadNum() + private static native int getThreadNum_0(); + + // C++: int solveCubic(Mat coeffs, Mat& roots) + private static native int solveCubic_0(long coeffs_nativeObj, long roots_nativeObj); + + // C++: int64 getCPUTickCount() + private static native long getCPUTickCount_0(); + + // C++: int64 getTickCount() + private static native long getTickCount_0(); + + // C++: void LUT(Mat src, Mat lut, Mat& dst) + private static native void LUT_0(long src_nativeObj, long lut_nativeObj, long dst_nativeObj); + + // C++: void PCABackProject(Mat data, Mat mean, Mat eigenvectors, Mat& result) + private static native void PCABackProject_0(long data_nativeObj, long mean_nativeObj, long eigenvectors_nativeObj, long result_nativeObj); + + // C++: void PCACompute(Mat data, Mat& mean, Mat& eigenvectors, double retainedVariance) + private static native void PCACompute_0(long data_nativeObj, long mean_nativeObj, long eigenvectors_nativeObj, double retainedVariance); + + // C++: void PCACompute(Mat data, Mat& mean, Mat& eigenvectors, int maxComponents = 0) + private static native void PCACompute_1(long data_nativeObj, long mean_nativeObj, long eigenvectors_nativeObj, int maxComponents); + private static native void PCACompute_2(long data_nativeObj, long mean_nativeObj, long eigenvectors_nativeObj); + + // C++: void PCAProject(Mat data, Mat mean, Mat eigenvectors, Mat& result) + private static native void PCAProject_0(long data_nativeObj, long mean_nativeObj, long eigenvectors_nativeObj, long result_nativeObj); + + // C++: void SVBackSubst(Mat w, Mat u, Mat vt, Mat rhs, Mat& dst) + private static native void SVBackSubst_0(long w_nativeObj, long u_nativeObj, long vt_nativeObj, long rhs_nativeObj, long dst_nativeObj); + + // C++: void SVDecomp(Mat src, Mat& w, Mat& u, Mat& vt, int flags = 0) + private static native void SVDecomp_0(long src_nativeObj, long w_nativeObj, long u_nativeObj, long vt_nativeObj, int flags); + private static native void SVDecomp_1(long src_nativeObj, long w_nativeObj, long u_nativeObj, long vt_nativeObj); + + // C++: void absdiff(Mat src1, Mat src2, Mat& dst) + private static native void absdiff_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void absdiff(Mat src1, Scalar src2, Mat& dst) + private static native void absdiff_1(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj); + + // C++: void add(Mat src1, Mat src2, Mat& dst, Mat mask = Mat(), int dtype = -1) + private static native void add_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj, int dtype); + private static native void add_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void add_2(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void add(Mat src1, Scalar src2, Mat& dst, Mat mask = Mat(), int dtype = -1) + private static native void add_3(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, long mask_nativeObj, int dtype); + private static native void add_4(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, long mask_nativeObj); + private static native void add_5(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj); + + // C++: void addWeighted(Mat src1, double alpha, Mat src2, double beta, double gamma, Mat& dst, int dtype = -1) + private static native void addWeighted_0(long src1_nativeObj, double alpha, long src2_nativeObj, double beta, double gamma, long dst_nativeObj, int dtype); + private static native void addWeighted_1(long src1_nativeObj, double alpha, long src2_nativeObj, double beta, double gamma, long dst_nativeObj); + + // C++: void batchDistance(Mat src1, Mat src2, Mat& dist, int dtype, Mat& nidx, int normType = NORM_L2, int K = 0, Mat mask = Mat(), int update = 0, bool crosscheck = false) + private static native void batchDistance_0(long src1_nativeObj, long src2_nativeObj, long dist_nativeObj, int dtype, long nidx_nativeObj, int normType, int K, long mask_nativeObj, int update, boolean crosscheck); + private static native void batchDistance_1(long src1_nativeObj, long src2_nativeObj, long dist_nativeObj, int dtype, long nidx_nativeObj, int normType, int K); + private static native void batchDistance_2(long src1_nativeObj, long src2_nativeObj, long dist_nativeObj, int dtype, long nidx_nativeObj); + + // C++: void bitwise_and(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) + private static native void bitwise_and_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void bitwise_and_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void bitwise_not(Mat src, Mat& dst, Mat mask = Mat()) + private static native void bitwise_not_0(long src_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void bitwise_not_1(long src_nativeObj, long dst_nativeObj); + + // C++: void bitwise_or(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) + private static native void bitwise_or_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void bitwise_or_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void bitwise_xor(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) + private static native void bitwise_xor_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void bitwise_xor_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void calcCovarMatrix(Mat samples, Mat& covar, Mat& mean, int flags, int ctype = CV_64F) + private static native void calcCovarMatrix_0(long samples_nativeObj, long covar_nativeObj, long mean_nativeObj, int flags, int ctype); + private static native void calcCovarMatrix_1(long samples_nativeObj, long covar_nativeObj, long mean_nativeObj, int flags); + + // C++: void cartToPolar(Mat x, Mat y, Mat& magnitude, Mat& angle, bool angleInDegrees = false) + private static native void cartToPolar_0(long x_nativeObj, long y_nativeObj, long magnitude_nativeObj, long angle_nativeObj, boolean angleInDegrees); + private static native void cartToPolar_1(long x_nativeObj, long y_nativeObj, long magnitude_nativeObj, long angle_nativeObj); + + // C++: void compare(Mat src1, Mat src2, Mat& dst, int cmpop) + private static native void compare_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, int cmpop); + + // C++: void compare(Mat src1, Scalar src2, Mat& dst, int cmpop) + private static native void compare_1(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, int cmpop); + + // C++: void completeSymm(Mat& mtx, bool lowerToUpper = false) + private static native void completeSymm_0(long mtx_nativeObj, boolean lowerToUpper); + private static native void completeSymm_1(long mtx_nativeObj); + + // C++: void convertScaleAbs(Mat src, Mat& dst, double alpha = 1, double beta = 0) + private static native void convertScaleAbs_0(long src_nativeObj, long dst_nativeObj, double alpha, double beta); + private static native void convertScaleAbs_1(long src_nativeObj, long dst_nativeObj); + + // C++: void copyMakeBorder(Mat src, Mat& dst, int top, int bottom, int left, int right, int borderType, Scalar value = Scalar()) + private static native void copyMakeBorder_0(long src_nativeObj, long dst_nativeObj, int top, int bottom, int left, int right, int borderType, double value_val0, double value_val1, double value_val2, double value_val3); + private static native void copyMakeBorder_1(long src_nativeObj, long dst_nativeObj, int top, int bottom, int left, int right, int borderType); + + // C++: void dct(Mat src, Mat& dst, int flags = 0) + private static native void dct_0(long src_nativeObj, long dst_nativeObj, int flags); + private static native void dct_1(long src_nativeObj, long dst_nativeObj); + + // C++: void dft(Mat src, Mat& dst, int flags = 0, int nonzeroRows = 0) + private static native void dft_0(long src_nativeObj, long dst_nativeObj, int flags, int nonzeroRows); + private static native void dft_1(long src_nativeObj, long dst_nativeObj); + + // C++: void divide(Mat src1, Mat src2, Mat& dst, double scale = 1, int dtype = -1) + private static native void divide_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, double scale, int dtype); + private static native void divide_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, double scale); + private static native void divide_2(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void divide(Mat src1, Scalar src2, Mat& dst, double scale = 1, int dtype = -1) + private static native void divide_3(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, double scale, int dtype); + private static native void divide_4(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, double scale); + private static native void divide_5(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj); + + // C++: void divide(double scale, Mat src2, Mat& dst, int dtype = -1) + private static native void divide_6(double scale, long src2_nativeObj, long dst_nativeObj, int dtype); + private static native void divide_7(double scale, long src2_nativeObj, long dst_nativeObj); + + // C++: void exp(Mat src, Mat& dst) + private static native void exp_0(long src_nativeObj, long dst_nativeObj); + + // C++: void extractChannel(Mat src, Mat& dst, int coi) + private static native void extractChannel_0(long src_nativeObj, long dst_nativeObj, int coi); + + // C++: void findNonZero(Mat src, Mat& idx) + private static native void findNonZero_0(long src_nativeObj, long idx_nativeObj); + + // C++: void flip(Mat src, Mat& dst, int flipCode) + private static native void flip_0(long src_nativeObj, long dst_nativeObj, int flipCode); + + // C++: void gemm(Mat src1, Mat src2, double alpha, Mat src3, double beta, Mat& dst, int flags = 0) + private static native void gemm_0(long src1_nativeObj, long src2_nativeObj, double alpha, long src3_nativeObj, double beta, long dst_nativeObj, int flags); + private static native void gemm_1(long src1_nativeObj, long src2_nativeObj, double alpha, long src3_nativeObj, double beta, long dst_nativeObj); + + // C++: void hconcat(vector_Mat src, Mat& dst) + private static native void hconcat_0(long src_mat_nativeObj, long dst_nativeObj); + + // C++: void idct(Mat src, Mat& dst, int flags = 0) + private static native void idct_0(long src_nativeObj, long dst_nativeObj, int flags); + private static native void idct_1(long src_nativeObj, long dst_nativeObj); + + // C++: void idft(Mat src, Mat& dst, int flags = 0, int nonzeroRows = 0) + private static native void idft_0(long src_nativeObj, long dst_nativeObj, int flags, int nonzeroRows); + private static native void idft_1(long src_nativeObj, long dst_nativeObj); + + // C++: void inRange(Mat src, Scalar lowerb, Scalar upperb, Mat& dst) + private static native void inRange_0(long src_nativeObj, double lowerb_val0, double lowerb_val1, double lowerb_val2, double lowerb_val3, double upperb_val0, double upperb_val1, double upperb_val2, double upperb_val3, long dst_nativeObj); + + // C++: void insertChannel(Mat src, Mat& dst, int coi) + private static native void insertChannel_0(long src_nativeObj, long dst_nativeObj, int coi); + + // C++: void log(Mat src, Mat& dst) + private static native void log_0(long src_nativeObj, long dst_nativeObj); + + // C++: void magnitude(Mat x, Mat y, Mat& magnitude) + private static native void magnitude_0(long x_nativeObj, long y_nativeObj, long magnitude_nativeObj); + + // C++: void max(Mat src1, Mat src2, Mat& dst) + private static native void max_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void max(Mat src1, Scalar src2, Mat& dst) + private static native void max_1(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj); + + // C++: void meanStdDev(Mat src, vector_double& mean, vector_double& stddev, Mat mask = Mat()) + private static native void meanStdDev_0(long src_nativeObj, long mean_mat_nativeObj, long stddev_mat_nativeObj, long mask_nativeObj); + private static native void meanStdDev_1(long src_nativeObj, long mean_mat_nativeObj, long stddev_mat_nativeObj); + + // C++: void merge(vector_Mat mv, Mat& dst) + private static native void merge_0(long mv_mat_nativeObj, long dst_nativeObj); + + // C++: void min(Mat src1, Mat src2, Mat& dst) + private static native void min_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void min(Mat src1, Scalar src2, Mat& dst) + private static native void min_1(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj); + + // C++: void mixChannels(vector_Mat src, vector_Mat dst, vector_int fromTo) + private static native void mixChannels_0(long src_mat_nativeObj, long dst_mat_nativeObj, long fromTo_mat_nativeObj); + + // C++: void mulSpectrums(Mat a, Mat b, Mat& c, int flags, bool conjB = false) + private static native void mulSpectrums_0(long a_nativeObj, long b_nativeObj, long c_nativeObj, int flags, boolean conjB); + private static native void mulSpectrums_1(long a_nativeObj, long b_nativeObj, long c_nativeObj, int flags); + + // C++: void mulTransposed(Mat src, Mat& dst, bool aTa, Mat delta = Mat(), double scale = 1, int dtype = -1) + private static native void mulTransposed_0(long src_nativeObj, long dst_nativeObj, boolean aTa, long delta_nativeObj, double scale, int dtype); + private static native void mulTransposed_1(long src_nativeObj, long dst_nativeObj, boolean aTa, long delta_nativeObj, double scale); + private static native void mulTransposed_2(long src_nativeObj, long dst_nativeObj, boolean aTa); + + // C++: void multiply(Mat src1, Mat src2, Mat& dst, double scale = 1, int dtype = -1) + private static native void multiply_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, double scale, int dtype); + private static native void multiply_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, double scale); + private static native void multiply_2(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void multiply(Mat src1, Scalar src2, Mat& dst, double scale = 1, int dtype = -1) + private static native void multiply_3(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, double scale, int dtype); + private static native void multiply_4(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, double scale); + private static native void multiply_5(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj); + + // C++: void normalize(Mat src, Mat& dst, double alpha = 1, double beta = 0, int norm_type = NORM_L2, int dtype = -1, Mat mask = Mat()) + private static native void normalize_0(long src_nativeObj, long dst_nativeObj, double alpha, double beta, int norm_type, int dtype, long mask_nativeObj); + private static native void normalize_1(long src_nativeObj, long dst_nativeObj, double alpha, double beta, int norm_type, int dtype); + private static native void normalize_2(long src_nativeObj, long dst_nativeObj, double alpha, double beta, int norm_type); + private static native void normalize_3(long src_nativeObj, long dst_nativeObj); + + // C++: void patchNaNs(Mat& a, double val = 0) + private static native void patchNaNs_0(long a_nativeObj, double val); + private static native void patchNaNs_1(long a_nativeObj); + + // C++: void perspectiveTransform(Mat src, Mat& dst, Mat m) + private static native void perspectiveTransform_0(long src_nativeObj, long dst_nativeObj, long m_nativeObj); + + // C++: void phase(Mat x, Mat y, Mat& angle, bool angleInDegrees = false) + private static native void phase_0(long x_nativeObj, long y_nativeObj, long angle_nativeObj, boolean angleInDegrees); + private static native void phase_1(long x_nativeObj, long y_nativeObj, long angle_nativeObj); + + // C++: void polarToCart(Mat magnitude, Mat angle, Mat& x, Mat& y, bool angleInDegrees = false) + private static native void polarToCart_0(long magnitude_nativeObj, long angle_nativeObj, long x_nativeObj, long y_nativeObj, boolean angleInDegrees); + private static native void polarToCart_1(long magnitude_nativeObj, long angle_nativeObj, long x_nativeObj, long y_nativeObj); + + // C++: void pow(Mat src, double power, Mat& dst) + private static native void pow_0(long src_nativeObj, double power, long dst_nativeObj); + + // C++: void randShuffle(Mat& dst, double iterFactor = 1., RNG* rng = 0) + private static native void randShuffle_0(long dst_nativeObj, double iterFactor); + private static native void randShuffle_1(long dst_nativeObj); + + // C++: void randn(Mat& dst, double mean, double stddev) + private static native void randn_0(long dst_nativeObj, double mean, double stddev); + + // C++: void randu(Mat& dst, double low, double high) + private static native void randu_0(long dst_nativeObj, double low, double high); + + // C++: void reduce(Mat src, Mat& dst, int dim, int rtype, int dtype = -1) + private static native void reduce_0(long src_nativeObj, long dst_nativeObj, int dim, int rtype, int dtype); + private static native void reduce_1(long src_nativeObj, long dst_nativeObj, int dim, int rtype); + + // C++: void repeat(Mat src, int ny, int nx, Mat& dst) + private static native void repeat_0(long src_nativeObj, int ny, int nx, long dst_nativeObj); + + // C++: void scaleAdd(Mat src1, double alpha, Mat src2, Mat& dst) + private static native void scaleAdd_0(long src1_nativeObj, double alpha, long src2_nativeObj, long dst_nativeObj); + + // C++: void setErrorVerbosity(bool verbose) + private static native void setErrorVerbosity_0(boolean verbose); + + // C++: void setIdentity(Mat& mtx, Scalar s = Scalar(1)) + private static native void setIdentity_0(long mtx_nativeObj, double s_val0, double s_val1, double s_val2, double s_val3); + private static native void setIdentity_1(long mtx_nativeObj); + + // C++: void setNumThreads(int nthreads) + private static native void setNumThreads_0(int nthreads); + + // C++: void sort(Mat src, Mat& dst, int flags) + private static native void sort_0(long src_nativeObj, long dst_nativeObj, int flags); + + // C++: void sortIdx(Mat src, Mat& dst, int flags) + private static native void sortIdx_0(long src_nativeObj, long dst_nativeObj, int flags); + + // C++: void split(Mat m, vector_Mat& mv) + private static native void split_0(long m_nativeObj, long mv_mat_nativeObj); + + // C++: void sqrt(Mat src, Mat& dst) + private static native void sqrt_0(long src_nativeObj, long dst_nativeObj); + + // C++: void subtract(Mat src1, Mat src2, Mat& dst, Mat mask = Mat(), int dtype = -1) + private static native void subtract_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj, int dtype); + private static native void subtract_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void subtract_2(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void subtract(Mat src1, Scalar src2, Mat& dst, Mat mask = Mat(), int dtype = -1) + private static native void subtract_3(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, long mask_nativeObj, int dtype); + private static native void subtract_4(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj, long mask_nativeObj); + private static native void subtract_5(long src1_nativeObj, double src2_val0, double src2_val1, double src2_val2, double src2_val3, long dst_nativeObj); + + // C++: void transform(Mat src, Mat& dst, Mat m) + private static native void transform_0(long src_nativeObj, long dst_nativeObj, long m_nativeObj); + + // C++: void transpose(Mat src, Mat& dst) + private static native void transpose_0(long src_nativeObj, long dst_nativeObj); + + // C++: void vconcat(vector_Mat src, Mat& dst) + private static native void vconcat_0(long src_mat_nativeObj, long dst_nativeObj); + private static native double[] n_minMaxLocManual(long src_nativeObj, long mask_nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/CvException.java b/openCVLibrary310/src/main/java/org/opencv/core/CvException.java new file mode 100644 index 0000000..e9241e6 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/CvException.java @@ -0,0 +1,15 @@ +package org.opencv.core; + +public class CvException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public CvException(String msg) { + super(msg); + } + + @Override + public String toString() { + return "CvException [" + super.toString() + "]"; + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/CvType.java b/openCVLibrary310/src/main/java/org/opencv/core/CvType.java new file mode 100644 index 0000000..748c1cd --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/CvType.java @@ -0,0 +1,136 @@ +package org.opencv.core; + +public final class CvType { + + // type depth constants + public static final int + CV_8U = 0, CV_8S = 1, + CV_16U = 2, CV_16S = 3, + CV_32S = 4, + CV_32F = 5, + CV_64F = 6, + CV_USRTYPE1 = 7; + + // predefined type constants + public static final int + CV_8UC1 = CV_8UC(1), CV_8UC2 = CV_8UC(2), CV_8UC3 = CV_8UC(3), CV_8UC4 = CV_8UC(4), + CV_8SC1 = CV_8SC(1), CV_8SC2 = CV_8SC(2), CV_8SC3 = CV_8SC(3), CV_8SC4 = CV_8SC(4), + CV_16UC1 = CV_16UC(1), CV_16UC2 = CV_16UC(2), CV_16UC3 = CV_16UC(3), CV_16UC4 = CV_16UC(4), + CV_16SC1 = CV_16SC(1), CV_16SC2 = CV_16SC(2), CV_16SC3 = CV_16SC(3), CV_16SC4 = CV_16SC(4), + CV_32SC1 = CV_32SC(1), CV_32SC2 = CV_32SC(2), CV_32SC3 = CV_32SC(3), CV_32SC4 = CV_32SC(4), + CV_32FC1 = CV_32FC(1), CV_32FC2 = CV_32FC(2), CV_32FC3 = CV_32FC(3), CV_32FC4 = CV_32FC(4), + CV_64FC1 = CV_64FC(1), CV_64FC2 = CV_64FC(2), CV_64FC3 = CV_64FC(3), CV_64FC4 = CV_64FC(4); + + private static final int CV_CN_MAX = 512, CV_CN_SHIFT = 3, CV_DEPTH_MAX = (1 << CV_CN_SHIFT); + + public static final int makeType(int depth, int channels) { + if (channels <= 0 || channels >= CV_CN_MAX) { + throw new java.lang.UnsupportedOperationException( + "Channels count should be 1.." + (CV_CN_MAX - 1)); + } + if (depth < 0 || depth >= CV_DEPTH_MAX) { + throw new java.lang.UnsupportedOperationException( + "Data type depth should be 0.." + (CV_DEPTH_MAX - 1)); + } + return (depth & (CV_DEPTH_MAX - 1)) + ((channels - 1) << CV_CN_SHIFT); + } + + public static final int CV_8UC(int ch) { + return makeType(CV_8U, ch); + } + + public static final int CV_8SC(int ch) { + return makeType(CV_8S, ch); + } + + public static final int CV_16UC(int ch) { + return makeType(CV_16U, ch); + } + + public static final int CV_16SC(int ch) { + return makeType(CV_16S, ch); + } + + public static final int CV_32SC(int ch) { + return makeType(CV_32S, ch); + } + + public static final int CV_32FC(int ch) { + return makeType(CV_32F, ch); + } + + public static final int CV_64FC(int ch) { + return makeType(CV_64F, ch); + } + + public static final int channels(int type) { + return (type >> CV_CN_SHIFT) + 1; + } + + public static final int depth(int type) { + return type & (CV_DEPTH_MAX - 1); + } + + public static final boolean isInteger(int type) { + return depth(type) < CV_32F; + } + + public static final int ELEM_SIZE(int type) { + switch (depth(type)) { + case CV_8U: + case CV_8S: + return channels(type); + case CV_16U: + case CV_16S: + return 2 * channels(type); + case CV_32S: + case CV_32F: + return 4 * channels(type); + case CV_64F: + return 8 * channels(type); + default: + throw new java.lang.UnsupportedOperationException( + "Unsupported CvType value: " + type); + } + } + + public static final String typeToString(int type) { + String s; + switch (depth(type)) { + case CV_8U: + s = "CV_8U"; + break; + case CV_8S: + s = "CV_8S"; + break; + case CV_16U: + s = "CV_16U"; + break; + case CV_16S: + s = "CV_16S"; + break; + case CV_32S: + s = "CV_32S"; + break; + case CV_32F: + s = "CV_32F"; + break; + case CV_64F: + s = "CV_64F"; + break; + case CV_USRTYPE1: + s = "CV_USRTYPE1"; + break; + default: + throw new java.lang.UnsupportedOperationException( + "Unsupported CvType value: " + type); + } + + int ch = channels(type); + if (ch <= 4) + return s + "C" + ch; + else + return s + "C(" + ch + ")"; + } + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/DMatch.java b/openCVLibrary310/src/main/java/org/opencv/core/DMatch.java new file mode 100644 index 0000000..12bd86e --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/DMatch.java @@ -0,0 +1,61 @@ +package org.opencv.core; + +//C++: class DMatch + +/** + * Structure for matching: query descriptor index, train descriptor index, train + * image index and distance between descriptors. + */ +public class DMatch { + + /** + * Query descriptor index. + */ + public int queryIdx; + /** + * Train descriptor index. + */ + public int trainIdx; + /** + * Train image index. + */ + public int imgIdx; + + // javadoc: DMatch::distance + public float distance; + + // javadoc: DMatch::DMatch() + public DMatch() { + this(-1, -1, Float.MAX_VALUE); + } + + // javadoc: DMatch::DMatch(_queryIdx, _trainIdx, _distance) + public DMatch(int _queryIdx, int _trainIdx, float _distance) { + queryIdx = _queryIdx; + trainIdx = _trainIdx; + imgIdx = -1; + distance = _distance; + } + + // javadoc: DMatch::DMatch(_queryIdx, _trainIdx, _imgIdx, _distance) + public DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance) { + queryIdx = _queryIdx; + trainIdx = _trainIdx; + imgIdx = _imgIdx; + distance = _distance; + } + + /** + * Less is better. + */ + public boolean lessThan(DMatch it) { + return distance < it.distance; + } + + @Override + public String toString() { + return "DMatch [queryIdx=" + queryIdx + ", trainIdx=" + trainIdx + + ", imgIdx=" + imgIdx + ", distance=" + distance + "]"; + } + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/KeyPoint.java b/openCVLibrary310/src/main/java/org/opencv/core/KeyPoint.java new file mode 100644 index 0000000..de5b215 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/KeyPoint.java @@ -0,0 +1,83 @@ +package org.opencv.core; + +import org.opencv.core.Point; + +//javadoc: KeyPoint +public class KeyPoint { + + /** + * Coordinates of the keypoint. + */ + public Point pt; + /** + * Diameter of the useful keypoint adjacent area. + */ + public float size; + /** + * Computed orientation of the keypoint (-1 if not applicable). + */ + public float angle; + /** + * The response, by which the strongest keypoints have been selected. Can + * be used for further sorting or subsampling. + */ + public float response; + /** + * Octave (pyramid layer), from which the keypoint has been extracted. + */ + public int octave; + /** + * Object ID, that can be used to cluster keypoints by an object they + * belong to. + */ + public int class_id; + + // javadoc:KeyPoint::KeyPoint(x,y,_size,_angle,_response,_octave,_class_id) + public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave, int _class_id) + { + pt = new Point(x, y); + size = _size; + angle = _angle; + response = _response; + octave = _octave; + class_id = _class_id; + } + + // javadoc: KeyPoint::KeyPoint() + public KeyPoint() + { + this(0, 0, 0, -1, 0, 0, -1); + } + + // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response, _octave) + public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave) + { + this(x, y, _size, _angle, _response, _octave, -1); + } + + // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response) + public KeyPoint(float x, float y, float _size, float _angle, float _response) + { + this(x, y, _size, _angle, _response, 0, -1); + } + + // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle) + public KeyPoint(float x, float y, float _size, float _angle) + { + this(x, y, _size, _angle, 0, 0, -1); + } + + // javadoc: KeyPoint::KeyPoint(x, y, _size) + public KeyPoint(float x, float y, float _size) + { + this(x, y, _size, -1, 0, 0, -1); + } + + @Override + public String toString() { + return "KeyPoint [pt=" + pt + ", size=" + size + ", angle=" + angle + + ", response=" + response + ", octave=" + octave + + ", class_id=" + class_id + "]"; + } + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Mat.java b/openCVLibrary310/src/main/java/org/opencv/core/Mat.java new file mode 100644 index 0000000..6db2554 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Mat.java @@ -0,0 +1,1316 @@ +package org.opencv.core; + +// C++: class Mat +//javadoc: Mat +public class Mat { + + public final long nativeObj; + + public Mat(long addr) + { + if (addr == 0) + throw new java.lang.UnsupportedOperationException("Native object address is NULL"); + nativeObj = addr; + } + + // + // C++: Mat::Mat() + // + + // javadoc: Mat::Mat() + public Mat() + { + + nativeObj = n_Mat(); + + return; + } + + // + // C++: Mat::Mat(int rows, int cols, int type) + // + + // javadoc: Mat::Mat(rows, cols, type) + public Mat(int rows, int cols, int type) + { + + nativeObj = n_Mat(rows, cols, type); + + return; + } + + // + // C++: Mat::Mat(Size size, int type) + // + + // javadoc: Mat::Mat(size, type) + public Mat(Size size, int type) + { + + nativeObj = n_Mat(size.width, size.height, type); + + return; + } + + // + // C++: Mat::Mat(int rows, int cols, int type, Scalar s) + // + + // javadoc: Mat::Mat(rows, cols, type, s) + public Mat(int rows, int cols, int type, Scalar s) + { + + nativeObj = n_Mat(rows, cols, type, s.val[0], s.val[1], s.val[2], s.val[3]); + + return; + } + + // + // C++: Mat::Mat(Size size, int type, Scalar s) + // + + // javadoc: Mat::Mat(size, type, s) + public Mat(Size size, int type, Scalar s) + { + + nativeObj = n_Mat(size.width, size.height, type, s.val[0], s.val[1], s.val[2], s.val[3]); + + return; + } + + // + // C++: Mat::Mat(Mat m, Range rowRange, Range colRange = Range::all()) + // + + // javadoc: Mat::Mat(m, rowRange, colRange) + public Mat(Mat m, Range rowRange, Range colRange) + { + + nativeObj = n_Mat(m.nativeObj, rowRange.start, rowRange.end, colRange.start, colRange.end); + + return; + } + + // javadoc: Mat::Mat(m, rowRange) + public Mat(Mat m, Range rowRange) + { + + nativeObj = n_Mat(m.nativeObj, rowRange.start, rowRange.end); + + return; + } + + // + // C++: Mat::Mat(Mat m, Rect roi) + // + + // javadoc: Mat::Mat(m, roi) + public Mat(Mat m, Rect roi) + { + + nativeObj = n_Mat(m.nativeObj, roi.y, roi.y + roi.height, roi.x, roi.x + roi.width); + + return; + } + + // + // C++: Mat Mat::adjustROI(int dtop, int dbottom, int dleft, int dright) + // + + // javadoc: Mat::adjustROI(dtop, dbottom, dleft, dright) + public Mat adjustROI(int dtop, int dbottom, int dleft, int dright) + { + + Mat retVal = new Mat(n_adjustROI(nativeObj, dtop, dbottom, dleft, dright)); + + return retVal; + } + + // + // C++: void Mat::assignTo(Mat m, int type = -1) + // + + // javadoc: Mat::assignTo(m, type) + public void assignTo(Mat m, int type) + { + + n_assignTo(nativeObj, m.nativeObj, type); + + return; + } + + // javadoc: Mat::assignTo(m) + public void assignTo(Mat m) + { + + n_assignTo(nativeObj, m.nativeObj); + + return; + } + + // + // C++: int Mat::channels() + // + + // javadoc: Mat::channels() + public int channels() + { + + int retVal = n_channels(nativeObj); + + return retVal; + } + + // + // C++: int Mat::checkVector(int elemChannels, int depth = -1, bool + // requireContinuous = true) + // + + // javadoc: Mat::checkVector(elemChannels, depth, requireContinuous) + public int checkVector(int elemChannels, int depth, boolean requireContinuous) + { + + int retVal = n_checkVector(nativeObj, elemChannels, depth, requireContinuous); + + return retVal; + } + + // javadoc: Mat::checkVector(elemChannels, depth) + public int checkVector(int elemChannels, int depth) + { + + int retVal = n_checkVector(nativeObj, elemChannels, depth); + + return retVal; + } + + // javadoc: Mat::checkVector(elemChannels) + public int checkVector(int elemChannels) + { + + int retVal = n_checkVector(nativeObj, elemChannels); + + return retVal; + } + + // + // C++: Mat Mat::clone() + // + + // javadoc: Mat::clone() + public Mat clone() + { + + Mat retVal = new Mat(n_clone(nativeObj)); + + return retVal; + } + + // + // C++: Mat Mat::col(int x) + // + + // javadoc: Mat::col(x) + public Mat col(int x) + { + + Mat retVal = new Mat(n_col(nativeObj, x)); + + return retVal; + } + + // + // C++: Mat Mat::colRange(int startcol, int endcol) + // + + // javadoc: Mat::colRange(startcol, endcol) + public Mat colRange(int startcol, int endcol) + { + + Mat retVal = new Mat(n_colRange(nativeObj, startcol, endcol)); + + return retVal; + } + + // + // C++: Mat Mat::colRange(Range r) + // + + // javadoc: Mat::colRange(r) + public Mat colRange(Range r) + { + + Mat retVal = new Mat(n_colRange(nativeObj, r.start, r.end)); + + return retVal; + } + + // + // C++: int Mat::dims() + // + + // javadoc: Mat::dims() + public int dims() + { + + int retVal = n_dims(nativeObj); + + return retVal; + } + + // + // C++: int Mat::cols() + // + + // javadoc: Mat::cols() + public int cols() + { + + int retVal = n_cols(nativeObj); + + return retVal; + } + + // + // C++: void Mat::convertTo(Mat& m, int rtype, double alpha = 1, double beta + // = 0) + // + + // javadoc: Mat::convertTo(m, rtype, alpha, beta) + public void convertTo(Mat m, int rtype, double alpha, double beta) + { + + n_convertTo(nativeObj, m.nativeObj, rtype, alpha, beta); + + return; + } + + // javadoc: Mat::convertTo(m, rtype, alpha) + public void convertTo(Mat m, int rtype, double alpha) + { + + n_convertTo(nativeObj, m.nativeObj, rtype, alpha); + + return; + } + + // javadoc: Mat::convertTo(m, rtype) + public void convertTo(Mat m, int rtype) + { + + n_convertTo(nativeObj, m.nativeObj, rtype); + + return; + } + + // + // C++: void Mat::copyTo(Mat& m) + // + + // javadoc: Mat::copyTo(m) + public void copyTo(Mat m) + { + + n_copyTo(nativeObj, m.nativeObj); + + return; + } + + // + // C++: void Mat::copyTo(Mat& m, Mat mask) + // + + // javadoc: Mat::copyTo(m, mask) + public void copyTo(Mat m, Mat mask) + { + + n_copyTo(nativeObj, m.nativeObj, mask.nativeObj); + + return; + } + + // + // C++: void Mat::create(int rows, int cols, int type) + // + + // javadoc: Mat::create(rows, cols, type) + public void create(int rows, int cols, int type) + { + + n_create(nativeObj, rows, cols, type); + + return; + } + + // + // C++: void Mat::create(Size size, int type) + // + + // javadoc: Mat::create(size, type) + public void create(Size size, int type) + { + + n_create(nativeObj, size.width, size.height, type); + + return; + } + + // + // C++: Mat Mat::cross(Mat m) + // + + // javadoc: Mat::cross(m) + public Mat cross(Mat m) + { + + Mat retVal = new Mat(n_cross(nativeObj, m.nativeObj)); + + return retVal; + } + + // + // C++: long Mat::dataAddr() + // + + // javadoc: Mat::dataAddr() + public long dataAddr() + { + + long retVal = n_dataAddr(nativeObj); + + return retVal; + } + + // + // C++: int Mat::depth() + // + + // javadoc: Mat::depth() + public int depth() + { + + int retVal = n_depth(nativeObj); + + return retVal; + } + + // + // C++: Mat Mat::diag(int d = 0) + // + + // javadoc: Mat::diag(d) + public Mat diag(int d) + { + + Mat retVal = new Mat(n_diag(nativeObj, d)); + + return retVal; + } + + // javadoc: Mat::diag() + public Mat diag() + { + + Mat retVal = new Mat(n_diag(nativeObj, 0)); + + return retVal; + } + + // + // C++: static Mat Mat::diag(Mat d) + // + + // javadoc: Mat::diag(d) + public static Mat diag(Mat d) + { + + Mat retVal = new Mat(n_diag(d.nativeObj)); + + return retVal; + } + + // + // C++: double Mat::dot(Mat m) + // + + // javadoc: Mat::dot(m) + public double dot(Mat m) + { + + double retVal = n_dot(nativeObj, m.nativeObj); + + return retVal; + } + + // + // C++: size_t Mat::elemSize() + // + + // javadoc: Mat::elemSize() + public long elemSize() + { + + long retVal = n_elemSize(nativeObj); + + return retVal; + } + + // + // C++: size_t Mat::elemSize1() + // + + // javadoc: Mat::elemSize1() + public long elemSize1() + { + + long retVal = n_elemSize1(nativeObj); + + return retVal; + } + + // + // C++: bool Mat::empty() + // + + // javadoc: Mat::empty() + public boolean empty() + { + + boolean retVal = n_empty(nativeObj); + + return retVal; + } + + // + // C++: static Mat Mat::eye(int rows, int cols, int type) + // + + // javadoc: Mat::eye(rows, cols, type) + public static Mat eye(int rows, int cols, int type) + { + + Mat retVal = new Mat(n_eye(rows, cols, type)); + + return retVal; + } + + // + // C++: static Mat Mat::eye(Size size, int type) + // + + // javadoc: Mat::eye(size, type) + public static Mat eye(Size size, int type) + { + + Mat retVal = new Mat(n_eye(size.width, size.height, type)); + + return retVal; + } + + // + // C++: Mat Mat::inv(int method = DECOMP_LU) + // + + // javadoc: Mat::inv(method) + public Mat inv(int method) + { + + Mat retVal = new Mat(n_inv(nativeObj, method)); + + return retVal; + } + + // javadoc: Mat::inv() + public Mat inv() + { + + Mat retVal = new Mat(n_inv(nativeObj)); + + return retVal; + } + + // + // C++: bool Mat::isContinuous() + // + + // javadoc: Mat::isContinuous() + public boolean isContinuous() + { + + boolean retVal = n_isContinuous(nativeObj); + + return retVal; + } + + // + // C++: bool Mat::isSubmatrix() + // + + // javadoc: Mat::isSubmatrix() + public boolean isSubmatrix() + { + + boolean retVal = n_isSubmatrix(nativeObj); + + return retVal; + } + + // + // C++: void Mat::locateROI(Size wholeSize, Point ofs) + // + + // javadoc: Mat::locateROI(wholeSize, ofs) + public void locateROI(Size wholeSize, Point ofs) + { + double[] wholeSize_out = new double[2]; + double[] ofs_out = new double[2]; + locateROI_0(nativeObj, wholeSize_out, ofs_out); + if(wholeSize!=null){ wholeSize.width = wholeSize_out[0]; wholeSize.height = wholeSize_out[1]; } + if(ofs!=null){ ofs.x = ofs_out[0]; ofs.y = ofs_out[1]; } + return; + } + + // + // C++: Mat Mat::mul(Mat m, double scale = 1) + // + + // javadoc: Mat::mul(m, scale) + public Mat mul(Mat m, double scale) + { + + Mat retVal = new Mat(n_mul(nativeObj, m.nativeObj, scale)); + + return retVal; + } + + // javadoc: Mat::mul(m) + public Mat mul(Mat m) + { + + Mat retVal = new Mat(n_mul(nativeObj, m.nativeObj)); + + return retVal; + } + + // + // C++: static Mat Mat::ones(int rows, int cols, int type) + // + + // javadoc: Mat::ones(rows, cols, type) + public static Mat ones(int rows, int cols, int type) + { + + Mat retVal = new Mat(n_ones(rows, cols, type)); + + return retVal; + } + + // + // C++: static Mat Mat::ones(Size size, int type) + // + + // javadoc: Mat::ones(size, type) + public static Mat ones(Size size, int type) + { + + Mat retVal = new Mat(n_ones(size.width, size.height, type)); + + return retVal; + } + + // + // C++: void Mat::push_back(Mat m) + // + + // javadoc: Mat::push_back(m) + public void push_back(Mat m) + { + + n_push_back(nativeObj, m.nativeObj); + + return; + } + + // + // C++: void Mat::release() + // + + // javadoc: Mat::release() + public void release() + { + + n_release(nativeObj); + + return; + } + + // + // C++: Mat Mat::reshape(int cn, int rows = 0) + // + + // javadoc: Mat::reshape(cn, rows) + public Mat reshape(int cn, int rows) + { + + Mat retVal = new Mat(n_reshape(nativeObj, cn, rows)); + + return retVal; + } + + // javadoc: Mat::reshape(cn) + public Mat reshape(int cn) + { + + Mat retVal = new Mat(n_reshape(nativeObj, cn)); + + return retVal; + } + + // + // C++: Mat Mat::row(int y) + // + + // javadoc: Mat::row(y) + public Mat row(int y) + { + + Mat retVal = new Mat(n_row(nativeObj, y)); + + return retVal; + } + + // + // C++: Mat Mat::rowRange(int startrow, int endrow) + // + + // javadoc: Mat::rowRange(startrow, endrow) + public Mat rowRange(int startrow, int endrow) + { + + Mat retVal = new Mat(n_rowRange(nativeObj, startrow, endrow)); + + return retVal; + } + + // + // C++: Mat Mat::rowRange(Range r) + // + + // javadoc: Mat::rowRange(r) + public Mat rowRange(Range r) + { + + Mat retVal = new Mat(n_rowRange(nativeObj, r.start, r.end)); + + return retVal; + } + + // + // C++: int Mat::rows() + // + + // javadoc: Mat::rows() + public int rows() + { + + int retVal = n_rows(nativeObj); + + return retVal; + } + + // + // C++: Mat Mat::operator =(Scalar s) + // + + // javadoc: Mat::operator =(s) + public Mat setTo(Scalar s) + { + + Mat retVal = new Mat(n_setTo(nativeObj, s.val[0], s.val[1], s.val[2], s.val[3])); + + return retVal; + } + + // + // C++: Mat Mat::setTo(Scalar value, Mat mask = Mat()) + // + + // javadoc: Mat::setTo(value, mask) + public Mat setTo(Scalar value, Mat mask) + { + + Mat retVal = new Mat(n_setTo(nativeObj, value.val[0], value.val[1], value.val[2], value.val[3], mask.nativeObj)); + + return retVal; + } + + // + // C++: Mat Mat::setTo(Mat value, Mat mask = Mat()) + // + + // javadoc: Mat::setTo(value, mask) + public Mat setTo(Mat value, Mat mask) + { + + Mat retVal = new Mat(n_setTo(nativeObj, value.nativeObj, mask.nativeObj)); + + return retVal; + } + + // javadoc: Mat::setTo(value) + public Mat setTo(Mat value) + { + + Mat retVal = new Mat(n_setTo(nativeObj, value.nativeObj)); + + return retVal; + } + + // + // C++: Size Mat::size() + // + + // javadoc: Mat::size() + public Size size() + { + + Size retVal = new Size(n_size(nativeObj)); + + return retVal; + } + + // + // C++: size_t Mat::step1(int i = 0) + // + + // javadoc: Mat::step1(i) + public long step1(int i) + { + + long retVal = n_step1(nativeObj, i); + + return retVal; + } + + // javadoc: Mat::step1() + public long step1() + { + + long retVal = n_step1(nativeObj); + + return retVal; + } + + // + // C++: Mat Mat::operator()(int rowStart, int rowEnd, int colStart, int + // colEnd) + // + + // javadoc: Mat::operator()(rowStart, rowEnd, colStart, colEnd) + public Mat submat(int rowStart, int rowEnd, int colStart, int colEnd) + { + + Mat retVal = new Mat(n_submat_rr(nativeObj, rowStart, rowEnd, colStart, colEnd)); + + return retVal; + } + + // + // C++: Mat Mat::operator()(Range rowRange, Range colRange) + // + + // javadoc: Mat::operator()(rowRange, colRange) + public Mat submat(Range rowRange, Range colRange) + { + + Mat retVal = new Mat(n_submat_rr(nativeObj, rowRange.start, rowRange.end, colRange.start, colRange.end)); + + return retVal; + } + + // + // C++: Mat Mat::operator()(Rect roi) + // + + // javadoc: Mat::operator()(roi) + public Mat submat(Rect roi) + { + + Mat retVal = new Mat(n_submat(nativeObj, roi.x, roi.y, roi.width, roi.height)); + + return retVal; + } + + // + // C++: Mat Mat::t() + // + + // javadoc: Mat::t() + public Mat t() + { + + Mat retVal = new Mat(n_t(nativeObj)); + + return retVal; + } + + // + // C++: size_t Mat::total() + // + + // javadoc: Mat::total() + public long total() + { + + long retVal = n_total(nativeObj); + + return retVal; + } + + // + // C++: int Mat::type() + // + + // javadoc: Mat::type() + public int type() + { + + int retVal = n_type(nativeObj); + + return retVal; + } + + // + // C++: static Mat Mat::zeros(int rows, int cols, int type) + // + + // javadoc: Mat::zeros(rows, cols, type) + public static Mat zeros(int rows, int cols, int type) + { + + Mat retVal = new Mat(n_zeros(rows, cols, type)); + + return retVal; + } + + // + // C++: static Mat Mat::zeros(Size size, int type) + // + + // javadoc: Mat::zeros(size, type) + public static Mat zeros(Size size, int type) + { + + Mat retVal = new Mat(n_zeros(size.width, size.height, type)); + + return retVal; + } + + @Override + protected void finalize() throws Throwable { + n_delete(nativeObj); + super.finalize(); + } + + // javadoc:Mat::toString() + @Override + public String toString() { + return "Mat [ " + + rows() + "*" + cols() + "*" + CvType.typeToString(type()) + + ", isCont=" + isContinuous() + ", isSubmat=" + isSubmatrix() + + ", nativeObj=0x" + Long.toHexString(nativeObj) + + ", dataAddr=0x" + Long.toHexString(dataAddr()) + + " ]"; + } + + // javadoc:Mat::dump() + public String dump() { + return nDump(nativeObj); + } + + // javadoc:Mat::put(row,col,data) + public int put(int row, int col, double... data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + return nPutD(nativeObj, row, col, data.length, data); + } + + // javadoc:Mat::put(row,col,data) + public int put(int row, int col, float[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_32F) { + return nPutF(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::put(row,col,data) + public int put(int row, int col, int[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_32S) { + return nPutI(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::put(row,col,data) + public int put(int row, int col, short[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_16U || CvType.depth(t) == CvType.CV_16S) { + return nPutS(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::put(row,col,data) + public int put(int row, int col, byte[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) { + return nPutB(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::get(row,col,data) + public int get(int row, int col, byte[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) { + return nGetB(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::get(row,col,data) + public int get(int row, int col, short[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_16U || CvType.depth(t) == CvType.CV_16S) { + return nGetS(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::get(row,col,data) + public int get(int row, int col, int[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_32S) { + return nGetI(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::get(row,col,data) + public int get(int row, int col, float[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_32F) { + return nGetF(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::get(row,col,data) + public int get(int row, int col, double[] data) { + int t = type(); + if (data == null || data.length % CvType.channels(t) != 0) + throw new java.lang.UnsupportedOperationException( + "Provided data element number (" + + (data == null ? 0 : data.length) + + ") should be multiple of the Mat channels count (" + + CvType.channels(t) + ")"); + if (CvType.depth(t) == CvType.CV_64F) { + return nGetD(nativeObj, row, col, data.length, data); + } + throw new java.lang.UnsupportedOperationException("Mat data type is not compatible: " + t); + } + + // javadoc:Mat::get(row,col) + public double[] get(int row, int col) { + return nGet(nativeObj, row, col); + } + + // javadoc:Mat::height() + public int height() { + return rows(); + } + + // javadoc:Mat::width() + public int width() { + return cols(); + } + + // javadoc:Mat::getNativeObjAddr() + public long getNativeObjAddr() { + return nativeObj; + } + + // C++: Mat::Mat() + private static native long n_Mat(); + + // C++: Mat::Mat(int rows, int cols, int type) + private static native long n_Mat(int rows, int cols, int type); + + // C++: Mat::Mat(Size size, int type) + private static native long n_Mat(double size_width, double size_height, int type); + + // C++: Mat::Mat(int rows, int cols, int type, Scalar s) + private static native long n_Mat(int rows, int cols, int type, double s_val0, double s_val1, double s_val2, double s_val3); + + // C++: Mat::Mat(Size size, int type, Scalar s) + private static native long n_Mat(double size_width, double size_height, int type, double s_val0, double s_val1, double s_val2, double s_val3); + + // C++: Mat::Mat(Mat m, Range rowRange, Range colRange = Range::all()) + private static native long n_Mat(long m_nativeObj, int rowRange_start, int rowRange_end, int colRange_start, int colRange_end); + + private static native long n_Mat(long m_nativeObj, int rowRange_start, int rowRange_end); + + // C++: Mat Mat::adjustROI(int dtop, int dbottom, int dleft, int dright) + private static native long n_adjustROI(long nativeObj, int dtop, int dbottom, int dleft, int dright); + + // C++: void Mat::assignTo(Mat m, int type = -1) + private static native void n_assignTo(long nativeObj, long m_nativeObj, int type); + + private static native void n_assignTo(long nativeObj, long m_nativeObj); + + // C++: int Mat::channels() + private static native int n_channels(long nativeObj); + + // C++: int Mat::checkVector(int elemChannels, int depth = -1, bool + // requireContinuous = true) + private static native int n_checkVector(long nativeObj, int elemChannels, int depth, boolean requireContinuous); + + private static native int n_checkVector(long nativeObj, int elemChannels, int depth); + + private static native int n_checkVector(long nativeObj, int elemChannels); + + // C++: Mat Mat::clone() + private static native long n_clone(long nativeObj); + + // C++: Mat Mat::col(int x) + private static native long n_col(long nativeObj, int x); + + // C++: Mat Mat::colRange(int startcol, int endcol) + private static native long n_colRange(long nativeObj, int startcol, int endcol); + + // C++: int Mat::dims() + private static native int n_dims(long nativeObj); + + // C++: int Mat::cols() + private static native int n_cols(long nativeObj); + + // C++: void Mat::convertTo(Mat& m, int rtype, double alpha = 1, double beta + // = 0) + private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype, double alpha, double beta); + + private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype, double alpha); + + private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype); + + // C++: void Mat::copyTo(Mat& m) + private static native void n_copyTo(long nativeObj, long m_nativeObj); + + // C++: void Mat::copyTo(Mat& m, Mat mask) + private static native void n_copyTo(long nativeObj, long m_nativeObj, long mask_nativeObj); + + // C++: void Mat::create(int rows, int cols, int type) + private static native void n_create(long nativeObj, int rows, int cols, int type); + + // C++: void Mat::create(Size size, int type) + private static native void n_create(long nativeObj, double size_width, double size_height, int type); + + // C++: Mat Mat::cross(Mat m) + private static native long n_cross(long nativeObj, long m_nativeObj); + + // C++: long Mat::dataAddr() + private static native long n_dataAddr(long nativeObj); + + // C++: int Mat::depth() + private static native int n_depth(long nativeObj); + + // C++: Mat Mat::diag(int d = 0) + private static native long n_diag(long nativeObj, int d); + + // C++: static Mat Mat::diag(Mat d) + private static native long n_diag(long d_nativeObj); + + // C++: double Mat::dot(Mat m) + private static native double n_dot(long nativeObj, long m_nativeObj); + + // C++: size_t Mat::elemSize() + private static native long n_elemSize(long nativeObj); + + // C++: size_t Mat::elemSize1() + private static native long n_elemSize1(long nativeObj); + + // C++: bool Mat::empty() + private static native boolean n_empty(long nativeObj); + + // C++: static Mat Mat::eye(int rows, int cols, int type) + private static native long n_eye(int rows, int cols, int type); + + // C++: static Mat Mat::eye(Size size, int type) + private static native long n_eye(double size_width, double size_height, int type); + + // C++: Mat Mat::inv(int method = DECOMP_LU) + private static native long n_inv(long nativeObj, int method); + + private static native long n_inv(long nativeObj); + + // C++: bool Mat::isContinuous() + private static native boolean n_isContinuous(long nativeObj); + + // C++: bool Mat::isSubmatrix() + private static native boolean n_isSubmatrix(long nativeObj); + + // C++: void Mat::locateROI(Size wholeSize, Point ofs) + private static native void locateROI_0(long nativeObj, double[] wholeSize_out, double[] ofs_out); + + // C++: Mat Mat::mul(Mat m, double scale = 1) + private static native long n_mul(long nativeObj, long m_nativeObj, double scale); + + private static native long n_mul(long nativeObj, long m_nativeObj); + + // C++: static Mat Mat::ones(int rows, int cols, int type) + private static native long n_ones(int rows, int cols, int type); + + // C++: static Mat Mat::ones(Size size, int type) + private static native long n_ones(double size_width, double size_height, int type); + + // C++: void Mat::push_back(Mat m) + private static native void n_push_back(long nativeObj, long m_nativeObj); + + // C++: void Mat::release() + private static native void n_release(long nativeObj); + + // C++: Mat Mat::reshape(int cn, int rows = 0) + private static native long n_reshape(long nativeObj, int cn, int rows); + + private static native long n_reshape(long nativeObj, int cn); + + // C++: Mat Mat::row(int y) + private static native long n_row(long nativeObj, int y); + + // C++: Mat Mat::rowRange(int startrow, int endrow) + private static native long n_rowRange(long nativeObj, int startrow, int endrow); + + // C++: int Mat::rows() + private static native int n_rows(long nativeObj); + + // C++: Mat Mat::operator =(Scalar s) + private static native long n_setTo(long nativeObj, double s_val0, double s_val1, double s_val2, double s_val3); + + // C++: Mat Mat::setTo(Scalar value, Mat mask = Mat()) + private static native long n_setTo(long nativeObj, double s_val0, double s_val1, double s_val2, double s_val3, long mask_nativeObj); + + // C++: Mat Mat::setTo(Mat value, Mat mask = Mat()) + private static native long n_setTo(long nativeObj, long value_nativeObj, long mask_nativeObj); + + private static native long n_setTo(long nativeObj, long value_nativeObj); + + // C++: Size Mat::size() + private static native double[] n_size(long nativeObj); + + // C++: size_t Mat::step1(int i = 0) + private static native long n_step1(long nativeObj, int i); + + private static native long n_step1(long nativeObj); + + // C++: Mat Mat::operator()(Range rowRange, Range colRange) + private static native long n_submat_rr(long nativeObj, int rowRange_start, int rowRange_end, int colRange_start, int colRange_end); + + // C++: Mat Mat::operator()(Rect roi) + private static native long n_submat(long nativeObj, int roi_x, int roi_y, int roi_width, int roi_height); + + // C++: Mat Mat::t() + private static native long n_t(long nativeObj); + + // C++: size_t Mat::total() + private static native long n_total(long nativeObj); + + // C++: int Mat::type() + private static native int n_type(long nativeObj); + + // C++: static Mat Mat::zeros(int rows, int cols, int type) + private static native long n_zeros(int rows, int cols, int type); + + // C++: static Mat Mat::zeros(Size size, int type) + private static native long n_zeros(double size_width, double size_height, int type); + + // native support for java finalize() + private static native void n_delete(long nativeObj); + + private static native int nPutD(long self, int row, int col, int count, double[] data); + + private static native int nPutF(long self, int row, int col, int count, float[] data); + + private static native int nPutI(long self, int row, int col, int count, int[] data); + + private static native int nPutS(long self, int row, int col, int count, short[] data); + + private static native int nPutB(long self, int row, int col, int count, byte[] data); + + private static native int nGetB(long self, int row, int col, int count, byte[] vals); + + private static native int nGetS(long self, int row, int col, int count, short[] vals); + + private static native int nGetI(long self, int row, int col, int count, int[] vals); + + private static native int nGetF(long self, int row, int col, int count, float[] vals); + + private static native int nGetD(long self, int row, int col, int count, double[] vals); + + private static native double[] nGet(long self, int row, int col); + + private static native String nDump(long self); +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/MatOfByte.java b/openCVLibrary310/src/main/java/org/opencv/core/MatOfByte.java new file mode 100644 index 0000000..7756eb9 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/MatOfByte.java @@ -0,0 +1,79 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfByte extends Mat { + // 8UC(x) + private static final int _depth = CvType.CV_8U; + private static final int _channels = 1; + + public MatOfByte() { + super(); + } + + protected MatOfByte(long addr) { + super(addr); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public static MatOfByte fromNativeAddr(long addr) { + return new MatOfByte(addr); + } + + public MatOfByte(Mat m) { + super(m, Range.all()); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfByte(byte...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(byte...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public byte[] toArray() { + int num = checkVector(_channels, _depth); + if(num < 0) + throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); + byte[] a = new byte[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Byte ab[] = lb.toArray(new Byte[0]); + byte a[] = new byte[ab.length]; + for(int i=0; i toList() { + byte[] a = toArray(); + Byte ab[] = new Byte[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + + public void fromArray(DMatch...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + float buff[] = new float[num * _channels]; + for(int i=0; i ldm) { + DMatch adm[] = ldm.toArray(new DMatch[0]); + fromArray(adm); + } + + public List toList() { + DMatch[] adm = toArray(); + return Arrays.asList(adm); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/MatOfDouble.java b/openCVLibrary310/src/main/java/org/opencv/core/MatOfDouble.java new file mode 100644 index 0000000..1a8e23c --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/MatOfDouble.java @@ -0,0 +1,79 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfDouble extends Mat { + // 64FC(x) + private static final int _depth = CvType.CV_64F; + private static final int _channels = 1; + + public MatOfDouble() { + super(); + } + + protected MatOfDouble(long addr) { + super(addr); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public static MatOfDouble fromNativeAddr(long addr) { + return new MatOfDouble(addr); + } + + public MatOfDouble(Mat m) { + super(m, Range.all()); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfDouble(double...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(double...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public double[] toArray() { + int num = checkVector(_channels, _depth); + if(num < 0) + throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); + double[] a = new double[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Double ab[] = lb.toArray(new Double[0]); + double a[] = new double[ab.length]; + for(int i=0; i toList() { + double[] a = toArray(); + Double ab[] = new Double[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(float...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public float[] toArray() { + int num = checkVector(_channels, _depth); + if(num < 0) + throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); + float[] a = new float[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Float ab[] = lb.toArray(new Float[0]); + float a[] = new float[ab.length]; + for(int i=0; i toList() { + float[] a = toArray(); + Float ab[] = new Float[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(float...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public float[] toArray() { + int num = checkVector(_channels, _depth); + if(num < 0) + throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); + float[] a = new float[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Float ab[] = lb.toArray(new Float[0]); + float a[] = new float[ab.length]; + for(int i=0; i toList() { + float[] a = toArray(); + Float ab[] = new Float[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(float...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public float[] toArray() { + int num = checkVector(_channels, _depth); + if(num < 0) + throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); + float[] a = new float[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Float ab[] = lb.toArray(new Float[0]); + float a[] = new float[ab.length]; + for(int i=0; i toList() { + float[] a = toArray(); + Float ab[] = new Float[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(int...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public int[] toArray() { + int num = checkVector(_channels, _depth); + if(num < 0) + throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); + int[] a = new int[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Integer ab[] = lb.toArray(new Integer[0]); + int a[] = new int[ab.length]; + for(int i=0; i toList() { + int[] a = toArray(); + Integer ab[] = new Integer[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(int...a) { + if(a==null || a.length==0) + return; + int num = a.length / _channels; + alloc(num); + put(0, 0, a); //TODO: check ret val! + } + + public int[] toArray() { + int num = checkVector(_channels, _depth); + if(num < 0) + throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); + int[] a = new int[num * _channels]; + if(num == 0) + return a; + get(0, 0, a); //TODO: check ret val! + return a; + } + + public void fromList(List lb) { + if(lb==null || lb.size()==0) + return; + Integer ab[] = lb.toArray(new Integer[0]); + int a[] = new int[ab.length]; + for(int i=0; i toList() { + int[] a = toArray(); + Integer ab[] = new Integer[a.length]; + for(int i=0; i0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(KeyPoint...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + float buff[] = new float[num * _channels]; + for(int i=0; i lkp) { + KeyPoint akp[] = lkp.toArray(new KeyPoint[0]); + fromArray(akp); + } + + public List toList() { + KeyPoint[] akp = toArray(); + return Arrays.asList(akp); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint.java b/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint.java new file mode 100644 index 0000000..f4d573b --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint.java @@ -0,0 +1,78 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfPoint extends Mat { + // 32SC2 + private static final int _depth = CvType.CV_32S; + private static final int _channels = 2; + + public MatOfPoint() { + super(); + } + + protected MatOfPoint(long addr) { + super(addr); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public static MatOfPoint fromNativeAddr(long addr) { + return new MatOfPoint(addr); + } + + public MatOfPoint(Mat m) { + super(m, Range.all()); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint(Point...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Point...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + int buff[] = new int[num * _channels]; + for(int i=0; i lp) { + Point ap[] = lp.toArray(new Point[0]); + fromArray(ap); + } + + public List toList() { + Point[] ap = toArray(); + return Arrays.asList(ap); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint2f.java b/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint2f.java new file mode 100644 index 0000000..4b8c926 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint2f.java @@ -0,0 +1,78 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfPoint2f extends Mat { + // 32FC2 + private static final int _depth = CvType.CV_32F; + private static final int _channels = 2; + + public MatOfPoint2f() { + super(); + } + + protected MatOfPoint2f(long addr) { + super(addr); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public static MatOfPoint2f fromNativeAddr(long addr) { + return new MatOfPoint2f(addr); + } + + public MatOfPoint2f(Mat m) { + super(m, Range.all()); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint2f(Point...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Point...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + float buff[] = new float[num * _channels]; + for(int i=0; i lp) { + Point ap[] = lp.toArray(new Point[0]); + fromArray(ap); + } + + public List toList() { + Point[] ap = toArray(); + return Arrays.asList(ap); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint3.java b/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint3.java new file mode 100644 index 0000000..3b50561 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint3.java @@ -0,0 +1,79 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfPoint3 extends Mat { + // 32SC3 + private static final int _depth = CvType.CV_32S; + private static final int _channels = 3; + + public MatOfPoint3() { + super(); + } + + protected MatOfPoint3(long addr) { + super(addr); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public static MatOfPoint3 fromNativeAddr(long addr) { + return new MatOfPoint3(addr); + } + + public MatOfPoint3(Mat m) { + super(m, Range.all()); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint3(Point3...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Point3...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + int buff[] = new int[num * _channels]; + for(int i=0; i lp) { + Point3 ap[] = lp.toArray(new Point3[0]); + fromArray(ap); + } + + public List toList() { + Point3[] ap = toArray(); + return Arrays.asList(ap); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint3f.java b/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint3f.java new file mode 100644 index 0000000..fc5fee4 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/MatOfPoint3f.java @@ -0,0 +1,79 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + +public class MatOfPoint3f extends Mat { + // 32FC3 + private static final int _depth = CvType.CV_32F; + private static final int _channels = 3; + + public MatOfPoint3f() { + super(); + } + + protected MatOfPoint3f(long addr) { + super(addr); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public static MatOfPoint3f fromNativeAddr(long addr) { + return new MatOfPoint3f(addr); + } + + public MatOfPoint3f(Mat m) { + super(m, Range.all()); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfPoint3f(Point3...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Point3...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + float buff[] = new float[num * _channels]; + for(int i=0; i lp) { + Point3 ap[] = lp.toArray(new Point3[0]); + fromArray(ap); + } + + public List toList() { + Point3[] ap = toArray(); + return Arrays.asList(ap); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/MatOfRect.java b/openCVLibrary310/src/main/java/org/opencv/core/MatOfRect.java new file mode 100644 index 0000000..ec0fb01 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/MatOfRect.java @@ -0,0 +1,81 @@ +package org.opencv.core; + +import java.util.Arrays; +import java.util.List; + + +public class MatOfRect extends Mat { + // 32SC4 + private static final int _depth = CvType.CV_32S; + private static final int _channels = 4; + + public MatOfRect() { + super(); + } + + protected MatOfRect(long addr) { + super(addr); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public static MatOfRect fromNativeAddr(long addr) { + return new MatOfRect(addr); + } + + public MatOfRect(Mat m) { + super(m, Range.all()); + if( !empty() && checkVector(_channels, _depth) < 0 ) + throw new IllegalArgumentException("Incompatible Mat"); + //FIXME: do we need release() here? + } + + public MatOfRect(Rect...a) { + super(); + fromArray(a); + } + + public void alloc(int elemNumber) { + if(elemNumber>0) + super.create(elemNumber, 1, CvType.makeType(_depth, _channels)); + } + + public void fromArray(Rect...a) { + if(a==null || a.length==0) + return; + int num = a.length; + alloc(num); + int buff[] = new int[num * _channels]; + for(int i=0; i lr) { + Rect ap[] = lr.toArray(new Rect[0]); + fromArray(ap); + } + + public List toList() { + Rect[] ar = toArray(); + return Arrays.asList(ar); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Point.java b/openCVLibrary310/src/main/java/org/opencv/core/Point.java new file mode 100644 index 0000000..ce493d7 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Point.java @@ -0,0 +1,68 @@ +package org.opencv.core; + +//javadoc:Point_ +public class Point { + + public double x, y; + + public Point(double x, double y) { + this.x = x; + this.y = y; + } + + public Point() { + this(0, 0); + } + + public Point(double[] vals) { + this(); + set(vals); + } + + public void set(double[] vals) { + if (vals != null) { + x = vals.length > 0 ? vals[0] : 0; + y = vals.length > 1 ? vals[1] : 0; + } else { + x = 0; + y = 0; + } + } + + public Point clone() { + return new Point(x, y); + } + + public double dot(Point p) { + return x * p.x + y * p.y; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(x); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(y); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof Point)) return false; + Point it = (Point) obj; + return x == it.x && y == it.y; + } + + public boolean inside(Rect r) { + return r.contains(this); + } + + @Override + public String toString() { + return "{" + x + ", " + y + "}"; + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Point3.java b/openCVLibrary310/src/main/java/org/opencv/core/Point3.java new file mode 100644 index 0000000..14b91c6 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Point3.java @@ -0,0 +1,79 @@ +package org.opencv.core; + +//javadoc:Point3_ +public class Point3 { + + public double x, y, z; + + public Point3(double x, double y, double z) { + this.x = x; + this.y = y; + this.z = z; + } + + public Point3() { + this(0, 0, 0); + } + + public Point3(Point p) { + x = p.x; + y = p.y; + z = 0; + } + + public Point3(double[] vals) { + this(); + set(vals); + } + + public void set(double[] vals) { + if (vals != null) { + x = vals.length > 0 ? vals[0] : 0; + y = vals.length > 1 ? vals[1] : 0; + z = vals.length > 2 ? vals[2] : 0; + } else { + x = 0; + y = 0; + z = 0; + } + } + + public Point3 clone() { + return new Point3(x, y, z); + } + + public double dot(Point3 p) { + return x * p.x + y * p.y + z * p.z; + } + + public Point3 cross(Point3 p) { + return new Point3(y * p.z - z * p.y, z * p.x - x * p.z, x * p.y - y * p.x); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(x); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(y); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(z); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof Point3)) return false; + Point3 it = (Point3) obj; + return x == it.x && y == it.y && z == it.z; + } + + @Override + public String toString() { + return "{" + x + ", " + y + ", " + z + "}"; + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Range.java b/openCVLibrary310/src/main/java/org/opencv/core/Range.java new file mode 100644 index 0000000..f7eee4d --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Range.java @@ -0,0 +1,82 @@ +package org.opencv.core; + +//javadoc:Range +public class Range { + + public int start, end; + + public Range(int s, int e) { + this.start = s; + this.end = e; + } + + public Range() { + this(0, 0); + } + + public Range(double[] vals) { + set(vals); + } + + public void set(double[] vals) { + if (vals != null) { + start = vals.length > 0 ? (int) vals[0] : 0; + end = vals.length > 1 ? (int) vals[1] : 0; + } else { + start = 0; + end = 0; + } + + } + + public int size() { + return empty() ? 0 : end - start; + } + + public boolean empty() { + return end <= start; + } + + public static Range all() { + return new Range(Integer.MIN_VALUE, Integer.MAX_VALUE); + } + + public Range intersection(Range r1) { + Range r = new Range(Math.max(r1.start, this.start), Math.min(r1.end, this.end)); + r.end = Math.max(r.end, r.start); + return r; + } + + public Range shift(int delta) { + return new Range(start + delta, end + delta); + } + + public Range clone() { + return new Range(start, end); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(start); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(end); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof Range)) return false; + Range it = (Range) obj; + return start == it.start && end == it.end; + } + + @Override + public String toString() { + return "[" + start + ", " + end + ")"; + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Rect.java b/openCVLibrary310/src/main/java/org/opencv/core/Rect.java new file mode 100644 index 0000000..8f3fad7 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Rect.java @@ -0,0 +1,100 @@ +package org.opencv.core; + +//javadoc:Rect_ +public class Rect { + + public int x, y, width, height; + + public Rect(int x, int y, int width, int height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + + public Rect() { + this(0, 0, 0, 0); + } + + public Rect(Point p1, Point p2) { + x = (int) (p1.x < p2.x ? p1.x : p2.x); + y = (int) (p1.y < p2.y ? p1.y : p2.y); + width = (int) (p1.x > p2.x ? p1.x : p2.x) - x; + height = (int) (p1.y > p2.y ? p1.y : p2.y) - y; + } + + public Rect(Point p, Size s) { + this((int) p.x, (int) p.y, (int) s.width, (int) s.height); + } + + public Rect(double[] vals) { + set(vals); + } + + public void set(double[] vals) { + if (vals != null) { + x = vals.length > 0 ? (int) vals[0] : 0; + y = vals.length > 1 ? (int) vals[1] : 0; + width = vals.length > 2 ? (int) vals[2] : 0; + height = vals.length > 3 ? (int) vals[3] : 0; + } else { + x = 0; + y = 0; + width = 0; + height = 0; + } + } + + public Rect clone() { + return new Rect(x, y, width, height); + } + + public Point tl() { + return new Point(x, y); + } + + public Point br() { + return new Point(x + width, y + height); + } + + public Size size() { + return new Size(width, height); + } + + public double area() { + return width * height; + } + + public boolean contains(Point p) { + return x <= p.x && p.x < x + width && y <= p.y && p.y < y + height; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(height); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(width); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(x); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(y); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof Rect)) return false; + Rect it = (Rect) obj; + return x == it.x && y == it.y && width == it.width && height == it.height; + } + + @Override + public String toString() { + return "{" + x + ", " + y + ", " + width + "x" + height + "}"; + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/RotatedRect.java b/openCVLibrary310/src/main/java/org/opencv/core/RotatedRect.java new file mode 100644 index 0000000..f6d1163 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/RotatedRect.java @@ -0,0 +1,113 @@ +package org.opencv.core; + +//javadoc:RotatedRect_ +public class RotatedRect { + + public Point center; + public Size size; + public double angle; + + public RotatedRect() { + this.center = new Point(); + this.size = new Size(); + this.angle = 0; + } + + public RotatedRect(Point c, Size s, double a) { + this.center = c.clone(); + this.size = s.clone(); + this.angle = a; + } + + public RotatedRect(double[] vals) { + this(); + set(vals); + } + + public void set(double[] vals) { + if (vals != null) { + center.x = vals.length > 0 ? (double) vals[0] : 0; + center.y = vals.length > 1 ? (double) vals[1] : 0; + size.width = vals.length > 2 ? (double) vals[2] : 0; + size.height = vals.length > 3 ? (double) vals[3] : 0; + angle = vals.length > 4 ? (double) vals[4] : 0; + } else { + center.x = 0; + center.x = 0; + size.width = 0; + size.height = 0; + angle = 0; + } + } + + public void points(Point pt[]) + { + double _angle = angle * Math.PI / 180.0; + double b = (double) Math.cos(_angle) * 0.5f; + double a = (double) Math.sin(_angle) * 0.5f; + + pt[0] = new Point( + center.x - a * size.height - b * size.width, + center.y + b * size.height - a * size.width); + + pt[1] = new Point( + center.x + a * size.height - b * size.width, + center.y - b * size.height - a * size.width); + + pt[2] = new Point( + 2 * center.x - pt[0].x, + 2 * center.y - pt[0].y); + + pt[3] = new Point( + 2 * center.x - pt[1].x, + 2 * center.y - pt[1].y); + } + + public Rect boundingRect() + { + Point pt[] = new Point[4]; + points(pt); + 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)), + (int) Math.floor(Math.min(Math.min(Math.min(pt[0].y, pt[1].y), pt[2].y), pt[3].y)), + (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].x, pt[1].x), pt[2].x), pt[3].x)), + (int) Math.ceil(Math.max(Math.max(Math.max(pt[0].y, pt[1].y), pt[2].y), pt[3].y))); + r.width -= r.x - 1; + r.height -= r.y - 1; + return r; + } + + public RotatedRect clone() { + return new RotatedRect(center, size, angle); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(center.x); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(center.y); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(size.width); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(size.height); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(angle); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof RotatedRect)) return false; + RotatedRect it = (RotatedRect) obj; + return center.equals(it.center) && size.equals(it.size) && angle == it.angle; + } + + @Override + public String toString() { + return "{ " + center + " " + size + " * " + angle + " }"; + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Scalar.java b/openCVLibrary310/src/main/java/org/opencv/core/Scalar.java new file mode 100644 index 0000000..01676e4 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Scalar.java @@ -0,0 +1,90 @@ +package org.opencv.core; + +//javadoc:Scalar_ +public class Scalar { + + public double val[]; + + public Scalar(double v0, double v1, double v2, double v3) { + val = new double[] { v0, v1, v2, v3 }; + } + + public Scalar(double v0, double v1, double v2) { + val = new double[] { v0, v1, v2, 0 }; + } + + public Scalar(double v0, double v1) { + val = new double[] { v0, v1, 0, 0 }; + } + + public Scalar(double v0) { + val = new double[] { v0, 0, 0, 0 }; + } + + public Scalar(double[] vals) { + if (vals != null && vals.length == 4) + val = vals.clone(); + else { + val = new double[4]; + set(vals); + } + } + + public void set(double[] vals) { + if (vals != null) { + val[0] = vals.length > 0 ? vals[0] : 0; + val[1] = vals.length > 1 ? vals[1] : 0; + val[2] = vals.length > 2 ? vals[2] : 0; + val[3] = vals.length > 3 ? vals[3] : 0; + } else + val[0] = val[1] = val[2] = val[3] = 0; + } + + public static Scalar all(double v) { + return new Scalar(v, v, v, v); + } + + public Scalar clone() { + return new Scalar(val); + } + + public Scalar mul(Scalar it, double scale) { + return new Scalar(val[0] * it.val[0] * scale, val[1] * it.val[1] * scale, + val[2] * it.val[2] * scale, val[3] * it.val[3] * scale); + } + + public Scalar mul(Scalar it) { + return mul(it, 1); + } + + public Scalar conj() { + return new Scalar(val[0], -val[1], -val[2], -val[3]); + } + + public boolean isReal() { + return val[1] == 0 && val[2] == 0 && val[3] == 0; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + java.util.Arrays.hashCode(val); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof Scalar)) return false; + Scalar it = (Scalar) obj; + if (!java.util.Arrays.equals(val, it.val)) return false; + return true; + } + + @Override + public String toString() { + return "[" + val[0] + ", " + val[1] + ", " + val[2] + ", " + val[3] + "]"; + } + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/Size.java b/openCVLibrary310/src/main/java/org/opencv/core/Size.java new file mode 100644 index 0000000..dcc5742 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/Size.java @@ -0,0 +1,69 @@ +package org.opencv.core; + +//javadoc:Size_ +public class Size { + + public double width, height; + + public Size(double width, double height) { + this.width = width; + this.height = height; + } + + public Size() { + this(0, 0); + } + + public Size(Point p) { + width = p.x; + height = p.y; + } + + public Size(double[] vals) { + set(vals); + } + + public void set(double[] vals) { + if (vals != null) { + width = vals.length > 0 ? vals[0] : 0; + height = vals.length > 1 ? vals[1] : 0; + } else { + width = 0; + height = 0; + } + } + + public double area() { + return width * height; + } + + public Size clone() { + return new Size(width, height); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(height); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(width); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof Size)) return false; + Size it = (Size) obj; + return width == it.width && height == it.height; + } + + @Override + public String toString() { + return (int)width + "x" + (int)height; + } + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/core/TermCriteria.java b/openCVLibrary310/src/main/java/org/opencv/core/TermCriteria.java new file mode 100644 index 0000000..c67e51e --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/core/TermCriteria.java @@ -0,0 +1,92 @@ +package org.opencv.core; + +//javadoc:TermCriteria +public class TermCriteria { + + /** + * The maximum number of iterations or elements to compute + */ + public static final int COUNT = 1; + /** + * The maximum number of iterations or elements to compute + */ + public static final int MAX_ITER = COUNT; + /** + * The desired accuracy threshold or change in parameters at which the iterative algorithm is terminated. + */ + public static final int EPS = 2; + + public int type; + public int maxCount; + public double epsilon; + + /** + * Termination criteria for iterative algorithms. + * + * @param type + * the type of termination criteria: COUNT, EPS or COUNT + EPS. + * @param maxCount + * the maximum number of iterations/elements. + * @param epsilon + * the desired accuracy. + */ + public TermCriteria(int type, int maxCount, double epsilon) { + this.type = type; + this.maxCount = maxCount; + this.epsilon = epsilon; + } + + /** + * Termination criteria for iterative algorithms. + */ + public TermCriteria() { + this(0, 0, 0.0); + } + + public TermCriteria(double[] vals) { + set(vals); + } + + public void set(double[] vals) { + if (vals != null) { + type = vals.length > 0 ? (int) vals[0] : 0; + maxCount = vals.length > 1 ? (int) vals[1] : 0; + epsilon = vals.length > 2 ? (double) vals[2] : 0; + } else { + type = 0; + maxCount = 0; + epsilon = 0; + } + } + + public TermCriteria clone() { + return new TermCriteria(type, maxCount, epsilon); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(type); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(maxCount); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(epsilon); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof TermCriteria)) return false; + TermCriteria it = (TermCriteria) obj; + return type == it.type && maxCount == it.maxCount && epsilon == it.epsilon; + } + + @Override + public String toString() { + return "{ type: " + type + ", maxCount: " + maxCount + ", epsilon: " + epsilon + "}"; + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/features2d/DescriptorExtractor.java b/openCVLibrary310/src/main/java/org/opencv/features2d/DescriptorExtractor.java new file mode 100644 index 0000000..7c2b321 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/features2d/DescriptorExtractor.java @@ -0,0 +1,195 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.features2d; + +import java.lang.String; +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfKeyPoint; +import org.opencv.utils.Converters; + +// C++: class javaDescriptorExtractor +//javadoc: javaDescriptorExtractor +public class DescriptorExtractor { + + protected final long nativeObj; + protected DescriptorExtractor(long addr) { nativeObj = addr; } + + + private static final int + OPPONENTEXTRACTOR = 1000; + + + public static final int + SIFT = 1, + SURF = 2, + ORB = 3, + BRIEF = 4, + BRISK = 5, + FREAK = 6, + AKAZE = 7, + OPPONENT_SIFT = OPPONENTEXTRACTOR + SIFT, + OPPONENT_SURF = OPPONENTEXTRACTOR + SURF, + OPPONENT_ORB = OPPONENTEXTRACTOR + ORB, + OPPONENT_BRIEF = OPPONENTEXTRACTOR + BRIEF, + OPPONENT_BRISK = OPPONENTEXTRACTOR + BRISK, + OPPONENT_FREAK = OPPONENTEXTRACTOR + FREAK, + OPPONENT_AKAZE = OPPONENTEXTRACTOR + AKAZE; + + + // + // C++: bool empty() + // + + //javadoc: javaDescriptorExtractor::empty() + public boolean empty() + { + + boolean retVal = empty_0(nativeObj); + + return retVal; + } + + + // + // C++: int descriptorSize() + // + + //javadoc: javaDescriptorExtractor::descriptorSize() + public int descriptorSize() + { + + int retVal = descriptorSize_0(nativeObj); + + return retVal; + } + + + // + // C++: int descriptorType() + // + + //javadoc: javaDescriptorExtractor::descriptorType() + public int descriptorType() + { + + int retVal = descriptorType_0(nativeObj); + + return retVal; + } + + + // + // C++: static javaDescriptorExtractor* create(int extractorType) + // + + //javadoc: javaDescriptorExtractor::create(extractorType) + public static DescriptorExtractor create(int extractorType) + { + + DescriptorExtractor retVal = new DescriptorExtractor(create_0(extractorType)); + + return retVal; + } + + + // + // C++: void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors) + // + + //javadoc: javaDescriptorExtractor::compute(image, keypoints, descriptors) + public void compute(Mat image, MatOfKeyPoint keypoints, Mat descriptors) + { + Mat keypoints_mat = keypoints; + compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj); + + return; + } + + + // + // C++: void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors) + // + + //javadoc: javaDescriptorExtractor::compute(images, keypoints, descriptors) + public void compute(List images, List keypoints, List descriptors) + { + Mat images_mat = Converters.vector_Mat_to_Mat(images); + List keypoints_tmplm = new ArrayList((keypoints != null) ? keypoints.size() : 0); + Mat keypoints_mat = Converters.vector_vector_KeyPoint_to_Mat(keypoints, keypoints_tmplm); + Mat descriptors_mat = new Mat(); + compute_1(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, descriptors_mat.nativeObj); + Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints); + keypoints_mat.release(); + Converters.Mat_to_vector_Mat(descriptors_mat, descriptors); + descriptors_mat.release(); + return; + } + + + // + // C++: void read(String fileName) + // + + //javadoc: javaDescriptorExtractor::read(fileName) + public void read(String fileName) + { + + read_0(nativeObj, fileName); + + return; + } + + + // + // C++: void write(String fileName) + // + + //javadoc: javaDescriptorExtractor::write(fileName) + public void write(String fileName) + { + + write_0(nativeObj, fileName); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: bool empty() + private static native boolean empty_0(long nativeObj); + + // C++: int descriptorSize() + private static native int descriptorSize_0(long nativeObj); + + // C++: int descriptorType() + private static native int descriptorType_0(long nativeObj); + + // C++: static javaDescriptorExtractor* create(int extractorType) + private static native long create_0(int extractorType); + + // C++: void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors) + private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj); + + // C++: void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors) + private static native void compute_1(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long descriptors_mat_nativeObj); + + // C++: void read(String fileName) + private static native void read_0(long nativeObj, String fileName); + + // C++: void write(String fileName) + private static native void write_0(long nativeObj, String fileName); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/features2d/DescriptorMatcher.java b/openCVLibrary310/src/main/java/org/opencv/features2d/DescriptorMatcher.java new file mode 100644 index 0000000..78552da --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/features2d/DescriptorMatcher.java @@ -0,0 +1,394 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.features2d; + +import java.lang.String; +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfDMatch; +import org.opencv.utils.Converters; + +// C++: class javaDescriptorMatcher +//javadoc: javaDescriptorMatcher +public class DescriptorMatcher { + + protected final long nativeObj; + protected DescriptorMatcher(long addr) { nativeObj = addr; } + + + public static final int + FLANNBASED = 1, + BRUTEFORCE = 2, + BRUTEFORCE_L1 = 3, + BRUTEFORCE_HAMMING = 4, + BRUTEFORCE_HAMMINGLUT = 5, + BRUTEFORCE_SL2 = 6; + + + // + // C++: bool empty() + // + + //javadoc: javaDescriptorMatcher::empty() + public boolean empty() + { + + boolean retVal = empty_0(nativeObj); + + return retVal; + } + + + // + // C++: bool isMaskSupported() + // + + //javadoc: javaDescriptorMatcher::isMaskSupported() + public boolean isMaskSupported() + { + + boolean retVal = isMaskSupported_0(nativeObj); + + return retVal; + } + + + // + // C++: static javaDescriptorMatcher* create(int matcherType) + // + + //javadoc: javaDescriptorMatcher::create(matcherType) + public static DescriptorMatcher create(int matcherType) + { + + DescriptorMatcher retVal = new DescriptorMatcher(create_0(matcherType)); + + return retVal; + } + + + // + // C++: javaDescriptorMatcher* jclone(bool emptyTrainData = false) + // + + //javadoc: javaDescriptorMatcher::jclone(emptyTrainData) + public DescriptorMatcher clone(boolean emptyTrainData) + { + + DescriptorMatcher retVal = new DescriptorMatcher(clone_0(nativeObj, emptyTrainData)); + + return retVal; + } + + //javadoc: javaDescriptorMatcher::jclone() + public DescriptorMatcher clone() + { + + DescriptorMatcher retVal = new DescriptorMatcher(clone_1(nativeObj)); + + return retVal; + } + + + // + // C++: vector_Mat getTrainDescriptors() + // + + //javadoc: javaDescriptorMatcher::getTrainDescriptors() + public List getTrainDescriptors() + { + List retVal = new ArrayList(); + Mat retValMat = new Mat(getTrainDescriptors_0(nativeObj)); + Converters.Mat_to_vector_Mat(retValMat, retVal); + return retVal; + } + + + // + // C++: void add(vector_Mat descriptors) + // + + //javadoc: javaDescriptorMatcher::add(descriptors) + public void add(List descriptors) + { + Mat descriptors_mat = Converters.vector_Mat_to_Mat(descriptors); + add_0(nativeObj, descriptors_mat.nativeObj); + + return; + } + + + // + // C++: void clear() + // + + //javadoc: javaDescriptorMatcher::clear() + public void clear() + { + + clear_0(nativeObj); + + return; + } + + + // + // C++: void knnMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false) + // + + //javadoc: javaDescriptorMatcher::knnMatch(queryDescriptors, trainDescriptors, matches, k, mask, compactResult) + public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List matches, int k, Mat mask, boolean compactResult) + { + Mat matches_mat = new Mat(); + knnMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k, mask.nativeObj, compactResult); + Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); + matches_mat.release(); + return; + } + + //javadoc: javaDescriptorMatcher::knnMatch(queryDescriptors, trainDescriptors, matches, k) + public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List matches, int k) + { + Mat matches_mat = new Mat(); + knnMatch_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k); + Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); + matches_mat.release(); + return; + } + + + // + // C++: void knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches, int k, vector_Mat masks = std::vector(), bool compactResult = false) + // + + //javadoc: javaDescriptorMatcher::knnMatch(queryDescriptors, matches, k, masks, compactResult) + public void knnMatch(Mat queryDescriptors, List matches, int k, List masks, boolean compactResult) + { + Mat matches_mat = new Mat(); + Mat masks_mat = Converters.vector_Mat_to_Mat(masks); + knnMatch_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k, masks_mat.nativeObj, compactResult); + Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); + matches_mat.release(); + return; + } + + //javadoc: javaDescriptorMatcher::knnMatch(queryDescriptors, matches, k) + public void knnMatch(Mat queryDescriptors, List matches, int k) + { + Mat matches_mat = new Mat(); + knnMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k); + Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); + matches_mat.release(); + return; + } + + + // + // C++: void match(Mat queryDescriptors, Mat trainDescriptors, vector_DMatch& matches, Mat mask = Mat()) + // + + //javadoc: javaDescriptorMatcher::match(queryDescriptors, trainDescriptors, matches, mask) + public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches, Mat mask) + { + Mat matches_mat = matches; + match_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: javaDescriptorMatcher::match(queryDescriptors, trainDescriptors, matches) + public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches) + { + Mat matches_mat = matches; + match_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj); + + return; + } + + + // + // C++: void match(Mat queryDescriptors, vector_DMatch& matches, vector_Mat masks = std::vector()) + // + + //javadoc: javaDescriptorMatcher::match(queryDescriptors, matches, masks) + public void match(Mat queryDescriptors, MatOfDMatch matches, List masks) + { + Mat matches_mat = matches; + Mat masks_mat = Converters.vector_Mat_to_Mat(masks); + match_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, masks_mat.nativeObj); + + return; + } + + //javadoc: javaDescriptorMatcher::match(queryDescriptors, matches) + public void match(Mat queryDescriptors, MatOfDMatch matches) + { + Mat matches_mat = matches; + match_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj); + + return; + } + + + // + // C++: void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false) + // + + //javadoc: javaDescriptorMatcher::radiusMatch(queryDescriptors, trainDescriptors, matches, maxDistance, mask, compactResult) + public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List matches, float maxDistance, Mat mask, boolean compactResult) + { + Mat matches_mat = new Mat(); + radiusMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, mask.nativeObj, compactResult); + Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); + matches_mat.release(); + return; + } + + //javadoc: javaDescriptorMatcher::radiusMatch(queryDescriptors, trainDescriptors, matches, maxDistance) + public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List matches, float maxDistance) + { + Mat matches_mat = new Mat(); + radiusMatch_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance); + Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); + matches_mat.release(); + return; + } + + + // + // C++: void radiusMatch(Mat queryDescriptors, vector_vector_DMatch& matches, float maxDistance, vector_Mat masks = std::vector(), bool compactResult = false) + // + + //javadoc: javaDescriptorMatcher::radiusMatch(queryDescriptors, matches, maxDistance, masks, compactResult) + public void radiusMatch(Mat queryDescriptors, List matches, float maxDistance, List masks, boolean compactResult) + { + Mat matches_mat = new Mat(); + Mat masks_mat = Converters.vector_Mat_to_Mat(masks); + radiusMatch_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, masks_mat.nativeObj, compactResult); + Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); + matches_mat.release(); + return; + } + + //javadoc: javaDescriptorMatcher::radiusMatch(queryDescriptors, matches, maxDistance) + public void radiusMatch(Mat queryDescriptors, List matches, float maxDistance) + { + Mat matches_mat = new Mat(); + radiusMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance); + Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); + matches_mat.release(); + return; + } + + + // + // C++: void read(String fileName) + // + + //javadoc: javaDescriptorMatcher::read(fileName) + public void read(String fileName) + { + + read_0(nativeObj, fileName); + + return; + } + + + // + // C++: void train() + // + + //javadoc: javaDescriptorMatcher::train() + public void train() + { + + train_0(nativeObj); + + return; + } + + + // + // C++: void write(String fileName) + // + + //javadoc: javaDescriptorMatcher::write(fileName) + public void write(String fileName) + { + + write_0(nativeObj, fileName); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: bool empty() + private static native boolean empty_0(long nativeObj); + + // C++: bool isMaskSupported() + private static native boolean isMaskSupported_0(long nativeObj); + + // C++: static javaDescriptorMatcher* create(int matcherType) + private static native long create_0(int matcherType); + + // C++: javaDescriptorMatcher* jclone(bool emptyTrainData = false) + private static native long clone_0(long nativeObj, boolean emptyTrainData); + private static native long clone_1(long nativeObj); + + // C++: vector_Mat getTrainDescriptors() + private static native long getTrainDescriptors_0(long nativeObj); + + // C++: void add(vector_Mat descriptors) + private static native void add_0(long nativeObj, long descriptors_mat_nativeObj); + + // C++: void clear() + private static native void clear_0(long nativeObj); + + // C++: void knnMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false) + private static native void knnMatch_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, int k, long mask_nativeObj, boolean compactResult); + private static native void knnMatch_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, int k); + + // C++: void knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches, int k, vector_Mat masks = std::vector(), bool compactResult = false) + private static native void knnMatch_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k, long masks_mat_nativeObj, boolean compactResult); + private static native void knnMatch_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k); + + // C++: void match(Mat queryDescriptors, Mat trainDescriptors, vector_DMatch& matches, Mat mask = Mat()) + private static native void match_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, long mask_nativeObj); + private static native void match_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj); + + // C++: void match(Mat queryDescriptors, vector_DMatch& matches, vector_Mat masks = std::vector()) + private static native void match_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, long masks_mat_nativeObj); + private static native void match_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj); + + // C++: void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false) + private static native void radiusMatch_0(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long mask_nativeObj, boolean compactResult); + private static native void radiusMatch_1(long nativeObj, long queryDescriptors_nativeObj, long trainDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance); + + // C++: void radiusMatch(Mat queryDescriptors, vector_vector_DMatch& matches, float maxDistance, vector_Mat masks = std::vector(), bool compactResult = false) + private static native void radiusMatch_2(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance, long masks_mat_nativeObj, boolean compactResult); + private static native void radiusMatch_3(long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, float maxDistance); + + // C++: void read(String fileName) + private static native void read_0(long nativeObj, String fileName); + + // C++: void train() + private static native void train_0(long nativeObj); + + // C++: void write(String fileName) + private static native void write_0(long nativeObj, String fileName); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/features2d/FeatureDetector.java b/openCVLibrary310/src/main/java/org/opencv/features2d/FeatureDetector.java new file mode 100644 index 0000000..a7d98cd --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/features2d/FeatureDetector.java @@ -0,0 +1,216 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.features2d; + +import java.lang.String; +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfKeyPoint; +import org.opencv.utils.Converters; + +// C++: class javaFeatureDetector +//javadoc: javaFeatureDetector +public class FeatureDetector { + + protected final long nativeObj; + protected FeatureDetector(long addr) { nativeObj = addr; } + + + private static final int + GRIDDETECTOR = 1000, + PYRAMIDDETECTOR = 2000, + DYNAMICDETECTOR = 3000; + + + public static final int + FAST = 1, + STAR = 2, + SIFT = 3, + SURF = 4, + ORB = 5, + MSER = 6, + GFTT = 7, + HARRIS = 8, + SIMPLEBLOB = 9, + DENSE = 10, + BRISK = 11, + AKAZE = 12, + GRID_FAST = GRIDDETECTOR + FAST, + GRID_STAR = GRIDDETECTOR + STAR, + GRID_SIFT = GRIDDETECTOR + SIFT, + GRID_SURF = GRIDDETECTOR + SURF, + GRID_ORB = GRIDDETECTOR + ORB, + GRID_MSER = GRIDDETECTOR + MSER, + GRID_GFTT = GRIDDETECTOR + GFTT, + GRID_HARRIS = GRIDDETECTOR + HARRIS, + GRID_SIMPLEBLOB = GRIDDETECTOR + SIMPLEBLOB, + GRID_DENSE = GRIDDETECTOR + DENSE, + GRID_BRISK = GRIDDETECTOR + BRISK, + GRID_AKAZE = GRIDDETECTOR + AKAZE, + PYRAMID_FAST = PYRAMIDDETECTOR + FAST, + PYRAMID_STAR = PYRAMIDDETECTOR + STAR, + PYRAMID_SIFT = PYRAMIDDETECTOR + SIFT, + PYRAMID_SURF = PYRAMIDDETECTOR + SURF, + PYRAMID_ORB = PYRAMIDDETECTOR + ORB, + PYRAMID_MSER = PYRAMIDDETECTOR + MSER, + PYRAMID_GFTT = PYRAMIDDETECTOR + GFTT, + PYRAMID_HARRIS = PYRAMIDDETECTOR + HARRIS, + PYRAMID_SIMPLEBLOB = PYRAMIDDETECTOR + SIMPLEBLOB, + PYRAMID_DENSE = PYRAMIDDETECTOR + DENSE, + PYRAMID_BRISK = PYRAMIDDETECTOR + BRISK, + PYRAMID_AKAZE = PYRAMIDDETECTOR + AKAZE, + DYNAMIC_FAST = DYNAMICDETECTOR + FAST, + DYNAMIC_STAR = DYNAMICDETECTOR + STAR, + DYNAMIC_SIFT = DYNAMICDETECTOR + SIFT, + DYNAMIC_SURF = DYNAMICDETECTOR + SURF, + DYNAMIC_ORB = DYNAMICDETECTOR + ORB, + DYNAMIC_MSER = DYNAMICDETECTOR + MSER, + DYNAMIC_GFTT = DYNAMICDETECTOR + GFTT, + DYNAMIC_HARRIS = DYNAMICDETECTOR + HARRIS, + DYNAMIC_SIMPLEBLOB = DYNAMICDETECTOR + SIMPLEBLOB, + DYNAMIC_DENSE = DYNAMICDETECTOR + DENSE, + DYNAMIC_BRISK = DYNAMICDETECTOR + BRISK, + DYNAMIC_AKAZE = DYNAMICDETECTOR + AKAZE; + + + // + // C++: bool empty() + // + + //javadoc: javaFeatureDetector::empty() + public boolean empty() + { + + boolean retVal = empty_0(nativeObj); + + return retVal; + } + + + // + // C++: static javaFeatureDetector* create(int detectorType) + // + + //javadoc: javaFeatureDetector::create(detectorType) + public static FeatureDetector create(int detectorType) + { + + FeatureDetector retVal = new FeatureDetector(create_0(detectorType)); + + return retVal; + } + + + // + // C++: void detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat()) + // + + //javadoc: javaFeatureDetector::detect(image, keypoints, mask) + public void detect(Mat image, MatOfKeyPoint keypoints, Mat mask) + { + Mat keypoints_mat = keypoints; + detect_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: javaFeatureDetector::detect(image, keypoints) + public void detect(Mat image, MatOfKeyPoint keypoints) + { + Mat keypoints_mat = keypoints; + detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj); + + return; + } + + + // + // C++: void detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = std::vector()) + // + + //javadoc: javaFeatureDetector::detect(images, keypoints, masks) + public void detect(List images, List keypoints, List masks) + { + Mat images_mat = Converters.vector_Mat_to_Mat(images); + Mat keypoints_mat = new Mat(); + Mat masks_mat = Converters.vector_Mat_to_Mat(masks); + detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj); + Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints); + keypoints_mat.release(); + return; + } + + //javadoc: javaFeatureDetector::detect(images, keypoints) + public void detect(List images, List keypoints) + { + Mat images_mat = Converters.vector_Mat_to_Mat(images); + Mat keypoints_mat = new Mat(); + detect_3(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj); + Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints); + keypoints_mat.release(); + return; + } + + + // + // C++: void read(String fileName) + // + + //javadoc: javaFeatureDetector::read(fileName) + public void read(String fileName) + { + + read_0(nativeObj, fileName); + + return; + } + + + // + // C++: void write(String fileName) + // + + //javadoc: javaFeatureDetector::write(fileName) + public void write(String fileName) + { + + write_0(nativeObj, fileName); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: bool empty() + private static native boolean empty_0(long nativeObj); + + // C++: static javaFeatureDetector* create(int detectorType) + private static native long create_0(int detectorType); + + // C++: void detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat()) + private static native void detect_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long mask_nativeObj); + private static native void detect_1(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj); + + // C++: void detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = std::vector()) + private static native void detect_2(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long masks_mat_nativeObj); + private static native void detect_3(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj); + + // C++: void read(String fileName) + private static native void read_0(long nativeObj, String fileName); + + // C++: void write(String fileName) + private static native void write_0(long nativeObj, String fileName); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/features2d/Features2d.java b/openCVLibrary310/src/main/java/org/opencv/features2d/Features2d.java new file mode 100644 index 0000000..9260327 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/features2d/Features2d.java @@ -0,0 +1,120 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.features2d; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfByte; +import org.opencv.core.MatOfDMatch; +import org.opencv.core.MatOfKeyPoint; +import org.opencv.core.Scalar; +import org.opencv.utils.Converters; + +public class Features2d { + + public static final int + DRAW_OVER_OUTIMG = 1, + NOT_DRAW_SINGLE_POINTS = 2, + DRAW_RICH_KEYPOINTS = 4; + + + // + // C++: void drawKeypoints(Mat image, vector_KeyPoint keypoints, Mat outImage, Scalar color = Scalar::all(-1), int flags = 0) + // + + //javadoc: drawKeypoints(image, keypoints, outImage, color, flags) + public static void drawKeypoints(Mat image, MatOfKeyPoint keypoints, Mat outImage, Scalar color, int flags) + { + Mat keypoints_mat = keypoints; + drawKeypoints_0(image.nativeObj, keypoints_mat.nativeObj, outImage.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3], flags); + + return; + } + + //javadoc: drawKeypoints(image, keypoints, outImage) + public static void drawKeypoints(Mat image, MatOfKeyPoint keypoints, Mat outImage) + { + Mat keypoints_mat = keypoints; + drawKeypoints_1(image.nativeObj, keypoints_mat.nativeObj, outImage.nativeObj); + + return; + } + + + // + // C++: void drawMatches(Mat img1, vector_KeyPoint keypoints1, Mat img2, vector_KeyPoint keypoints2, vector_DMatch matches1to2, Mat outImg, Scalar matchColor = Scalar::all(-1), Scalar singlePointColor = Scalar::all(-1), vector_char matchesMask = std::vector(), int flags = 0) + // + + //javadoc: drawMatches(img1, keypoints1, img2, keypoints2, matches1to2, outImg, matchColor, singlePointColor, matchesMask, flags) + public static void drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, MatOfByte matchesMask, int flags) + { + Mat keypoints1_mat = keypoints1; + Mat keypoints2_mat = keypoints2; + Mat matches1to2_mat = matches1to2; + Mat matchesMask_mat = matchesMask; + drawMatches_0(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj, matchColor.val[0], matchColor.val[1], matchColor.val[2], matchColor.val[3], singlePointColor.val[0], singlePointColor.val[1], singlePointColor.val[2], singlePointColor.val[3], matchesMask_mat.nativeObj, flags); + + return; + } + + //javadoc: drawMatches(img1, keypoints1, img2, keypoints2, matches1to2, outImg) + public static void drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg) + { + Mat keypoints1_mat = keypoints1; + Mat keypoints2_mat = keypoints2; + Mat matches1to2_mat = matches1to2; + drawMatches_1(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj); + + return; + } + + + // + // C++: void drawMatches(Mat img1, vector_KeyPoint keypoints1, Mat img2, vector_KeyPoint keypoints2, vector_vector_DMatch matches1to2, Mat outImg, Scalar matchColor = Scalar::all(-1), Scalar singlePointColor = Scalar::all(-1), vector_vector_char matchesMask = std::vector >(), int flags = 0) + // + + //javadoc: drawMatches(img1, keypoints1, img2, keypoints2, matches1to2, outImg, matchColor, singlePointColor, matchesMask, flags) + public static void drawMatches2(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, List matchesMask, int flags) + { + Mat keypoints1_mat = keypoints1; + Mat keypoints2_mat = keypoints2; + List matches1to2_tmplm = new ArrayList((matches1to2 != null) ? matches1to2.size() : 0); + Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm); + List matchesMask_tmplm = new ArrayList((matchesMask != null) ? matchesMask.size() : 0); + Mat matchesMask_mat = Converters.vector_vector_char_to_Mat(matchesMask, matchesMask_tmplm); + drawMatches2_0(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj, matchColor.val[0], matchColor.val[1], matchColor.val[2], matchColor.val[3], singlePointColor.val[0], singlePointColor.val[1], singlePointColor.val[2], singlePointColor.val[3], matchesMask_mat.nativeObj, flags); + + return; + } + + //javadoc: drawMatches(img1, keypoints1, img2, keypoints2, matches1to2, outImg) + public static void drawMatches2(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List matches1to2, Mat outImg) + { + Mat keypoints1_mat = keypoints1; + Mat keypoints2_mat = keypoints2; + List matches1to2_tmplm = new ArrayList((matches1to2 != null) ? matches1to2.size() : 0); + Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm); + drawMatches2_1(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj); + + return; + } + + + + + // C++: void drawKeypoints(Mat image, vector_KeyPoint keypoints, Mat outImage, Scalar color = Scalar::all(-1), int flags = 0) + private static native void drawKeypoints_0(long image_nativeObj, long keypoints_mat_nativeObj, long outImage_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3, int flags); + private static native void drawKeypoints_1(long image_nativeObj, long keypoints_mat_nativeObj, long outImage_nativeObj); + + // C++: void drawMatches(Mat img1, vector_KeyPoint keypoints1, Mat img2, vector_KeyPoint keypoints2, vector_DMatch matches1to2, Mat outImg, Scalar matchColor = Scalar::all(-1), Scalar singlePointColor = Scalar::all(-1), vector_char matchesMask = std::vector(), int flags = 0) + private static native void drawMatches_0(long img1_nativeObj, long keypoints1_mat_nativeObj, long img2_nativeObj, long keypoints2_mat_nativeObj, long matches1to2_mat_nativeObj, long outImg_nativeObj, double matchColor_val0, double matchColor_val1, double matchColor_val2, double matchColor_val3, double singlePointColor_val0, double singlePointColor_val1, double singlePointColor_val2, double singlePointColor_val3, long matchesMask_mat_nativeObj, int flags); + private static native void drawMatches_1(long img1_nativeObj, long keypoints1_mat_nativeObj, long img2_nativeObj, long keypoints2_mat_nativeObj, long matches1to2_mat_nativeObj, long outImg_nativeObj); + + // C++: void drawMatches(Mat img1, vector_KeyPoint keypoints1, Mat img2, vector_KeyPoint keypoints2, vector_vector_DMatch matches1to2, Mat outImg, Scalar matchColor = Scalar::all(-1), Scalar singlePointColor = Scalar::all(-1), vector_vector_char matchesMask = std::vector >(), int flags = 0) + private static native void drawMatches2_0(long img1_nativeObj, long keypoints1_mat_nativeObj, long img2_nativeObj, long keypoints2_mat_nativeObj, long matches1to2_mat_nativeObj, long outImg_nativeObj, double matchColor_val0, double matchColor_val1, double matchColor_val2, double matchColor_val3, double singlePointColor_val0, double singlePointColor_val1, double singlePointColor_val2, double singlePointColor_val3, long matchesMask_mat_nativeObj, int flags); + private static native void drawMatches2_1(long img1_nativeObj, long keypoints1_mat_nativeObj, long img2_nativeObj, long keypoints2_mat_nativeObj, long matches1to2_mat_nativeObj, long outImg_nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/imgcodecs/Imgcodecs.java b/openCVLibrary310/src/main/java/org/opencv/imgcodecs/Imgcodecs.java new file mode 100644 index 0000000..dad8b09 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/imgcodecs/Imgcodecs.java @@ -0,0 +1,199 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.imgcodecs; + +import java.lang.String; +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfByte; +import org.opencv.core.MatOfInt; +import org.opencv.utils.Converters; + +public class Imgcodecs { + + public static final int + CV_LOAD_IMAGE_UNCHANGED = -1, + CV_LOAD_IMAGE_GRAYSCALE = 0, + CV_LOAD_IMAGE_COLOR = 1, + CV_LOAD_IMAGE_ANYDEPTH = 2, + CV_LOAD_IMAGE_ANYCOLOR = 4, + CV_IMWRITE_JPEG_QUALITY = 1, + CV_IMWRITE_JPEG_PROGRESSIVE = 2, + CV_IMWRITE_JPEG_OPTIMIZE = 3, + CV_IMWRITE_JPEG_RST_INTERVAL = 4, + CV_IMWRITE_JPEG_LUMA_QUALITY = 5, + CV_IMWRITE_JPEG_CHROMA_QUALITY = 6, + CV_IMWRITE_PNG_COMPRESSION = 16, + CV_IMWRITE_PNG_STRATEGY = 17, + CV_IMWRITE_PNG_BILEVEL = 18, + CV_IMWRITE_PNG_STRATEGY_DEFAULT = 0, + CV_IMWRITE_PNG_STRATEGY_FILTERED = 1, + CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY = 2, + CV_IMWRITE_PNG_STRATEGY_RLE = 3, + CV_IMWRITE_PNG_STRATEGY_FIXED = 4, + CV_IMWRITE_PXM_BINARY = 32, + CV_IMWRITE_WEBP_QUALITY = 64, + CV_CVTIMG_FLIP = 1, + CV_CVTIMG_SWAP_RB = 2, + IMREAD_UNCHANGED = -1, + IMREAD_GRAYSCALE = 0, + IMREAD_COLOR = 1, + IMREAD_ANYDEPTH = 2, + IMREAD_ANYCOLOR = 4, + IMREAD_LOAD_GDAL = 8, + IMREAD_REDUCED_GRAYSCALE_2 = 16, + IMREAD_REDUCED_COLOR_2 = 17, + IMREAD_REDUCED_GRAYSCALE_4 = 32, + IMREAD_REDUCED_COLOR_4 = 33, + IMREAD_REDUCED_GRAYSCALE_8 = 64, + IMREAD_REDUCED_COLOR_8 = 65, + IMWRITE_JPEG_QUALITY = 1, + IMWRITE_JPEG_PROGRESSIVE = 2, + IMWRITE_JPEG_OPTIMIZE = 3, + IMWRITE_JPEG_RST_INTERVAL = 4, + IMWRITE_JPEG_LUMA_QUALITY = 5, + IMWRITE_JPEG_CHROMA_QUALITY = 6, + IMWRITE_PNG_COMPRESSION = 16, + IMWRITE_PNG_STRATEGY = 17, + IMWRITE_PNG_BILEVEL = 18, + IMWRITE_PXM_BINARY = 32, + IMWRITE_WEBP_QUALITY = 64, + IMWRITE_PNG_STRATEGY_DEFAULT = 0, + IMWRITE_PNG_STRATEGY_FILTERED = 1, + IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY = 2, + IMWRITE_PNG_STRATEGY_RLE = 3, + IMWRITE_PNG_STRATEGY_FIXED = 4; + + + // + // C++: Mat imdecode(Mat buf, int flags) + // + + //javadoc: imdecode(buf, flags) + public static Mat imdecode(Mat buf, int flags) + { + + Mat retVal = new Mat(imdecode_0(buf.nativeObj, flags)); + + return retVal; + } + + + // + // C++: Mat imread(String filename, int flags = IMREAD_COLOR) + // + + //javadoc: imread(filename, flags) + public static Mat imread(String filename, int flags) + { + + Mat retVal = new Mat(imread_0(filename, flags)); + + return retVal; + } + + //javadoc: imread(filename) + public static Mat imread(String filename) + { + + Mat retVal = new Mat(imread_1(filename)); + + return retVal; + } + + + // + // C++: bool imencode(String ext, Mat img, vector_uchar& buf, vector_int params = std::vector()) + // + + //javadoc: imencode(ext, img, buf, params) + public static boolean imencode(String ext, Mat img, MatOfByte buf, MatOfInt params) + { + Mat buf_mat = buf; + Mat params_mat = params; + boolean retVal = imencode_0(ext, img.nativeObj, buf_mat.nativeObj, params_mat.nativeObj); + + return retVal; + } + + //javadoc: imencode(ext, img, buf) + public static boolean imencode(String ext, Mat img, MatOfByte buf) + { + Mat buf_mat = buf; + boolean retVal = imencode_1(ext, img.nativeObj, buf_mat.nativeObj); + + return retVal; + } + + + // + // C++: bool imreadmulti(String filename, vector_Mat mats, int flags = IMREAD_ANYCOLOR) + // + + //javadoc: imreadmulti(filename, mats, flags) + public static boolean imreadmulti(String filename, List mats, int flags) + { + Mat mats_mat = Converters.vector_Mat_to_Mat(mats); + boolean retVal = imreadmulti_0(filename, mats_mat.nativeObj, flags); + + return retVal; + } + + //javadoc: imreadmulti(filename, mats) + public static boolean imreadmulti(String filename, List mats) + { + Mat mats_mat = Converters.vector_Mat_to_Mat(mats); + boolean retVal = imreadmulti_1(filename, mats_mat.nativeObj); + + return retVal; + } + + + // + // C++: bool imwrite(String filename, Mat img, vector_int params = std::vector()) + // + + //javadoc: imwrite(filename, img, params) + public static boolean imwrite(String filename, Mat img, MatOfInt params) + { + Mat params_mat = params; + boolean retVal = imwrite_0(filename, img.nativeObj, params_mat.nativeObj); + + return retVal; + } + + //javadoc: imwrite(filename, img) + public static boolean imwrite(String filename, Mat img) + { + + boolean retVal = imwrite_1(filename, img.nativeObj); + + return retVal; + } + + + + + // C++: Mat imdecode(Mat buf, int flags) + private static native long imdecode_0(long buf_nativeObj, int flags); + + // C++: Mat imread(String filename, int flags = IMREAD_COLOR) + private static native long imread_0(String filename, int flags); + private static native long imread_1(String filename); + + // C++: bool imencode(String ext, Mat img, vector_uchar& buf, vector_int params = std::vector()) + private static native boolean imencode_0(String ext, long img_nativeObj, long buf_mat_nativeObj, long params_mat_nativeObj); + private static native boolean imencode_1(String ext, long img_nativeObj, long buf_mat_nativeObj); + + // C++: bool imreadmulti(String filename, vector_Mat mats, int flags = IMREAD_ANYCOLOR) + private static native boolean imreadmulti_0(String filename, long mats_mat_nativeObj, int flags); + private static native boolean imreadmulti_1(String filename, long mats_mat_nativeObj); + + // C++: bool imwrite(String filename, Mat img, vector_int params = std::vector()) + private static native boolean imwrite_0(String filename, long img_nativeObj, long params_mat_nativeObj); + private static native boolean imwrite_1(String filename, long img_nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/imgproc/CLAHE.java b/openCVLibrary310/src/main/java/org/opencv/imgproc/CLAHE.java new file mode 100644 index 0000000..9c53b6f --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/imgproc/CLAHE.java @@ -0,0 +1,130 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.imgproc; + +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; +import org.opencv.core.Size; + +// C++: class CLAHE +//javadoc: CLAHE +public class CLAHE extends Algorithm { + + protected CLAHE(long addr) { super(addr); } + + + // + // C++: Size getTilesGridSize() + // + + //javadoc: CLAHE::getTilesGridSize() + public Size getTilesGridSize() + { + + Size retVal = new Size(getTilesGridSize_0(nativeObj)); + + return retVal; + } + + + // + // C++: double getClipLimit() + // + + //javadoc: CLAHE::getClipLimit() + public double getClipLimit() + { + + double retVal = getClipLimit_0(nativeObj); + + return retVal; + } + + + // + // C++: void apply(Mat src, Mat& dst) + // + + //javadoc: CLAHE::apply(src, dst) + public void apply(Mat src, Mat dst) + { + + apply_0(nativeObj, src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void collectGarbage() + // + + //javadoc: CLAHE::collectGarbage() + public void collectGarbage() + { + + collectGarbage_0(nativeObj); + + return; + } + + + // + // C++: void setClipLimit(double clipLimit) + // + + //javadoc: CLAHE::setClipLimit(clipLimit) + public void setClipLimit(double clipLimit) + { + + setClipLimit_0(nativeObj, clipLimit); + + return; + } + + + // + // C++: void setTilesGridSize(Size tileGridSize) + // + + //javadoc: CLAHE::setTilesGridSize(tileGridSize) + public void setTilesGridSize(Size tileGridSize) + { + + setTilesGridSize_0(nativeObj, tileGridSize.width, tileGridSize.height); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Size getTilesGridSize() + private static native double[] getTilesGridSize_0(long nativeObj); + + // C++: double getClipLimit() + private static native double getClipLimit_0(long nativeObj); + + // C++: void apply(Mat src, Mat& dst) + private static native void apply_0(long nativeObj, long src_nativeObj, long dst_nativeObj); + + // C++: void collectGarbage() + private static native void collectGarbage_0(long nativeObj); + + // C++: void setClipLimit(double clipLimit) + private static native void setClipLimit_0(long nativeObj, double clipLimit); + + // C++: void setTilesGridSize(Size tileGridSize) + private static native void setTilesGridSize_0(long nativeObj, double tileGridSize_width, double tileGridSize_height); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/imgproc/Imgproc.java b/openCVLibrary310/src/main/java/org/opencv/imgproc/Imgproc.java new file mode 100644 index 0000000..5d12bca --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/imgproc/Imgproc.java @@ -0,0 +1,3392 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.imgproc; + +import java.lang.String; +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfFloat; +import org.opencv.core.MatOfInt; +import org.opencv.core.MatOfInt4; +import org.opencv.core.MatOfPoint; +import org.opencv.core.MatOfPoint2f; +import org.opencv.core.Point; +import org.opencv.core.Rect; +import org.opencv.core.RotatedRect; +import org.opencv.core.Scalar; +import org.opencv.core.Size; +import org.opencv.core.TermCriteria; +import org.opencv.utils.Converters; + +public class Imgproc { + + private static final int + IPL_BORDER_CONSTANT = 0, + IPL_BORDER_REPLICATE = 1, + IPL_BORDER_REFLECT = 2, + IPL_BORDER_WRAP = 3, + IPL_BORDER_REFLECT_101 = 4, + IPL_BORDER_TRANSPARENT = 5, + CV_INTER_NN = 0, + CV_INTER_LINEAR = 1, + CV_INTER_CUBIC = 2, + CV_INTER_AREA = 3, + CV_INTER_LANCZOS4 = 4, + CV_MOP_ERODE = 0, + CV_MOP_DILATE = 1, + CV_MOP_OPEN = 2, + CV_MOP_CLOSE = 3, + CV_MOP_GRADIENT = 4, + CV_MOP_TOPHAT = 5, + CV_MOP_BLACKHAT = 6, + CV_RETR_EXTERNAL = 0, + CV_RETR_LIST = 1, + CV_RETR_CCOMP = 2, + CV_RETR_TREE = 3, + CV_RETR_FLOODFILL = 4, + CV_CHAIN_APPROX_NONE = 1, + CV_CHAIN_APPROX_SIMPLE = 2, + CV_CHAIN_APPROX_TC89_L1 = 3, + CV_CHAIN_APPROX_TC89_KCOS = 4, + CV_THRESH_BINARY = 0, + CV_THRESH_BINARY_INV = 1, + CV_THRESH_TRUNC = 2, + CV_THRESH_TOZERO = 3, + CV_THRESH_TOZERO_INV = 4, + CV_THRESH_MASK = 7, + CV_THRESH_OTSU = 8, + CV_THRESH_TRIANGLE = 16; + + + public static final int + LINE_AA = 16, + LINE_8 = 8, + LINE_4 = 4, + CV_BLUR_NO_SCALE = 0, + CV_BLUR = 1, + CV_GAUSSIAN = 2, + CV_MEDIAN = 3, + CV_BILATERAL = 4, + CV_GAUSSIAN_5x5 = 7, + CV_SCHARR = -1, + CV_MAX_SOBEL_KSIZE = 7, + CV_RGBA2mRGBA = 125, + CV_mRGBA2RGBA = 126, + CV_WARP_FILL_OUTLIERS = 8, + CV_WARP_INVERSE_MAP = 16, + CV_SHAPE_RECT = 0, + CV_SHAPE_CROSS = 1, + CV_SHAPE_ELLIPSE = 2, + CV_SHAPE_CUSTOM = 100, + CV_CHAIN_CODE = 0, + CV_LINK_RUNS = 5, + CV_POLY_APPROX_DP = 0, + CV_CONTOURS_MATCH_I1 = 1, + CV_CONTOURS_MATCH_I2 = 2, + CV_CONTOURS_MATCH_I3 = 3, + CV_CLOCKWISE = 1, + CV_COUNTER_CLOCKWISE = 2, + CV_COMP_CORREL = 0, + CV_COMP_CHISQR = 1, + CV_COMP_INTERSECT = 2, + CV_COMP_BHATTACHARYYA = 3, + CV_COMP_HELLINGER = CV_COMP_BHATTACHARYYA, + CV_COMP_CHISQR_ALT = 4, + CV_COMP_KL_DIV = 5, + CV_DIST_MASK_3 = 3, + CV_DIST_MASK_5 = 5, + CV_DIST_MASK_PRECISE = 0, + CV_DIST_LABEL_CCOMP = 0, + CV_DIST_LABEL_PIXEL = 1, + CV_DIST_USER = -1, + CV_DIST_L1 = 1, + CV_DIST_L2 = 2, + CV_DIST_C = 3, + CV_DIST_L12 = 4, + CV_DIST_FAIR = 5, + CV_DIST_WELSCH = 6, + CV_DIST_HUBER = 7, + CV_CANNY_L2_GRADIENT = (1 << 31), + CV_HOUGH_STANDARD = 0, + CV_HOUGH_PROBABILISTIC = 1, + CV_HOUGH_MULTI_SCALE = 2, + CV_HOUGH_GRADIENT = 3, + MORPH_ERODE = 0, + MORPH_DILATE = 1, + MORPH_OPEN = 2, + MORPH_CLOSE = 3, + MORPH_GRADIENT = 4, + MORPH_TOPHAT = 5, + MORPH_BLACKHAT = 6, + MORPH_HITMISS = 7, + MORPH_RECT = 0, + MORPH_CROSS = 1, + MORPH_ELLIPSE = 2, + INTER_NEAREST = 0, + INTER_LINEAR = 1, + INTER_CUBIC = 2, + INTER_AREA = 3, + INTER_LANCZOS4 = 4, + INTER_MAX = 7, + WARP_FILL_OUTLIERS = 8, + WARP_INVERSE_MAP = 16, + INTER_BITS = 5, + INTER_BITS2 = INTER_BITS * 2, + INTER_TAB_SIZE = 1 << INTER_BITS, + INTER_TAB_SIZE2 = INTER_TAB_SIZE * INTER_TAB_SIZE, + DIST_USER = -1, + DIST_L1 = 1, + DIST_L2 = 2, + DIST_C = 3, + DIST_L12 = 4, + DIST_FAIR = 5, + DIST_WELSCH = 6, + DIST_HUBER = 7, + DIST_MASK_3 = 3, + DIST_MASK_5 = 5, + DIST_MASK_PRECISE = 0, + THRESH_BINARY = 0, + THRESH_BINARY_INV = 1, + THRESH_TRUNC = 2, + THRESH_TOZERO = 3, + THRESH_TOZERO_INV = 4, + THRESH_MASK = 7, + THRESH_OTSU = 8, + THRESH_TRIANGLE = 16, + ADAPTIVE_THRESH_MEAN_C = 0, + ADAPTIVE_THRESH_GAUSSIAN_C = 1, + PROJ_SPHERICAL_ORTHO = 0, + PROJ_SPHERICAL_EQRECT = 1, + GC_BGD = 0, + GC_FGD = 1, + GC_PR_BGD = 2, + GC_PR_FGD = 3, + GC_INIT_WITH_RECT = 0, + GC_INIT_WITH_MASK = 1, + GC_EVAL = 2, + DIST_LABEL_CCOMP = 0, + DIST_LABEL_PIXEL = 1, + FLOODFILL_FIXED_RANGE = 1 << 16, + FLOODFILL_MASK_ONLY = 1 << 17, + CC_STAT_LEFT = 0, + CC_STAT_TOP = 1, + CC_STAT_WIDTH = 2, + CC_STAT_HEIGHT = 3, + CC_STAT_AREA = 4, + CC_STAT_MAX = 5, + RETR_EXTERNAL = 0, + RETR_LIST = 1, + RETR_CCOMP = 2, + RETR_TREE = 3, + RETR_FLOODFILL = 4, + CHAIN_APPROX_NONE = 1, + CHAIN_APPROX_SIMPLE = 2, + CHAIN_APPROX_TC89_L1 = 3, + CHAIN_APPROX_TC89_KCOS = 4, + HOUGH_STANDARD = 0, + HOUGH_PROBABILISTIC = 1, + HOUGH_MULTI_SCALE = 2, + HOUGH_GRADIENT = 3, + LSD_REFINE_NONE = 0, + LSD_REFINE_STD = 1, + LSD_REFINE_ADV = 2, + HISTCMP_CORREL = 0, + HISTCMP_CHISQR = 1, + HISTCMP_INTERSECT = 2, + HISTCMP_BHATTACHARYYA = 3, + HISTCMP_HELLINGER = HISTCMP_BHATTACHARYYA, + HISTCMP_CHISQR_ALT = 4, + HISTCMP_KL_DIV = 5, + COLOR_BGR2BGRA = 0, + COLOR_RGB2RGBA = COLOR_BGR2BGRA, + COLOR_BGRA2BGR = 1, + COLOR_RGBA2RGB = COLOR_BGRA2BGR, + COLOR_BGR2RGBA = 2, + COLOR_RGB2BGRA = COLOR_BGR2RGBA, + COLOR_RGBA2BGR = 3, + COLOR_BGRA2RGB = COLOR_RGBA2BGR, + COLOR_BGR2RGB = 4, + COLOR_RGB2BGR = COLOR_BGR2RGB, + COLOR_BGRA2RGBA = 5, + COLOR_RGBA2BGRA = COLOR_BGRA2RGBA, + COLOR_BGR2GRAY = 6, + COLOR_RGB2GRAY = 7, + COLOR_GRAY2BGR = 8, + COLOR_GRAY2RGB = COLOR_GRAY2BGR, + COLOR_GRAY2BGRA = 9, + COLOR_GRAY2RGBA = COLOR_GRAY2BGRA, + COLOR_BGRA2GRAY = 10, + COLOR_RGBA2GRAY = 11, + COLOR_BGR2BGR565 = 12, + COLOR_RGB2BGR565 = 13, + COLOR_BGR5652BGR = 14, + COLOR_BGR5652RGB = 15, + COLOR_BGRA2BGR565 = 16, + COLOR_RGBA2BGR565 = 17, + COLOR_BGR5652BGRA = 18, + COLOR_BGR5652RGBA = 19, + COLOR_GRAY2BGR565 = 20, + COLOR_BGR5652GRAY = 21, + COLOR_BGR2BGR555 = 22, + COLOR_RGB2BGR555 = 23, + COLOR_BGR5552BGR = 24, + COLOR_BGR5552RGB = 25, + COLOR_BGRA2BGR555 = 26, + COLOR_RGBA2BGR555 = 27, + COLOR_BGR5552BGRA = 28, + COLOR_BGR5552RGBA = 29, + COLOR_GRAY2BGR555 = 30, + COLOR_BGR5552GRAY = 31, + COLOR_BGR2XYZ = 32, + COLOR_RGB2XYZ = 33, + COLOR_XYZ2BGR = 34, + COLOR_XYZ2RGB = 35, + COLOR_BGR2YCrCb = 36, + COLOR_RGB2YCrCb = 37, + COLOR_YCrCb2BGR = 38, + COLOR_YCrCb2RGB = 39, + COLOR_BGR2HSV = 40, + COLOR_RGB2HSV = 41, + COLOR_BGR2Lab = 44, + COLOR_RGB2Lab = 45, + COLOR_BGR2Luv = 50, + COLOR_RGB2Luv = 51, + COLOR_BGR2HLS = 52, + COLOR_RGB2HLS = 53, + COLOR_HSV2BGR = 54, + COLOR_HSV2RGB = 55, + COLOR_Lab2BGR = 56, + COLOR_Lab2RGB = 57, + COLOR_Luv2BGR = 58, + COLOR_Luv2RGB = 59, + COLOR_HLS2BGR = 60, + COLOR_HLS2RGB = 61, + COLOR_BGR2HSV_FULL = 66, + COLOR_RGB2HSV_FULL = 67, + COLOR_BGR2HLS_FULL = 68, + COLOR_RGB2HLS_FULL = 69, + COLOR_HSV2BGR_FULL = 70, + COLOR_HSV2RGB_FULL = 71, + COLOR_HLS2BGR_FULL = 72, + COLOR_HLS2RGB_FULL = 73, + COLOR_LBGR2Lab = 74, + COLOR_LRGB2Lab = 75, + COLOR_LBGR2Luv = 76, + COLOR_LRGB2Luv = 77, + COLOR_Lab2LBGR = 78, + COLOR_Lab2LRGB = 79, + COLOR_Luv2LBGR = 80, + COLOR_Luv2LRGB = 81, + COLOR_BGR2YUV = 82, + COLOR_RGB2YUV = 83, + COLOR_YUV2BGR = 84, + COLOR_YUV2RGB = 85, + COLOR_YUV2RGB_NV12 = 90, + COLOR_YUV2BGR_NV12 = 91, + COLOR_YUV2RGB_NV21 = 92, + COLOR_YUV2BGR_NV21 = 93, + COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21, + COLOR_YUV420sp2BGR = COLOR_YUV2BGR_NV21, + COLOR_YUV2RGBA_NV12 = 94, + COLOR_YUV2BGRA_NV12 = 95, + COLOR_YUV2RGBA_NV21 = 96, + COLOR_YUV2BGRA_NV21 = 97, + COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21, + COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21, + COLOR_YUV2RGB_YV12 = 98, + COLOR_YUV2BGR_YV12 = 99, + COLOR_YUV2RGB_IYUV = 100, + COLOR_YUV2BGR_IYUV = 101, + COLOR_YUV2RGB_I420 = COLOR_YUV2RGB_IYUV, + COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV, + COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12, + COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12, + COLOR_YUV2RGBA_YV12 = 102, + COLOR_YUV2BGRA_YV12 = 103, + COLOR_YUV2RGBA_IYUV = 104, + COLOR_YUV2BGRA_IYUV = 105, + COLOR_YUV2RGBA_I420 = COLOR_YUV2RGBA_IYUV, + COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV, + COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12, + COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12, + COLOR_YUV2GRAY_420 = 106, + COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420, + COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420, + COLOR_YUV2GRAY_YV12 = COLOR_YUV2GRAY_420, + COLOR_YUV2GRAY_IYUV = COLOR_YUV2GRAY_420, + COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420, + COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420, + COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420, + COLOR_YUV2RGB_UYVY = 107, + COLOR_YUV2BGR_UYVY = 108, + COLOR_YUV2RGB_Y422 = COLOR_YUV2RGB_UYVY, + COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY, + COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY, + COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY, + COLOR_YUV2RGBA_UYVY = 111, + COLOR_YUV2BGRA_UYVY = 112, + COLOR_YUV2RGBA_Y422 = COLOR_YUV2RGBA_UYVY, + COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY, + COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY, + COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY, + COLOR_YUV2RGB_YUY2 = 115, + COLOR_YUV2BGR_YUY2 = 116, + COLOR_YUV2RGB_YVYU = 117, + COLOR_YUV2BGR_YVYU = 118, + COLOR_YUV2RGB_YUYV = COLOR_YUV2RGB_YUY2, + COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2, + COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2, + COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2, + COLOR_YUV2RGBA_YUY2 = 119, + COLOR_YUV2BGRA_YUY2 = 120, + COLOR_YUV2RGBA_YVYU = 121, + COLOR_YUV2BGRA_YVYU = 122, + COLOR_YUV2RGBA_YUYV = COLOR_YUV2RGBA_YUY2, + COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2, + COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2, + COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2, + COLOR_YUV2GRAY_UYVY = 123, + COLOR_YUV2GRAY_YUY2 = 124, + COLOR_YUV2GRAY_Y422 = COLOR_YUV2GRAY_UYVY, + COLOR_YUV2GRAY_UYNV = COLOR_YUV2GRAY_UYVY, + COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2, + COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2, + COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2, + COLOR_RGBA2mRGBA = 125, + COLOR_mRGBA2RGBA = 126, + COLOR_RGB2YUV_I420 = 127, + COLOR_BGR2YUV_I420 = 128, + COLOR_RGB2YUV_IYUV = COLOR_RGB2YUV_I420, + COLOR_BGR2YUV_IYUV = COLOR_BGR2YUV_I420, + COLOR_RGBA2YUV_I420 = 129, + COLOR_BGRA2YUV_I420 = 130, + COLOR_RGBA2YUV_IYUV = COLOR_RGBA2YUV_I420, + COLOR_BGRA2YUV_IYUV = COLOR_BGRA2YUV_I420, + COLOR_RGB2YUV_YV12 = 131, + COLOR_BGR2YUV_YV12 = 132, + COLOR_RGBA2YUV_YV12 = 133, + COLOR_BGRA2YUV_YV12 = 134, + COLOR_BayerBG2BGR = 46, + COLOR_BayerGB2BGR = 47, + COLOR_BayerRG2BGR = 48, + COLOR_BayerGR2BGR = 49, + COLOR_BayerBG2RGB = COLOR_BayerRG2BGR, + COLOR_BayerGB2RGB = COLOR_BayerGR2BGR, + COLOR_BayerRG2RGB = COLOR_BayerBG2BGR, + COLOR_BayerGR2RGB = COLOR_BayerGB2BGR, + COLOR_BayerBG2GRAY = 86, + COLOR_BayerGB2GRAY = 87, + COLOR_BayerRG2GRAY = 88, + COLOR_BayerGR2GRAY = 89, + COLOR_BayerBG2BGR_VNG = 62, + COLOR_BayerGB2BGR_VNG = 63, + COLOR_BayerRG2BGR_VNG = 64, + COLOR_BayerGR2BGR_VNG = 65, + COLOR_BayerBG2RGB_VNG = COLOR_BayerRG2BGR_VNG, + COLOR_BayerGB2RGB_VNG = COLOR_BayerGR2BGR_VNG, + COLOR_BayerRG2RGB_VNG = COLOR_BayerBG2BGR_VNG, + COLOR_BayerGR2RGB_VNG = COLOR_BayerGB2BGR_VNG, + COLOR_BayerBG2BGR_EA = 135, + COLOR_BayerGB2BGR_EA = 136, + COLOR_BayerRG2BGR_EA = 137, + COLOR_BayerGR2BGR_EA = 138, + COLOR_BayerBG2RGB_EA = COLOR_BayerRG2BGR_EA, + COLOR_BayerGB2RGB_EA = COLOR_BayerGR2BGR_EA, + COLOR_BayerRG2RGB_EA = COLOR_BayerBG2BGR_EA, + COLOR_BayerGR2RGB_EA = COLOR_BayerGB2BGR_EA, + COLOR_COLORCVT_MAX = 139, + INTERSECT_NONE = 0, + INTERSECT_PARTIAL = 1, + INTERSECT_FULL = 2, + TM_SQDIFF = 0, + TM_SQDIFF_NORMED = 1, + TM_CCORR = 2, + TM_CCORR_NORMED = 3, + TM_CCOEFF = 4, + TM_CCOEFF_NORMED = 5, + COLORMAP_AUTUMN = 0, + COLORMAP_BONE = 1, + COLORMAP_JET = 2, + COLORMAP_WINTER = 3, + COLORMAP_RAINBOW = 4, + COLORMAP_OCEAN = 5, + COLORMAP_SUMMER = 6, + COLORMAP_SPRING = 7, + COLORMAP_COOL = 8, + COLORMAP_HSV = 9, + COLORMAP_PINK = 10, + COLORMAP_HOT = 11, + COLORMAP_PARULA = 12, + MARKER_CROSS = 0, + MARKER_TILTED_CROSS = 1, + MARKER_STAR = 2, + MARKER_DIAMOND = 3, + MARKER_SQUARE = 4, + MARKER_TRIANGLE_UP = 5, + MARKER_TRIANGLE_DOWN = 6; + + + // + // C++: Mat getAffineTransform(vector_Point2f src, vector_Point2f dst) + // + + //javadoc: getAffineTransform(src, dst) + public static Mat getAffineTransform(MatOfPoint2f src, MatOfPoint2f dst) + { + Mat src_mat = src; + Mat dst_mat = dst; + Mat retVal = new Mat(getAffineTransform_0(src_mat.nativeObj, dst_mat.nativeObj)); + + return retVal; + } + + + // + // C++: Mat getDefaultNewCameraMatrix(Mat cameraMatrix, Size imgsize = Size(), bool centerPrincipalPoint = false) + // + + //javadoc: getDefaultNewCameraMatrix(cameraMatrix, imgsize, centerPrincipalPoint) + public static Mat getDefaultNewCameraMatrix(Mat cameraMatrix, Size imgsize, boolean centerPrincipalPoint) + { + + Mat retVal = new Mat(getDefaultNewCameraMatrix_0(cameraMatrix.nativeObj, imgsize.width, imgsize.height, centerPrincipalPoint)); + + return retVal; + } + + //javadoc: getDefaultNewCameraMatrix(cameraMatrix) + public static Mat getDefaultNewCameraMatrix(Mat cameraMatrix) + { + + Mat retVal = new Mat(getDefaultNewCameraMatrix_1(cameraMatrix.nativeObj)); + + return retVal; + } + + + // + // C++: Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi = CV_PI*0.5, int ktype = CV_64F) + // + + //javadoc: getGaborKernel(ksize, sigma, theta, lambd, gamma, psi, ktype) + public static Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi, int ktype) + { + + Mat retVal = new Mat(getGaborKernel_0(ksize.width, ksize.height, sigma, theta, lambd, gamma, psi, ktype)); + + return retVal; + } + + //javadoc: getGaborKernel(ksize, sigma, theta, lambd, gamma) + public static Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma) + { + + Mat retVal = new Mat(getGaborKernel_1(ksize.width, ksize.height, sigma, theta, lambd, gamma)); + + return retVal; + } + + + // + // C++: Mat getGaussianKernel(int ksize, double sigma, int ktype = CV_64F) + // + + //javadoc: getGaussianKernel(ksize, sigma, ktype) + public static Mat getGaussianKernel(int ksize, double sigma, int ktype) + { + + Mat retVal = new Mat(getGaussianKernel_0(ksize, sigma, ktype)); + + return retVal; + } + + //javadoc: getGaussianKernel(ksize, sigma) + public static Mat getGaussianKernel(int ksize, double sigma) + { + + Mat retVal = new Mat(getGaussianKernel_1(ksize, sigma)); + + return retVal; + } + + + // + // C++: Mat getPerspectiveTransform(Mat src, Mat dst) + // + + //javadoc: getPerspectiveTransform(src, dst) + public static Mat getPerspectiveTransform(Mat src, Mat dst) + { + + Mat retVal = new Mat(getPerspectiveTransform_0(src.nativeObj, dst.nativeObj)); + + return retVal; + } + + + // + // C++: Mat getRotationMatrix2D(Point2f center, double angle, double scale) + // + + //javadoc: getRotationMatrix2D(center, angle, scale) + public static Mat getRotationMatrix2D(Point center, double angle, double scale) + { + + Mat retVal = new Mat(getRotationMatrix2D_0(center.x, center.y, angle, scale)); + + return retVal; + } + + + // + // C++: Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1)) + // + + //javadoc: getStructuringElement(shape, ksize, anchor) + public static Mat getStructuringElement(int shape, Size ksize, Point anchor) + { + + Mat retVal = new Mat(getStructuringElement_0(shape, ksize.width, ksize.height, anchor.x, anchor.y)); + + return retVal; + } + + //javadoc: getStructuringElement(shape, ksize) + public static Mat getStructuringElement(int shape, Size ksize) + { + + Mat retVal = new Mat(getStructuringElement_1(shape, ksize.width, ksize.height)); + + return retVal; + } + + + // + // C++: Moments moments(Mat array, bool binaryImage = false) + // + + //javadoc: moments(array, binaryImage) + public static Moments moments(Mat array, boolean binaryImage) + { + + Moments retVal = new Moments(moments_0(array.nativeObj, binaryImage)); + + return retVal; + } + + //javadoc: moments(array) + public static Moments moments(Mat array) + { + + Moments retVal = new Moments(moments_1(array.nativeObj)); + + return retVal; + } + + + // + // C++: Point2d phaseCorrelate(Mat src1, Mat src2, Mat window = Mat(), double* response = 0) + // + + //javadoc: phaseCorrelate(src1, src2, window, response) + public static Point phaseCorrelate(Mat src1, Mat src2, Mat window, double[] response) + { + double[] response_out = new double[1]; + Point retVal = new Point(phaseCorrelate_0(src1.nativeObj, src2.nativeObj, window.nativeObj, response_out)); + if(response!=null) response[0] = (double)response_out[0]; + return retVal; + } + + //javadoc: phaseCorrelate(src1, src2) + public static Point phaseCorrelate(Mat src1, Mat src2) + { + + Point retVal = new Point(phaseCorrelate_1(src1.nativeObj, src2.nativeObj)); + + return retVal; + } + + + // + // C++: Ptr_CLAHE createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8)) + // + + //javadoc: createCLAHE(clipLimit, tileGridSize) + public static CLAHE createCLAHE(double clipLimit, Size tileGridSize) + { + + CLAHE retVal = new CLAHE(createCLAHE_0(clipLimit, tileGridSize.width, tileGridSize.height)); + + return retVal; + } + + //javadoc: createCLAHE() + public static CLAHE createCLAHE() + { + + CLAHE retVal = new CLAHE(createCLAHE_1()); + + return retVal; + } + + + // + // C++: Ptr_LineSegmentDetector createLineSegmentDetector(int _refine = LSD_REFINE_STD, double _scale = 0.8, double _sigma_scale = 0.6, double _quant = 2.0, double _ang_th = 22.5, double _log_eps = 0, double _density_th = 0.7, int _n_bins = 1024) + // + + //javadoc: createLineSegmentDetector(_refine, _scale, _sigma_scale, _quant, _ang_th, _log_eps, _density_th, _n_bins) + public static LineSegmentDetector createLineSegmentDetector(int _refine, double _scale, double _sigma_scale, double _quant, double _ang_th, double _log_eps, double _density_th, int _n_bins) + { + + LineSegmentDetector retVal = new LineSegmentDetector(createLineSegmentDetector_0(_refine, _scale, _sigma_scale, _quant, _ang_th, _log_eps, _density_th, _n_bins)); + + return retVal; + } + + //javadoc: createLineSegmentDetector() + public static LineSegmentDetector createLineSegmentDetector() + { + + LineSegmentDetector retVal = new LineSegmentDetector(createLineSegmentDetector_1()); + + return retVal; + } + + + // + // C++: Rect boundingRect(vector_Point points) + // + + //javadoc: boundingRect(points) + public static Rect boundingRect(MatOfPoint points) + { + Mat points_mat = points; + Rect retVal = new Rect(boundingRect_0(points_mat.nativeObj)); + + return retVal; + } + + + // + // C++: RotatedRect fitEllipse(vector_Point2f points) + // + + //javadoc: fitEllipse(points) + public static RotatedRect fitEllipse(MatOfPoint2f points) + { + Mat points_mat = points; + RotatedRect retVal = new RotatedRect(fitEllipse_0(points_mat.nativeObj)); + + return retVal; + } + + + // + // C++: RotatedRect minAreaRect(vector_Point2f points) + // + + //javadoc: minAreaRect(points) + public static RotatedRect minAreaRect(MatOfPoint2f points) + { + Mat points_mat = points; + RotatedRect retVal = new RotatedRect(minAreaRect_0(points_mat.nativeObj)); + + return retVal; + } + + + // + // C++: bool clipLine(Rect imgRect, Point& pt1, Point& pt2) + // + + //javadoc: clipLine(imgRect, pt1, pt2) + public static boolean clipLine(Rect imgRect, Point pt1, Point pt2) + { + double[] pt1_out = new double[2]; + double[] pt2_out = new double[2]; + boolean retVal = clipLine_0(imgRect.x, imgRect.y, imgRect.width, imgRect.height, pt1.x, pt1.y, pt1_out, pt2.x, pt2.y, pt2_out); + if(pt1!=null){ pt1.x = pt1_out[0]; pt1.y = pt1_out[1]; } + if(pt2!=null){ pt2.x = pt2_out[0]; pt2.y = pt2_out[1]; } + return retVal; + } + + + // + // C++: bool isContourConvex(vector_Point contour) + // + + //javadoc: isContourConvex(contour) + public static boolean isContourConvex(MatOfPoint contour) + { + Mat contour_mat = contour; + boolean retVal = isContourConvex_0(contour_mat.nativeObj); + + return retVal; + } + + + // + // C++: double arcLength(vector_Point2f curve, bool closed) + // + + //javadoc: arcLength(curve, closed) + public static double arcLength(MatOfPoint2f curve, boolean closed) + { + Mat curve_mat = curve; + double retVal = arcLength_0(curve_mat.nativeObj, closed); + + return retVal; + } + + + // + // C++: double compareHist(Mat H1, Mat H2, int method) + // + + //javadoc: compareHist(H1, H2, method) + public static double compareHist(Mat H1, Mat H2, int method) + { + + double retVal = compareHist_0(H1.nativeObj, H2.nativeObj, method); + + return retVal; + } + + + // + // C++: double contourArea(Mat contour, bool oriented = false) + // + + //javadoc: contourArea(contour, oriented) + public static double contourArea(Mat contour, boolean oriented) + { + + double retVal = contourArea_0(contour.nativeObj, oriented); + + return retVal; + } + + //javadoc: contourArea(contour) + public static double contourArea(Mat contour) + { + + double retVal = contourArea_1(contour.nativeObj); + + return retVal; + } + + + // + // C++: double matchShapes(Mat contour1, Mat contour2, int method, double parameter) + // + + //javadoc: matchShapes(contour1, contour2, method, parameter) + public static double matchShapes(Mat contour1, Mat contour2, int method, double parameter) + { + + double retVal = matchShapes_0(contour1.nativeObj, contour2.nativeObj, method, parameter); + + return retVal; + } + + + // + // C++: double minEnclosingTriangle(Mat points, Mat& triangle) + // + + //javadoc: minEnclosingTriangle(points, triangle) + public static double minEnclosingTriangle(Mat points, Mat triangle) + { + + double retVal = minEnclosingTriangle_0(points.nativeObj, triangle.nativeObj); + + return retVal; + } + + + // + // C++: double pointPolygonTest(vector_Point2f contour, Point2f pt, bool measureDist) + // + + //javadoc: pointPolygonTest(contour, pt, measureDist) + public static double pointPolygonTest(MatOfPoint2f contour, Point pt, boolean measureDist) + { + Mat contour_mat = contour; + double retVal = pointPolygonTest_0(contour_mat.nativeObj, pt.x, pt.y, measureDist); + + return retVal; + } + + + // + // C++: double threshold(Mat src, Mat& dst, double thresh, double maxval, int type) + // + + //javadoc: threshold(src, dst, thresh, maxval, type) + public static double threshold(Mat src, Mat dst, double thresh, double maxval, int type) + { + + double retVal = threshold_0(src.nativeObj, dst.nativeObj, thresh, maxval, type); + + return retVal; + } + + + // + // C++: float initWideAngleProjMap(Mat cameraMatrix, Mat distCoeffs, Size imageSize, int destImageWidth, int m1type, Mat& map1, Mat& map2, int projType = PROJ_SPHERICAL_EQRECT, double alpha = 0) + // + + //javadoc: initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize, destImageWidth, m1type, map1, map2, projType, alpha) + public static float initWideAngleProjMap(Mat cameraMatrix, Mat distCoeffs, Size imageSize, int destImageWidth, int m1type, Mat map1, Mat map2, int projType, double alpha) + { + + float retVal = initWideAngleProjMap_0(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, destImageWidth, m1type, map1.nativeObj, map2.nativeObj, projType, alpha); + + return retVal; + } + + //javadoc: initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize, destImageWidth, m1type, map1, map2) + public static float initWideAngleProjMap(Mat cameraMatrix, Mat distCoeffs, Size imageSize, int destImageWidth, int m1type, Mat map1, Mat map2) + { + + float retVal = initWideAngleProjMap_1(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, destImageWidth, m1type, map1.nativeObj, map2.nativeObj); + + return retVal; + } + + + // + // C++: float intersectConvexConvex(Mat _p1, Mat _p2, Mat& _p12, bool handleNested = true) + // + + //javadoc: intersectConvexConvex(_p1, _p2, _p12, handleNested) + public static float intersectConvexConvex(Mat _p1, Mat _p2, Mat _p12, boolean handleNested) + { + + float retVal = intersectConvexConvex_0(_p1.nativeObj, _p2.nativeObj, _p12.nativeObj, handleNested); + + return retVal; + } + + //javadoc: intersectConvexConvex(_p1, _p2, _p12) + public static float intersectConvexConvex(Mat _p1, Mat _p2, Mat _p12) + { + + float retVal = intersectConvexConvex_1(_p1.nativeObj, _p2.nativeObj, _p12.nativeObj); + + return retVal; + } + + + // + // C++: int connectedComponents(Mat image, Mat& labels, int connectivity = 8, int ltype = CV_32S) + // + + //javadoc: connectedComponents(image, labels, connectivity, ltype) + public static int connectedComponents(Mat image, Mat labels, int connectivity, int ltype) + { + + int retVal = connectedComponents_0(image.nativeObj, labels.nativeObj, connectivity, ltype); + + return retVal; + } + + //javadoc: connectedComponents(image, labels) + public static int connectedComponents(Mat image, Mat labels) + { + + int retVal = connectedComponents_1(image.nativeObj, labels.nativeObj); + + return retVal; + } + + + // + // C++: int connectedComponentsWithStats(Mat image, Mat& labels, Mat& stats, Mat& centroids, int connectivity = 8, int ltype = CV_32S) + // + + //javadoc: connectedComponentsWithStats(image, labels, stats, centroids, connectivity, ltype) + public static int connectedComponentsWithStats(Mat image, Mat labels, Mat stats, Mat centroids, int connectivity, int ltype) + { + + int retVal = connectedComponentsWithStats_0(image.nativeObj, labels.nativeObj, stats.nativeObj, centroids.nativeObj, connectivity, ltype); + + return retVal; + } + + //javadoc: connectedComponentsWithStats(image, labels, stats, centroids) + public static int connectedComponentsWithStats(Mat image, Mat labels, Mat stats, Mat centroids) + { + + int retVal = connectedComponentsWithStats_1(image.nativeObj, labels.nativeObj, stats.nativeObj, centroids.nativeObj); + + return retVal; + } + + + // + // C++: int floodFill(Mat& image, Mat& mask, Point seedPoint, Scalar newVal, Rect* rect = 0, Scalar loDiff = Scalar(), Scalar upDiff = Scalar(), int flags = 4) + // + + //javadoc: floodFill(image, mask, seedPoint, newVal, rect, loDiff, upDiff, flags) + public static int floodFill(Mat image, Mat mask, Point seedPoint, Scalar newVal, Rect rect, Scalar loDiff, Scalar upDiff, int flags) + { + double[] rect_out = new double[4]; + int retVal = floodFill_0(image.nativeObj, mask.nativeObj, seedPoint.x, seedPoint.y, newVal.val[0], newVal.val[1], newVal.val[2], newVal.val[3], rect_out, loDiff.val[0], loDiff.val[1], loDiff.val[2], loDiff.val[3], upDiff.val[0], upDiff.val[1], upDiff.val[2], upDiff.val[3], flags); + if(rect!=null){ rect.x = (int)rect_out[0]; rect.y = (int)rect_out[1]; rect.width = (int)rect_out[2]; rect.height = (int)rect_out[3]; } + return retVal; + } + + //javadoc: floodFill(image, mask, seedPoint, newVal) + public static int floodFill(Mat image, Mat mask, Point seedPoint, Scalar newVal) + { + + int retVal = floodFill_1(image.nativeObj, mask.nativeObj, seedPoint.x, seedPoint.y, newVal.val[0], newVal.val[1], newVal.val[2], newVal.val[3]); + + return retVal; + } + + + // + // C++: int rotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, Mat& intersectingRegion) + // + + //javadoc: rotatedRectangleIntersection(rect1, rect2, intersectingRegion) + public static int rotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, Mat intersectingRegion) + { + + int retVal = rotatedRectangleIntersection_0(rect1.center.x, rect1.center.y, rect1.size.width, rect1.size.height, rect1.angle, rect2.center.x, rect2.center.y, rect2.size.width, rect2.size.height, rect2.angle, intersectingRegion.nativeObj); + + return retVal; + } + + + // + // C++: void Canny(Mat image, Mat& edges, double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false) + // + + //javadoc: Canny(image, edges, threshold1, threshold2, apertureSize, L2gradient) + public static void Canny(Mat image, Mat edges, double threshold1, double threshold2, int apertureSize, boolean L2gradient) + { + + Canny_0(image.nativeObj, edges.nativeObj, threshold1, threshold2, apertureSize, L2gradient); + + return; + } + + //javadoc: Canny(image, edges, threshold1, threshold2) + public static void Canny(Mat image, Mat edges, double threshold1, double threshold2) + { + + Canny_1(image.nativeObj, edges.nativeObj, threshold1, threshold2); + + return; + } + + + // + // C++: void GaussianBlur(Mat src, Mat& dst, Size ksize, double sigmaX, double sigmaY = 0, int borderType = BORDER_DEFAULT) + // + + //javadoc: GaussianBlur(src, dst, ksize, sigmaX, sigmaY, borderType) + public static void GaussianBlur(Mat src, Mat dst, Size ksize, double sigmaX, double sigmaY, int borderType) + { + + GaussianBlur_0(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, sigmaX, sigmaY, borderType); + + return; + } + + //javadoc: GaussianBlur(src, dst, ksize, sigmaX, sigmaY) + public static void GaussianBlur(Mat src, Mat dst, Size ksize, double sigmaX, double sigmaY) + { + + GaussianBlur_1(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, sigmaX, sigmaY); + + return; + } + + //javadoc: GaussianBlur(src, dst, ksize, sigmaX) + public static void GaussianBlur(Mat src, Mat dst, Size ksize, double sigmaX) + { + + GaussianBlur_2(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, sigmaX); + + return; + } + + + // + // C++: void HoughCircles(Mat image, Mat& circles, int method, double dp, double minDist, double param1 = 100, double param2 = 100, int minRadius = 0, int maxRadius = 0) + // + + //javadoc: HoughCircles(image, circles, method, dp, minDist, param1, param2, minRadius, maxRadius) + public static void HoughCircles(Mat image, Mat circles, int method, double dp, double minDist, double param1, double param2, int minRadius, int maxRadius) + { + + HoughCircles_0(image.nativeObj, circles.nativeObj, method, dp, minDist, param1, param2, minRadius, maxRadius); + + return; + } + + //javadoc: HoughCircles(image, circles, method, dp, minDist) + public static void HoughCircles(Mat image, Mat circles, int method, double dp, double minDist) + { + + HoughCircles_1(image.nativeObj, circles.nativeObj, method, dp, minDist); + + return; + } + + + // + // C++: void HoughLines(Mat image, Mat& lines, double rho, double theta, int threshold, double srn = 0, double stn = 0, double min_theta = 0, double max_theta = CV_PI) + // + + //javadoc: HoughLines(image, lines, rho, theta, threshold, srn, stn, min_theta, max_theta) + public static void HoughLines(Mat image, Mat lines, double rho, double theta, int threshold, double srn, double stn, double min_theta, double max_theta) + { + + HoughLines_0(image.nativeObj, lines.nativeObj, rho, theta, threshold, srn, stn, min_theta, max_theta); + + return; + } + + //javadoc: HoughLines(image, lines, rho, theta, threshold) + public static void HoughLines(Mat image, Mat lines, double rho, double theta, int threshold) + { + + HoughLines_1(image.nativeObj, lines.nativeObj, rho, theta, threshold); + + return; + } + + + // + // C++: void HoughLinesP(Mat image, Mat& lines, double rho, double theta, int threshold, double minLineLength = 0, double maxLineGap = 0) + // + + //javadoc: HoughLinesP(image, lines, rho, theta, threshold, minLineLength, maxLineGap) + public static void HoughLinesP(Mat image, Mat lines, double rho, double theta, int threshold, double minLineLength, double maxLineGap) + { + + HoughLinesP_0(image.nativeObj, lines.nativeObj, rho, theta, threshold, minLineLength, maxLineGap); + + return; + } + + //javadoc: HoughLinesP(image, lines, rho, theta, threshold) + public static void HoughLinesP(Mat image, Mat lines, double rho, double theta, int threshold) + { + + HoughLinesP_1(image.nativeObj, lines.nativeObj, rho, theta, threshold); + + return; + } + + + // + // C++: void HuMoments(Moments m, Mat& hu) + // + + //javadoc: HuMoments(m, hu) + public static void HuMoments(Moments m, Mat hu) + { + + HuMoments_0(m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03, hu.nativeObj); + + return; + } + + + // + // C++: void Laplacian(Mat src, Mat& dst, int ddepth, int ksize = 1, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) + // + + //javadoc: Laplacian(src, dst, ddepth, ksize, scale, delta, borderType) + public static void Laplacian(Mat src, Mat dst, int ddepth, int ksize, double scale, double delta, int borderType) + { + + Laplacian_0(src.nativeObj, dst.nativeObj, ddepth, ksize, scale, delta, borderType); + + return; + } + + //javadoc: Laplacian(src, dst, ddepth, ksize, scale, delta) + public static void Laplacian(Mat src, Mat dst, int ddepth, int ksize, double scale, double delta) + { + + Laplacian_1(src.nativeObj, dst.nativeObj, ddepth, ksize, scale, delta); + + return; + } + + //javadoc: Laplacian(src, dst, ddepth) + public static void Laplacian(Mat src, Mat dst, int ddepth) + { + + Laplacian_2(src.nativeObj, dst.nativeObj, ddepth); + + return; + } + + + // + // C++: void Scharr(Mat src, Mat& dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) + // + + //javadoc: Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType) + public static void Scharr(Mat src, Mat dst, int ddepth, int dx, int dy, double scale, double delta, int borderType) + { + + Scharr_0(src.nativeObj, dst.nativeObj, ddepth, dx, dy, scale, delta, borderType); + + return; + } + + //javadoc: Scharr(src, dst, ddepth, dx, dy, scale, delta) + public static void Scharr(Mat src, Mat dst, int ddepth, int dx, int dy, double scale, double delta) + { + + Scharr_1(src.nativeObj, dst.nativeObj, ddepth, dx, dy, scale, delta); + + return; + } + + //javadoc: Scharr(src, dst, ddepth, dx, dy) + public static void Scharr(Mat src, Mat dst, int ddepth, int dx, int dy) + { + + Scharr_2(src.nativeObj, dst.nativeObj, ddepth, dx, dy); + + return; + } + + + // + // C++: void Sobel(Mat src, Mat& dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) + // + + //javadoc: Sobel(src, dst, ddepth, dx, dy, ksize, scale, delta, borderType) + public static void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType) + { + + Sobel_0(src.nativeObj, dst.nativeObj, ddepth, dx, dy, ksize, scale, delta, borderType); + + return; + } + + //javadoc: Sobel(src, dst, ddepth, dx, dy, ksize, scale, delta) + public static void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta) + { + + Sobel_1(src.nativeObj, dst.nativeObj, ddepth, dx, dy, ksize, scale, delta); + + return; + } + + //javadoc: Sobel(src, dst, ddepth, dx, dy) + public static void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy) + { + + Sobel_2(src.nativeObj, dst.nativeObj, ddepth, dx, dy); + + return; + } + + + // + // C++: void accumulate(Mat src, Mat& dst, Mat mask = Mat()) + // + + //javadoc: accumulate(src, dst, mask) + public static void accumulate(Mat src, Mat dst, Mat mask) + { + + accumulate_0(src.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: accumulate(src, dst) + public static void accumulate(Mat src, Mat dst) + { + + accumulate_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void accumulateProduct(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) + // + + //javadoc: accumulateProduct(src1, src2, dst, mask) + public static void accumulateProduct(Mat src1, Mat src2, Mat dst, Mat mask) + { + + accumulateProduct_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: accumulateProduct(src1, src2, dst) + public static void accumulateProduct(Mat src1, Mat src2, Mat dst) + { + + accumulateProduct_1(src1.nativeObj, src2.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void accumulateSquare(Mat src, Mat& dst, Mat mask = Mat()) + // + + //javadoc: accumulateSquare(src, dst, mask) + public static void accumulateSquare(Mat src, Mat dst, Mat mask) + { + + accumulateSquare_0(src.nativeObj, dst.nativeObj, mask.nativeObj); + + return; + } + + //javadoc: accumulateSquare(src, dst) + public static void accumulateSquare(Mat src, Mat dst) + { + + accumulateSquare_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void accumulateWeighted(Mat src, Mat& dst, double alpha, Mat mask = Mat()) + // + + //javadoc: accumulateWeighted(src, dst, alpha, mask) + public static void accumulateWeighted(Mat src, Mat dst, double alpha, Mat mask) + { + + accumulateWeighted_0(src.nativeObj, dst.nativeObj, alpha, mask.nativeObj); + + return; + } + + //javadoc: accumulateWeighted(src, dst, alpha) + public static void accumulateWeighted(Mat src, Mat dst, double alpha) + { + + accumulateWeighted_1(src.nativeObj, dst.nativeObj, alpha); + + return; + } + + + // + // C++: void adaptiveThreshold(Mat src, Mat& dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) + // + + //javadoc: adaptiveThreshold(src, dst, maxValue, adaptiveMethod, thresholdType, blockSize, C) + public static void adaptiveThreshold(Mat src, Mat dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) + { + + adaptiveThreshold_0(src.nativeObj, dst.nativeObj, maxValue, adaptiveMethod, thresholdType, blockSize, C); + + return; + } + + + // + // C++: void applyColorMap(Mat src, Mat& dst, int colormap) + // + + //javadoc: applyColorMap(src, dst, colormap) + public static void applyColorMap(Mat src, Mat dst, int colormap) + { + + applyColorMap_0(src.nativeObj, dst.nativeObj, colormap); + + return; + } + + + // + // C++: void approxPolyDP(vector_Point2f curve, vector_Point2f& approxCurve, double epsilon, bool closed) + // + + //javadoc: approxPolyDP(curve, approxCurve, epsilon, closed) + public static void approxPolyDP(MatOfPoint2f curve, MatOfPoint2f approxCurve, double epsilon, boolean closed) + { + Mat curve_mat = curve; + Mat approxCurve_mat = approxCurve; + approxPolyDP_0(curve_mat.nativeObj, approxCurve_mat.nativeObj, epsilon, closed); + + return; + } + + + // + // C++: void arrowedLine(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int line_type = 8, int shift = 0, double tipLength = 0.1) + // + + //javadoc: arrowedLine(img, pt1, pt2, color, thickness, line_type, shift, tipLength) + public static void arrowedLine(Mat img, Point pt1, Point pt2, Scalar color, int thickness, int line_type, int shift, double tipLength) + { + + arrowedLine_0(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness, line_type, shift, tipLength); + + return; + } + + //javadoc: arrowedLine(img, pt1, pt2, color) + public static void arrowedLine(Mat img, Point pt1, Point pt2, Scalar color) + { + + arrowedLine_1(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void bilateralFilter(Mat src, Mat& dst, int d, double sigmaColor, double sigmaSpace, int borderType = BORDER_DEFAULT) + // + + //javadoc: bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, borderType) + public static void bilateralFilter(Mat src, Mat dst, int d, double sigmaColor, double sigmaSpace, int borderType) + { + + bilateralFilter_0(src.nativeObj, dst.nativeObj, d, sigmaColor, sigmaSpace, borderType); + + return; + } + + //javadoc: bilateralFilter(src, dst, d, sigmaColor, sigmaSpace) + public static void bilateralFilter(Mat src, Mat dst, int d, double sigmaColor, double sigmaSpace) + { + + bilateralFilter_1(src.nativeObj, dst.nativeObj, d, sigmaColor, sigmaSpace); + + return; + } + + + // + // C++: void blur(Mat src, Mat& dst, Size ksize, Point anchor = Point(-1,-1), int borderType = BORDER_DEFAULT) + // + + //javadoc: blur(src, dst, ksize, anchor, borderType) + public static void blur(Mat src, Mat dst, Size ksize, Point anchor, int borderType) + { + + blur_0(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, anchor.x, anchor.y, borderType); + + return; + } + + //javadoc: blur(src, dst, ksize, anchor) + public static void blur(Mat src, Mat dst, Size ksize, Point anchor) + { + + blur_1(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, anchor.x, anchor.y); + + return; + } + + //javadoc: blur(src, dst, ksize) + public static void blur(Mat src, Mat dst, Size ksize) + { + + blur_2(src.nativeObj, dst.nativeObj, ksize.width, ksize.height); + + return; + } + + + // + // C++: void boxFilter(Mat src, Mat& dst, int ddepth, Size ksize, Point anchor = Point(-1,-1), bool normalize = true, int borderType = BORDER_DEFAULT) + // + + //javadoc: boxFilter(src, dst, ddepth, ksize, anchor, normalize, borderType) + public static void boxFilter(Mat src, Mat dst, int ddepth, Size ksize, Point anchor, boolean normalize, int borderType) + { + + boxFilter_0(src.nativeObj, dst.nativeObj, ddepth, ksize.width, ksize.height, anchor.x, anchor.y, normalize, borderType); + + return; + } + + //javadoc: boxFilter(src, dst, ddepth, ksize, anchor, normalize) + public static void boxFilter(Mat src, Mat dst, int ddepth, Size ksize, Point anchor, boolean normalize) + { + + boxFilter_1(src.nativeObj, dst.nativeObj, ddepth, ksize.width, ksize.height, anchor.x, anchor.y, normalize); + + return; + } + + //javadoc: boxFilter(src, dst, ddepth, ksize) + public static void boxFilter(Mat src, Mat dst, int ddepth, Size ksize) + { + + boxFilter_2(src.nativeObj, dst.nativeObj, ddepth, ksize.width, ksize.height); + + return; + } + + + // + // C++: void boxPoints(RotatedRect box, Mat& points) + // + + //javadoc: boxPoints(box, points) + public static void boxPoints(RotatedRect box, Mat points) + { + + boxPoints_0(box.center.x, box.center.y, box.size.width, box.size.height, box.angle, points.nativeObj); + + return; + } + + + // + // C++: void calcBackProject(vector_Mat images, vector_int channels, Mat hist, Mat& dst, vector_float ranges, double scale) + // + + //javadoc: calcBackProject(images, channels, hist, dst, ranges, scale) + public static void calcBackProject(List images, MatOfInt channels, Mat hist, Mat dst, MatOfFloat ranges, double scale) + { + Mat images_mat = Converters.vector_Mat_to_Mat(images); + Mat channels_mat = channels; + Mat ranges_mat = ranges; + calcBackProject_0(images_mat.nativeObj, channels_mat.nativeObj, hist.nativeObj, dst.nativeObj, ranges_mat.nativeObj, scale); + + return; + } + + + // + // C++: void calcHist(vector_Mat images, vector_int channels, Mat mask, Mat& hist, vector_int histSize, vector_float ranges, bool accumulate = false) + // + + //javadoc: calcHist(images, channels, mask, hist, histSize, ranges, accumulate) + public static void calcHist(List images, MatOfInt channels, Mat mask, Mat hist, MatOfInt histSize, MatOfFloat ranges, boolean accumulate) + { + Mat images_mat = Converters.vector_Mat_to_Mat(images); + Mat channels_mat = channels; + Mat histSize_mat = histSize; + Mat ranges_mat = ranges; + calcHist_0(images_mat.nativeObj, channels_mat.nativeObj, mask.nativeObj, hist.nativeObj, histSize_mat.nativeObj, ranges_mat.nativeObj, accumulate); + + return; + } + + //javadoc: calcHist(images, channels, mask, hist, histSize, ranges) + public static void calcHist(List images, MatOfInt channels, Mat mask, Mat hist, MatOfInt histSize, MatOfFloat ranges) + { + Mat images_mat = Converters.vector_Mat_to_Mat(images); + Mat channels_mat = channels; + Mat histSize_mat = histSize; + Mat ranges_mat = ranges; + calcHist_1(images_mat.nativeObj, channels_mat.nativeObj, mask.nativeObj, hist.nativeObj, histSize_mat.nativeObj, ranges_mat.nativeObj); + + return; + } + + + // + // C++: void circle(Mat& img, Point center, int radius, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + // + + //javadoc: circle(img, center, radius, color, thickness, lineType, shift) + public static void circle(Mat img, Point center, int radius, Scalar color, int thickness, int lineType, int shift) + { + + circle_0(img.nativeObj, center.x, center.y, radius, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); + + return; + } + + //javadoc: circle(img, center, radius, color, thickness) + public static void circle(Mat img, Point center, int radius, Scalar color, int thickness) + { + + circle_1(img.nativeObj, center.x, center.y, radius, color.val[0], color.val[1], color.val[2], color.val[3], thickness); + + return; + } + + //javadoc: circle(img, center, radius, color) + public static void circle(Mat img, Point center, int radius, Scalar color) + { + + circle_2(img.nativeObj, center.x, center.y, radius, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void convertMaps(Mat map1, Mat map2, Mat& dstmap1, Mat& dstmap2, int dstmap1type, bool nninterpolation = false) + // + + //javadoc: convertMaps(map1, map2, dstmap1, dstmap2, dstmap1type, nninterpolation) + public static void convertMaps(Mat map1, Mat map2, Mat dstmap1, Mat dstmap2, int dstmap1type, boolean nninterpolation) + { + + convertMaps_0(map1.nativeObj, map2.nativeObj, dstmap1.nativeObj, dstmap2.nativeObj, dstmap1type, nninterpolation); + + return; + } + + //javadoc: convertMaps(map1, map2, dstmap1, dstmap2, dstmap1type) + public static void convertMaps(Mat map1, Mat map2, Mat dstmap1, Mat dstmap2, int dstmap1type) + { + + convertMaps_1(map1.nativeObj, map2.nativeObj, dstmap1.nativeObj, dstmap2.nativeObj, dstmap1type); + + return; + } + + + // + // C++: void convexHull(vector_Point points, vector_int& hull, bool clockwise = false, _hidden_ returnPoints = true) + // + + //javadoc: convexHull(points, hull, clockwise) + public static void convexHull(MatOfPoint points, MatOfInt hull, boolean clockwise) + { + Mat points_mat = points; + Mat hull_mat = hull; + convexHull_0(points_mat.nativeObj, hull_mat.nativeObj, clockwise); + + return; + } + + //javadoc: convexHull(points, hull) + public static void convexHull(MatOfPoint points, MatOfInt hull) + { + Mat points_mat = points; + Mat hull_mat = hull; + convexHull_1(points_mat.nativeObj, hull_mat.nativeObj); + + return; + } + + + // + // C++: void convexityDefects(vector_Point contour, vector_int convexhull, vector_Vec4i& convexityDefects) + // + + //javadoc: convexityDefects(contour, convexhull, convexityDefects) + public static void convexityDefects(MatOfPoint contour, MatOfInt convexhull, MatOfInt4 convexityDefects) + { + Mat contour_mat = contour; + Mat convexhull_mat = convexhull; + Mat convexityDefects_mat = convexityDefects; + convexityDefects_0(contour_mat.nativeObj, convexhull_mat.nativeObj, convexityDefects_mat.nativeObj); + + return; + } + + + // + // C++: void cornerEigenValsAndVecs(Mat src, Mat& dst, int blockSize, int ksize, int borderType = BORDER_DEFAULT) + // + + //javadoc: cornerEigenValsAndVecs(src, dst, blockSize, ksize, borderType) + public static void cornerEigenValsAndVecs(Mat src, Mat dst, int blockSize, int ksize, int borderType) + { + + cornerEigenValsAndVecs_0(src.nativeObj, dst.nativeObj, blockSize, ksize, borderType); + + return; + } + + //javadoc: cornerEigenValsAndVecs(src, dst, blockSize, ksize) + public static void cornerEigenValsAndVecs(Mat src, Mat dst, int blockSize, int ksize) + { + + cornerEigenValsAndVecs_1(src.nativeObj, dst.nativeObj, blockSize, ksize); + + return; + } + + + // + // C++: void cornerHarris(Mat src, Mat& dst, int blockSize, int ksize, double k, int borderType = BORDER_DEFAULT) + // + + //javadoc: cornerHarris(src, dst, blockSize, ksize, k, borderType) + public static void cornerHarris(Mat src, Mat dst, int blockSize, int ksize, double k, int borderType) + { + + cornerHarris_0(src.nativeObj, dst.nativeObj, blockSize, ksize, k, borderType); + + return; + } + + //javadoc: cornerHarris(src, dst, blockSize, ksize, k) + public static void cornerHarris(Mat src, Mat dst, int blockSize, int ksize, double k) + { + + cornerHarris_1(src.nativeObj, dst.nativeObj, blockSize, ksize, k); + + return; + } + + + // + // C++: void cornerMinEigenVal(Mat src, Mat& dst, int blockSize, int ksize = 3, int borderType = BORDER_DEFAULT) + // + + //javadoc: cornerMinEigenVal(src, dst, blockSize, ksize, borderType) + public static void cornerMinEigenVal(Mat src, Mat dst, int blockSize, int ksize, int borderType) + { + + cornerMinEigenVal_0(src.nativeObj, dst.nativeObj, blockSize, ksize, borderType); + + return; + } + + //javadoc: cornerMinEigenVal(src, dst, blockSize, ksize) + public static void cornerMinEigenVal(Mat src, Mat dst, int blockSize, int ksize) + { + + cornerMinEigenVal_1(src.nativeObj, dst.nativeObj, blockSize, ksize); + + return; + } + + //javadoc: cornerMinEigenVal(src, dst, blockSize) + public static void cornerMinEigenVal(Mat src, Mat dst, int blockSize) + { + + cornerMinEigenVal_2(src.nativeObj, dst.nativeObj, blockSize); + + return; + } + + + // + // C++: void cornerSubPix(Mat image, vector_Point2f& corners, Size winSize, Size zeroZone, TermCriteria criteria) + // + + //javadoc: cornerSubPix(image, corners, winSize, zeroZone, criteria) + public static void cornerSubPix(Mat image, MatOfPoint2f corners, Size winSize, Size zeroZone, TermCriteria criteria) + { + Mat corners_mat = corners; + cornerSubPix_0(image.nativeObj, corners_mat.nativeObj, winSize.width, winSize.height, zeroZone.width, zeroZone.height, criteria.type, criteria.maxCount, criteria.epsilon); + + return; + } + + + // + // C++: void createHanningWindow(Mat& dst, Size winSize, int type) + // + + //javadoc: createHanningWindow(dst, winSize, type) + public static void createHanningWindow(Mat dst, Size winSize, int type) + { + + createHanningWindow_0(dst.nativeObj, winSize.width, winSize.height, type); + + return; + } + + + // + // C++: void cvtColor(Mat src, Mat& dst, int code, int dstCn = 0) + // + + //javadoc: cvtColor(src, dst, code, dstCn) + public static void cvtColor(Mat src, Mat dst, int code, int dstCn) + { + + cvtColor_0(src.nativeObj, dst.nativeObj, code, dstCn); + + return; + } + + //javadoc: cvtColor(src, dst, code) + public static void cvtColor(Mat src, Mat dst, int code) + { + + cvtColor_1(src.nativeObj, dst.nativeObj, code); + + return; + } + + + // + // C++: void demosaicing(Mat _src, Mat& _dst, int code, int dcn = 0) + // + + //javadoc: demosaicing(_src, _dst, code, dcn) + public static void demosaicing(Mat _src, Mat _dst, int code, int dcn) + { + + demosaicing_0(_src.nativeObj, _dst.nativeObj, code, dcn); + + return; + } + + //javadoc: demosaicing(_src, _dst, code) + public static void demosaicing(Mat _src, Mat _dst, int code) + { + + demosaicing_1(_src.nativeObj, _dst.nativeObj, code); + + return; + } + + + // + // C++: void dilate(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) + // + + //javadoc: dilate(src, dst, kernel, anchor, iterations, borderType, borderValue) + public static void dilate(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue) + { + + dilate_0(src.nativeObj, dst.nativeObj, kernel.nativeObj, anchor.x, anchor.y, iterations, borderType, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); + + return; + } + + //javadoc: dilate(src, dst, kernel, anchor, iterations) + public static void dilate(Mat src, Mat dst, Mat kernel, Point anchor, int iterations) + { + + dilate_1(src.nativeObj, dst.nativeObj, kernel.nativeObj, anchor.x, anchor.y, iterations); + + return; + } + + //javadoc: dilate(src, dst, kernel) + public static void dilate(Mat src, Mat dst, Mat kernel) + { + + dilate_2(src.nativeObj, dst.nativeObj, kernel.nativeObj); + + return; + } + + + // + // C++: void distanceTransform(Mat src, Mat& dst, Mat& labels, int distanceType, int maskSize, int labelType = DIST_LABEL_CCOMP) + // + + //javadoc: distanceTransform(src, dst, labels, distanceType, maskSize, labelType) + public static void distanceTransformWithLabels(Mat src, Mat dst, Mat labels, int distanceType, int maskSize, int labelType) + { + + distanceTransformWithLabels_0(src.nativeObj, dst.nativeObj, labels.nativeObj, distanceType, maskSize, labelType); + + return; + } + + //javadoc: distanceTransform(src, dst, labels, distanceType, maskSize) + public static void distanceTransformWithLabels(Mat src, Mat dst, Mat labels, int distanceType, int maskSize) + { + + distanceTransformWithLabels_1(src.nativeObj, dst.nativeObj, labels.nativeObj, distanceType, maskSize); + + return; + } + + + // + // C++: void distanceTransform(Mat src, Mat& dst, int distanceType, int maskSize, int dstType = CV_32F) + // + + //javadoc: distanceTransform(src, dst, distanceType, maskSize, dstType) + public static void distanceTransform(Mat src, Mat dst, int distanceType, int maskSize, int dstType) + { + + distanceTransform_0(src.nativeObj, dst.nativeObj, distanceType, maskSize, dstType); + + return; + } + + //javadoc: distanceTransform(src, dst, distanceType, maskSize) + public static void distanceTransform(Mat src, Mat dst, int distanceType, int maskSize) + { + + distanceTransform_1(src.nativeObj, dst.nativeObj, distanceType, maskSize); + + return; + } + + + // + // C++: void drawContours(Mat& image, vector_vector_Point contours, int contourIdx, Scalar color, int thickness = 1, int lineType = LINE_8, Mat hierarchy = Mat(), int maxLevel = INT_MAX, Point offset = Point()) + // + + //javadoc: drawContours(image, contours, contourIdx, color, thickness, lineType, hierarchy, maxLevel, offset) + public static void drawContours(Mat image, List contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset) + { + List contours_tmplm = new ArrayList((contours != null) ? contours.size() : 0); + Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm); + drawContours_0(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, hierarchy.nativeObj, maxLevel, offset.x, offset.y); + + return; + } + + //javadoc: drawContours(image, contours, contourIdx, color, thickness) + public static void drawContours(Mat image, List contours, int contourIdx, Scalar color, int thickness) + { + List contours_tmplm = new ArrayList((contours != null) ? contours.size() : 0); + Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm); + drawContours_1(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3], thickness); + + return; + } + + //javadoc: drawContours(image, contours, contourIdx, color) + public static void drawContours(Mat image, List contours, int contourIdx, Scalar color) + { + List contours_tmplm = new ArrayList((contours != null) ? contours.size() : 0); + Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm); + drawContours_2(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void drawMarker(Mat& img, Point position, Scalar color, int markerType = MARKER_CROSS, int markerSize = 20, int thickness = 1, int line_type = 8) + // + + //javadoc: drawMarker(img, position, color, markerType, markerSize, thickness, line_type) + public static void drawMarker(Mat img, Point position, Scalar color, int markerType, int markerSize, int thickness, int line_type) + { + + drawMarker_0(img.nativeObj, position.x, position.y, color.val[0], color.val[1], color.val[2], color.val[3], markerType, markerSize, thickness, line_type); + + return; + } + + //javadoc: drawMarker(img, position, color) + public static void drawMarker(Mat img, Point position, Scalar color) + { + + drawMarker_1(img.nativeObj, position.x, position.y, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + // + + //javadoc: ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness, lineType, shift) + public static void ellipse(Mat img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness, int lineType, int shift) + { + + ellipse_0(img.nativeObj, center.x, center.y, axes.width, axes.height, angle, startAngle, endAngle, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); + + return; + } + + //javadoc: ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness) + public static void ellipse(Mat img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness) + { + + ellipse_1(img.nativeObj, center.x, center.y, axes.width, axes.height, angle, startAngle, endAngle, color.val[0], color.val[1], color.val[2], color.val[3], thickness); + + return; + } + + //javadoc: ellipse(img, center, axes, angle, startAngle, endAngle, color) + public static void ellipse(Mat img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color) + { + + ellipse_2(img.nativeObj, center.x, center.y, axes.width, axes.height, angle, startAngle, endAngle, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void ellipse(Mat& img, RotatedRect box, Scalar color, int thickness = 1, int lineType = LINE_8) + // + + //javadoc: ellipse(img, box, color, thickness, lineType) + public static void ellipse(Mat img, RotatedRect box, Scalar color, int thickness, int lineType) + { + + ellipse_3(img.nativeObj, box.center.x, box.center.y, box.size.width, box.size.height, box.angle, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType); + + return; + } + + //javadoc: ellipse(img, box, color, thickness) + public static void ellipse(Mat img, RotatedRect box, Scalar color, int thickness) + { + + ellipse_4(img.nativeObj, box.center.x, box.center.y, box.size.width, box.size.height, box.angle, color.val[0], color.val[1], color.val[2], color.val[3], thickness); + + return; + } + + //javadoc: ellipse(img, box, color) + public static void ellipse(Mat img, RotatedRect box, Scalar color) + { + + ellipse_5(img.nativeObj, box.center.x, box.center.y, box.size.width, box.size.height, box.angle, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, vector_Point& pts) + // + + //javadoc: ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta, pts) + public static void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, MatOfPoint pts) + { + Mat pts_mat = pts; + ellipse2Poly_0(center.x, center.y, axes.width, axes.height, angle, arcStart, arcEnd, delta, pts_mat.nativeObj); + + return; + } + + + // + // C++: void equalizeHist(Mat src, Mat& dst) + // + + //javadoc: equalizeHist(src, dst) + public static void equalizeHist(Mat src, Mat dst) + { + + equalizeHist_0(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void erode(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) + // + + //javadoc: erode(src, dst, kernel, anchor, iterations, borderType, borderValue) + public static void erode(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue) + { + + erode_0(src.nativeObj, dst.nativeObj, kernel.nativeObj, anchor.x, anchor.y, iterations, borderType, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); + + return; + } + + //javadoc: erode(src, dst, kernel, anchor, iterations) + public static void erode(Mat src, Mat dst, Mat kernel, Point anchor, int iterations) + { + + erode_1(src.nativeObj, dst.nativeObj, kernel.nativeObj, anchor.x, anchor.y, iterations); + + return; + } + + //javadoc: erode(src, dst, kernel) + public static void erode(Mat src, Mat dst, Mat kernel) + { + + erode_2(src.nativeObj, dst.nativeObj, kernel.nativeObj); + + return; + } + + + // + // C++: void fillConvexPoly(Mat& img, vector_Point points, Scalar color, int lineType = LINE_8, int shift = 0) + // + + //javadoc: fillConvexPoly(img, points, color, lineType, shift) + public static void fillConvexPoly(Mat img, MatOfPoint points, Scalar color, int lineType, int shift) + { + Mat points_mat = points; + fillConvexPoly_0(img.nativeObj, points_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3], lineType, shift); + + return; + } + + //javadoc: fillConvexPoly(img, points, color) + public static void fillConvexPoly(Mat img, MatOfPoint points, Scalar color) + { + Mat points_mat = points; + fillConvexPoly_1(img.nativeObj, points_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void fillPoly(Mat& img, vector_vector_Point pts, Scalar color, int lineType = LINE_8, int shift = 0, Point offset = Point()) + // + + //javadoc: fillPoly(img, pts, color, lineType, shift, offset) + public static void fillPoly(Mat img, List pts, Scalar color, int lineType, int shift, Point offset) + { + List pts_tmplm = new ArrayList((pts != null) ? pts.size() : 0); + Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); + fillPoly_0(img.nativeObj, pts_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3], lineType, shift, offset.x, offset.y); + + return; + } + + //javadoc: fillPoly(img, pts, color) + public static void fillPoly(Mat img, List pts, Scalar color) + { + List pts_tmplm = new ArrayList((pts != null) ? pts.size() : 0); + Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); + fillPoly_1(img.nativeObj, pts_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void filter2D(Mat src, Mat& dst, int ddepth, Mat kernel, Point anchor = Point(-1,-1), double delta = 0, int borderType = BORDER_DEFAULT) + // + + //javadoc: filter2D(src, dst, ddepth, kernel, anchor, delta, borderType) + public static void filter2D(Mat src, Mat dst, int ddepth, Mat kernel, Point anchor, double delta, int borderType) + { + + filter2D_0(src.nativeObj, dst.nativeObj, ddepth, kernel.nativeObj, anchor.x, anchor.y, delta, borderType); + + return; + } + + //javadoc: filter2D(src, dst, ddepth, kernel, anchor, delta) + public static void filter2D(Mat src, Mat dst, int ddepth, Mat kernel, Point anchor, double delta) + { + + filter2D_1(src.nativeObj, dst.nativeObj, ddepth, kernel.nativeObj, anchor.x, anchor.y, delta); + + return; + } + + //javadoc: filter2D(src, dst, ddepth, kernel) + public static void filter2D(Mat src, Mat dst, int ddepth, Mat kernel) + { + + filter2D_2(src.nativeObj, dst.nativeObj, ddepth, kernel.nativeObj); + + return; + } + + + // + // C++: void findContours(Mat& image, vector_vector_Point& contours, Mat& hierarchy, int mode, int method, Point offset = Point()) + // + + //javadoc: findContours(image, contours, hierarchy, mode, method, offset) + public static void findContours(Mat image, List contours, Mat hierarchy, int mode, int method, Point offset) + { + Mat contours_mat = new Mat(); + findContours_0(image.nativeObj, contours_mat.nativeObj, hierarchy.nativeObj, mode, method, offset.x, offset.y); + Converters.Mat_to_vector_vector_Point(contours_mat, contours); + contours_mat.release(); + return; + } + + //javadoc: findContours(image, contours, hierarchy, mode, method) + public static void findContours(Mat image, List contours, Mat hierarchy, int mode, int method) + { + Mat contours_mat = new Mat(); + findContours_1(image.nativeObj, contours_mat.nativeObj, hierarchy.nativeObj, mode, method); + Converters.Mat_to_vector_vector_Point(contours_mat, contours); + contours_mat.release(); + return; + } + + + // + // C++: void fitLine(Mat points, Mat& line, int distType, double param, double reps, double aeps) + // + + //javadoc: fitLine(points, line, distType, param, reps, aeps) + public static void fitLine(Mat points, Mat line, int distType, double param, double reps, double aeps) + { + + fitLine_0(points.nativeObj, line.nativeObj, distType, param, reps, aeps); + + return; + } + + + // + // C++: void getDerivKernels(Mat& kx, Mat& ky, int dx, int dy, int ksize, bool normalize = false, int ktype = CV_32F) + // + + //javadoc: getDerivKernels(kx, ky, dx, dy, ksize, normalize, ktype) + public static void getDerivKernels(Mat kx, Mat ky, int dx, int dy, int ksize, boolean normalize, int ktype) + { + + getDerivKernels_0(kx.nativeObj, ky.nativeObj, dx, dy, ksize, normalize, ktype); + + return; + } + + //javadoc: getDerivKernels(kx, ky, dx, dy, ksize) + public static void getDerivKernels(Mat kx, Mat ky, int dx, int dy, int ksize) + { + + getDerivKernels_1(kx.nativeObj, ky.nativeObj, dx, dy, ksize); + + return; + } + + + // + // C++: void getRectSubPix(Mat image, Size patchSize, Point2f center, Mat& patch, int patchType = -1) + // + + //javadoc: getRectSubPix(image, patchSize, center, patch, patchType) + public static void getRectSubPix(Mat image, Size patchSize, Point center, Mat patch, int patchType) + { + + getRectSubPix_0(image.nativeObj, patchSize.width, patchSize.height, center.x, center.y, patch.nativeObj, patchType); + + return; + } + + //javadoc: getRectSubPix(image, patchSize, center, patch) + public static void getRectSubPix(Mat image, Size patchSize, Point center, Mat patch) + { + + getRectSubPix_1(image.nativeObj, patchSize.width, patchSize.height, center.x, center.y, patch.nativeObj); + + return; + } + + + // + // C++: void goodFeaturesToTrack(Mat image, vector_Point& corners, int maxCorners, double qualityLevel, double minDistance, Mat mask = Mat(), int blockSize = 3, bool useHarrisDetector = false, double k = 0.04) + // + + //javadoc: goodFeaturesToTrack(image, corners, maxCorners, qualityLevel, minDistance, mask, blockSize, useHarrisDetector, k) + public static void goodFeaturesToTrack(Mat image, MatOfPoint corners, int maxCorners, double qualityLevel, double minDistance, Mat mask, int blockSize, boolean useHarrisDetector, double k) + { + Mat corners_mat = corners; + goodFeaturesToTrack_0(image.nativeObj, corners_mat.nativeObj, maxCorners, qualityLevel, minDistance, mask.nativeObj, blockSize, useHarrisDetector, k); + + return; + } + + //javadoc: goodFeaturesToTrack(image, corners, maxCorners, qualityLevel, minDistance) + public static void goodFeaturesToTrack(Mat image, MatOfPoint corners, int maxCorners, double qualityLevel, double minDistance) + { + Mat corners_mat = corners; + goodFeaturesToTrack_1(image.nativeObj, corners_mat.nativeObj, maxCorners, qualityLevel, minDistance); + + return; + } + + + // + // C++: void grabCut(Mat img, Mat& mask, Rect rect, Mat& bgdModel, Mat& fgdModel, int iterCount, int mode = GC_EVAL) + // + + //javadoc: grabCut(img, mask, rect, bgdModel, fgdModel, iterCount, mode) + public static void grabCut(Mat img, Mat mask, Rect rect, Mat bgdModel, Mat fgdModel, int iterCount, int mode) + { + + grabCut_0(img.nativeObj, mask.nativeObj, rect.x, rect.y, rect.width, rect.height, bgdModel.nativeObj, fgdModel.nativeObj, iterCount, mode); + + return; + } + + //javadoc: grabCut(img, mask, rect, bgdModel, fgdModel, iterCount) + public static void grabCut(Mat img, Mat mask, Rect rect, Mat bgdModel, Mat fgdModel, int iterCount) + { + + grabCut_1(img.nativeObj, mask.nativeObj, rect.x, rect.y, rect.width, rect.height, bgdModel.nativeObj, fgdModel.nativeObj, iterCount); + + return; + } + + + // + // C++: void initUndistortRectifyMap(Mat cameraMatrix, Mat distCoeffs, Mat R, Mat newCameraMatrix, Size size, int m1type, Mat& map1, Mat& map2) + // + + //javadoc: initUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, size, m1type, map1, map2) + public static void initUndistortRectifyMap(Mat cameraMatrix, Mat distCoeffs, Mat R, Mat newCameraMatrix, Size size, int m1type, Mat map1, Mat map2) + { + + initUndistortRectifyMap_0(cameraMatrix.nativeObj, distCoeffs.nativeObj, R.nativeObj, newCameraMatrix.nativeObj, size.width, size.height, m1type, map1.nativeObj, map2.nativeObj); + + return; + } + + + // + // C++: void integral(Mat src, Mat& sum, Mat& sqsum, Mat& tilted, int sdepth = -1, int sqdepth = -1) + // + + //javadoc: integral(src, sum, sqsum, tilted, sdepth, sqdepth) + public static void integral3(Mat src, Mat sum, Mat sqsum, Mat tilted, int sdepth, int sqdepth) + { + + integral3_0(src.nativeObj, sum.nativeObj, sqsum.nativeObj, tilted.nativeObj, sdepth, sqdepth); + + return; + } + + //javadoc: integral(src, sum, sqsum, tilted) + public static void integral3(Mat src, Mat sum, Mat sqsum, Mat tilted) + { + + integral3_1(src.nativeObj, sum.nativeObj, sqsum.nativeObj, tilted.nativeObj); + + return; + } + + + // + // C++: void integral(Mat src, Mat& sum, Mat& sqsum, int sdepth = -1, int sqdepth = -1) + // + + //javadoc: integral(src, sum, sqsum, sdepth, sqdepth) + public static void integral2(Mat src, Mat sum, Mat sqsum, int sdepth, int sqdepth) + { + + integral2_0(src.nativeObj, sum.nativeObj, sqsum.nativeObj, sdepth, sqdepth); + + return; + } + + //javadoc: integral(src, sum, sqsum) + public static void integral2(Mat src, Mat sum, Mat sqsum) + { + + integral2_1(src.nativeObj, sum.nativeObj, sqsum.nativeObj); + + return; + } + + + // + // C++: void integral(Mat src, Mat& sum, int sdepth = -1) + // + + //javadoc: integral(src, sum, sdepth) + public static void integral(Mat src, Mat sum, int sdepth) + { + + integral_0(src.nativeObj, sum.nativeObj, sdepth); + + return; + } + + //javadoc: integral(src, sum) + public static void integral(Mat src, Mat sum) + { + + integral_1(src.nativeObj, sum.nativeObj); + + return; + } + + + // + // C++: void invertAffineTransform(Mat M, Mat& iM) + // + + //javadoc: invertAffineTransform(M, iM) + public static void invertAffineTransform(Mat M, Mat iM) + { + + invertAffineTransform_0(M.nativeObj, iM.nativeObj); + + return; + } + + + // + // C++: void line(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + // + + //javadoc: line(img, pt1, pt2, color, thickness, lineType, shift) + public static void line(Mat img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift) + { + + line_0(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); + + return; + } + + //javadoc: line(img, pt1, pt2, color, thickness) + public static void line(Mat img, Point pt1, Point pt2, Scalar color, int thickness) + { + + line_1(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness); + + return; + } + + //javadoc: line(img, pt1, pt2, color) + public static void line(Mat img, Point pt1, Point pt2, Scalar color) + { + + line_2(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void linearPolar(Mat src, Mat& dst, Point2f center, double maxRadius, int flags) + // + + //javadoc: linearPolar(src, dst, center, maxRadius, flags) + public static void linearPolar(Mat src, Mat dst, Point center, double maxRadius, int flags) + { + + linearPolar_0(src.nativeObj, dst.nativeObj, center.x, center.y, maxRadius, flags); + + return; + } + + + // + // C++: void logPolar(Mat src, Mat& dst, Point2f center, double M, int flags) + // + + //javadoc: logPolar(src, dst, center, M, flags) + public static void logPolar(Mat src, Mat dst, Point center, double M, int flags) + { + + logPolar_0(src.nativeObj, dst.nativeObj, center.x, center.y, M, flags); + + return; + } + + + // + // C++: void matchTemplate(Mat image, Mat templ, Mat& result, int method, Mat mask = Mat()) + // + + //javadoc: matchTemplate(image, templ, result, method, mask) + public static void matchTemplate(Mat image, Mat templ, Mat result, int method, Mat mask) + { + + matchTemplate_0(image.nativeObj, templ.nativeObj, result.nativeObj, method, mask.nativeObj); + + return; + } + + //javadoc: matchTemplate(image, templ, result, method) + public static void matchTemplate(Mat image, Mat templ, Mat result, int method) + { + + matchTemplate_1(image.nativeObj, templ.nativeObj, result.nativeObj, method); + + return; + } + + + // + // C++: void medianBlur(Mat src, Mat& dst, int ksize) + // + + //javadoc: medianBlur(src, dst, ksize) + public static void medianBlur(Mat src, Mat dst, int ksize) + { + + medianBlur_0(src.nativeObj, dst.nativeObj, ksize); + + return; + } + + + // + // C++: void minEnclosingCircle(vector_Point2f points, Point2f& center, float& radius) + // + + //javadoc: minEnclosingCircle(points, center, radius) + public static void minEnclosingCircle(MatOfPoint2f points, Point center, float[] radius) + { + Mat points_mat = points; + double[] center_out = new double[2]; + double[] radius_out = new double[1]; + minEnclosingCircle_0(points_mat.nativeObj, center_out, radius_out); + if(center!=null){ center.x = center_out[0]; center.y = center_out[1]; } + if(radius!=null) radius[0] = (float)radius_out[0]; + return; + } + + + // + // C++: void morphologyEx(Mat src, Mat& dst, int op, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) + // + + //javadoc: morphologyEx(src, dst, op, kernel, anchor, iterations, borderType, borderValue) + public static void morphologyEx(Mat src, Mat dst, int op, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue) + { + + morphologyEx_0(src.nativeObj, dst.nativeObj, op, kernel.nativeObj, anchor.x, anchor.y, iterations, borderType, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); + + return; + } + + //javadoc: morphologyEx(src, dst, op, kernel, anchor, iterations) + public static void morphologyEx(Mat src, Mat dst, int op, Mat kernel, Point anchor, int iterations) + { + + morphologyEx_1(src.nativeObj, dst.nativeObj, op, kernel.nativeObj, anchor.x, anchor.y, iterations); + + return; + } + + //javadoc: morphologyEx(src, dst, op, kernel) + public static void morphologyEx(Mat src, Mat dst, int op, Mat kernel) + { + + morphologyEx_2(src.nativeObj, dst.nativeObj, op, kernel.nativeObj); + + return; + } + + + // + // C++: void polylines(Mat& img, vector_vector_Point pts, bool isClosed, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + // + + //javadoc: polylines(img, pts, isClosed, color, thickness, lineType, shift) + public static void polylines(Mat img, List pts, boolean isClosed, Scalar color, int thickness, int lineType, int shift) + { + List pts_tmplm = new ArrayList((pts != null) ? pts.size() : 0); + Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); + polylines_0(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); + + return; + } + + //javadoc: polylines(img, pts, isClosed, color, thickness) + public static void polylines(Mat img, List pts, boolean isClosed, Scalar color, int thickness) + { + List pts_tmplm = new ArrayList((pts != null) ? pts.size() : 0); + Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); + polylines_1(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3], thickness); + + return; + } + + //javadoc: polylines(img, pts, isClosed, color) + public static void polylines(Mat img, List pts, boolean isClosed, Scalar color) + { + List pts_tmplm = new ArrayList((pts != null) ? pts.size() : 0); + Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); + polylines_2(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void preCornerDetect(Mat src, Mat& dst, int ksize, int borderType = BORDER_DEFAULT) + // + + //javadoc: preCornerDetect(src, dst, ksize, borderType) + public static void preCornerDetect(Mat src, Mat dst, int ksize, int borderType) + { + + preCornerDetect_0(src.nativeObj, dst.nativeObj, ksize, borderType); + + return; + } + + //javadoc: preCornerDetect(src, dst, ksize) + public static void preCornerDetect(Mat src, Mat dst, int ksize) + { + + preCornerDetect_1(src.nativeObj, dst.nativeObj, ksize); + + return; + } + + + // + // C++: void putText(Mat& img, String text, Point org, int fontFace, double fontScale, Scalar color, int thickness = 1, int lineType = LINE_8, bool bottomLeftOrigin = false) + // + + //javadoc: putText(img, text, org, fontFace, fontScale, color, thickness, lineType, bottomLeftOrigin) + public static void putText(Mat img, String text, Point org, int fontFace, double fontScale, Scalar color, int thickness, int lineType, boolean bottomLeftOrigin) + { + + putText_0(img.nativeObj, text, org.x, org.y, fontFace, fontScale, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, bottomLeftOrigin); + + return; + } + + //javadoc: putText(img, text, org, fontFace, fontScale, color, thickness) + public static void putText(Mat img, String text, Point org, int fontFace, double fontScale, Scalar color, int thickness) + { + + putText_1(img.nativeObj, text, org.x, org.y, fontFace, fontScale, color.val[0], color.val[1], color.val[2], color.val[3], thickness); + + return; + } + + //javadoc: putText(img, text, org, fontFace, fontScale, color) + public static void putText(Mat img, String text, Point org, int fontFace, double fontScale, Scalar color) + { + + putText_2(img.nativeObj, text, org.x, org.y, fontFace, fontScale, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void pyrDown(Mat src, Mat& dst, Size dstsize = Size(), int borderType = BORDER_DEFAULT) + // + + //javadoc: pyrDown(src, dst, dstsize, borderType) + public static void pyrDown(Mat src, Mat dst, Size dstsize, int borderType) + { + + pyrDown_0(src.nativeObj, dst.nativeObj, dstsize.width, dstsize.height, borderType); + + return; + } + + //javadoc: pyrDown(src, dst, dstsize) + public static void pyrDown(Mat src, Mat dst, Size dstsize) + { + + pyrDown_1(src.nativeObj, dst.nativeObj, dstsize.width, dstsize.height); + + return; + } + + //javadoc: pyrDown(src, dst) + public static void pyrDown(Mat src, Mat dst) + { + + pyrDown_2(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void pyrMeanShiftFiltering(Mat src, Mat& dst, double sp, double sr, int maxLevel = 1, TermCriteria termcrit = TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1)) + // + + //javadoc: pyrMeanShiftFiltering(src, dst, sp, sr, maxLevel, termcrit) + public static void pyrMeanShiftFiltering(Mat src, Mat dst, double sp, double sr, int maxLevel, TermCriteria termcrit) + { + + pyrMeanShiftFiltering_0(src.nativeObj, dst.nativeObj, sp, sr, maxLevel, termcrit.type, termcrit.maxCount, termcrit.epsilon); + + return; + } + + //javadoc: pyrMeanShiftFiltering(src, dst, sp, sr) + public static void pyrMeanShiftFiltering(Mat src, Mat dst, double sp, double sr) + { + + pyrMeanShiftFiltering_1(src.nativeObj, dst.nativeObj, sp, sr); + + return; + } + + + // + // C++: void pyrUp(Mat src, Mat& dst, Size dstsize = Size(), int borderType = BORDER_DEFAULT) + // + + //javadoc: pyrUp(src, dst, dstsize, borderType) + public static void pyrUp(Mat src, Mat dst, Size dstsize, int borderType) + { + + pyrUp_0(src.nativeObj, dst.nativeObj, dstsize.width, dstsize.height, borderType); + + return; + } + + //javadoc: pyrUp(src, dst, dstsize) + public static void pyrUp(Mat src, Mat dst, Size dstsize) + { + + pyrUp_1(src.nativeObj, dst.nativeObj, dstsize.width, dstsize.height); + + return; + } + + //javadoc: pyrUp(src, dst) + public static void pyrUp(Mat src, Mat dst) + { + + pyrUp_2(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void rectangle(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + // + + //javadoc: rectangle(img, pt1, pt2, color, thickness, lineType, shift) + public static void rectangle(Mat img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift) + { + + rectangle_0(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); + + return; + } + + //javadoc: rectangle(img, pt1, pt2, color, thickness) + public static void rectangle(Mat img, Point pt1, Point pt2, Scalar color, int thickness) + { + + rectangle_1(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness); + + return; + } + + //javadoc: rectangle(img, pt1, pt2, color) + public static void rectangle(Mat img, Point pt1, Point pt2, Scalar color) + { + + rectangle_2(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3]); + + return; + } + + + // + // C++: void remap(Mat src, Mat& dst, Mat map1, Mat map2, int interpolation, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) + // + + //javadoc: remap(src, dst, map1, map2, interpolation, borderMode, borderValue) + public static void remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation, int borderMode, Scalar borderValue) + { + + remap_0(src.nativeObj, dst.nativeObj, map1.nativeObj, map2.nativeObj, interpolation, borderMode, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); + + return; + } + + //javadoc: remap(src, dst, map1, map2, interpolation) + public static void remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation) + { + + remap_1(src.nativeObj, dst.nativeObj, map1.nativeObj, map2.nativeObj, interpolation); + + return; + } + + + // + // C++: void resize(Mat src, Mat& dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR) + // + + //javadoc: resize(src, dst, dsize, fx, fy, interpolation) + public static void resize(Mat src, Mat dst, Size dsize, double fx, double fy, int interpolation) + { + + resize_0(src.nativeObj, dst.nativeObj, dsize.width, dsize.height, fx, fy, interpolation); + + return; + } + + //javadoc: resize(src, dst, dsize) + public static void resize(Mat src, Mat dst, Size dsize) + { + + resize_1(src.nativeObj, dst.nativeObj, dsize.width, dsize.height); + + return; + } + + + // + // C++: void sepFilter2D(Mat src, Mat& dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor = Point(-1,-1), double delta = 0, int borderType = BORDER_DEFAULT) + // + + //javadoc: sepFilter2D(src, dst, ddepth, kernelX, kernelY, anchor, delta, borderType) + public static void sepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor, double delta, int borderType) + { + + sepFilter2D_0(src.nativeObj, dst.nativeObj, ddepth, kernelX.nativeObj, kernelY.nativeObj, anchor.x, anchor.y, delta, borderType); + + return; + } + + //javadoc: sepFilter2D(src, dst, ddepth, kernelX, kernelY, anchor, delta) + public static void sepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor, double delta) + { + + sepFilter2D_1(src.nativeObj, dst.nativeObj, ddepth, kernelX.nativeObj, kernelY.nativeObj, anchor.x, anchor.y, delta); + + return; + } + + //javadoc: sepFilter2D(src, dst, ddepth, kernelX, kernelY) + public static void sepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY) + { + + sepFilter2D_2(src.nativeObj, dst.nativeObj, ddepth, kernelX.nativeObj, kernelY.nativeObj); + + return; + } + + + // + // C++: void spatialGradient(Mat src, Mat& dx, Mat& dy, int ksize = 3, int borderType = BORDER_DEFAULT) + // + + //javadoc: spatialGradient(src, dx, dy, ksize, borderType) + public static void spatialGradient(Mat src, Mat dx, Mat dy, int ksize, int borderType) + { + + spatialGradient_0(src.nativeObj, dx.nativeObj, dy.nativeObj, ksize, borderType); + + return; + } + + //javadoc: spatialGradient(src, dx, dy, ksize) + public static void spatialGradient(Mat src, Mat dx, Mat dy, int ksize) + { + + spatialGradient_1(src.nativeObj, dx.nativeObj, dy.nativeObj, ksize); + + return; + } + + //javadoc: spatialGradient(src, dx, dy) + public static void spatialGradient(Mat src, Mat dx, Mat dy) + { + + spatialGradient_2(src.nativeObj, dx.nativeObj, dy.nativeObj); + + return; + } + + + // + // C++: void sqrBoxFilter(Mat _src, Mat& _dst, int ddepth, Size ksize, Point anchor = Point(-1, -1), bool normalize = true, int borderType = BORDER_DEFAULT) + // + + //javadoc: sqrBoxFilter(_src, _dst, ddepth, ksize, anchor, normalize, borderType) + public static void sqrBoxFilter(Mat _src, Mat _dst, int ddepth, Size ksize, Point anchor, boolean normalize, int borderType) + { + + sqrBoxFilter_0(_src.nativeObj, _dst.nativeObj, ddepth, ksize.width, ksize.height, anchor.x, anchor.y, normalize, borderType); + + return; + } + + //javadoc: sqrBoxFilter(_src, _dst, ddepth, ksize, anchor, normalize) + public static void sqrBoxFilter(Mat _src, Mat _dst, int ddepth, Size ksize, Point anchor, boolean normalize) + { + + sqrBoxFilter_1(_src.nativeObj, _dst.nativeObj, ddepth, ksize.width, ksize.height, anchor.x, anchor.y, normalize); + + return; + } + + //javadoc: sqrBoxFilter(_src, _dst, ddepth, ksize) + public static void sqrBoxFilter(Mat _src, Mat _dst, int ddepth, Size ksize) + { + + sqrBoxFilter_2(_src.nativeObj, _dst.nativeObj, ddepth, ksize.width, ksize.height); + + return; + } + + + // + // C++: void undistort(Mat src, Mat& dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix = Mat()) + // + + //javadoc: undistort(src, dst, cameraMatrix, distCoeffs, newCameraMatrix) + public static void undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix) + { + + undistort_0(src.nativeObj, dst.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, newCameraMatrix.nativeObj); + + return; + } + + //javadoc: undistort(src, dst, cameraMatrix, distCoeffs) + public static void undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs) + { + + undistort_1(src.nativeObj, dst.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj); + + return; + } + + + // + // C++: void undistortPoints(vector_Point2f src, vector_Point2f& dst, Mat cameraMatrix, Mat distCoeffs, Mat R = Mat(), Mat P = Mat()) + // + + //javadoc: undistortPoints(src, dst, cameraMatrix, distCoeffs, R, P) + public static void undistortPoints(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R, Mat P) + { + Mat src_mat = src; + Mat dst_mat = dst; + undistortPoints_0(src_mat.nativeObj, dst_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, R.nativeObj, P.nativeObj); + + return; + } + + //javadoc: undistortPoints(src, dst, cameraMatrix, distCoeffs) + public static void undistortPoints(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs) + { + Mat src_mat = src; + Mat dst_mat = dst; + undistortPoints_1(src_mat.nativeObj, dst_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj); + + return; + } + + + // + // C++: void warpAffine(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) + // + + //javadoc: warpAffine(src, dst, M, dsize, flags, borderMode, borderValue) + public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize, int flags, int borderMode, Scalar borderValue) + { + + warpAffine_0(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags, borderMode, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); + + return; + } + + //javadoc: warpAffine(src, dst, M, dsize, flags) + public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize, int flags) + { + + warpAffine_1(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags); + + return; + } + + //javadoc: warpAffine(src, dst, M, dsize) + public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize) + { + + warpAffine_2(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height); + + return; + } + + + // + // C++: void warpPerspective(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) + // + + //javadoc: warpPerspective(src, dst, M, dsize, flags, borderMode, borderValue) + public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize, int flags, int borderMode, Scalar borderValue) + { + + warpPerspective_0(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags, borderMode, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); + + return; + } + + //javadoc: warpPerspective(src, dst, M, dsize, flags) + public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize, int flags) + { + + warpPerspective_1(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags); + + return; + } + + //javadoc: warpPerspective(src, dst, M, dsize) + public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize) + { + + warpPerspective_2(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height); + + return; + } + + + // + // C++: void watershed(Mat image, Mat& markers) + // + + //javadoc: watershed(image, markers) + public static void watershed(Mat image, Mat markers) + { + + watershed_0(image.nativeObj, markers.nativeObj); + + return; + } + + + // C++: Size getTextSize(const String& text, int fontFace, double fontScale, int thickness, int* baseLine); + //javadoc:getTextSize(text, fontFace, fontScale, thickness, baseLine) + public static Size getTextSize(String text, int fontFace, double fontScale, int thickness, int[] baseLine) { + if(baseLine != null && baseLine.length != 1) + throw new java.lang.IllegalArgumentException("'baseLine' must be 'int[1]' or 'null'."); + Size retVal = new Size(n_getTextSize(text, fontFace, fontScale, thickness, baseLine)); + return retVal; + } + + + + // C++: Mat getAffineTransform(vector_Point2f src, vector_Point2f dst) + private static native long getAffineTransform_0(long src_mat_nativeObj, long dst_mat_nativeObj); + + // C++: Mat getDefaultNewCameraMatrix(Mat cameraMatrix, Size imgsize = Size(), bool centerPrincipalPoint = false) + private static native long getDefaultNewCameraMatrix_0(long cameraMatrix_nativeObj, double imgsize_width, double imgsize_height, boolean centerPrincipalPoint); + private static native long getDefaultNewCameraMatrix_1(long cameraMatrix_nativeObj); + + // C++: Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi = CV_PI*0.5, int ktype = CV_64F) + private static native long getGaborKernel_0(double ksize_width, double ksize_height, double sigma, double theta, double lambd, double gamma, double psi, int ktype); + private static native long getGaborKernel_1(double ksize_width, double ksize_height, double sigma, double theta, double lambd, double gamma); + + // C++: Mat getGaussianKernel(int ksize, double sigma, int ktype = CV_64F) + private static native long getGaussianKernel_0(int ksize, double sigma, int ktype); + private static native long getGaussianKernel_1(int ksize, double sigma); + + // C++: Mat getPerspectiveTransform(Mat src, Mat dst) + private static native long getPerspectiveTransform_0(long src_nativeObj, long dst_nativeObj); + + // C++: Mat getRotationMatrix2D(Point2f center, double angle, double scale) + private static native long getRotationMatrix2D_0(double center_x, double center_y, double angle, double scale); + + // C++: Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1)) + private static native long getStructuringElement_0(int shape, double ksize_width, double ksize_height, double anchor_x, double anchor_y); + private static native long getStructuringElement_1(int shape, double ksize_width, double ksize_height); + + // C++: Moments moments(Mat array, bool binaryImage = false) + private static native double[] moments_0(long array_nativeObj, boolean binaryImage); + private static native double[] moments_1(long array_nativeObj); + + // C++: Point2d phaseCorrelate(Mat src1, Mat src2, Mat window = Mat(), double* response = 0) + private static native double[] phaseCorrelate_0(long src1_nativeObj, long src2_nativeObj, long window_nativeObj, double[] response_out); + private static native double[] phaseCorrelate_1(long src1_nativeObj, long src2_nativeObj); + + // C++: Ptr_CLAHE createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8)) + private static native long createCLAHE_0(double clipLimit, double tileGridSize_width, double tileGridSize_height); + private static native long createCLAHE_1(); + + // C++: Ptr_LineSegmentDetector createLineSegmentDetector(int _refine = LSD_REFINE_STD, double _scale = 0.8, double _sigma_scale = 0.6, double _quant = 2.0, double _ang_th = 22.5, double _log_eps = 0, double _density_th = 0.7, int _n_bins = 1024) + private static native long createLineSegmentDetector_0(int _refine, double _scale, double _sigma_scale, double _quant, double _ang_th, double _log_eps, double _density_th, int _n_bins); + private static native long createLineSegmentDetector_1(); + + // C++: Rect boundingRect(vector_Point points) + private static native double[] boundingRect_0(long points_mat_nativeObj); + + // C++: RotatedRect fitEllipse(vector_Point2f points) + private static native double[] fitEllipse_0(long points_mat_nativeObj); + + // C++: RotatedRect minAreaRect(vector_Point2f points) + private static native double[] minAreaRect_0(long points_mat_nativeObj); + + // C++: bool clipLine(Rect imgRect, Point& pt1, Point& pt2) + private static native boolean clipLine_0(int imgRect_x, int imgRect_y, int imgRect_width, int imgRect_height, double pt1_x, double pt1_y, double[] pt1_out, double pt2_x, double pt2_y, double[] pt2_out); + + // C++: bool isContourConvex(vector_Point contour) + private static native boolean isContourConvex_0(long contour_mat_nativeObj); + + // C++: double arcLength(vector_Point2f curve, bool closed) + private static native double arcLength_0(long curve_mat_nativeObj, boolean closed); + + // C++: double compareHist(Mat H1, Mat H2, int method) + private static native double compareHist_0(long H1_nativeObj, long H2_nativeObj, int method); + + // C++: double contourArea(Mat contour, bool oriented = false) + private static native double contourArea_0(long contour_nativeObj, boolean oriented); + private static native double contourArea_1(long contour_nativeObj); + + // C++: double matchShapes(Mat contour1, Mat contour2, int method, double parameter) + private static native double matchShapes_0(long contour1_nativeObj, long contour2_nativeObj, int method, double parameter); + + // C++: double minEnclosingTriangle(Mat points, Mat& triangle) + private static native double minEnclosingTriangle_0(long points_nativeObj, long triangle_nativeObj); + + // C++: double pointPolygonTest(vector_Point2f contour, Point2f pt, bool measureDist) + private static native double pointPolygonTest_0(long contour_mat_nativeObj, double pt_x, double pt_y, boolean measureDist); + + // C++: double threshold(Mat src, Mat& dst, double thresh, double maxval, int type) + private static native double threshold_0(long src_nativeObj, long dst_nativeObj, double thresh, double maxval, int type); + + // C++: float initWideAngleProjMap(Mat cameraMatrix, Mat distCoeffs, Size imageSize, int destImageWidth, int m1type, Mat& map1, Mat& map2, int projType = PROJ_SPHERICAL_EQRECT, double alpha = 0) + private static native float initWideAngleProjMap_0(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, double imageSize_width, double imageSize_height, int destImageWidth, int m1type, long map1_nativeObj, long map2_nativeObj, int projType, double alpha); + private static native float initWideAngleProjMap_1(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, double imageSize_width, double imageSize_height, int destImageWidth, int m1type, long map1_nativeObj, long map2_nativeObj); + + // C++: float intersectConvexConvex(Mat _p1, Mat _p2, Mat& _p12, bool handleNested = true) + private static native float intersectConvexConvex_0(long _p1_nativeObj, long _p2_nativeObj, long _p12_nativeObj, boolean handleNested); + private static native float intersectConvexConvex_1(long _p1_nativeObj, long _p2_nativeObj, long _p12_nativeObj); + + // C++: int connectedComponents(Mat image, Mat& labels, int connectivity = 8, int ltype = CV_32S) + private static native int connectedComponents_0(long image_nativeObj, long labels_nativeObj, int connectivity, int ltype); + private static native int connectedComponents_1(long image_nativeObj, long labels_nativeObj); + + // C++: int connectedComponentsWithStats(Mat image, Mat& labels, Mat& stats, Mat& centroids, int connectivity = 8, int ltype = CV_32S) + private static native int connectedComponentsWithStats_0(long image_nativeObj, long labels_nativeObj, long stats_nativeObj, long centroids_nativeObj, int connectivity, int ltype); + private static native int connectedComponentsWithStats_1(long image_nativeObj, long labels_nativeObj, long stats_nativeObj, long centroids_nativeObj); + + // C++: int floodFill(Mat& image, Mat& mask, Point seedPoint, Scalar newVal, Rect* rect = 0, Scalar loDiff = Scalar(), Scalar upDiff = Scalar(), int flags = 4) + private static native int floodFill_0(long image_nativeObj, long mask_nativeObj, double seedPoint_x, double seedPoint_y, double newVal_val0, double newVal_val1, double newVal_val2, double newVal_val3, double[] rect_out, double loDiff_val0, double loDiff_val1, double loDiff_val2, double loDiff_val3, double upDiff_val0, double upDiff_val1, double upDiff_val2, double upDiff_val3, int flags); + private static native int floodFill_1(long image_nativeObj, long mask_nativeObj, double seedPoint_x, double seedPoint_y, double newVal_val0, double newVal_val1, double newVal_val2, double newVal_val3); + + // C++: int rotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, Mat& intersectingRegion) + private static native int rotatedRectangleIntersection_0(double rect1_center_x, double rect1_center_y, double rect1_size_width, double rect1_size_height, double rect1_angle, double rect2_center_x, double rect2_center_y, double rect2_size_width, double rect2_size_height, double rect2_angle, long intersectingRegion_nativeObj); + + // C++: void Canny(Mat image, Mat& edges, double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false) + private static native void Canny_0(long image_nativeObj, long edges_nativeObj, double threshold1, double threshold2, int apertureSize, boolean L2gradient); + private static native void Canny_1(long image_nativeObj, long edges_nativeObj, double threshold1, double threshold2); + + // C++: void GaussianBlur(Mat src, Mat& dst, Size ksize, double sigmaX, double sigmaY = 0, int borderType = BORDER_DEFAULT) + private static native void GaussianBlur_0(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double sigmaX, double sigmaY, int borderType); + private static native void GaussianBlur_1(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double sigmaX, double sigmaY); + private static native void GaussianBlur_2(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double sigmaX); + + // C++: void HoughCircles(Mat image, Mat& circles, int method, double dp, double minDist, double param1 = 100, double param2 = 100, int minRadius = 0, int maxRadius = 0) + private static native void HoughCircles_0(long image_nativeObj, long circles_nativeObj, int method, double dp, double minDist, double param1, double param2, int minRadius, int maxRadius); + private static native void HoughCircles_1(long image_nativeObj, long circles_nativeObj, int method, double dp, double minDist); + + // C++: void HoughLines(Mat image, Mat& lines, double rho, double theta, int threshold, double srn = 0, double stn = 0, double min_theta = 0, double max_theta = CV_PI) + private static native void HoughLines_0(long image_nativeObj, long lines_nativeObj, double rho, double theta, int threshold, double srn, double stn, double min_theta, double max_theta); + private static native void HoughLines_1(long image_nativeObj, long lines_nativeObj, double rho, double theta, int threshold); + + // C++: void HoughLinesP(Mat image, Mat& lines, double rho, double theta, int threshold, double minLineLength = 0, double maxLineGap = 0) + private static native void HoughLinesP_0(long image_nativeObj, long lines_nativeObj, double rho, double theta, int threshold, double minLineLength, double maxLineGap); + private static native void HoughLinesP_1(long image_nativeObj, long lines_nativeObj, double rho, double theta, int threshold); + + // C++: void HuMoments(Moments m, Mat& hu) + private static native void HuMoments_0(double m_m00, double m_m10, double m_m01, double m_m20, double m_m11, double m_m02, double m_m30, double m_m21, double m_m12, double m_m03, long hu_nativeObj); + + // C++: void Laplacian(Mat src, Mat& dst, int ddepth, int ksize = 1, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) + private static native void Laplacian_0(long src_nativeObj, long dst_nativeObj, int ddepth, int ksize, double scale, double delta, int borderType); + private static native void Laplacian_1(long src_nativeObj, long dst_nativeObj, int ddepth, int ksize, double scale, double delta); + private static native void Laplacian_2(long src_nativeObj, long dst_nativeObj, int ddepth); + + // C++: void Scharr(Mat src, Mat& dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) + private static native void Scharr_0(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy, double scale, double delta, int borderType); + private static native void Scharr_1(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy, double scale, double delta); + private static native void Scharr_2(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy); + + // C++: void Sobel(Mat src, Mat& dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) + private static native void Sobel_0(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType); + private static native void Sobel_1(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy, int ksize, double scale, double delta); + private static native void Sobel_2(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy); + + // C++: void accumulate(Mat src, Mat& dst, Mat mask = Mat()) + private static native void accumulate_0(long src_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void accumulate_1(long src_nativeObj, long dst_nativeObj); + + // C++: void accumulateProduct(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) + private static native void accumulateProduct_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void accumulateProduct_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); + + // C++: void accumulateSquare(Mat src, Mat& dst, Mat mask = Mat()) + private static native void accumulateSquare_0(long src_nativeObj, long dst_nativeObj, long mask_nativeObj); + private static native void accumulateSquare_1(long src_nativeObj, long dst_nativeObj); + + // C++: void accumulateWeighted(Mat src, Mat& dst, double alpha, Mat mask = Mat()) + private static native void accumulateWeighted_0(long src_nativeObj, long dst_nativeObj, double alpha, long mask_nativeObj); + private static native void accumulateWeighted_1(long src_nativeObj, long dst_nativeObj, double alpha); + + // C++: void adaptiveThreshold(Mat src, Mat& dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) + private static native void adaptiveThreshold_0(long src_nativeObj, long dst_nativeObj, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C); + + // C++: void applyColorMap(Mat src, Mat& dst, int colormap) + private static native void applyColorMap_0(long src_nativeObj, long dst_nativeObj, int colormap); + + // C++: void approxPolyDP(vector_Point2f curve, vector_Point2f& approxCurve, double epsilon, bool closed) + private static native void approxPolyDP_0(long curve_mat_nativeObj, long approxCurve_mat_nativeObj, double epsilon, boolean closed); + + // C++: void arrowedLine(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int line_type = 8, int shift = 0, double tipLength = 0.1) + private static native void arrowedLine_0(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int line_type, int shift, double tipLength); + private static native void arrowedLine_1(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void bilateralFilter(Mat src, Mat& dst, int d, double sigmaColor, double sigmaSpace, int borderType = BORDER_DEFAULT) + private static native void bilateralFilter_0(long src_nativeObj, long dst_nativeObj, int d, double sigmaColor, double sigmaSpace, int borderType); + private static native void bilateralFilter_1(long src_nativeObj, long dst_nativeObj, int d, double sigmaColor, double sigmaSpace); + + // C++: void blur(Mat src, Mat& dst, Size ksize, Point anchor = Point(-1,-1), int borderType = BORDER_DEFAULT) + private static native void blur_0(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double anchor_x, double anchor_y, int borderType); + private static native void blur_1(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double anchor_x, double anchor_y); + private static native void blur_2(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height); + + // C++: void boxFilter(Mat src, Mat& dst, int ddepth, Size ksize, Point anchor = Point(-1,-1), bool normalize = true, int borderType = BORDER_DEFAULT) + private static native void boxFilter_0(long src_nativeObj, long dst_nativeObj, int ddepth, double ksize_width, double ksize_height, double anchor_x, double anchor_y, boolean normalize, int borderType); + private static native void boxFilter_1(long src_nativeObj, long dst_nativeObj, int ddepth, double ksize_width, double ksize_height, double anchor_x, double anchor_y, boolean normalize); + private static native void boxFilter_2(long src_nativeObj, long dst_nativeObj, int ddepth, double ksize_width, double ksize_height); + + // C++: void boxPoints(RotatedRect box, Mat& points) + private static native void boxPoints_0(double box_center_x, double box_center_y, double box_size_width, double box_size_height, double box_angle, long points_nativeObj); + + // C++: void calcBackProject(vector_Mat images, vector_int channels, Mat hist, Mat& dst, vector_float ranges, double scale) + private static native void calcBackProject_0(long images_mat_nativeObj, long channels_mat_nativeObj, long hist_nativeObj, long dst_nativeObj, long ranges_mat_nativeObj, double scale); + + // C++: void calcHist(vector_Mat images, vector_int channels, Mat mask, Mat& hist, vector_int histSize, vector_float ranges, bool accumulate = false) + private static native void calcHist_0(long images_mat_nativeObj, long channels_mat_nativeObj, long mask_nativeObj, long hist_nativeObj, long histSize_mat_nativeObj, long ranges_mat_nativeObj, boolean accumulate); + private static native void calcHist_1(long images_mat_nativeObj, long channels_mat_nativeObj, long mask_nativeObj, long hist_nativeObj, long histSize_mat_nativeObj, long ranges_mat_nativeObj); + + // C++: void circle(Mat& img, Point center, int radius, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + private static native void circle_0(long img_nativeObj, double center_x, double center_y, int radius, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); + private static native void circle_1(long img_nativeObj, double center_x, double center_y, int radius, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); + private static native void circle_2(long img_nativeObj, double center_x, double center_y, int radius, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void convertMaps(Mat map1, Mat map2, Mat& dstmap1, Mat& dstmap2, int dstmap1type, bool nninterpolation = false) + private static native void convertMaps_0(long map1_nativeObj, long map2_nativeObj, long dstmap1_nativeObj, long dstmap2_nativeObj, int dstmap1type, boolean nninterpolation); + private static native void convertMaps_1(long map1_nativeObj, long map2_nativeObj, long dstmap1_nativeObj, long dstmap2_nativeObj, int dstmap1type); + + // C++: void convexHull(vector_Point points, vector_int& hull, bool clockwise = false, _hidden_ returnPoints = true) + private static native void convexHull_0(long points_mat_nativeObj, long hull_mat_nativeObj, boolean clockwise); + private static native void convexHull_1(long points_mat_nativeObj, long hull_mat_nativeObj); + + // C++: void convexityDefects(vector_Point contour, vector_int convexhull, vector_Vec4i& convexityDefects) + private static native void convexityDefects_0(long contour_mat_nativeObj, long convexhull_mat_nativeObj, long convexityDefects_mat_nativeObj); + + // C++: void cornerEigenValsAndVecs(Mat src, Mat& dst, int blockSize, int ksize, int borderType = BORDER_DEFAULT) + private static native void cornerEigenValsAndVecs_0(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize, int borderType); + private static native void cornerEigenValsAndVecs_1(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize); + + // C++: void cornerHarris(Mat src, Mat& dst, int blockSize, int ksize, double k, int borderType = BORDER_DEFAULT) + private static native void cornerHarris_0(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize, double k, int borderType); + private static native void cornerHarris_1(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize, double k); + + // C++: void cornerMinEigenVal(Mat src, Mat& dst, int blockSize, int ksize = 3, int borderType = BORDER_DEFAULT) + private static native void cornerMinEigenVal_0(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize, int borderType); + private static native void cornerMinEigenVal_1(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize); + private static native void cornerMinEigenVal_2(long src_nativeObj, long dst_nativeObj, int blockSize); + + // C++: void cornerSubPix(Mat image, vector_Point2f& corners, Size winSize, Size zeroZone, TermCriteria criteria) + private static native void cornerSubPix_0(long image_nativeObj, long corners_mat_nativeObj, double winSize_width, double winSize_height, double zeroZone_width, double zeroZone_height, int criteria_type, int criteria_maxCount, double criteria_epsilon); + + // C++: void createHanningWindow(Mat& dst, Size winSize, int type) + private static native void createHanningWindow_0(long dst_nativeObj, double winSize_width, double winSize_height, int type); + + // C++: void cvtColor(Mat src, Mat& dst, int code, int dstCn = 0) + private static native void cvtColor_0(long src_nativeObj, long dst_nativeObj, int code, int dstCn); + private static native void cvtColor_1(long src_nativeObj, long dst_nativeObj, int code); + + // C++: void demosaicing(Mat _src, Mat& _dst, int code, int dcn = 0) + private static native void demosaicing_0(long _src_nativeObj, long _dst_nativeObj, int code, int dcn); + private static native void demosaicing_1(long _src_nativeObj, long _dst_nativeObj, int code); + + // C++: void dilate(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) + private static native void dilate_0(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations, int borderType, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); + private static native void dilate_1(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations); + private static native void dilate_2(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj); + + // C++: void distanceTransform(Mat src, Mat& dst, Mat& labels, int distanceType, int maskSize, int labelType = DIST_LABEL_CCOMP) + private static native void distanceTransformWithLabels_0(long src_nativeObj, long dst_nativeObj, long labels_nativeObj, int distanceType, int maskSize, int labelType); + private static native void distanceTransformWithLabels_1(long src_nativeObj, long dst_nativeObj, long labels_nativeObj, int distanceType, int maskSize); + + // C++: void distanceTransform(Mat src, Mat& dst, int distanceType, int maskSize, int dstType = CV_32F) + private static native void distanceTransform_0(long src_nativeObj, long dst_nativeObj, int distanceType, int maskSize, int dstType); + private static native void distanceTransform_1(long src_nativeObj, long dst_nativeObj, int distanceType, int maskSize); + + // C++: void drawContours(Mat& image, vector_vector_Point contours, int contourIdx, Scalar color, int thickness = 1, int lineType = LINE_8, Mat hierarchy = Mat(), int maxLevel = INT_MAX, Point offset = Point()) + private static native void drawContours_0(long image_nativeObj, long contours_mat_nativeObj, int contourIdx, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, long hierarchy_nativeObj, int maxLevel, double offset_x, double offset_y); + private static native void drawContours_1(long image_nativeObj, long contours_mat_nativeObj, int contourIdx, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); + private static native void drawContours_2(long image_nativeObj, long contours_mat_nativeObj, int contourIdx, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void drawMarker(Mat& img, Point position, Scalar color, int markerType = MARKER_CROSS, int markerSize = 20, int thickness = 1, int line_type = 8) + private static native void drawMarker_0(long img_nativeObj, double position_x, double position_y, double color_val0, double color_val1, double color_val2, double color_val3, int markerType, int markerSize, int thickness, int line_type); + private static native void drawMarker_1(long img_nativeObj, double position_x, double position_y, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + private static native void ellipse_0(long img_nativeObj, double center_x, double center_y, double axes_width, double axes_height, double angle, double startAngle, double endAngle, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); + private static native void ellipse_1(long img_nativeObj, double center_x, double center_y, double axes_width, double axes_height, double angle, double startAngle, double endAngle, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); + private static native void ellipse_2(long img_nativeObj, double center_x, double center_y, double axes_width, double axes_height, double angle, double startAngle, double endAngle, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void ellipse(Mat& img, RotatedRect box, Scalar color, int thickness = 1, int lineType = LINE_8) + private static native void ellipse_3(long img_nativeObj, double box_center_x, double box_center_y, double box_size_width, double box_size_height, double box_angle, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType); + private static native void ellipse_4(long img_nativeObj, double box_center_x, double box_center_y, double box_size_width, double box_size_height, double box_angle, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); + private static native void ellipse_5(long img_nativeObj, double box_center_x, double box_center_y, double box_size_width, double box_size_height, double box_angle, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, vector_Point& pts) + private static native void ellipse2Poly_0(double center_x, double center_y, double axes_width, double axes_height, int angle, int arcStart, int arcEnd, int delta, long pts_mat_nativeObj); + + // C++: void equalizeHist(Mat src, Mat& dst) + private static native void equalizeHist_0(long src_nativeObj, long dst_nativeObj); + + // C++: void erode(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) + private static native void erode_0(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations, int borderType, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); + private static native void erode_1(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations); + private static native void erode_2(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj); + + // C++: void fillConvexPoly(Mat& img, vector_Point points, Scalar color, int lineType = LINE_8, int shift = 0) + private static native void fillConvexPoly_0(long img_nativeObj, long points_mat_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3, int lineType, int shift); + private static native void fillConvexPoly_1(long img_nativeObj, long points_mat_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void fillPoly(Mat& img, vector_vector_Point pts, Scalar color, int lineType = LINE_8, int shift = 0, Point offset = Point()) + private static native void fillPoly_0(long img_nativeObj, long pts_mat_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3, int lineType, int shift, double offset_x, double offset_y); + private static native void fillPoly_1(long img_nativeObj, long pts_mat_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void filter2D(Mat src, Mat& dst, int ddepth, Mat kernel, Point anchor = Point(-1,-1), double delta = 0, int borderType = BORDER_DEFAULT) + private static native void filter2D_0(long src_nativeObj, long dst_nativeObj, int ddepth, long kernel_nativeObj, double anchor_x, double anchor_y, double delta, int borderType); + private static native void filter2D_1(long src_nativeObj, long dst_nativeObj, int ddepth, long kernel_nativeObj, double anchor_x, double anchor_y, double delta); + private static native void filter2D_2(long src_nativeObj, long dst_nativeObj, int ddepth, long kernel_nativeObj); + + // C++: void findContours(Mat& image, vector_vector_Point& contours, Mat& hierarchy, int mode, int method, Point offset = Point()) + private static native void findContours_0(long image_nativeObj, long contours_mat_nativeObj, long hierarchy_nativeObj, int mode, int method, double offset_x, double offset_y); + private static native void findContours_1(long image_nativeObj, long contours_mat_nativeObj, long hierarchy_nativeObj, int mode, int method); + + // C++: void fitLine(Mat points, Mat& line, int distType, double param, double reps, double aeps) + private static native void fitLine_0(long points_nativeObj, long line_nativeObj, int distType, double param, double reps, double aeps); + + // C++: void getDerivKernels(Mat& kx, Mat& ky, int dx, int dy, int ksize, bool normalize = false, int ktype = CV_32F) + private static native void getDerivKernels_0(long kx_nativeObj, long ky_nativeObj, int dx, int dy, int ksize, boolean normalize, int ktype); + private static native void getDerivKernels_1(long kx_nativeObj, long ky_nativeObj, int dx, int dy, int ksize); + + // C++: void getRectSubPix(Mat image, Size patchSize, Point2f center, Mat& patch, int patchType = -1) + private static native void getRectSubPix_0(long image_nativeObj, double patchSize_width, double patchSize_height, double center_x, double center_y, long patch_nativeObj, int patchType); + private static native void getRectSubPix_1(long image_nativeObj, double patchSize_width, double patchSize_height, double center_x, double center_y, long patch_nativeObj); + + // C++: void goodFeaturesToTrack(Mat image, vector_Point& corners, int maxCorners, double qualityLevel, double minDistance, Mat mask = Mat(), int blockSize = 3, bool useHarrisDetector = false, double k = 0.04) + private static native void goodFeaturesToTrack_0(long image_nativeObj, long corners_mat_nativeObj, int maxCorners, double qualityLevel, double minDistance, long mask_nativeObj, int blockSize, boolean useHarrisDetector, double k); + private static native void goodFeaturesToTrack_1(long image_nativeObj, long corners_mat_nativeObj, int maxCorners, double qualityLevel, double minDistance); + + // C++: void grabCut(Mat img, Mat& mask, Rect rect, Mat& bgdModel, Mat& fgdModel, int iterCount, int mode = GC_EVAL) + private static native void grabCut_0(long img_nativeObj, long mask_nativeObj, int rect_x, int rect_y, int rect_width, int rect_height, long bgdModel_nativeObj, long fgdModel_nativeObj, int iterCount, int mode); + private static native void grabCut_1(long img_nativeObj, long mask_nativeObj, int rect_x, int rect_y, int rect_width, int rect_height, long bgdModel_nativeObj, long fgdModel_nativeObj, int iterCount); + + // C++: void initUndistortRectifyMap(Mat cameraMatrix, Mat distCoeffs, Mat R, Mat newCameraMatrix, Size size, int m1type, Mat& map1, Mat& map2) + private static native void initUndistortRectifyMap_0(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long R_nativeObj, long newCameraMatrix_nativeObj, double size_width, double size_height, int m1type, long map1_nativeObj, long map2_nativeObj); + + // C++: void integral(Mat src, Mat& sum, Mat& sqsum, Mat& tilted, int sdepth = -1, int sqdepth = -1) + private static native void integral3_0(long src_nativeObj, long sum_nativeObj, long sqsum_nativeObj, long tilted_nativeObj, int sdepth, int sqdepth); + private static native void integral3_1(long src_nativeObj, long sum_nativeObj, long sqsum_nativeObj, long tilted_nativeObj); + + // C++: void integral(Mat src, Mat& sum, Mat& sqsum, int sdepth = -1, int sqdepth = -1) + private static native void integral2_0(long src_nativeObj, long sum_nativeObj, long sqsum_nativeObj, int sdepth, int sqdepth); + private static native void integral2_1(long src_nativeObj, long sum_nativeObj, long sqsum_nativeObj); + + // C++: void integral(Mat src, Mat& sum, int sdepth = -1) + private static native void integral_0(long src_nativeObj, long sum_nativeObj, int sdepth); + private static native void integral_1(long src_nativeObj, long sum_nativeObj); + + // C++: void invertAffineTransform(Mat M, Mat& iM) + private static native void invertAffineTransform_0(long M_nativeObj, long iM_nativeObj); + + // C++: void line(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + private static native void line_0(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); + private static native void line_1(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); + private static native void line_2(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void linearPolar(Mat src, Mat& dst, Point2f center, double maxRadius, int flags) + private static native void linearPolar_0(long src_nativeObj, long dst_nativeObj, double center_x, double center_y, double maxRadius, int flags); + + // C++: void logPolar(Mat src, Mat& dst, Point2f center, double M, int flags) + private static native void logPolar_0(long src_nativeObj, long dst_nativeObj, double center_x, double center_y, double M, int flags); + + // C++: void matchTemplate(Mat image, Mat templ, Mat& result, int method, Mat mask = Mat()) + private static native void matchTemplate_0(long image_nativeObj, long templ_nativeObj, long result_nativeObj, int method, long mask_nativeObj); + private static native void matchTemplate_1(long image_nativeObj, long templ_nativeObj, long result_nativeObj, int method); + + // C++: void medianBlur(Mat src, Mat& dst, int ksize) + private static native void medianBlur_0(long src_nativeObj, long dst_nativeObj, int ksize); + + // C++: void minEnclosingCircle(vector_Point2f points, Point2f& center, float& radius) + private static native void minEnclosingCircle_0(long points_mat_nativeObj, double[] center_out, double[] radius_out); + + // C++: void morphologyEx(Mat src, Mat& dst, int op, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) + private static native void morphologyEx_0(long src_nativeObj, long dst_nativeObj, int op, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations, int borderType, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); + private static native void morphologyEx_1(long src_nativeObj, long dst_nativeObj, int op, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations); + private static native void morphologyEx_2(long src_nativeObj, long dst_nativeObj, int op, long kernel_nativeObj); + + // C++: void polylines(Mat& img, vector_vector_Point pts, bool isClosed, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + private static native void polylines_0(long img_nativeObj, long pts_mat_nativeObj, boolean isClosed, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); + private static native void polylines_1(long img_nativeObj, long pts_mat_nativeObj, boolean isClosed, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); + private static native void polylines_2(long img_nativeObj, long pts_mat_nativeObj, boolean isClosed, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void preCornerDetect(Mat src, Mat& dst, int ksize, int borderType = BORDER_DEFAULT) + private static native void preCornerDetect_0(long src_nativeObj, long dst_nativeObj, int ksize, int borderType); + private static native void preCornerDetect_1(long src_nativeObj, long dst_nativeObj, int ksize); + + // C++: void putText(Mat& img, String text, Point org, int fontFace, double fontScale, Scalar color, int thickness = 1, int lineType = LINE_8, bool bottomLeftOrigin = false) + private static native void putText_0(long img_nativeObj, String text, double org_x, double org_y, int fontFace, double fontScale, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, boolean bottomLeftOrigin); + private static native void putText_1(long img_nativeObj, String text, double org_x, double org_y, int fontFace, double fontScale, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); + private static native void putText_2(long img_nativeObj, String text, double org_x, double org_y, int fontFace, double fontScale, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void pyrDown(Mat src, Mat& dst, Size dstsize = Size(), int borderType = BORDER_DEFAULT) + private static native void pyrDown_0(long src_nativeObj, long dst_nativeObj, double dstsize_width, double dstsize_height, int borderType); + private static native void pyrDown_1(long src_nativeObj, long dst_nativeObj, double dstsize_width, double dstsize_height); + private static native void pyrDown_2(long src_nativeObj, long dst_nativeObj); + + // C++: void pyrMeanShiftFiltering(Mat src, Mat& dst, double sp, double sr, int maxLevel = 1, TermCriteria termcrit = TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1)) + private static native void pyrMeanShiftFiltering_0(long src_nativeObj, long dst_nativeObj, double sp, double sr, int maxLevel, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon); + private static native void pyrMeanShiftFiltering_1(long src_nativeObj, long dst_nativeObj, double sp, double sr); + + // C++: void pyrUp(Mat src, Mat& dst, Size dstsize = Size(), int borderType = BORDER_DEFAULT) + private static native void pyrUp_0(long src_nativeObj, long dst_nativeObj, double dstsize_width, double dstsize_height, int borderType); + private static native void pyrUp_1(long src_nativeObj, long dst_nativeObj, double dstsize_width, double dstsize_height); + private static native void pyrUp_2(long src_nativeObj, long dst_nativeObj); + + // C++: void rectangle(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) + private static native void rectangle_0(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); + private static native void rectangle_1(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); + private static native void rectangle_2(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3); + + // C++: void remap(Mat src, Mat& dst, Mat map1, Mat map2, int interpolation, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) + private static native void remap_0(long src_nativeObj, long dst_nativeObj, long map1_nativeObj, long map2_nativeObj, int interpolation, int borderMode, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); + private static native void remap_1(long src_nativeObj, long dst_nativeObj, long map1_nativeObj, long map2_nativeObj, int interpolation); + + // C++: void resize(Mat src, Mat& dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR) + private static native void resize_0(long src_nativeObj, long dst_nativeObj, double dsize_width, double dsize_height, double fx, double fy, int interpolation); + private static native void resize_1(long src_nativeObj, long dst_nativeObj, double dsize_width, double dsize_height); + + // C++: void sepFilter2D(Mat src, Mat& dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor = Point(-1,-1), double delta = 0, int borderType = BORDER_DEFAULT) + private static native void sepFilter2D_0(long src_nativeObj, long dst_nativeObj, int ddepth, long kernelX_nativeObj, long kernelY_nativeObj, double anchor_x, double anchor_y, double delta, int borderType); + private static native void sepFilter2D_1(long src_nativeObj, long dst_nativeObj, int ddepth, long kernelX_nativeObj, long kernelY_nativeObj, double anchor_x, double anchor_y, double delta); + private static native void sepFilter2D_2(long src_nativeObj, long dst_nativeObj, int ddepth, long kernelX_nativeObj, long kernelY_nativeObj); + + // C++: void spatialGradient(Mat src, Mat& dx, Mat& dy, int ksize = 3, int borderType = BORDER_DEFAULT) + private static native void spatialGradient_0(long src_nativeObj, long dx_nativeObj, long dy_nativeObj, int ksize, int borderType); + private static native void spatialGradient_1(long src_nativeObj, long dx_nativeObj, long dy_nativeObj, int ksize); + private static native void spatialGradient_2(long src_nativeObj, long dx_nativeObj, long dy_nativeObj); + + // C++: void sqrBoxFilter(Mat _src, Mat& _dst, int ddepth, Size ksize, Point anchor = Point(-1, -1), bool normalize = true, int borderType = BORDER_DEFAULT) + private static native void sqrBoxFilter_0(long _src_nativeObj, long _dst_nativeObj, int ddepth, double ksize_width, double ksize_height, double anchor_x, double anchor_y, boolean normalize, int borderType); + private static native void sqrBoxFilter_1(long _src_nativeObj, long _dst_nativeObj, int ddepth, double ksize_width, double ksize_height, double anchor_x, double anchor_y, boolean normalize); + private static native void sqrBoxFilter_2(long _src_nativeObj, long _dst_nativeObj, int ddepth, double ksize_width, double ksize_height); + + // C++: void undistort(Mat src, Mat& dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix = Mat()) + private static native void undistort_0(long src_nativeObj, long dst_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long newCameraMatrix_nativeObj); + private static native void undistort_1(long src_nativeObj, long dst_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj); + + // C++: void undistortPoints(vector_Point2f src, vector_Point2f& dst, Mat cameraMatrix, Mat distCoeffs, Mat R = Mat(), Mat P = Mat()) + private static native void undistortPoints_0(long src_mat_nativeObj, long dst_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long R_nativeObj, long P_nativeObj); + private static native void undistortPoints_1(long src_mat_nativeObj, long dst_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj); + + // C++: void warpAffine(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) + private static native void warpAffine_0(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height, int flags, int borderMode, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); + private static native void warpAffine_1(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height, int flags); + private static native void warpAffine_2(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height); + + // C++: void warpPerspective(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) + private static native void warpPerspective_0(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height, int flags, int borderMode, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); + private static native void warpPerspective_1(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height, int flags); + private static native void warpPerspective_2(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height); + + // C++: void watershed(Mat image, Mat& markers) + private static native void watershed_0(long image_nativeObj, long markers_nativeObj); + private static native double[] n_getTextSize(String text, int fontFace, double fontScale, int thickness, int[] baseLine); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/imgproc/LineSegmentDetector.java b/openCVLibrary310/src/main/java/org/opencv/imgproc/LineSegmentDetector.java new file mode 100644 index 0000000..24003a6 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/imgproc/LineSegmentDetector.java @@ -0,0 +1,99 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.imgproc; + +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; +import org.opencv.core.Size; + +// C++: class LineSegmentDetector +//javadoc: LineSegmentDetector +public class LineSegmentDetector extends Algorithm { + + protected LineSegmentDetector(long addr) { super(addr); } + + + // + // C++: int compareSegments(Size size, Mat lines1, Mat lines2, Mat& _image = Mat()) + // + + //javadoc: LineSegmentDetector::compareSegments(size, lines1, lines2, _image) + public int compareSegments(Size size, Mat lines1, Mat lines2, Mat _image) + { + + int retVal = compareSegments_0(nativeObj, size.width, size.height, lines1.nativeObj, lines2.nativeObj, _image.nativeObj); + + return retVal; + } + + //javadoc: LineSegmentDetector::compareSegments(size, lines1, lines2) + public int compareSegments(Size size, Mat lines1, Mat lines2) + { + + int retVal = compareSegments_1(nativeObj, size.width, size.height, lines1.nativeObj, lines2.nativeObj); + + return retVal; + } + + + // + // C++: void detect(Mat _image, Mat& _lines, Mat& width = Mat(), Mat& prec = Mat(), Mat& nfa = Mat()) + // + + //javadoc: LineSegmentDetector::detect(_image, _lines, width, prec, nfa) + public void detect(Mat _image, Mat _lines, Mat width, Mat prec, Mat nfa) + { + + detect_0(nativeObj, _image.nativeObj, _lines.nativeObj, width.nativeObj, prec.nativeObj, nfa.nativeObj); + + return; + } + + //javadoc: LineSegmentDetector::detect(_image, _lines) + public void detect(Mat _image, Mat _lines) + { + + detect_1(nativeObj, _image.nativeObj, _lines.nativeObj); + + return; + } + + + // + // C++: void drawSegments(Mat& _image, Mat lines) + // + + //javadoc: LineSegmentDetector::drawSegments(_image, lines) + public void drawSegments(Mat _image, Mat lines) + { + + drawSegments_0(nativeObj, _image.nativeObj, lines.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: int compareSegments(Size size, Mat lines1, Mat lines2, Mat& _image = Mat()) + private static native int compareSegments_0(long nativeObj, double size_width, double size_height, long lines1_nativeObj, long lines2_nativeObj, long _image_nativeObj); + private static native int compareSegments_1(long nativeObj, double size_width, double size_height, long lines1_nativeObj, long lines2_nativeObj); + + // C++: void detect(Mat _image, Mat& _lines, Mat& width = Mat(), Mat& prec = Mat(), Mat& nfa = Mat()) + private static native void detect_0(long nativeObj, long _image_nativeObj, long _lines_nativeObj, long width_nativeObj, long prec_nativeObj, long nfa_nativeObj); + private static native void detect_1(long nativeObj, long _image_nativeObj, long _lines_nativeObj); + + // C++: void drawSegments(Mat& _image, Mat lines) + private static native void drawSegments_0(long nativeObj, long _image_nativeObj, long lines_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/imgproc/Moments.java b/openCVLibrary310/src/main/java/org/opencv/imgproc/Moments.java new file mode 100644 index 0000000..431b025 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/imgproc/Moments.java @@ -0,0 +1,244 @@ +package org.opencv.imgproc; + +import java.lang.Math; + +//javadoc:Moments +public class Moments { + + public double m00; + public double m10; + public double m01; + public double m20; + public double m11; + public double m02; + public double m30; + public double m21; + public double m12; + public double m03; + + public double mu20; + public double mu11; + public double mu02; + public double mu30; + public double mu21; + public double mu12; + public double mu03; + + public double nu20; + public double nu11; + public double nu02; + public double nu30; + public double nu21; + public double nu12; + public double nu03; + + public Moments( + double m00, + double m10, + double m01, + double m20, + double m11, + double m02, + double m30, + double m21, + double m12, + double m03) + { + this.m00 = m00; + this.m10 = m10; + this.m01 = m01; + this.m20 = m20; + this.m11 = m11; + this.m02 = m02; + this.m30 = m30; + this.m21 = m21; + this.m12 = m12; + this.m03 = m03; + this.completeState(); + } + + public Moments() { + this(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + + public Moments(double[] vals) { + set(vals); + } + + public void set(double[] vals) { + if (vals != null) { + m00 = vals.length > 0 ? (int) vals[0] : 0; + m10 = vals.length > 1 ? (int) vals[1] : 0; + m01 = vals.length > 2 ? (int) vals[2] : 0; + m20 = vals.length > 3 ? (int) vals[3] : 0; + m11 = vals.length > 4 ? (int) vals[4] : 0; + m02 = vals.length > 5 ? (int) vals[5] : 0; + m30 = vals.length > 6 ? (int) vals[6] : 0; + m21 = vals.length > 7 ? (int) vals[7] : 0; + m12 = vals.length > 8 ? (int) vals[8] : 0; + m03 = vals.length > 9 ? (int) vals[9] : 0; + this.completeState(); + } else { + m00 = 0; + m10 = 0; + m01 = 0; + m20 = 0; + m11 = 0; + m02 = 0; + m30 = 0; + m21 = 0; + m12 = 0; + m03 = 0; + mu20 = 0; + mu11 = 0; + mu02 = 0; + mu30 = 0; + mu21 = 0; + mu12 = 0; + mu03 = 0; + nu20 = 0; + nu11 = 0; + nu02 = 0; + nu30 = 0; + nu21 = 0; + nu12 = 0; + nu03 = 0; + } + } + + @Override + public String toString() { + return "Moments [ " + + "\n" + + "m00=" + m00 + ", " + + "\n" + + "m10=" + m10 + ", " + + "m01=" + m01 + ", " + + "\n" + + "m20=" + m20 + ", " + + "m11=" + m11 + ", " + + "m02=" + m02 + ", " + + "\n" + + "m30=" + m30 + ", " + + "m21=" + m21 + ", " + + "m12=" + m12 + ", " + + "m03=" + m03 + ", " + + "\n" + + "mu20=" + mu20 + ", " + + "mu11=" + mu11 + ", " + + "mu02=" + mu02 + ", " + + "\n" + + "mu30=" + mu30 + ", " + + "mu21=" + mu21 + ", " + + "mu12=" + mu12 + ", " + + "mu03=" + mu03 + ", " + + "\n" + + "nu20=" + nu20 + ", " + + "nu11=" + nu11 + ", " + + "nu02=" + nu02 + ", " + + "\n" + + "nu30=" + nu30 + ", " + + "nu21=" + nu21 + ", " + + "nu12=" + nu12 + ", " + + "nu03=" + nu03 + ", " + + "\n]"; + } + + protected void completeState() + { + double cx = 0, cy = 0; + double mu20, mu11, mu02; + double inv_m00 = 0.0; + + if( Math.abs(this.m00) > 0.00000001 ) + { + inv_m00 = 1. / this.m00; + cx = this.m10 * inv_m00; + cy = this.m01 * inv_m00; + } + + // mu20 = m20 - m10*cx + mu20 = this.m20 - this.m10 * cx; + // mu11 = m11 - m10*cy + mu11 = this.m11 - this.m10 * cy; + // mu02 = m02 - m01*cy + mu02 = this.m02 - this.m01 * cy; + + this.mu20 = mu20; + this.mu11 = mu11; + this.mu02 = mu02; + + // mu30 = m30 - cx*(3*mu20 + cx*m10) + this.mu30 = this.m30 - cx * (3 * mu20 + cx * this.m10); + mu11 += mu11; + // mu21 = m21 - cx*(2*mu11 + cx*m01) - cy*mu20 + this.mu21 = this.m21 - cx * (mu11 + cx * this.m01) - cy * mu20; + // mu12 = m12 - cy*(2*mu11 + cy*m10) - cx*mu02 + this.mu12 = this.m12 - cy * (mu11 + cy * this.m10) - cx * mu02; + // mu03 = m03 - cy*(3*mu02 + cy*m01) + this.mu03 = this.m03 - cy * (3 * mu02 + cy * this.m01); + + + double inv_sqrt_m00 = Math.sqrt(Math.abs(inv_m00)); + double s2 = inv_m00*inv_m00, s3 = s2*inv_sqrt_m00; + + this.nu20 = this.mu20*s2; + this.nu11 = this.mu11*s2; + this.nu02 = this.mu02*s2; + this.nu30 = this.mu30*s3; + this.nu21 = this.mu21*s3; + this.nu12 = this.mu12*s3; + this.nu03 = this.mu03*s3; + + } + + public double get_m00() { return this.m00; } + public double get_m10() { return this.m10; } + public double get_m01() { return this.m01; } + public double get_m20() { return this.m20; } + public double get_m11() { return this.m11; } + public double get_m02() { return this.m02; } + public double get_m30() { return this.m30; } + public double get_m21() { return this.m21; } + public double get_m12() { return this.m12; } + public double get_m03() { return this.m03; } + public double get_mu20() { return this.mu20; } + public double get_mu11() { return this.mu11; } + public double get_mu02() { return this.mu02; } + public double get_mu30() { return this.mu30; } + public double get_mu21() { return this.mu21; } + public double get_mu12() { return this.mu12; } + public double get_mu03() { return this.mu03; } + public double get_nu20() { return this.nu20; } + public double get_nu11() { return this.nu11; } + public double get_nu02() { return this.nu02; } + public double get_nu30() { return this.nu30; } + public double get_nu21() { return this.nu21; } + public double get_nu12() { return this.nu12; } + public double get_nu03() { return this.nu03; } + + public void set_m00(double m00) { this.m00 = m00; } + public void set_m10(double m10) { this.m10 = m10; } + public void set_m01(double m01) { this.m01 = m01; } + public void set_m20(double m20) { this.m20 = m20; } + public void set_m11(double m11) { this.m11 = m11; } + public void set_m02(double m02) { this.m02 = m02; } + public void set_m30(double m30) { this.m30 = m30; } + public void set_m21(double m21) { this.m21 = m21; } + public void set_m12(double m12) { this.m12 = m12; } + public void set_m03(double m03) { this.m03 = m03; } + public void set_mu20(double mu20) { this.mu20 = mu20; } + public void set_mu11(double mu11) { this.mu11 = mu11; } + public void set_mu02(double mu02) { this.mu02 = mu02; } + public void set_mu30(double mu30) { this.mu30 = mu30; } + public void set_mu21(double mu21) { this.mu21 = mu21; } + public void set_mu12(double mu12) { this.mu12 = mu12; } + public void set_mu03(double mu03) { this.mu03 = mu03; } + public void set_nu20(double nu20) { this.nu20 = nu20; } + public void set_nu11(double nu11) { this.nu11 = nu11; } + public void set_nu02(double nu02) { this.nu02 = nu02; } + public void set_nu30(double nu30) { this.nu30 = nu30; } + public void set_nu21(double nu21) { this.nu21 = nu21; } + public void set_nu12(double nu12) { this.nu12 = nu12; } + public void set_nu03(double nu03) { this.nu03 = nu03; } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/imgproc/Subdiv2D.java b/openCVLibrary310/src/main/java/org/opencv/imgproc/Subdiv2D.java new file mode 100644 index 0000000..d4b7716 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/imgproc/Subdiv2D.java @@ -0,0 +1,386 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.imgproc; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfFloat4; +import org.opencv.core.MatOfFloat6; +import org.opencv.core.MatOfInt; +import org.opencv.core.MatOfPoint2f; +import org.opencv.core.Point; +import org.opencv.core.Rect; +import org.opencv.utils.Converters; + +// C++: class Subdiv2D +//javadoc: Subdiv2D +public class Subdiv2D { + + protected final long nativeObj; + protected Subdiv2D(long addr) { nativeObj = addr; } + + + public static final int + PTLOC_ERROR = -2, + PTLOC_OUTSIDE_RECT = -1, + PTLOC_INSIDE = 0, + PTLOC_VERTEX = 1, + PTLOC_ON_EDGE = 2, + NEXT_AROUND_ORG = 0x00, + NEXT_AROUND_DST = 0x22, + PREV_AROUND_ORG = 0x11, + PREV_AROUND_DST = 0x33, + NEXT_AROUND_LEFT = 0x13, + NEXT_AROUND_RIGHT = 0x31, + PREV_AROUND_LEFT = 0x20, + PREV_AROUND_RIGHT = 0x02; + + + // + // C++: Subdiv2D(Rect rect) + // + + //javadoc: Subdiv2D::Subdiv2D(rect) + public Subdiv2D(Rect rect) + { + + nativeObj = Subdiv2D_0(rect.x, rect.y, rect.width, rect.height); + + return; + } + + + // + // C++: Subdiv2D() + // + + //javadoc: Subdiv2D::Subdiv2D() + public Subdiv2D() + { + + nativeObj = Subdiv2D_1(); + + return; + } + + + // + // C++: Point2f getVertex(int vertex, int* firstEdge = 0) + // + + //javadoc: Subdiv2D::getVertex(vertex, firstEdge) + public Point getVertex(int vertex, int[] firstEdge) + { + double[] firstEdge_out = new double[1]; + Point retVal = new Point(getVertex_0(nativeObj, vertex, firstEdge_out)); + if(firstEdge!=null) firstEdge[0] = (int)firstEdge_out[0]; + return retVal; + } + + //javadoc: Subdiv2D::getVertex(vertex) + public Point getVertex(int vertex) + { + + Point retVal = new Point(getVertex_1(nativeObj, vertex)); + + return retVal; + } + + + // + // C++: int edgeDst(int edge, Point2f* dstpt = 0) + // + + //javadoc: Subdiv2D::edgeDst(edge, dstpt) + public int edgeDst(int edge, Point dstpt) + { + double[] dstpt_out = new double[2]; + int retVal = edgeDst_0(nativeObj, edge, dstpt_out); + if(dstpt!=null){ dstpt.x = dstpt_out[0]; dstpt.y = dstpt_out[1]; } + return retVal; + } + + //javadoc: Subdiv2D::edgeDst(edge) + public int edgeDst(int edge) + { + + int retVal = edgeDst_1(nativeObj, edge); + + return retVal; + } + + + // + // C++: int edgeOrg(int edge, Point2f* orgpt = 0) + // + + //javadoc: Subdiv2D::edgeOrg(edge, orgpt) + public int edgeOrg(int edge, Point orgpt) + { + double[] orgpt_out = new double[2]; + int retVal = edgeOrg_0(nativeObj, edge, orgpt_out); + if(orgpt!=null){ orgpt.x = orgpt_out[0]; orgpt.y = orgpt_out[1]; } + return retVal; + } + + //javadoc: Subdiv2D::edgeOrg(edge) + public int edgeOrg(int edge) + { + + int retVal = edgeOrg_1(nativeObj, edge); + + return retVal; + } + + + // + // C++: int findNearest(Point2f pt, Point2f* nearestPt = 0) + // + + //javadoc: Subdiv2D::findNearest(pt, nearestPt) + public int findNearest(Point pt, Point nearestPt) + { + double[] nearestPt_out = new double[2]; + int retVal = findNearest_0(nativeObj, pt.x, pt.y, nearestPt_out); + if(nearestPt!=null){ nearestPt.x = nearestPt_out[0]; nearestPt.y = nearestPt_out[1]; } + return retVal; + } + + //javadoc: Subdiv2D::findNearest(pt) + public int findNearest(Point pt) + { + + int retVal = findNearest_1(nativeObj, pt.x, pt.y); + + return retVal; + } + + + // + // C++: int getEdge(int edge, int nextEdgeType) + // + + //javadoc: Subdiv2D::getEdge(edge, nextEdgeType) + public int getEdge(int edge, int nextEdgeType) + { + + int retVal = getEdge_0(nativeObj, edge, nextEdgeType); + + return retVal; + } + + + // + // C++: int insert(Point2f pt) + // + + //javadoc: Subdiv2D::insert(pt) + public int insert(Point pt) + { + + int retVal = insert_0(nativeObj, pt.x, pt.y); + + return retVal; + } + + + // + // C++: int locate(Point2f pt, int& edge, int& vertex) + // + + //javadoc: Subdiv2D::locate(pt, edge, vertex) + public int locate(Point pt, int[] edge, int[] vertex) + { + double[] edge_out = new double[1]; + double[] vertex_out = new double[1]; + int retVal = locate_0(nativeObj, pt.x, pt.y, edge_out, vertex_out); + if(edge!=null) edge[0] = (int)edge_out[0]; + if(vertex!=null) vertex[0] = (int)vertex_out[0]; + return retVal; + } + + + // + // C++: int nextEdge(int edge) + // + + //javadoc: Subdiv2D::nextEdge(edge) + public int nextEdge(int edge) + { + + int retVal = nextEdge_0(nativeObj, edge); + + return retVal; + } + + + // + // C++: int rotateEdge(int edge, int rotate) + // + + //javadoc: Subdiv2D::rotateEdge(edge, rotate) + public int rotateEdge(int edge, int rotate) + { + + int retVal = rotateEdge_0(nativeObj, edge, rotate); + + return retVal; + } + + + // + // C++: int symEdge(int edge) + // + + //javadoc: Subdiv2D::symEdge(edge) + public int symEdge(int edge) + { + + int retVal = symEdge_0(nativeObj, edge); + + return retVal; + } + + + // + // C++: void getEdgeList(vector_Vec4f& edgeList) + // + + //javadoc: Subdiv2D::getEdgeList(edgeList) + public void getEdgeList(MatOfFloat4 edgeList) + { + Mat edgeList_mat = edgeList; + getEdgeList_0(nativeObj, edgeList_mat.nativeObj); + + return; + } + + + // + // C++: void getTriangleList(vector_Vec6f& triangleList) + // + + //javadoc: Subdiv2D::getTriangleList(triangleList) + public void getTriangleList(MatOfFloat6 triangleList) + { + Mat triangleList_mat = triangleList; + getTriangleList_0(nativeObj, triangleList_mat.nativeObj); + + return; + } + + + // + // C++: void getVoronoiFacetList(vector_int idx, vector_vector_Point2f& facetList, vector_Point2f& facetCenters) + // + + //javadoc: Subdiv2D::getVoronoiFacetList(idx, facetList, facetCenters) + public void getVoronoiFacetList(MatOfInt idx, List facetList, MatOfPoint2f facetCenters) + { + Mat idx_mat = idx; + Mat facetList_mat = new Mat(); + Mat facetCenters_mat = facetCenters; + getVoronoiFacetList_0(nativeObj, idx_mat.nativeObj, facetList_mat.nativeObj, facetCenters_mat.nativeObj); + Converters.Mat_to_vector_vector_Point2f(facetList_mat, facetList); + facetList_mat.release(); + return; + } + + + // + // C++: void initDelaunay(Rect rect) + // + + //javadoc: Subdiv2D::initDelaunay(rect) + public void initDelaunay(Rect rect) + { + + initDelaunay_0(nativeObj, rect.x, rect.y, rect.width, rect.height); + + return; + } + + + // + // C++: void insert(vector_Point2f ptvec) + // + + //javadoc: Subdiv2D::insert(ptvec) + public void insert(MatOfPoint2f ptvec) + { + Mat ptvec_mat = ptvec; + insert_1(nativeObj, ptvec_mat.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Subdiv2D(Rect rect) + private static native long Subdiv2D_0(int rect_x, int rect_y, int rect_width, int rect_height); + + // C++: Subdiv2D() + private static native long Subdiv2D_1(); + + // C++: Point2f getVertex(int vertex, int* firstEdge = 0) + private static native double[] getVertex_0(long nativeObj, int vertex, double[] firstEdge_out); + private static native double[] getVertex_1(long nativeObj, int vertex); + + // C++: int edgeDst(int edge, Point2f* dstpt = 0) + private static native int edgeDst_0(long nativeObj, int edge, double[] dstpt_out); + private static native int edgeDst_1(long nativeObj, int edge); + + // C++: int edgeOrg(int edge, Point2f* orgpt = 0) + private static native int edgeOrg_0(long nativeObj, int edge, double[] orgpt_out); + private static native int edgeOrg_1(long nativeObj, int edge); + + // C++: int findNearest(Point2f pt, Point2f* nearestPt = 0) + private static native int findNearest_0(long nativeObj, double pt_x, double pt_y, double[] nearestPt_out); + private static native int findNearest_1(long nativeObj, double pt_x, double pt_y); + + // C++: int getEdge(int edge, int nextEdgeType) + private static native int getEdge_0(long nativeObj, int edge, int nextEdgeType); + + // C++: int insert(Point2f pt) + private static native int insert_0(long nativeObj, double pt_x, double pt_y); + + // C++: int locate(Point2f pt, int& edge, int& vertex) + private static native int locate_0(long nativeObj, double pt_x, double pt_y, double[] edge_out, double[] vertex_out); + + // C++: int nextEdge(int edge) + private static native int nextEdge_0(long nativeObj, int edge); + + // C++: int rotateEdge(int edge, int rotate) + private static native int rotateEdge_0(long nativeObj, int edge, int rotate); + + // C++: int symEdge(int edge) + private static native int symEdge_0(long nativeObj, int edge); + + // C++: void getEdgeList(vector_Vec4f& edgeList) + private static native void getEdgeList_0(long nativeObj, long edgeList_mat_nativeObj); + + // C++: void getTriangleList(vector_Vec6f& triangleList) + private static native void getTriangleList_0(long nativeObj, long triangleList_mat_nativeObj); + + // C++: void getVoronoiFacetList(vector_int idx, vector_vector_Point2f& facetList, vector_Point2f& facetCenters) + private static native void getVoronoiFacetList_0(long nativeObj, long idx_mat_nativeObj, long facetList_mat_nativeObj, long facetCenters_mat_nativeObj); + + // C++: void initDelaunay(Rect rect) + private static native void initDelaunay_0(long nativeObj, int rect_x, int rect_y, int rect_width, int rect_height); + + // C++: void insert(vector_Point2f ptvec) + private static native void insert_1(long nativeObj, long ptvec_mat_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/ANN_MLP.java b/openCVLibrary310/src/main/java/org/opencv/ml/ANN_MLP.java new file mode 100644 index 0000000..4fcbabd --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/ANN_MLP.java @@ -0,0 +1,449 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Mat; +import org.opencv.core.TermCriteria; + +// C++: class ANN_MLP +//javadoc: ANN_MLP +public class ANN_MLP extends StatModel { + + protected ANN_MLP(long addr) { super(addr); } + + + public static final int + BACKPROP = 0, + RPROP = 1, + IDENTITY = 0, + SIGMOID_SYM = 1, + GAUSSIAN = 2, + UPDATE_WEIGHTS = 1, + NO_INPUT_SCALE = 2, + NO_OUTPUT_SCALE = 4; + + + // + // C++: Mat getLayerSizes() + // + + //javadoc: ANN_MLP::getLayerSizes() + public Mat getLayerSizes() + { + + Mat retVal = new Mat(getLayerSizes_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getWeights(int layerIdx) + // + + //javadoc: ANN_MLP::getWeights(layerIdx) + public Mat getWeights(int layerIdx) + { + + Mat retVal = new Mat(getWeights_0(nativeObj, layerIdx)); + + return retVal; + } + + + // + // C++: static Ptr_ANN_MLP create() + // + + //javadoc: ANN_MLP::create() + public static ANN_MLP create() + { + + ANN_MLP retVal = new ANN_MLP(create_0()); + + return retVal; + } + + + // + // C++: TermCriteria getTermCriteria() + // + + //javadoc: ANN_MLP::getTermCriteria() + public TermCriteria getTermCriteria() + { + + TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); + + return retVal; + } + + + // + // C++: double getBackpropMomentumScale() + // + + //javadoc: ANN_MLP::getBackpropMomentumScale() + public double getBackpropMomentumScale() + { + + double retVal = getBackpropMomentumScale_0(nativeObj); + + return retVal; + } + + + // + // C++: double getBackpropWeightScale() + // + + //javadoc: ANN_MLP::getBackpropWeightScale() + public double getBackpropWeightScale() + { + + double retVal = getBackpropWeightScale_0(nativeObj); + + return retVal; + } + + + // + // C++: double getRpropDW0() + // + + //javadoc: ANN_MLP::getRpropDW0() + public double getRpropDW0() + { + + double retVal = getRpropDW0_0(nativeObj); + + return retVal; + } + + + // + // C++: double getRpropDWMax() + // + + //javadoc: ANN_MLP::getRpropDWMax() + public double getRpropDWMax() + { + + double retVal = getRpropDWMax_0(nativeObj); + + return retVal; + } + + + // + // C++: double getRpropDWMin() + // + + //javadoc: ANN_MLP::getRpropDWMin() + public double getRpropDWMin() + { + + double retVal = getRpropDWMin_0(nativeObj); + + return retVal; + } + + + // + // C++: double getRpropDWMinus() + // + + //javadoc: ANN_MLP::getRpropDWMinus() + public double getRpropDWMinus() + { + + double retVal = getRpropDWMinus_0(nativeObj); + + return retVal; + } + + + // + // C++: double getRpropDWPlus() + // + + //javadoc: ANN_MLP::getRpropDWPlus() + public double getRpropDWPlus() + { + + double retVal = getRpropDWPlus_0(nativeObj); + + return retVal; + } + + + // + // C++: int getTrainMethod() + // + + //javadoc: ANN_MLP::getTrainMethod() + public int getTrainMethod() + { + + int retVal = getTrainMethod_0(nativeObj); + + return retVal; + } + + + // + // C++: void setActivationFunction(int type, double param1 = 0, double param2 = 0) + // + + //javadoc: ANN_MLP::setActivationFunction(type, param1, param2) + public void setActivationFunction(int type, double param1, double param2) + { + + setActivationFunction_0(nativeObj, type, param1, param2); + + return; + } + + //javadoc: ANN_MLP::setActivationFunction(type) + public void setActivationFunction(int type) + { + + setActivationFunction_1(nativeObj, type); + + return; + } + + + // + // C++: void setBackpropMomentumScale(double val) + // + + //javadoc: ANN_MLP::setBackpropMomentumScale(val) + public void setBackpropMomentumScale(double val) + { + + setBackpropMomentumScale_0(nativeObj, val); + + return; + } + + + // + // C++: void setBackpropWeightScale(double val) + // + + //javadoc: ANN_MLP::setBackpropWeightScale(val) + public void setBackpropWeightScale(double val) + { + + setBackpropWeightScale_0(nativeObj, val); + + return; + } + + + // + // C++: void setLayerSizes(Mat _layer_sizes) + // + + //javadoc: ANN_MLP::setLayerSizes(_layer_sizes) + public void setLayerSizes(Mat _layer_sizes) + { + + setLayerSizes_0(nativeObj, _layer_sizes.nativeObj); + + return; + } + + + // + // C++: void setRpropDW0(double val) + // + + //javadoc: ANN_MLP::setRpropDW0(val) + public void setRpropDW0(double val) + { + + setRpropDW0_0(nativeObj, val); + + return; + } + + + // + // C++: void setRpropDWMax(double val) + // + + //javadoc: ANN_MLP::setRpropDWMax(val) + public void setRpropDWMax(double val) + { + + setRpropDWMax_0(nativeObj, val); + + return; + } + + + // + // C++: void setRpropDWMin(double val) + // + + //javadoc: ANN_MLP::setRpropDWMin(val) + public void setRpropDWMin(double val) + { + + setRpropDWMin_0(nativeObj, val); + + return; + } + + + // + // C++: void setRpropDWMinus(double val) + // + + //javadoc: ANN_MLP::setRpropDWMinus(val) + public void setRpropDWMinus(double val) + { + + setRpropDWMinus_0(nativeObj, val); + + return; + } + + + // + // C++: void setRpropDWPlus(double val) + // + + //javadoc: ANN_MLP::setRpropDWPlus(val) + public void setRpropDWPlus(double val) + { + + setRpropDWPlus_0(nativeObj, val); + + return; + } + + + // + // C++: void setTermCriteria(TermCriteria val) + // + + //javadoc: ANN_MLP::setTermCriteria(val) + public void setTermCriteria(TermCriteria val) + { + + setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); + + return; + } + + + // + // C++: void setTrainMethod(int method, double param1 = 0, double param2 = 0) + // + + //javadoc: ANN_MLP::setTrainMethod(method, param1, param2) + public void setTrainMethod(int method, double param1, double param2) + { + + setTrainMethod_0(nativeObj, method, param1, param2); + + return; + } + + //javadoc: ANN_MLP::setTrainMethod(method) + public void setTrainMethod(int method) + { + + setTrainMethod_1(nativeObj, method); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Mat getLayerSizes() + private static native long getLayerSizes_0(long nativeObj); + + // C++: Mat getWeights(int layerIdx) + private static native long getWeights_0(long nativeObj, int layerIdx); + + // C++: static Ptr_ANN_MLP create() + private static native long create_0(); + + // C++: TermCriteria getTermCriteria() + private static native double[] getTermCriteria_0(long nativeObj); + + // C++: double getBackpropMomentumScale() + private static native double getBackpropMomentumScale_0(long nativeObj); + + // C++: double getBackpropWeightScale() + private static native double getBackpropWeightScale_0(long nativeObj); + + // C++: double getRpropDW0() + private static native double getRpropDW0_0(long nativeObj); + + // C++: double getRpropDWMax() + private static native double getRpropDWMax_0(long nativeObj); + + // C++: double getRpropDWMin() + private static native double getRpropDWMin_0(long nativeObj); + + // C++: double getRpropDWMinus() + private static native double getRpropDWMinus_0(long nativeObj); + + // C++: double getRpropDWPlus() + private static native double getRpropDWPlus_0(long nativeObj); + + // C++: int getTrainMethod() + private static native int getTrainMethod_0(long nativeObj); + + // C++: void setActivationFunction(int type, double param1 = 0, double param2 = 0) + private static native void setActivationFunction_0(long nativeObj, int type, double param1, double param2); + private static native void setActivationFunction_1(long nativeObj, int type); + + // C++: void setBackpropMomentumScale(double val) + private static native void setBackpropMomentumScale_0(long nativeObj, double val); + + // C++: void setBackpropWeightScale(double val) + private static native void setBackpropWeightScale_0(long nativeObj, double val); + + // C++: void setLayerSizes(Mat _layer_sizes) + private static native void setLayerSizes_0(long nativeObj, long _layer_sizes_nativeObj); + + // C++: void setRpropDW0(double val) + private static native void setRpropDW0_0(long nativeObj, double val); + + // C++: void setRpropDWMax(double val) + private static native void setRpropDWMax_0(long nativeObj, double val); + + // C++: void setRpropDWMin(double val) + private static native void setRpropDWMin_0(long nativeObj, double val); + + // C++: void setRpropDWMinus(double val) + private static native void setRpropDWMinus_0(long nativeObj, double val); + + // C++: void setRpropDWPlus(double val) + private static native void setRpropDWPlus_0(long nativeObj, double val); + + // C++: void setTermCriteria(TermCriteria val) + private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); + + // C++: void setTrainMethod(int method, double param1 = 0, double param2 = 0) + private static native void setTrainMethod_0(long nativeObj, int method, double param1, double param2); + private static native void setTrainMethod_1(long nativeObj, int method); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/Boost.java b/openCVLibrary310/src/main/java/org/opencv/ml/Boost.java new file mode 100644 index 0000000..d19bfbc --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/Boost.java @@ -0,0 +1,152 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + + + +// C++: class Boost +//javadoc: Boost +public class Boost extends DTrees { + + protected Boost(long addr) { super(addr); } + + + public static final int + DISCRETE = 0, + REAL = 1, + LOGIT = 2, + GENTLE = 3; + + + // + // C++: static Ptr_Boost create() + // + + //javadoc: Boost::create() + public static Boost create() + { + + Boost retVal = new Boost(create_0()); + + return retVal; + } + + + // + // C++: double getWeightTrimRate() + // + + //javadoc: Boost::getWeightTrimRate() + public double getWeightTrimRate() + { + + double retVal = getWeightTrimRate_0(nativeObj); + + return retVal; + } + + + // + // C++: int getBoostType() + // + + //javadoc: Boost::getBoostType() + public int getBoostType() + { + + int retVal = getBoostType_0(nativeObj); + + return retVal; + } + + + // + // C++: int getWeakCount() + // + + //javadoc: Boost::getWeakCount() + public int getWeakCount() + { + + int retVal = getWeakCount_0(nativeObj); + + return retVal; + } + + + // + // C++: void setBoostType(int val) + // + + //javadoc: Boost::setBoostType(val) + public void setBoostType(int val) + { + + setBoostType_0(nativeObj, val); + + return; + } + + + // + // C++: void setWeakCount(int val) + // + + //javadoc: Boost::setWeakCount(val) + public void setWeakCount(int val) + { + + setWeakCount_0(nativeObj, val); + + return; + } + + + // + // C++: void setWeightTrimRate(double val) + // + + //javadoc: Boost::setWeightTrimRate(val) + public void setWeightTrimRate(double val) + { + + setWeightTrimRate_0(nativeObj, val); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: static Ptr_Boost create() + private static native long create_0(); + + // C++: double getWeightTrimRate() + private static native double getWeightTrimRate_0(long nativeObj); + + // C++: int getBoostType() + private static native int getBoostType_0(long nativeObj); + + // C++: int getWeakCount() + private static native int getWeakCount_0(long nativeObj); + + // C++: void setBoostType(int val) + private static native void setBoostType_0(long nativeObj, int val); + + // C++: void setWeakCount(int val) + private static native void setWeakCount_0(long nativeObj, int val); + + // C++: void setWeightTrimRate(double val) + private static native void setWeightTrimRate_0(long nativeObj, double val); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/DTrees.java b/openCVLibrary310/src/main/java/org/opencv/ml/DTrees.java new file mode 100644 index 0000000..7727ca3 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/DTrees.java @@ -0,0 +1,356 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Mat; + +// C++: class DTrees +//javadoc: DTrees +public class DTrees extends StatModel { + + protected DTrees(long addr) { super(addr); } + + + public static final int + PREDICT_AUTO = 0, + PREDICT_SUM = (1<<8), + PREDICT_MAX_VOTE = (2<<8), + PREDICT_MASK = (3<<8); + + + // + // C++: Mat getPriors() + // + + //javadoc: DTrees::getPriors() + public Mat getPriors() + { + + Mat retVal = new Mat(getPriors_0(nativeObj)); + + return retVal; + } + + + // + // C++: static Ptr_DTrees create() + // + + //javadoc: DTrees::create() + public static DTrees create() + { + + DTrees retVal = new DTrees(create_0()); + + return retVal; + } + + + // + // C++: bool getTruncatePrunedTree() + // + + //javadoc: DTrees::getTruncatePrunedTree() + public boolean getTruncatePrunedTree() + { + + boolean retVal = getTruncatePrunedTree_0(nativeObj); + + return retVal; + } + + + // + // C++: bool getUse1SERule() + // + + //javadoc: DTrees::getUse1SERule() + public boolean getUse1SERule() + { + + boolean retVal = getUse1SERule_0(nativeObj); + + return retVal; + } + + + // + // C++: bool getUseSurrogates() + // + + //javadoc: DTrees::getUseSurrogates() + public boolean getUseSurrogates() + { + + boolean retVal = getUseSurrogates_0(nativeObj); + + return retVal; + } + + + // + // C++: float getRegressionAccuracy() + // + + //javadoc: DTrees::getRegressionAccuracy() + public float getRegressionAccuracy() + { + + float retVal = getRegressionAccuracy_0(nativeObj); + + return retVal; + } + + + // + // C++: int getCVFolds() + // + + //javadoc: DTrees::getCVFolds() + public int getCVFolds() + { + + int retVal = getCVFolds_0(nativeObj); + + return retVal; + } + + + // + // C++: int getMaxCategories() + // + + //javadoc: DTrees::getMaxCategories() + public int getMaxCategories() + { + + int retVal = getMaxCategories_0(nativeObj); + + return retVal; + } + + + // + // C++: int getMaxDepth() + // + + //javadoc: DTrees::getMaxDepth() + public int getMaxDepth() + { + + int retVal = getMaxDepth_0(nativeObj); + + return retVal; + } + + + // + // C++: int getMinSampleCount() + // + + //javadoc: DTrees::getMinSampleCount() + public int getMinSampleCount() + { + + int retVal = getMinSampleCount_0(nativeObj); + + return retVal; + } + + + // + // C++: void setCVFolds(int val) + // + + //javadoc: DTrees::setCVFolds(val) + public void setCVFolds(int val) + { + + setCVFolds_0(nativeObj, val); + + return; + } + + + // + // C++: void setMaxCategories(int val) + // + + //javadoc: DTrees::setMaxCategories(val) + public void setMaxCategories(int val) + { + + setMaxCategories_0(nativeObj, val); + + return; + } + + + // + // C++: void setMaxDepth(int val) + // + + //javadoc: DTrees::setMaxDepth(val) + public void setMaxDepth(int val) + { + + setMaxDepth_0(nativeObj, val); + + return; + } + + + // + // C++: void setMinSampleCount(int val) + // + + //javadoc: DTrees::setMinSampleCount(val) + public void setMinSampleCount(int val) + { + + setMinSampleCount_0(nativeObj, val); + + return; + } + + + // + // C++: void setPriors(Mat val) + // + + //javadoc: DTrees::setPriors(val) + public void setPriors(Mat val) + { + + setPriors_0(nativeObj, val.nativeObj); + + return; + } + + + // + // C++: void setRegressionAccuracy(float val) + // + + //javadoc: DTrees::setRegressionAccuracy(val) + public void setRegressionAccuracy(float val) + { + + setRegressionAccuracy_0(nativeObj, val); + + return; + } + + + // + // C++: void setTruncatePrunedTree(bool val) + // + + //javadoc: DTrees::setTruncatePrunedTree(val) + public void setTruncatePrunedTree(boolean val) + { + + setTruncatePrunedTree_0(nativeObj, val); + + return; + } + + + // + // C++: void setUse1SERule(bool val) + // + + //javadoc: DTrees::setUse1SERule(val) + public void setUse1SERule(boolean val) + { + + setUse1SERule_0(nativeObj, val); + + return; + } + + + // + // C++: void setUseSurrogates(bool val) + // + + //javadoc: DTrees::setUseSurrogates(val) + public void setUseSurrogates(boolean val) + { + + setUseSurrogates_0(nativeObj, val); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Mat getPriors() + private static native long getPriors_0(long nativeObj); + + // C++: static Ptr_DTrees create() + private static native long create_0(); + + // C++: bool getTruncatePrunedTree() + private static native boolean getTruncatePrunedTree_0(long nativeObj); + + // C++: bool getUse1SERule() + private static native boolean getUse1SERule_0(long nativeObj); + + // C++: bool getUseSurrogates() + private static native boolean getUseSurrogates_0(long nativeObj); + + // C++: float getRegressionAccuracy() + private static native float getRegressionAccuracy_0(long nativeObj); + + // C++: int getCVFolds() + private static native int getCVFolds_0(long nativeObj); + + // C++: int getMaxCategories() + private static native int getMaxCategories_0(long nativeObj); + + // C++: int getMaxDepth() + private static native int getMaxDepth_0(long nativeObj); + + // C++: int getMinSampleCount() + private static native int getMinSampleCount_0(long nativeObj); + + // C++: void setCVFolds(int val) + private static native void setCVFolds_0(long nativeObj, int val); + + // C++: void setMaxCategories(int val) + private static native void setMaxCategories_0(long nativeObj, int val); + + // C++: void setMaxDepth(int val) + private static native void setMaxDepth_0(long nativeObj, int val); + + // C++: void setMinSampleCount(int val) + private static native void setMinSampleCount_0(long nativeObj, int val); + + // C++: void setPriors(Mat val) + private static native void setPriors_0(long nativeObj, long val_nativeObj); + + // C++: void setRegressionAccuracy(float val) + private static native void setRegressionAccuracy_0(long nativeObj, float val); + + // C++: void setTruncatePrunedTree(bool val) + private static native void setTruncatePrunedTree_0(long nativeObj, boolean val); + + // C++: void setUse1SERule(bool val) + private static native void setUse1SERule_0(long nativeObj, boolean val); + + // C++: void setUseSurrogates(bool val) + private static native void setUseSurrogates_0(long nativeObj, boolean val); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/EM.java b/openCVLibrary310/src/main/java/org/opencv/ml/EM.java new file mode 100644 index 0000000..3858f0e --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/EM.java @@ -0,0 +1,311 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.TermCriteria; +import org.opencv.utils.Converters; + +// C++: class EM +//javadoc: EM +public class EM extends StatModel { + + protected EM(long addr) { super(addr); } + + + public static final int + COV_MAT_SPHERICAL = 0, + COV_MAT_DIAGONAL = 1, + COV_MAT_GENERIC = 2, + COV_MAT_DEFAULT = COV_MAT_DIAGONAL, + DEFAULT_NCLUSTERS = 5, + DEFAULT_MAX_ITERS = 100, + START_E_STEP = 1, + START_M_STEP = 2, + START_AUTO_STEP = 0; + + + // + // C++: Mat getMeans() + // + + //javadoc: EM::getMeans() + public Mat getMeans() + { + + Mat retVal = new Mat(getMeans_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getWeights() + // + + //javadoc: EM::getWeights() + public Mat getWeights() + { + + Mat retVal = new Mat(getWeights_0(nativeObj)); + + return retVal; + } + + + // + // C++: static Ptr_EM create() + // + + //javadoc: EM::create() + public static EM create() + { + + EM retVal = new EM(create_0()); + + return retVal; + } + + + // + // C++: TermCriteria getTermCriteria() + // + + //javadoc: EM::getTermCriteria() + public TermCriteria getTermCriteria() + { + + TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); + + return retVal; + } + + + // + // C++: Vec2d predict2(Mat sample, Mat& probs) + // + + //javadoc: EM::predict2(sample, probs) + public double[] predict2(Mat sample, Mat probs) + { + + double[] retVal = predict2_0(nativeObj, sample.nativeObj, probs.nativeObj); + + return retVal; + } + + + // + // C++: bool trainE(Mat samples, Mat means0, Mat covs0 = Mat(), Mat weights0 = Mat(), Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) + // + + //javadoc: EM::trainE(samples, means0, covs0, weights0, logLikelihoods, labels, probs) + public boolean trainE(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods, Mat labels, Mat probs) + { + + boolean retVal = trainE_0(nativeObj, samples.nativeObj, means0.nativeObj, covs0.nativeObj, weights0.nativeObj, logLikelihoods.nativeObj, labels.nativeObj, probs.nativeObj); + + return retVal; + } + + //javadoc: EM::trainE(samples, means0) + public boolean trainE(Mat samples, Mat means0) + { + + boolean retVal = trainE_1(nativeObj, samples.nativeObj, means0.nativeObj); + + return retVal; + } + + + // + // C++: bool trainEM(Mat samples, Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) + // + + //javadoc: EM::trainEM(samples, logLikelihoods, labels, probs) + public boolean trainEM(Mat samples, Mat logLikelihoods, Mat labels, Mat probs) + { + + boolean retVal = trainEM_0(nativeObj, samples.nativeObj, logLikelihoods.nativeObj, labels.nativeObj, probs.nativeObj); + + return retVal; + } + + //javadoc: EM::trainEM(samples) + public boolean trainEM(Mat samples) + { + + boolean retVal = trainEM_1(nativeObj, samples.nativeObj); + + return retVal; + } + + + // + // C++: bool trainM(Mat samples, Mat probs0, Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) + // + + //javadoc: EM::trainM(samples, probs0, logLikelihoods, labels, probs) + public boolean trainM(Mat samples, Mat probs0, Mat logLikelihoods, Mat labels, Mat probs) + { + + boolean retVal = trainM_0(nativeObj, samples.nativeObj, probs0.nativeObj, logLikelihoods.nativeObj, labels.nativeObj, probs.nativeObj); + + return retVal; + } + + //javadoc: EM::trainM(samples, probs0) + public boolean trainM(Mat samples, Mat probs0) + { + + boolean retVal = trainM_1(nativeObj, samples.nativeObj, probs0.nativeObj); + + return retVal; + } + + + // + // C++: int getClustersNumber() + // + + //javadoc: EM::getClustersNumber() + public int getClustersNumber() + { + + int retVal = getClustersNumber_0(nativeObj); + + return retVal; + } + + + // + // C++: int getCovarianceMatrixType() + // + + //javadoc: EM::getCovarianceMatrixType() + public int getCovarianceMatrixType() + { + + int retVal = getCovarianceMatrixType_0(nativeObj); + + return retVal; + } + + + // + // C++: void getCovs(vector_Mat& covs) + // + + //javadoc: EM::getCovs(covs) + public void getCovs(List covs) + { + Mat covs_mat = new Mat(); + getCovs_0(nativeObj, covs_mat.nativeObj); + Converters.Mat_to_vector_Mat(covs_mat, covs); + covs_mat.release(); + return; + } + + + // + // C++: void setClustersNumber(int val) + // + + //javadoc: EM::setClustersNumber(val) + public void setClustersNumber(int val) + { + + setClustersNumber_0(nativeObj, val); + + return; + } + + + // + // C++: void setCovarianceMatrixType(int val) + // + + //javadoc: EM::setCovarianceMatrixType(val) + public void setCovarianceMatrixType(int val) + { + + setCovarianceMatrixType_0(nativeObj, val); + + return; + } + + + // + // C++: void setTermCriteria(TermCriteria val) + // + + //javadoc: EM::setTermCriteria(val) + public void setTermCriteria(TermCriteria val) + { + + setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Mat getMeans() + private static native long getMeans_0(long nativeObj); + + // C++: Mat getWeights() + private static native long getWeights_0(long nativeObj); + + // C++: static Ptr_EM create() + private static native long create_0(); + + // C++: TermCriteria getTermCriteria() + private static native double[] getTermCriteria_0(long nativeObj); + + // C++: Vec2d predict2(Mat sample, Mat& probs) + private static native double[] predict2_0(long nativeObj, long sample_nativeObj, long probs_nativeObj); + + // C++: bool trainE(Mat samples, Mat means0, Mat covs0 = Mat(), Mat weights0 = Mat(), Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) + private static native boolean trainE_0(long nativeObj, long samples_nativeObj, long means0_nativeObj, long covs0_nativeObj, long weights0_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj); + private static native boolean trainE_1(long nativeObj, long samples_nativeObj, long means0_nativeObj); + + // C++: bool trainEM(Mat samples, Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) + private static native boolean trainEM_0(long nativeObj, long samples_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj); + private static native boolean trainEM_1(long nativeObj, long samples_nativeObj); + + // C++: bool trainM(Mat samples, Mat probs0, Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) + private static native boolean trainM_0(long nativeObj, long samples_nativeObj, long probs0_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj); + private static native boolean trainM_1(long nativeObj, long samples_nativeObj, long probs0_nativeObj); + + // C++: int getClustersNumber() + private static native int getClustersNumber_0(long nativeObj); + + // C++: int getCovarianceMatrixType() + private static native int getCovarianceMatrixType_0(long nativeObj); + + // C++: void getCovs(vector_Mat& covs) + private static native void getCovs_0(long nativeObj, long covs_mat_nativeObj); + + // C++: void setClustersNumber(int val) + private static native void setClustersNumber_0(long nativeObj, int val); + + // C++: void setCovarianceMatrixType(int val) + private static native void setCovarianceMatrixType_0(long nativeObj, int val); + + // C++: void setTermCriteria(TermCriteria val) + private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/KNearest.java b/openCVLibrary310/src/main/java/org/opencv/ml/KNearest.java new file mode 100644 index 0000000..6d4b641 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/KNearest.java @@ -0,0 +1,211 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Mat; + +// C++: class KNearest +//javadoc: KNearest +public class KNearest extends StatModel { + + protected KNearest(long addr) { super(addr); } + + + public static final int + BRUTE_FORCE = 1, + KDTREE = 2; + + + // + // C++: static Ptr_KNearest create() + // + + //javadoc: KNearest::create() + public static KNearest create() + { + + KNearest retVal = new KNearest(create_0()); + + return retVal; + } + + + // + // C++: bool getIsClassifier() + // + + //javadoc: KNearest::getIsClassifier() + public boolean getIsClassifier() + { + + boolean retVal = getIsClassifier_0(nativeObj); + + return retVal; + } + + + // + // C++: float findNearest(Mat samples, int k, Mat& results, Mat& neighborResponses = Mat(), Mat& dist = Mat()) + // + + //javadoc: KNearest::findNearest(samples, k, results, neighborResponses, dist) + public float findNearest(Mat samples, int k, Mat results, Mat neighborResponses, Mat dist) + { + + float retVal = findNearest_0(nativeObj, samples.nativeObj, k, results.nativeObj, neighborResponses.nativeObj, dist.nativeObj); + + return retVal; + } + + //javadoc: KNearest::findNearest(samples, k, results) + public float findNearest(Mat samples, int k, Mat results) + { + + float retVal = findNearest_1(nativeObj, samples.nativeObj, k, results.nativeObj); + + return retVal; + } + + + // + // C++: int getAlgorithmType() + // + + //javadoc: KNearest::getAlgorithmType() + public int getAlgorithmType() + { + + int retVal = getAlgorithmType_0(nativeObj); + + return retVal; + } + + + // + // C++: int getDefaultK() + // + + //javadoc: KNearest::getDefaultK() + public int getDefaultK() + { + + int retVal = getDefaultK_0(nativeObj); + + return retVal; + } + + + // + // C++: int getEmax() + // + + //javadoc: KNearest::getEmax() + public int getEmax() + { + + int retVal = getEmax_0(nativeObj); + + return retVal; + } + + + // + // C++: void setAlgorithmType(int val) + // + + //javadoc: KNearest::setAlgorithmType(val) + public void setAlgorithmType(int val) + { + + setAlgorithmType_0(nativeObj, val); + + return; + } + + + // + // C++: void setDefaultK(int val) + // + + //javadoc: KNearest::setDefaultK(val) + public void setDefaultK(int val) + { + + setDefaultK_0(nativeObj, val); + + return; + } + + + // + // C++: void setEmax(int val) + // + + //javadoc: KNearest::setEmax(val) + public void setEmax(int val) + { + + setEmax_0(nativeObj, val); + + return; + } + + + // + // C++: void setIsClassifier(bool val) + // + + //javadoc: KNearest::setIsClassifier(val) + public void setIsClassifier(boolean val) + { + + setIsClassifier_0(nativeObj, val); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: static Ptr_KNearest create() + private static native long create_0(); + + // C++: bool getIsClassifier() + private static native boolean getIsClassifier_0(long nativeObj); + + // C++: float findNearest(Mat samples, int k, Mat& results, Mat& neighborResponses = Mat(), Mat& dist = Mat()) + private static native float findNearest_0(long nativeObj, long samples_nativeObj, int k, long results_nativeObj, long neighborResponses_nativeObj, long dist_nativeObj); + private static native float findNearest_1(long nativeObj, long samples_nativeObj, int k, long results_nativeObj); + + // C++: int getAlgorithmType() + private static native int getAlgorithmType_0(long nativeObj); + + // C++: int getDefaultK() + private static native int getDefaultK_0(long nativeObj); + + // C++: int getEmax() + private static native int getEmax_0(long nativeObj); + + // C++: void setAlgorithmType(int val) + private static native void setAlgorithmType_0(long nativeObj, int val); + + // C++: void setDefaultK(int val) + private static native void setDefaultK_0(long nativeObj, int val); + + // C++: void setEmax(int val) + private static native void setEmax_0(long nativeObj, int val); + + // C++: void setIsClassifier(bool val) + private static native void setIsClassifier_0(long nativeObj, boolean val); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/LogisticRegression.java b/openCVLibrary310/src/main/java/org/opencv/ml/LogisticRegression.java new file mode 100644 index 0000000..eb45c65 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/LogisticRegression.java @@ -0,0 +1,300 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Mat; +import org.opencv.core.TermCriteria; + +// C++: class LogisticRegression +//javadoc: LogisticRegression +public class LogisticRegression extends StatModel { + + protected LogisticRegression(long addr) { super(addr); } + + + public static final int + REG_DISABLE = -1, + REG_L1 = 0, + REG_L2 = 1, + BATCH = 0, + MINI_BATCH = 1; + + + // + // C++: Mat get_learnt_thetas() + // + + //javadoc: LogisticRegression::get_learnt_thetas() + public Mat get_learnt_thetas() + { + + Mat retVal = new Mat(get_learnt_thetas_0(nativeObj)); + + return retVal; + } + + + // + // C++: static Ptr_LogisticRegression create() + // + + //javadoc: LogisticRegression::create() + public static LogisticRegression create() + { + + LogisticRegression retVal = new LogisticRegression(create_0()); + + return retVal; + } + + + // + // C++: TermCriteria getTermCriteria() + // + + //javadoc: LogisticRegression::getTermCriteria() + public TermCriteria getTermCriteria() + { + + TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); + + return retVal; + } + + + // + // C++: double getLearningRate() + // + + //javadoc: LogisticRegression::getLearningRate() + public double getLearningRate() + { + + double retVal = getLearningRate_0(nativeObj); + + return retVal; + } + + + // + // C++: float predict(Mat samples, Mat& results = Mat(), int flags = 0) + // + + //javadoc: LogisticRegression::predict(samples, results, flags) + public float predict(Mat samples, Mat results, int flags) + { + + float retVal = predict_0(nativeObj, samples.nativeObj, results.nativeObj, flags); + + return retVal; + } + + //javadoc: LogisticRegression::predict(samples) + public float predict(Mat samples) + { + + float retVal = predict_1(nativeObj, samples.nativeObj); + + return retVal; + } + + + // + // C++: int getIterations() + // + + //javadoc: LogisticRegression::getIterations() + public int getIterations() + { + + int retVal = getIterations_0(nativeObj); + + return retVal; + } + + + // + // C++: int getMiniBatchSize() + // + + //javadoc: LogisticRegression::getMiniBatchSize() + public int getMiniBatchSize() + { + + int retVal = getMiniBatchSize_0(nativeObj); + + return retVal; + } + + + // + // C++: int getRegularization() + // + + //javadoc: LogisticRegression::getRegularization() + public int getRegularization() + { + + int retVal = getRegularization_0(nativeObj); + + return retVal; + } + + + // + // C++: int getTrainMethod() + // + + //javadoc: LogisticRegression::getTrainMethod() + public int getTrainMethod() + { + + int retVal = getTrainMethod_0(nativeObj); + + return retVal; + } + + + // + // C++: void setIterations(int val) + // + + //javadoc: LogisticRegression::setIterations(val) + public void setIterations(int val) + { + + setIterations_0(nativeObj, val); + + return; + } + + + // + // C++: void setLearningRate(double val) + // + + //javadoc: LogisticRegression::setLearningRate(val) + public void setLearningRate(double val) + { + + setLearningRate_0(nativeObj, val); + + return; + } + + + // + // C++: void setMiniBatchSize(int val) + // + + //javadoc: LogisticRegression::setMiniBatchSize(val) + public void setMiniBatchSize(int val) + { + + setMiniBatchSize_0(nativeObj, val); + + return; + } + + + // + // C++: void setRegularization(int val) + // + + //javadoc: LogisticRegression::setRegularization(val) + public void setRegularization(int val) + { + + setRegularization_0(nativeObj, val); + + return; + } + + + // + // C++: void setTermCriteria(TermCriteria val) + // + + //javadoc: LogisticRegression::setTermCriteria(val) + public void setTermCriteria(TermCriteria val) + { + + setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); + + return; + } + + + // + // C++: void setTrainMethod(int val) + // + + //javadoc: LogisticRegression::setTrainMethod(val) + public void setTrainMethod(int val) + { + + setTrainMethod_0(nativeObj, val); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Mat get_learnt_thetas() + private static native long get_learnt_thetas_0(long nativeObj); + + // C++: static Ptr_LogisticRegression create() + private static native long create_0(); + + // C++: TermCriteria getTermCriteria() + private static native double[] getTermCriteria_0(long nativeObj); + + // C++: double getLearningRate() + private static native double getLearningRate_0(long nativeObj); + + // C++: float predict(Mat samples, Mat& results = Mat(), int flags = 0) + private static native float predict_0(long nativeObj, long samples_nativeObj, long results_nativeObj, int flags); + private static native float predict_1(long nativeObj, long samples_nativeObj); + + // C++: int getIterations() + private static native int getIterations_0(long nativeObj); + + // C++: int getMiniBatchSize() + private static native int getMiniBatchSize_0(long nativeObj); + + // C++: int getRegularization() + private static native int getRegularization_0(long nativeObj); + + // C++: int getTrainMethod() + private static native int getTrainMethod_0(long nativeObj); + + // C++: void setIterations(int val) + private static native void setIterations_0(long nativeObj, int val); + + // C++: void setLearningRate(double val) + private static native void setLearningRate_0(long nativeObj, double val); + + // C++: void setMiniBatchSize(int val) + private static native void setMiniBatchSize_0(long nativeObj, int val); + + // C++: void setRegularization(int val) + private static native void setRegularization_0(long nativeObj, int val); + + // C++: void setTermCriteria(TermCriteria val) + private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); + + // C++: void setTrainMethod(int val) + private static native void setTrainMethod_0(long nativeObj, int val); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/Ml.java b/openCVLibrary310/src/main/java/org/opencv/ml/Ml.java new file mode 100644 index 0000000..e8f317d --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/Ml.java @@ -0,0 +1,23 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + + + +public class Ml { + + public static final int + VAR_NUMERICAL = 0, + VAR_ORDERED = 0, + VAR_CATEGORICAL = 1, + TEST_ERROR = 0, + TRAIN_ERROR = 1, + ROW_SAMPLE = 0, + COL_SAMPLE = 1; + + + + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/NormalBayesClassifier.java b/openCVLibrary310/src/main/java/org/opencv/ml/NormalBayesClassifier.java new file mode 100644 index 0000000..0fd85e1 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/NormalBayesClassifier.java @@ -0,0 +1,70 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Mat; + +// C++: class NormalBayesClassifier +//javadoc: NormalBayesClassifier +public class NormalBayesClassifier extends StatModel { + + protected NormalBayesClassifier(long addr) { super(addr); } + + + // + // C++: static Ptr_NormalBayesClassifier create() + // + + //javadoc: NormalBayesClassifier::create() + public static NormalBayesClassifier create() + { + + NormalBayesClassifier retVal = new NormalBayesClassifier(create_0()); + + return retVal; + } + + + // + // C++: float predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0) + // + + //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs, flags) + public float predictProb(Mat inputs, Mat outputs, Mat outputProbs, int flags) + { + + float retVal = predictProb_0(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj, flags); + + return retVal; + } + + //javadoc: NormalBayesClassifier::predictProb(inputs, outputs, outputProbs) + public float predictProb(Mat inputs, Mat outputs, Mat outputProbs) + { + + float retVal = predictProb_1(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj); + + return retVal; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: static Ptr_NormalBayesClassifier create() + private static native long create_0(); + + // C++: float predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0) + private static native float predictProb_0(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj, int flags); + private static native float predictProb_1(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/RTrees.java b/openCVLibrary310/src/main/java/org/opencv/ml/RTrees.java new file mode 100644 index 0000000..238ca69 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/RTrees.java @@ -0,0 +1,163 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Mat; +import org.opencv.core.TermCriteria; + +// C++: class RTrees +//javadoc: RTrees +public class RTrees extends DTrees { + + protected RTrees(long addr) { super(addr); } + + + // + // C++: Mat getVarImportance() + // + + //javadoc: RTrees::getVarImportance() + public Mat getVarImportance() + { + + Mat retVal = new Mat(getVarImportance_0(nativeObj)); + + return retVal; + } + + + // + // C++: static Ptr_RTrees create() + // + + //javadoc: RTrees::create() + public static RTrees create() + { + + RTrees retVal = new RTrees(create_0()); + + return retVal; + } + + + // + // C++: TermCriteria getTermCriteria() + // + + //javadoc: RTrees::getTermCriteria() + public TermCriteria getTermCriteria() + { + + TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); + + return retVal; + } + + + // + // C++: bool getCalculateVarImportance() + // + + //javadoc: RTrees::getCalculateVarImportance() + public boolean getCalculateVarImportance() + { + + boolean retVal = getCalculateVarImportance_0(nativeObj); + + return retVal; + } + + + // + // C++: int getActiveVarCount() + // + + //javadoc: RTrees::getActiveVarCount() + public int getActiveVarCount() + { + + int retVal = getActiveVarCount_0(nativeObj); + + return retVal; + } + + + // + // C++: void setActiveVarCount(int val) + // + + //javadoc: RTrees::setActiveVarCount(val) + public void setActiveVarCount(int val) + { + + setActiveVarCount_0(nativeObj, val); + + return; + } + + + // + // C++: void setCalculateVarImportance(bool val) + // + + //javadoc: RTrees::setCalculateVarImportance(val) + public void setCalculateVarImportance(boolean val) + { + + setCalculateVarImportance_0(nativeObj, val); + + return; + } + + + // + // C++: void setTermCriteria(TermCriteria val) + // + + //javadoc: RTrees::setTermCriteria(val) + public void setTermCriteria(TermCriteria val) + { + + setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Mat getVarImportance() + private static native long getVarImportance_0(long nativeObj); + + // C++: static Ptr_RTrees create() + private static native long create_0(); + + // C++: TermCriteria getTermCriteria() + private static native double[] getTermCriteria_0(long nativeObj); + + // C++: bool getCalculateVarImportance() + private static native boolean getCalculateVarImportance_0(long nativeObj); + + // C++: int getActiveVarCount() + private static native int getActiveVarCount_0(long nativeObj); + + // C++: void setActiveVarCount(int val) + private static native void setActiveVarCount_0(long nativeObj, int val); + + // C++: void setCalculateVarImportance(bool val) + private static native void setCalculateVarImportance_0(long nativeObj, boolean val); + + // C++: void setTermCriteria(TermCriteria val) + private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/SVM.java b/openCVLibrary310/src/main/java/org/opencv/ml/SVM.java new file mode 100644 index 0000000..f7612b6 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/SVM.java @@ -0,0 +1,456 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Mat; +import org.opencv.core.TermCriteria; + +// C++: class SVM +//javadoc: SVM +public class SVM extends StatModel { + + protected SVM(long addr) { super(addr); } + + + public static final int + C_SVC = 100, + NU_SVC = 101, + ONE_CLASS = 102, + EPS_SVR = 103, + NU_SVR = 104, + CUSTOM = -1, + LINEAR = 0, + POLY = 1, + RBF = 2, + SIGMOID = 3, + CHI2 = 4, + INTER = 5, + C = 0, + GAMMA = 1, + P = 2, + NU = 3, + COEF = 4, + DEGREE = 5; + + + // + // C++: Mat getClassWeights() + // + + //javadoc: SVM::getClassWeights() + public Mat getClassWeights() + { + + Mat retVal = new Mat(getClassWeights_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getSupportVectors() + // + + //javadoc: SVM::getSupportVectors() + public Mat getSupportVectors() + { + + Mat retVal = new Mat(getSupportVectors_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getUncompressedSupportVectors() + // + + //javadoc: SVM::getUncompressedSupportVectors() + public Mat getUncompressedSupportVectors() + { + + Mat retVal = new Mat(getUncompressedSupportVectors_0(nativeObj)); + + return retVal; + } + + + // + // C++: static Ptr_SVM create() + // + + //javadoc: SVM::create() + public static SVM create() + { + + SVM retVal = new SVM(create_0()); + + return retVal; + } + + + // + // C++: TermCriteria getTermCriteria() + // + + //javadoc: SVM::getTermCriteria() + public TermCriteria getTermCriteria() + { + + TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); + + return retVal; + } + + + // + // C++: double getC() + // + + //javadoc: SVM::getC() + public double getC() + { + + double retVal = getC_0(nativeObj); + + return retVal; + } + + + // + // C++: double getCoef0() + // + + //javadoc: SVM::getCoef0() + public double getCoef0() + { + + double retVal = getCoef0_0(nativeObj); + + return retVal; + } + + + // + // C++: double getDecisionFunction(int i, Mat& alpha, Mat& svidx) + // + + //javadoc: SVM::getDecisionFunction(i, alpha, svidx) + public double getDecisionFunction(int i, Mat alpha, Mat svidx) + { + + double retVal = getDecisionFunction_0(nativeObj, i, alpha.nativeObj, svidx.nativeObj); + + return retVal; + } + + + // + // C++: double getDegree() + // + + //javadoc: SVM::getDegree() + public double getDegree() + { + + double retVal = getDegree_0(nativeObj); + + return retVal; + } + + + // + // C++: double getGamma() + // + + //javadoc: SVM::getGamma() + public double getGamma() + { + + double retVal = getGamma_0(nativeObj); + + return retVal; + } + + + // + // C++: double getNu() + // + + //javadoc: SVM::getNu() + public double getNu() + { + + double retVal = getNu_0(nativeObj); + + return retVal; + } + + + // + // C++: double getP() + // + + //javadoc: SVM::getP() + public double getP() + { + + double retVal = getP_0(nativeObj); + + return retVal; + } + + + // + // C++: int getKernelType() + // + + //javadoc: SVM::getKernelType() + public int getKernelType() + { + + int retVal = getKernelType_0(nativeObj); + + return retVal; + } + + + // + // C++: int getType() + // + + //javadoc: SVM::getType() + public int getType() + { + + int retVal = getType_0(nativeObj); + + return retVal; + } + + + // + // C++: void setC(double val) + // + + //javadoc: SVM::setC(val) + public void setC(double val) + { + + setC_0(nativeObj, val); + + return; + } + + + // + // C++: void setClassWeights(Mat val) + // + + //javadoc: SVM::setClassWeights(val) + public void setClassWeights(Mat val) + { + + setClassWeights_0(nativeObj, val.nativeObj); + + return; + } + + + // + // C++: void setCoef0(double val) + // + + //javadoc: SVM::setCoef0(val) + public void setCoef0(double val) + { + + setCoef0_0(nativeObj, val); + + return; + } + + + // + // C++: void setDegree(double val) + // + + //javadoc: SVM::setDegree(val) + public void setDegree(double val) + { + + setDegree_0(nativeObj, val); + + return; + } + + + // + // C++: void setGamma(double val) + // + + //javadoc: SVM::setGamma(val) + public void setGamma(double val) + { + + setGamma_0(nativeObj, val); + + return; + } + + + // + // C++: void setKernel(int kernelType) + // + + //javadoc: SVM::setKernel(kernelType) + public void setKernel(int kernelType) + { + + setKernel_0(nativeObj, kernelType); + + return; + } + + + // + // C++: void setNu(double val) + // + + //javadoc: SVM::setNu(val) + public void setNu(double val) + { + + setNu_0(nativeObj, val); + + return; + } + + + // + // C++: void setP(double val) + // + + //javadoc: SVM::setP(val) + public void setP(double val) + { + + setP_0(nativeObj, val); + + return; + } + + + // + // C++: void setTermCriteria(TermCriteria val) + // + + //javadoc: SVM::setTermCriteria(val) + public void setTermCriteria(TermCriteria val) + { + + setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); + + return; + } + + + // + // C++: void setType(int val) + // + + //javadoc: SVM::setType(val) + public void setType(int val) + { + + setType_0(nativeObj, val); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Mat getClassWeights() + private static native long getClassWeights_0(long nativeObj); + + // C++: Mat getSupportVectors() + private static native long getSupportVectors_0(long nativeObj); + + // C++: Mat getUncompressedSupportVectors() + private static native long getUncompressedSupportVectors_0(long nativeObj); + + // C++: static Ptr_SVM create() + private static native long create_0(); + + // C++: TermCriteria getTermCriteria() + private static native double[] getTermCriteria_0(long nativeObj); + + // C++: double getC() + private static native double getC_0(long nativeObj); + + // C++: double getCoef0() + private static native double getCoef0_0(long nativeObj); + + // C++: double getDecisionFunction(int i, Mat& alpha, Mat& svidx) + private static native double getDecisionFunction_0(long nativeObj, int i, long alpha_nativeObj, long svidx_nativeObj); + + // C++: double getDegree() + private static native double getDegree_0(long nativeObj); + + // C++: double getGamma() + private static native double getGamma_0(long nativeObj); + + // C++: double getNu() + private static native double getNu_0(long nativeObj); + + // C++: double getP() + private static native double getP_0(long nativeObj); + + // C++: int getKernelType() + private static native int getKernelType_0(long nativeObj); + + // C++: int getType() + private static native int getType_0(long nativeObj); + + // C++: void setC(double val) + private static native void setC_0(long nativeObj, double val); + + // C++: void setClassWeights(Mat val) + private static native void setClassWeights_0(long nativeObj, long val_nativeObj); + + // C++: void setCoef0(double val) + private static native void setCoef0_0(long nativeObj, double val); + + // C++: void setDegree(double val) + private static native void setDegree_0(long nativeObj, double val); + + // C++: void setGamma(double val) + private static native void setGamma_0(long nativeObj, double val); + + // C++: void setKernel(int kernelType) + private static native void setKernel_0(long nativeObj, int kernelType); + + // C++: void setNu(double val) + private static native void setNu_0(long nativeObj, double val); + + // C++: void setP(double val) + private static native void setP_0(long nativeObj, double val); + + // C++: void setTermCriteria(TermCriteria val) + private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); + + // C++: void setType(int val) + private static native void setType_0(long nativeObj, int val); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/StatModel.java b/openCVLibrary310/src/main/java/org/opencv/ml/StatModel.java new file mode 100644 index 0000000..ff31eb9 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/StatModel.java @@ -0,0 +1,160 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; + +// C++: class StatModel +//javadoc: StatModel +public class StatModel extends Algorithm { + + protected StatModel(long addr) { super(addr); } + + + public static final int + UPDATE_MODEL = 1, + RAW_OUTPUT = 1, + COMPRESSED_INPUT = 2, + PREPROCESSED_INPUT = 4; + + + // + // C++: bool empty() + // + + //javadoc: StatModel::empty() + public boolean empty() + { + + boolean retVal = empty_0(nativeObj); + + return retVal; + } + + + // + // C++: bool isClassifier() + // + + //javadoc: StatModel::isClassifier() + public boolean isClassifier() + { + + boolean retVal = isClassifier_0(nativeObj); + + return retVal; + } + + + // + // C++: bool isTrained() + // + + //javadoc: StatModel::isTrained() + public boolean isTrained() + { + + boolean retVal = isTrained_0(nativeObj); + + return retVal; + } + + + // + // C++: bool train(Mat samples, int layout, Mat responses) + // + + //javadoc: StatModel::train(samples, layout, responses) + public boolean train(Mat samples, int layout, Mat responses) + { + + boolean retVal = train_0(nativeObj, samples.nativeObj, layout, responses.nativeObj); + + return retVal; + } + + + // + // C++: bool train(Ptr_TrainData trainData, int flags = 0) + // + + // Unknown type 'Ptr_TrainData' (I), skipping the function + + + // + // C++: float calcError(Ptr_TrainData data, bool test, Mat& resp) + // + + // Unknown type 'Ptr_TrainData' (I), skipping the function + + + // + // C++: float predict(Mat samples, Mat& results = Mat(), int flags = 0) + // + + //javadoc: StatModel::predict(samples, results, flags) + public float predict(Mat samples, Mat results, int flags) + { + + float retVal = predict_0(nativeObj, samples.nativeObj, results.nativeObj, flags); + + return retVal; + } + + //javadoc: StatModel::predict(samples) + public float predict(Mat samples) + { + + float retVal = predict_1(nativeObj, samples.nativeObj); + + return retVal; + } + + + // + // C++: int getVarCount() + // + + //javadoc: StatModel::getVarCount() + public int getVarCount() + { + + int retVal = getVarCount_0(nativeObj); + + return retVal; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: bool empty() + private static native boolean empty_0(long nativeObj); + + // C++: bool isClassifier() + private static native boolean isClassifier_0(long nativeObj); + + // C++: bool isTrained() + private static native boolean isTrained_0(long nativeObj); + + // C++: bool train(Mat samples, int layout, Mat responses) + private static native boolean train_0(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj); + + // C++: float predict(Mat samples, Mat& results = Mat(), int flags = 0) + private static native float predict_0(long nativeObj, long samples_nativeObj, long results_nativeObj, int flags); + private static native float predict_1(long nativeObj, long samples_nativeObj); + + // C++: int getVarCount() + private static native int getVarCount_0(long nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/ml/TrainData.java b/openCVLibrary310/src/main/java/org/opencv/ml/TrainData.java new file mode 100644 index 0000000..d7bc2ac --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/ml/TrainData.java @@ -0,0 +1,642 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.ml; + +import org.opencv.core.Mat; + +// C++: class TrainData +//javadoc: TrainData +public class TrainData { + + protected final long nativeObj; + protected TrainData(long addr) { nativeObj = addr; } + + + // + // C++: Mat getCatMap() + // + + //javadoc: TrainData::getCatMap() + public Mat getCatMap() + { + + Mat retVal = new Mat(getCatMap_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getCatOfs() + // + + //javadoc: TrainData::getCatOfs() + public Mat getCatOfs() + { + + Mat retVal = new Mat(getCatOfs_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getClassLabels() + // + + //javadoc: TrainData::getClassLabels() + public Mat getClassLabels() + { + + Mat retVal = new Mat(getClassLabels_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getDefaultSubstValues() + // + + //javadoc: TrainData::getDefaultSubstValues() + public Mat getDefaultSubstValues() + { + + Mat retVal = new Mat(getDefaultSubstValues_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getMissing() + // + + //javadoc: TrainData::getMissing() + public Mat getMissing() + { + + Mat retVal = new Mat(getMissing_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getNormCatResponses() + // + + //javadoc: TrainData::getNormCatResponses() + public Mat getNormCatResponses() + { + + Mat retVal = new Mat(getNormCatResponses_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getResponses() + // + + //javadoc: TrainData::getResponses() + public Mat getResponses() + { + + Mat retVal = new Mat(getResponses_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getSampleWeights() + // + + //javadoc: TrainData::getSampleWeights() + public Mat getSampleWeights() + { + + Mat retVal = new Mat(getSampleWeights_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getSamples() + // + + //javadoc: TrainData::getSamples() + public Mat getSamples() + { + + Mat retVal = new Mat(getSamples_0(nativeObj)); + + return retVal; + } + + + // + // C++: static Mat getSubVector(Mat vec, Mat idx) + // + + //javadoc: TrainData::getSubVector(vec, idx) + public static Mat getSubVector(Mat vec, Mat idx) + { + + Mat retVal = new Mat(getSubVector_0(vec.nativeObj, idx.nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTestNormCatResponses() + // + + //javadoc: TrainData::getTestNormCatResponses() + public Mat getTestNormCatResponses() + { + + Mat retVal = new Mat(getTestNormCatResponses_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTestResponses() + // + + //javadoc: TrainData::getTestResponses() + public Mat getTestResponses() + { + + Mat retVal = new Mat(getTestResponses_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTestSampleIdx() + // + + //javadoc: TrainData::getTestSampleIdx() + public Mat getTestSampleIdx() + { + + Mat retVal = new Mat(getTestSampleIdx_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTestSampleWeights() + // + + //javadoc: TrainData::getTestSampleWeights() + public Mat getTestSampleWeights() + { + + Mat retVal = new Mat(getTestSampleWeights_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTrainNormCatResponses() + // + + //javadoc: TrainData::getTrainNormCatResponses() + public Mat getTrainNormCatResponses() + { + + Mat retVal = new Mat(getTrainNormCatResponses_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTrainResponses() + // + + //javadoc: TrainData::getTrainResponses() + public Mat getTrainResponses() + { + + Mat retVal = new Mat(getTrainResponses_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTrainSampleIdx() + // + + //javadoc: TrainData::getTrainSampleIdx() + public Mat getTrainSampleIdx() + { + + Mat retVal = new Mat(getTrainSampleIdx_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTrainSampleWeights() + // + + //javadoc: TrainData::getTrainSampleWeights() + public Mat getTrainSampleWeights() + { + + Mat retVal = new Mat(getTrainSampleWeights_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getTrainSamples(int layout = ROW_SAMPLE, bool compressSamples = true, bool compressVars = true) + // + + //javadoc: TrainData::getTrainSamples(layout, compressSamples, compressVars) + public Mat getTrainSamples(int layout, boolean compressSamples, boolean compressVars) + { + + Mat retVal = new Mat(getTrainSamples_0(nativeObj, layout, compressSamples, compressVars)); + + return retVal; + } + + //javadoc: TrainData::getTrainSamples() + public Mat getTrainSamples() + { + + Mat retVal = new Mat(getTrainSamples_1(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getVarIdx() + // + + //javadoc: TrainData::getVarIdx() + public Mat getVarIdx() + { + + Mat retVal = new Mat(getVarIdx_0(nativeObj)); + + return retVal; + } + + + // + // C++: Mat getVarType() + // + + //javadoc: TrainData::getVarType() + public Mat getVarType() + { + + Mat retVal = new Mat(getVarType_0(nativeObj)); + + return retVal; + } + + + // + // C++: static Ptr_TrainData create(Mat samples, int layout, Mat responses, Mat varIdx = Mat(), Mat sampleIdx = Mat(), Mat sampleWeights = Mat(), Mat varType = Mat()) + // + + // Return type 'Ptr_TrainData' is not supported, skipping the function + + + // + // C++: int getCatCount(int vi) + // + + //javadoc: TrainData::getCatCount(vi) + public int getCatCount(int vi) + { + + int retVal = getCatCount_0(nativeObj, vi); + + return retVal; + } + + + // + // C++: int getLayout() + // + + //javadoc: TrainData::getLayout() + public int getLayout() + { + + int retVal = getLayout_0(nativeObj); + + return retVal; + } + + + // + // C++: int getNAllVars() + // + + //javadoc: TrainData::getNAllVars() + public int getNAllVars() + { + + int retVal = getNAllVars_0(nativeObj); + + return retVal; + } + + + // + // C++: int getNSamples() + // + + //javadoc: TrainData::getNSamples() + public int getNSamples() + { + + int retVal = getNSamples_0(nativeObj); + + return retVal; + } + + + // + // C++: int getNTestSamples() + // + + //javadoc: TrainData::getNTestSamples() + public int getNTestSamples() + { + + int retVal = getNTestSamples_0(nativeObj); + + return retVal; + } + + + // + // C++: int getNTrainSamples() + // + + //javadoc: TrainData::getNTrainSamples() + public int getNTrainSamples() + { + + int retVal = getNTrainSamples_0(nativeObj); + + return retVal; + } + + + // + // C++: int getNVars() + // + + //javadoc: TrainData::getNVars() + public int getNVars() + { + + int retVal = getNVars_0(nativeObj); + + return retVal; + } + + + // + // C++: int getResponseType() + // + + //javadoc: TrainData::getResponseType() + public int getResponseType() + { + + int retVal = getResponseType_0(nativeObj); + + return retVal; + } + + + // + // C++: void getSample(Mat varIdx, int sidx, float* buf) + // + + //javadoc: TrainData::getSample(varIdx, sidx, buf) + public void getSample(Mat varIdx, int sidx, float buf) + { + + getSample_0(nativeObj, varIdx.nativeObj, sidx, buf); + + return; + } + + + // + // C++: void getValues(int vi, Mat sidx, float* values) + // + + //javadoc: TrainData::getValues(vi, sidx, values) + public void getValues(int vi, Mat sidx, float values) + { + + getValues_0(nativeObj, vi, sidx.nativeObj, values); + + return; + } + + + // + // C++: void setTrainTestSplit(int count, bool shuffle = true) + // + + //javadoc: TrainData::setTrainTestSplit(count, shuffle) + public void setTrainTestSplit(int count, boolean shuffle) + { + + setTrainTestSplit_0(nativeObj, count, shuffle); + + return; + } + + //javadoc: TrainData::setTrainTestSplit(count) + public void setTrainTestSplit(int count) + { + + setTrainTestSplit_1(nativeObj, count); + + return; + } + + + // + // C++: void setTrainTestSplitRatio(double ratio, bool shuffle = true) + // + + //javadoc: TrainData::setTrainTestSplitRatio(ratio, shuffle) + public void setTrainTestSplitRatio(double ratio, boolean shuffle) + { + + setTrainTestSplitRatio_0(nativeObj, ratio, shuffle); + + return; + } + + //javadoc: TrainData::setTrainTestSplitRatio(ratio) + public void setTrainTestSplitRatio(double ratio) + { + + setTrainTestSplitRatio_1(nativeObj, ratio); + + return; + } + + + // + // C++: void shuffleTrainTest() + // + + //javadoc: TrainData::shuffleTrainTest() + public void shuffleTrainTest() + { + + shuffleTrainTest_0(nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Mat getCatMap() + private static native long getCatMap_0(long nativeObj); + + // C++: Mat getCatOfs() + private static native long getCatOfs_0(long nativeObj); + + // C++: Mat getClassLabels() + private static native long getClassLabels_0(long nativeObj); + + // C++: Mat getDefaultSubstValues() + private static native long getDefaultSubstValues_0(long nativeObj); + + // C++: Mat getMissing() + private static native long getMissing_0(long nativeObj); + + // C++: Mat getNormCatResponses() + private static native long getNormCatResponses_0(long nativeObj); + + // C++: Mat getResponses() + private static native long getResponses_0(long nativeObj); + + // C++: Mat getSampleWeights() + private static native long getSampleWeights_0(long nativeObj); + + // C++: Mat getSamples() + private static native long getSamples_0(long nativeObj); + + // C++: static Mat getSubVector(Mat vec, Mat idx) + private static native long getSubVector_0(long vec_nativeObj, long idx_nativeObj); + + // C++: Mat getTestNormCatResponses() + private static native long getTestNormCatResponses_0(long nativeObj); + + // C++: Mat getTestResponses() + private static native long getTestResponses_0(long nativeObj); + + // C++: Mat getTestSampleIdx() + private static native long getTestSampleIdx_0(long nativeObj); + + // C++: Mat getTestSampleWeights() + private static native long getTestSampleWeights_0(long nativeObj); + + // C++: Mat getTrainNormCatResponses() + private static native long getTrainNormCatResponses_0(long nativeObj); + + // C++: Mat getTrainResponses() + private static native long getTrainResponses_0(long nativeObj); + + // C++: Mat getTrainSampleIdx() + private static native long getTrainSampleIdx_0(long nativeObj); + + // C++: Mat getTrainSampleWeights() + private static native long getTrainSampleWeights_0(long nativeObj); + + // C++: Mat getTrainSamples(int layout = ROW_SAMPLE, bool compressSamples = true, bool compressVars = true) + private static native long getTrainSamples_0(long nativeObj, int layout, boolean compressSamples, boolean compressVars); + private static native long getTrainSamples_1(long nativeObj); + + // C++: Mat getVarIdx() + private static native long getVarIdx_0(long nativeObj); + + // C++: Mat getVarType() + private static native long getVarType_0(long nativeObj); + + // C++: int getCatCount(int vi) + private static native int getCatCount_0(long nativeObj, int vi); + + // C++: int getLayout() + private static native int getLayout_0(long nativeObj); + + // C++: int getNAllVars() + private static native int getNAllVars_0(long nativeObj); + + // C++: int getNSamples() + private static native int getNSamples_0(long nativeObj); + + // C++: int getNTestSamples() + private static native int getNTestSamples_0(long nativeObj); + + // C++: int getNTrainSamples() + private static native int getNTrainSamples_0(long nativeObj); + + // C++: int getNVars() + private static native int getNVars_0(long nativeObj); + + // C++: int getResponseType() + private static native int getResponseType_0(long nativeObj); + + // C++: void getSample(Mat varIdx, int sidx, float* buf) + private static native void getSample_0(long nativeObj, long varIdx_nativeObj, int sidx, float buf); + + // C++: void getValues(int vi, Mat sidx, float* values) + private static native void getValues_0(long nativeObj, int vi, long sidx_nativeObj, float values); + + // C++: void setTrainTestSplit(int count, bool shuffle = true) + private static native void setTrainTestSplit_0(long nativeObj, int count, boolean shuffle); + private static native void setTrainTestSplit_1(long nativeObj, int count); + + // C++: void setTrainTestSplitRatio(double ratio, bool shuffle = true) + private static native void setTrainTestSplitRatio_0(long nativeObj, double ratio, boolean shuffle); + private static native void setTrainTestSplitRatio_1(long nativeObj, double ratio); + + // C++: void shuffleTrainTest() + private static native void shuffleTrainTest_0(long nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/objdetect/BaseCascadeClassifier.java b/openCVLibrary310/src/main/java/org/opencv/objdetect/BaseCascadeClassifier.java new file mode 100644 index 0000000..21c8db7 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/objdetect/BaseCascadeClassifier.java @@ -0,0 +1,26 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.objdetect; + +import org.opencv.core.Algorithm; + +// C++: class BaseCascadeClassifier +//javadoc: BaseCascadeClassifier +public class BaseCascadeClassifier extends Algorithm { + + protected BaseCascadeClassifier(long addr) { super(addr); } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/objdetect/CascadeClassifier.java b/openCVLibrary310/src/main/java/org/opencv/objdetect/CascadeClassifier.java new file mode 100644 index 0000000..4f4c39c --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/objdetect/CascadeClassifier.java @@ -0,0 +1,263 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.objdetect; + +import java.lang.String; +import java.util.ArrayList; +import org.opencv.core.Mat; +import org.opencv.core.MatOfDouble; +import org.opencv.core.MatOfInt; +import org.opencv.core.MatOfRect; +import org.opencv.core.Size; + +// C++: class CascadeClassifier +//javadoc: CascadeClassifier +public class CascadeClassifier { + + protected final long nativeObj; + protected CascadeClassifier(long addr) { nativeObj = addr; } + + + // + // C++: CascadeClassifier(String filename) + // + + //javadoc: CascadeClassifier::CascadeClassifier(filename) + public CascadeClassifier(String filename) + { + + nativeObj = CascadeClassifier_0(filename); + + return; + } + + + // + // C++: CascadeClassifier() + // + + //javadoc: CascadeClassifier::CascadeClassifier() + public CascadeClassifier() + { + + nativeObj = CascadeClassifier_1(); + + return; + } + + + // + // C++: Size getOriginalWindowSize() + // + + //javadoc: CascadeClassifier::getOriginalWindowSize() + public Size getOriginalWindowSize() + { + + Size retVal = new Size(getOriginalWindowSize_0(nativeObj)); + + return retVal; + } + + + // + // C++: static bool convert(String oldcascade, String newcascade) + // + + //javadoc: CascadeClassifier::convert(oldcascade, newcascade) + public static boolean convert(String oldcascade, String newcascade) + { + + boolean retVal = convert_0(oldcascade, newcascade); + + return retVal; + } + + + // + // C++: bool empty() + // + + //javadoc: CascadeClassifier::empty() + public boolean empty() + { + + boolean retVal = empty_0(nativeObj); + + return retVal; + } + + + // + // C++: bool isOldFormatCascade() + // + + //javadoc: CascadeClassifier::isOldFormatCascade() + public boolean isOldFormatCascade() + { + + boolean retVal = isOldFormatCascade_0(nativeObj); + + return retVal; + } + + + // + // C++: bool load(String filename) + // + + //javadoc: CascadeClassifier::load(filename) + public boolean load(String filename) + { + + boolean retVal = load_0(nativeObj, filename); + + return retVal; + } + + + // + // C++: bool read(FileNode node) + // + + // Unknown type 'FileNode' (I), skipping the function + + + // + // C++: int getFeatureType() + // + + //javadoc: CascadeClassifier::getFeatureType() + public int getFeatureType() + { + + int retVal = getFeatureType_0(nativeObj); + + return retVal; + } + + + // + // C++: void detectMultiScale(Mat image, vector_Rect& objects, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size()) + // + + //javadoc: CascadeClassifier::detectMultiScale(image, objects, scaleFactor, minNeighbors, flags, minSize, maxSize) + public void detectMultiScale(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize) + { + Mat objects_mat = objects; + detectMultiScale_0(nativeObj, image.nativeObj, objects_mat.nativeObj, scaleFactor, minNeighbors, flags, minSize.width, minSize.height, maxSize.width, maxSize.height); + + return; + } + + //javadoc: CascadeClassifier::detectMultiScale(image, objects) + public void detectMultiScale(Mat image, MatOfRect objects) + { + Mat objects_mat = objects; + detectMultiScale_1(nativeObj, image.nativeObj, objects_mat.nativeObj); + + return; + } + + + // + // C++: void detectMultiScale(Mat image, vector_Rect& objects, vector_int& numDetections, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size()) + // + + //javadoc: CascadeClassifier::detectMultiScale(image, objects, numDetections, scaleFactor, minNeighbors, flags, minSize, maxSize) + public void detectMultiScale2(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize) + { + Mat objects_mat = objects; + Mat numDetections_mat = numDetections; + detectMultiScale2_0(nativeObj, image.nativeObj, objects_mat.nativeObj, numDetections_mat.nativeObj, scaleFactor, minNeighbors, flags, minSize.width, minSize.height, maxSize.width, maxSize.height); + + return; + } + + //javadoc: CascadeClassifier::detectMultiScale(image, objects, numDetections) + public void detectMultiScale2(Mat image, MatOfRect objects, MatOfInt numDetections) + { + Mat objects_mat = objects; + Mat numDetections_mat = numDetections; + detectMultiScale2_1(nativeObj, image.nativeObj, objects_mat.nativeObj, numDetections_mat.nativeObj); + + return; + } + + + // + // C++: void detectMultiScale(Mat image, vector_Rect& objects, vector_int& rejectLevels, vector_double& levelWeights, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size(), bool outputRejectLevels = false) + // + + //javadoc: CascadeClassifier::detectMultiScale(image, objects, rejectLevels, levelWeights, scaleFactor, minNeighbors, flags, minSize, maxSize, outputRejectLevels) + public void detectMultiScale3(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize, boolean outputRejectLevels) + { + Mat objects_mat = objects; + Mat rejectLevels_mat = rejectLevels; + Mat levelWeights_mat = levelWeights; + detectMultiScale3_0(nativeObj, image.nativeObj, objects_mat.nativeObj, rejectLevels_mat.nativeObj, levelWeights_mat.nativeObj, scaleFactor, minNeighbors, flags, minSize.width, minSize.height, maxSize.width, maxSize.height, outputRejectLevels); + + return; + } + + //javadoc: CascadeClassifier::detectMultiScale(image, objects, rejectLevels, levelWeights) + public void detectMultiScale3(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights) + { + Mat objects_mat = objects; + Mat rejectLevels_mat = rejectLevels; + Mat levelWeights_mat = levelWeights; + detectMultiScale3_1(nativeObj, image.nativeObj, objects_mat.nativeObj, rejectLevels_mat.nativeObj, levelWeights_mat.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: CascadeClassifier(String filename) + private static native long CascadeClassifier_0(String filename); + + // C++: CascadeClassifier() + private static native long CascadeClassifier_1(); + + // C++: Size getOriginalWindowSize() + private static native double[] getOriginalWindowSize_0(long nativeObj); + + // C++: static bool convert(String oldcascade, String newcascade) + private static native boolean convert_0(String oldcascade, String newcascade); + + // C++: bool empty() + private static native boolean empty_0(long nativeObj); + + // C++: bool isOldFormatCascade() + private static native boolean isOldFormatCascade_0(long nativeObj); + + // C++: bool load(String filename) + private static native boolean load_0(long nativeObj, String filename); + + // C++: int getFeatureType() + private static native int getFeatureType_0(long nativeObj); + + // C++: void detectMultiScale(Mat image, vector_Rect& objects, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size()) + private static native void detectMultiScale_0(long nativeObj, long image_nativeObj, long objects_mat_nativeObj, double scaleFactor, int minNeighbors, int flags, double minSize_width, double minSize_height, double maxSize_width, double maxSize_height); + private static native void detectMultiScale_1(long nativeObj, long image_nativeObj, long objects_mat_nativeObj); + + // C++: void detectMultiScale(Mat image, vector_Rect& objects, vector_int& numDetections, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size()) + private static native void detectMultiScale2_0(long nativeObj, long image_nativeObj, long objects_mat_nativeObj, long numDetections_mat_nativeObj, double scaleFactor, int minNeighbors, int flags, double minSize_width, double minSize_height, double maxSize_width, double maxSize_height); + private static native void detectMultiScale2_1(long nativeObj, long image_nativeObj, long objects_mat_nativeObj, long numDetections_mat_nativeObj); + + // C++: void detectMultiScale(Mat image, vector_Rect& objects, vector_int& rejectLevels, vector_double& levelWeights, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size(), bool outputRejectLevels = false) + private static native void detectMultiScale3_0(long nativeObj, long image_nativeObj, long objects_mat_nativeObj, long rejectLevels_mat_nativeObj, long levelWeights_mat_nativeObj, double scaleFactor, int minNeighbors, int flags, double minSize_width, double minSize_height, double maxSize_width, double maxSize_height, boolean outputRejectLevels); + private static native void detectMultiScale3_1(long nativeObj, long image_nativeObj, long objects_mat_nativeObj, long rejectLevels_mat_nativeObj, long levelWeights_mat_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/objdetect/HOGDescriptor.java b/openCVLibrary310/src/main/java/org/opencv/objdetect/HOGDescriptor.java new file mode 100644 index 0000000..e86beee --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/objdetect/HOGDescriptor.java @@ -0,0 +1,591 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.objdetect; + +import java.lang.String; +import java.util.ArrayList; +import org.opencv.core.Mat; +import org.opencv.core.MatOfDouble; +import org.opencv.core.MatOfFloat; +import org.opencv.core.MatOfPoint; +import org.opencv.core.MatOfRect; +import org.opencv.core.Size; + +// C++: class HOGDescriptor +//javadoc: HOGDescriptor +public class HOGDescriptor { + + protected final long nativeObj; + protected HOGDescriptor(long addr) { nativeObj = addr; } + + + public static final int + L2Hys = 0, + DEFAULT_NLEVELS = 64; + + + // + // C++: HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture = 1, double _winSigma = -1, int _histogramNormType = HOGDescriptor::L2Hys, double _L2HysThreshold = 0.2, bool _gammaCorrection = false, int _nlevels = HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient = false) + // + + //javadoc: HOGDescriptor::HOGDescriptor(_winSize, _blockSize, _blockStride, _cellSize, _nbins, _derivAperture, _winSigma, _histogramNormType, _L2HysThreshold, _gammaCorrection, _nlevels, _signedGradient) + public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection, int _nlevels, boolean _signedGradient) + { + + nativeObj = HOGDescriptor_0(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins, _derivAperture, _winSigma, _histogramNormType, _L2HysThreshold, _gammaCorrection, _nlevels, _signedGradient); + + return; + } + + //javadoc: HOGDescriptor::HOGDescriptor(_winSize, _blockSize, _blockStride, _cellSize, _nbins) + public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins) + { + + nativeObj = HOGDescriptor_1(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins); + + return; + } + + + // + // C++: HOGDescriptor(String filename) + // + + //javadoc: HOGDescriptor::HOGDescriptor(filename) + public HOGDescriptor(String filename) + { + + nativeObj = HOGDescriptor_2(filename); + + return; + } + + + // + // C++: HOGDescriptor() + // + + //javadoc: HOGDescriptor::HOGDescriptor() + public HOGDescriptor() + { + + nativeObj = HOGDescriptor_3(); + + return; + } + + + // + // C++: bool checkDetectorSize() + // + + //javadoc: HOGDescriptor::checkDetectorSize() + public boolean checkDetectorSize() + { + + boolean retVal = checkDetectorSize_0(nativeObj); + + return retVal; + } + + + // + // C++: bool load(String filename, String objname = String()) + // + + //javadoc: HOGDescriptor::load(filename, objname) + public boolean load(String filename, String objname) + { + + boolean retVal = load_0(nativeObj, filename, objname); + + return retVal; + } + + //javadoc: HOGDescriptor::load(filename) + public boolean load(String filename) + { + + boolean retVal = load_1(nativeObj, filename); + + return retVal; + } + + + // + // C++: double getWinSigma() + // + + //javadoc: HOGDescriptor::getWinSigma() + public double getWinSigma() + { + + double retVal = getWinSigma_0(nativeObj); + + return retVal; + } + + + // + // C++: size_t getDescriptorSize() + // + + //javadoc: HOGDescriptor::getDescriptorSize() + public long getDescriptorSize() + { + + long retVal = getDescriptorSize_0(nativeObj); + + return retVal; + } + + + // + // C++: static vector_float getDaimlerPeopleDetector() + // + + //javadoc: HOGDescriptor::getDaimlerPeopleDetector() + public static MatOfFloat getDaimlerPeopleDetector() + { + + MatOfFloat retVal = MatOfFloat.fromNativeAddr(getDaimlerPeopleDetector_0()); + + return retVal; + } + + + // + // C++: static vector_float getDefaultPeopleDetector() + // + + //javadoc: HOGDescriptor::getDefaultPeopleDetector() + public static MatOfFloat getDefaultPeopleDetector() + { + + MatOfFloat retVal = MatOfFloat.fromNativeAddr(getDefaultPeopleDetector_0()); + + return retVal; + } + + + // + // C++: void compute(Mat img, vector_float& descriptors, Size winStride = Size(), Size padding = Size(), vector_Point locations = std::vector()) + // + + //javadoc: HOGDescriptor::compute(img, descriptors, winStride, padding, locations) + public void compute(Mat img, MatOfFloat descriptors, Size winStride, Size padding, MatOfPoint locations) + { + Mat descriptors_mat = descriptors; + Mat locations_mat = locations; + compute_0(nativeObj, img.nativeObj, descriptors_mat.nativeObj, winStride.width, winStride.height, padding.width, padding.height, locations_mat.nativeObj); + + return; + } + + //javadoc: HOGDescriptor::compute(img, descriptors) + public void compute(Mat img, MatOfFloat descriptors) + { + Mat descriptors_mat = descriptors; + compute_1(nativeObj, img.nativeObj, descriptors_mat.nativeObj); + + return; + } + + + // + // C++: void computeGradient(Mat img, Mat& grad, Mat& angleOfs, Size paddingTL = Size(), Size paddingBR = Size()) + // + + //javadoc: HOGDescriptor::computeGradient(img, grad, angleOfs, paddingTL, paddingBR) + public void computeGradient(Mat img, Mat grad, Mat angleOfs, Size paddingTL, Size paddingBR) + { + + computeGradient_0(nativeObj, img.nativeObj, grad.nativeObj, angleOfs.nativeObj, paddingTL.width, paddingTL.height, paddingBR.width, paddingBR.height); + + return; + } + + //javadoc: HOGDescriptor::computeGradient(img, grad, angleOfs) + public void computeGradient(Mat img, Mat grad, Mat angleOfs) + { + + computeGradient_1(nativeObj, img.nativeObj, grad.nativeObj, angleOfs.nativeObj); + + return; + } + + + // + // C++: void detect(Mat img, vector_Point& foundLocations, vector_double& weights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), vector_Point searchLocations = std::vector()) + // + + //javadoc: HOGDescriptor::detect(img, foundLocations, weights, hitThreshold, winStride, padding, searchLocations) + public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride, Size padding, MatOfPoint searchLocations) + { + Mat foundLocations_mat = foundLocations; + Mat weights_mat = weights; + Mat searchLocations_mat = searchLocations; + detect_0(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, searchLocations_mat.nativeObj); + + return; + } + + //javadoc: HOGDescriptor::detect(img, foundLocations, weights) + public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights) + { + Mat foundLocations_mat = foundLocations; + Mat weights_mat = weights; + detect_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj); + + return; + } + + + // + // C++: void detectMultiScale(Mat img, vector_Rect& foundLocations, vector_double& foundWeights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), double scale = 1.05, double finalThreshold = 2.0, bool useMeanshiftGrouping = false) + // + + //javadoc: HOGDescriptor::detectMultiScale(img, foundLocations, foundWeights, hitThreshold, winStride, padding, scale, finalThreshold, useMeanshiftGrouping) + public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding, double scale, double finalThreshold, boolean useMeanshiftGrouping) + { + Mat foundLocations_mat = foundLocations; + Mat foundWeights_mat = foundWeights; + detectMultiScale_0(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, scale, finalThreshold, useMeanshiftGrouping); + + return; + } + + //javadoc: HOGDescriptor::detectMultiScale(img, foundLocations, foundWeights) + public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights) + { + Mat foundLocations_mat = foundLocations; + Mat foundWeights_mat = foundWeights; + detectMultiScale_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj); + + return; + } + + + // + // C++: void save(String filename, String objname = String()) + // + + //javadoc: HOGDescriptor::save(filename, objname) + public void save(String filename, String objname) + { + + save_0(nativeObj, filename, objname); + + return; + } + + //javadoc: HOGDescriptor::save(filename) + public void save(String filename) + { + + save_1(nativeObj, filename); + + return; + } + + + // + // C++: void setSVMDetector(Mat _svmdetector) + // + + //javadoc: HOGDescriptor::setSVMDetector(_svmdetector) + public void setSVMDetector(Mat _svmdetector) + { + + setSVMDetector_0(nativeObj, _svmdetector.nativeObj); + + return; + } + + + // + // C++: Size HOGDescriptor::winSize + // + + //javadoc: HOGDescriptor::get_winSize() + public Size get_winSize() + { + + Size retVal = new Size(get_winSize_0(nativeObj)); + + return retVal; + } + + + // + // C++: Size HOGDescriptor::blockSize + // + + //javadoc: HOGDescriptor::get_blockSize() + public Size get_blockSize() + { + + Size retVal = new Size(get_blockSize_0(nativeObj)); + + return retVal; + } + + + // + // C++: Size HOGDescriptor::blockStride + // + + //javadoc: HOGDescriptor::get_blockStride() + public Size get_blockStride() + { + + Size retVal = new Size(get_blockStride_0(nativeObj)); + + return retVal; + } + + + // + // C++: Size HOGDescriptor::cellSize + // + + //javadoc: HOGDescriptor::get_cellSize() + public Size get_cellSize() + { + + Size retVal = new Size(get_cellSize_0(nativeObj)); + + return retVal; + } + + + // + // C++: int HOGDescriptor::nbins + // + + //javadoc: HOGDescriptor::get_nbins() + public int get_nbins() + { + + int retVal = get_nbins_0(nativeObj); + + return retVal; + } + + + // + // C++: int HOGDescriptor::derivAperture + // + + //javadoc: HOGDescriptor::get_derivAperture() + public int get_derivAperture() + { + + int retVal = get_derivAperture_0(nativeObj); + + return retVal; + } + + + // + // C++: double HOGDescriptor::winSigma + // + + //javadoc: HOGDescriptor::get_winSigma() + public double get_winSigma() + { + + double retVal = get_winSigma_0(nativeObj); + + return retVal; + } + + + // + // C++: int HOGDescriptor::histogramNormType + // + + //javadoc: HOGDescriptor::get_histogramNormType() + public int get_histogramNormType() + { + + int retVal = get_histogramNormType_0(nativeObj); + + return retVal; + } + + + // + // C++: double HOGDescriptor::L2HysThreshold + // + + //javadoc: HOGDescriptor::get_L2HysThreshold() + public double get_L2HysThreshold() + { + + double retVal = get_L2HysThreshold_0(nativeObj); + + return retVal; + } + + + // + // C++: bool HOGDescriptor::gammaCorrection + // + + //javadoc: HOGDescriptor::get_gammaCorrection() + public boolean get_gammaCorrection() + { + + boolean retVal = get_gammaCorrection_0(nativeObj); + + return retVal; + } + + + // + // C++: vector_float HOGDescriptor::svmDetector + // + + //javadoc: HOGDescriptor::get_svmDetector() + public MatOfFloat get_svmDetector() + { + + MatOfFloat retVal = MatOfFloat.fromNativeAddr(get_svmDetector_0(nativeObj)); + + return retVal; + } + + + // + // C++: int HOGDescriptor::nlevels + // + + //javadoc: HOGDescriptor::get_nlevels() + public int get_nlevels() + { + + int retVal = get_nlevels_0(nativeObj); + + return retVal; + } + + + // + // C++: bool HOGDescriptor::signedGradient + // + + //javadoc: HOGDescriptor::get_signedGradient() + public boolean get_signedGradient() + { + + boolean retVal = get_signedGradient_0(nativeObj); + + return retVal; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture = 1, double _winSigma = -1, int _histogramNormType = HOGDescriptor::L2Hys, double _L2HysThreshold = 0.2, bool _gammaCorrection = false, int _nlevels = HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient = false) + private static native long HOGDescriptor_0(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection, int _nlevels, boolean _signedGradient); + private static native long HOGDescriptor_1(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins); + + // C++: HOGDescriptor(String filename) + private static native long HOGDescriptor_2(String filename); + + // C++: HOGDescriptor() + private static native long HOGDescriptor_3(); + + // C++: bool checkDetectorSize() + private static native boolean checkDetectorSize_0(long nativeObj); + + // C++: bool load(String filename, String objname = String()) + private static native boolean load_0(long nativeObj, String filename, String objname); + private static native boolean load_1(long nativeObj, String filename); + + // C++: double getWinSigma() + private static native double getWinSigma_0(long nativeObj); + + // C++: size_t getDescriptorSize() + private static native long getDescriptorSize_0(long nativeObj); + + // C++: static vector_float getDaimlerPeopleDetector() + private static native long getDaimlerPeopleDetector_0(); + + // C++: static vector_float getDefaultPeopleDetector() + private static native long getDefaultPeopleDetector_0(); + + // C++: void compute(Mat img, vector_float& descriptors, Size winStride = Size(), Size padding = Size(), vector_Point locations = std::vector()) + private static native void compute_0(long nativeObj, long img_nativeObj, long descriptors_mat_nativeObj, double winStride_width, double winStride_height, double padding_width, double padding_height, long locations_mat_nativeObj); + private static native void compute_1(long nativeObj, long img_nativeObj, long descriptors_mat_nativeObj); + + // C++: void computeGradient(Mat img, Mat& grad, Mat& angleOfs, Size paddingTL = Size(), Size paddingBR = Size()) + private static native void computeGradient_0(long nativeObj, long img_nativeObj, long grad_nativeObj, long angleOfs_nativeObj, double paddingTL_width, double paddingTL_height, double paddingBR_width, double paddingBR_height); + private static native void computeGradient_1(long nativeObj, long img_nativeObj, long grad_nativeObj, long angleOfs_nativeObj); + + // C++: void detect(Mat img, vector_Point& foundLocations, vector_double& weights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), vector_Point searchLocations = std::vector()) + private static native void detect_0(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long weights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height, double padding_width, double padding_height, long searchLocations_mat_nativeObj); + private static native void detect_1(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long weights_mat_nativeObj); + + // C++: void detectMultiScale(Mat img, vector_Rect& foundLocations, vector_double& foundWeights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), double scale = 1.05, double finalThreshold = 2.0, bool useMeanshiftGrouping = false) + private static native void detectMultiScale_0(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height, double padding_width, double padding_height, double scale, double finalThreshold, boolean useMeanshiftGrouping); + private static native void detectMultiScale_1(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj); + + // C++: void save(String filename, String objname = String()) + private static native void save_0(long nativeObj, String filename, String objname); + private static native void save_1(long nativeObj, String filename); + + // C++: void setSVMDetector(Mat _svmdetector) + private static native void setSVMDetector_0(long nativeObj, long _svmdetector_nativeObj); + + // C++: Size HOGDescriptor::winSize + private static native double[] get_winSize_0(long nativeObj); + + // C++: Size HOGDescriptor::blockSize + private static native double[] get_blockSize_0(long nativeObj); + + // C++: Size HOGDescriptor::blockStride + private static native double[] get_blockStride_0(long nativeObj); + + // C++: Size HOGDescriptor::cellSize + private static native double[] get_cellSize_0(long nativeObj); + + // C++: int HOGDescriptor::nbins + private static native int get_nbins_0(long nativeObj); + + // C++: int HOGDescriptor::derivAperture + private static native int get_derivAperture_0(long nativeObj); + + // C++: double HOGDescriptor::winSigma + private static native double get_winSigma_0(long nativeObj); + + // C++: int HOGDescriptor::histogramNormType + private static native int get_histogramNormType_0(long nativeObj); + + // C++: double HOGDescriptor::L2HysThreshold + private static native double get_L2HysThreshold_0(long nativeObj); + + // C++: bool HOGDescriptor::gammaCorrection + private static native boolean get_gammaCorrection_0(long nativeObj); + + // C++: vector_float HOGDescriptor::svmDetector + private static native long get_svmDetector_0(long nativeObj); + + // C++: int HOGDescriptor::nlevels + private static native int get_nlevels_0(long nativeObj); + + // C++: bool HOGDescriptor::signedGradient + private static native boolean get_signedGradient_0(long nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/objdetect/Objdetect.java b/openCVLibrary310/src/main/java/org/opencv/objdetect/Objdetect.java new file mode 100644 index 0000000..c17b239 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/objdetect/Objdetect.java @@ -0,0 +1,52 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.objdetect; + +import java.util.ArrayList; +import org.opencv.core.Mat; +import org.opencv.core.MatOfInt; +import org.opencv.core.MatOfRect; + +public class Objdetect { + + public static final int + CASCADE_DO_CANNY_PRUNING = 1, + CASCADE_SCALE_IMAGE = 2, + CASCADE_FIND_BIGGEST_OBJECT = 4, + CASCADE_DO_ROUGH_SEARCH = 8; + + + // + // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) + // + + //javadoc: groupRectangles(rectList, weights, groupThreshold, eps) + public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps) + { + Mat rectList_mat = rectList; + Mat weights_mat = weights; + groupRectangles_0(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold, eps); + + return; + } + + //javadoc: groupRectangles(rectList, weights, groupThreshold) + public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold) + { + Mat rectList_mat = rectList; + Mat weights_mat = weights; + groupRectangles_1(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold); + + return; + } + + + + + // C++: void groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2) + private static native void groupRectangles_0(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold, double eps); + private static native void groupRectangles_1(long rectList_mat_nativeObj, long weights_mat_nativeObj, int groupThreshold); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/AlignExposures.java b/openCVLibrary310/src/main/java/org/opencv/photo/AlignExposures.java new file mode 100644 index 0000000..e9b64e7 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/AlignExposures.java @@ -0,0 +1,48 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; +import org.opencv.utils.Converters; + +// C++: class AlignExposures +//javadoc: AlignExposures +public class AlignExposures extends Algorithm { + + protected AlignExposures(long addr) { super(addr); } + + + // + // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response) + // + + //javadoc: AlignExposures::process(src, dst, times, response) + public void process(List src, List dst, Mat times, Mat response) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + Mat dst_mat = Converters.vector_Mat_to_Mat(dst); + process_0(nativeObj, src_mat.nativeObj, dst_mat.nativeObj, times.nativeObj, response.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response) + private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_mat_nativeObj, long times_nativeObj, long response_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/AlignMTB.java b/openCVLibrary310/src/main/java/org/opencv/photo/AlignMTB.java new file mode 100644 index 0000000..38695b0 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/AlignMTB.java @@ -0,0 +1,219 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.Point; +import org.opencv.utils.Converters; + +// C++: class AlignMTB +//javadoc: AlignMTB +public class AlignMTB extends AlignExposures { + + protected AlignMTB(long addr) { super(addr); } + + + // + // C++: Point calculateShift(Mat img0, Mat img1) + // + + //javadoc: AlignMTB::calculateShift(img0, img1) + public Point calculateShift(Mat img0, Mat img1) + { + + Point retVal = new Point(calculateShift_0(nativeObj, img0.nativeObj, img1.nativeObj)); + + return retVal; + } + + + // + // C++: bool getCut() + // + + //javadoc: AlignMTB::getCut() + public boolean getCut() + { + + boolean retVal = getCut_0(nativeObj); + + return retVal; + } + + + // + // C++: int getExcludeRange() + // + + //javadoc: AlignMTB::getExcludeRange() + public int getExcludeRange() + { + + int retVal = getExcludeRange_0(nativeObj); + + return retVal; + } + + + // + // C++: int getMaxBits() + // + + //javadoc: AlignMTB::getMaxBits() + public int getMaxBits() + { + + int retVal = getMaxBits_0(nativeObj); + + return retVal; + } + + + // + // C++: void computeBitmaps(Mat img, Mat& tb, Mat& eb) + // + + //javadoc: AlignMTB::computeBitmaps(img, tb, eb) + public void computeBitmaps(Mat img, Mat tb, Mat eb) + { + + computeBitmaps_0(nativeObj, img.nativeObj, tb.nativeObj, eb.nativeObj); + + return; + } + + + // + // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response) + // + + //javadoc: AlignMTB::process(src, dst, times, response) + public void process(List src, List dst, Mat times, Mat response) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + Mat dst_mat = Converters.vector_Mat_to_Mat(dst); + process_0(nativeObj, src_mat.nativeObj, dst_mat.nativeObj, times.nativeObj, response.nativeObj); + + return; + } + + + // + // C++: void process(vector_Mat src, vector_Mat dst) + // + + //javadoc: AlignMTB::process(src, dst) + public void process(List src, List dst) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + Mat dst_mat = Converters.vector_Mat_to_Mat(dst); + process_1(nativeObj, src_mat.nativeObj, dst_mat.nativeObj); + + return; + } + + + // + // C++: void setCut(bool value) + // + + //javadoc: AlignMTB::setCut(value) + public void setCut(boolean value) + { + + setCut_0(nativeObj, value); + + return; + } + + + // + // C++: void setExcludeRange(int exclude_range) + // + + //javadoc: AlignMTB::setExcludeRange(exclude_range) + public void setExcludeRange(int exclude_range) + { + + setExcludeRange_0(nativeObj, exclude_range); + + return; + } + + + // + // C++: void setMaxBits(int max_bits) + // + + //javadoc: AlignMTB::setMaxBits(max_bits) + public void setMaxBits(int max_bits) + { + + setMaxBits_0(nativeObj, max_bits); + + return; + } + + + // + // C++: void shiftMat(Mat src, Mat& dst, Point shift) + // + + //javadoc: AlignMTB::shiftMat(src, dst, shift) + public void shiftMat(Mat src, Mat dst, Point shift) + { + + shiftMat_0(nativeObj, src.nativeObj, dst.nativeObj, shift.x, shift.y); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Point calculateShift(Mat img0, Mat img1) + private static native double[] calculateShift_0(long nativeObj, long img0_nativeObj, long img1_nativeObj); + + // C++: bool getCut() + private static native boolean getCut_0(long nativeObj); + + // C++: int getExcludeRange() + private static native int getExcludeRange_0(long nativeObj); + + // C++: int getMaxBits() + private static native int getMaxBits_0(long nativeObj); + + // C++: void computeBitmaps(Mat img, Mat& tb, Mat& eb) + private static native void computeBitmaps_0(long nativeObj, long img_nativeObj, long tb_nativeObj, long eb_nativeObj); + + // C++: void process(vector_Mat src, vector_Mat dst, Mat times, Mat response) + private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_mat_nativeObj, long times_nativeObj, long response_nativeObj); + + // C++: void process(vector_Mat src, vector_Mat dst) + private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_mat_nativeObj); + + // C++: void setCut(bool value) + private static native void setCut_0(long nativeObj, boolean value); + + // C++: void setExcludeRange(int exclude_range) + private static native void setExcludeRange_0(long nativeObj, int exclude_range); + + // C++: void setMaxBits(int max_bits) + private static native void setMaxBits_0(long nativeObj, int max_bits); + + // C++: void shiftMat(Mat src, Mat& dst, Point shift) + private static native void shiftMat_0(long nativeObj, long src_nativeObj, long dst_nativeObj, double shift_x, double shift_y); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateCRF.java b/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateCRF.java new file mode 100644 index 0000000..1273078 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateCRF.java @@ -0,0 +1,47 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; +import org.opencv.utils.Converters; + +// C++: class CalibrateCRF +//javadoc: CalibrateCRF +public class CalibrateCRF extends Algorithm { + + protected CalibrateCRF(long addr) { super(addr); } + + + // + // C++: void process(vector_Mat src, Mat& dst, Mat times) + // + + //javadoc: CalibrateCRF::process(src, dst, times) + public void process(List src, Mat dst, Mat times) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: void process(vector_Mat src, Mat& dst, Mat times) + private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateDebevec.java b/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateDebevec.java new file mode 100644 index 0000000..45a3af6 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateDebevec.java @@ -0,0 +1,128 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + + + +// C++: class CalibrateDebevec +//javadoc: CalibrateDebevec +public class CalibrateDebevec extends CalibrateCRF { + + protected CalibrateDebevec(long addr) { super(addr); } + + + // + // C++: bool getRandom() + // + + //javadoc: CalibrateDebevec::getRandom() + public boolean getRandom() + { + + boolean retVal = getRandom_0(nativeObj); + + return retVal; + } + + + // + // C++: float getLambda() + // + + //javadoc: CalibrateDebevec::getLambda() + public float getLambda() + { + + float retVal = getLambda_0(nativeObj); + + return retVal; + } + + + // + // C++: int getSamples() + // + + //javadoc: CalibrateDebevec::getSamples() + public int getSamples() + { + + int retVal = getSamples_0(nativeObj); + + return retVal; + } + + + // + // C++: void setLambda(float lambda) + // + + //javadoc: CalibrateDebevec::setLambda(lambda) + public void setLambda(float lambda) + { + + setLambda_0(nativeObj, lambda); + + return; + } + + + // + // C++: void setRandom(bool random) + // + + //javadoc: CalibrateDebevec::setRandom(random) + public void setRandom(boolean random) + { + + setRandom_0(nativeObj, random); + + return; + } + + + // + // C++: void setSamples(int samples) + // + + //javadoc: CalibrateDebevec::setSamples(samples) + public void setSamples(int samples) + { + + setSamples_0(nativeObj, samples); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: bool getRandom() + private static native boolean getRandom_0(long nativeObj); + + // C++: float getLambda() + private static native float getLambda_0(long nativeObj); + + // C++: int getSamples() + private static native int getSamples_0(long nativeObj); + + // C++: void setLambda(float lambda) + private static native void setLambda_0(long nativeObj, float lambda); + + // C++: void setRandom(bool random) + private static native void setRandom_0(long nativeObj, boolean random); + + // C++: void setSamples(int samples) + private static native void setSamples_0(long nativeObj, int samples); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateRobertson.java b/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateRobertson.java new file mode 100644 index 0000000..4d2956a --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/CalibrateRobertson.java @@ -0,0 +1,111 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import org.opencv.core.Mat; + +// C++: class CalibrateRobertson +//javadoc: CalibrateRobertson +public class CalibrateRobertson extends CalibrateCRF { + + protected CalibrateRobertson(long addr) { super(addr); } + + + // + // C++: Mat getRadiance() + // + + //javadoc: CalibrateRobertson::getRadiance() + public Mat getRadiance() + { + + Mat retVal = new Mat(getRadiance_0(nativeObj)); + + return retVal; + } + + + // + // C++: float getThreshold() + // + + //javadoc: CalibrateRobertson::getThreshold() + public float getThreshold() + { + + float retVal = getThreshold_0(nativeObj); + + return retVal; + } + + + // + // C++: int getMaxIter() + // + + //javadoc: CalibrateRobertson::getMaxIter() + public int getMaxIter() + { + + int retVal = getMaxIter_0(nativeObj); + + return retVal; + } + + + // + // C++: void setMaxIter(int max_iter) + // + + //javadoc: CalibrateRobertson::setMaxIter(max_iter) + public void setMaxIter(int max_iter) + { + + setMaxIter_0(nativeObj, max_iter); + + return; + } + + + // + // C++: void setThreshold(float threshold) + // + + //javadoc: CalibrateRobertson::setThreshold(threshold) + public void setThreshold(float threshold) + { + + setThreshold_0(nativeObj, threshold); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: Mat getRadiance() + private static native long getRadiance_0(long nativeObj); + + // C++: float getThreshold() + private static native float getThreshold_0(long nativeObj); + + // C++: int getMaxIter() + private static native int getMaxIter_0(long nativeObj); + + // C++: void setMaxIter(int max_iter) + private static native void setMaxIter_0(long nativeObj, int max_iter); + + // C++: void setThreshold(float threshold) + private static native void setThreshold_0(long nativeObj, float threshold); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/MergeDebevec.java b/openCVLibrary310/src/main/java/org/opencv/photo/MergeDebevec.java new file mode 100644 index 0000000..f540c88 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/MergeDebevec.java @@ -0,0 +1,63 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.utils.Converters; + +// C++: class MergeDebevec +//javadoc: MergeDebevec +public class MergeDebevec extends MergeExposures { + + protected MergeDebevec(long addr) { super(addr); } + + + // + // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) + // + + //javadoc: MergeDebevec::process(src, dst, times, response) + public void process(List src, Mat dst, Mat times, Mat response) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); + + return; + } + + + // + // C++: void process(vector_Mat src, Mat& dst, Mat times) + // + + //javadoc: MergeDebevec::process(src, dst, times) + public void process(List src, Mat dst, Mat times) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + process_1(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) + private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); + + // C++: void process(vector_Mat src, Mat& dst, Mat times) + private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/MergeExposures.java b/openCVLibrary310/src/main/java/org/opencv/photo/MergeExposures.java new file mode 100644 index 0000000..558dfcc --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/MergeExposures.java @@ -0,0 +1,47 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; +import org.opencv.utils.Converters; + +// C++: class MergeExposures +//javadoc: MergeExposures +public class MergeExposures extends Algorithm { + + protected MergeExposures(long addr) { super(addr); } + + + // + // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) + // + + //javadoc: MergeExposures::process(src, dst, times, response) + public void process(List src, Mat dst, Mat times, Mat response) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) + private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/MergeMertens.java b/openCVLibrary310/src/main/java/org/opencv/photo/MergeMertens.java new file mode 100644 index 0000000..895c084 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/MergeMertens.java @@ -0,0 +1,165 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.utils.Converters; + +// C++: class MergeMertens +//javadoc: MergeMertens +public class MergeMertens extends MergeExposures { + + protected MergeMertens(long addr) { super(addr); } + + + // + // C++: float getContrastWeight() + // + + //javadoc: MergeMertens::getContrastWeight() + public float getContrastWeight() + { + + float retVal = getContrastWeight_0(nativeObj); + + return retVal; + } + + + // + // C++: float getExposureWeight() + // + + //javadoc: MergeMertens::getExposureWeight() + public float getExposureWeight() + { + + float retVal = getExposureWeight_0(nativeObj); + + return retVal; + } + + + // + // C++: float getSaturationWeight() + // + + //javadoc: MergeMertens::getSaturationWeight() + public float getSaturationWeight() + { + + float retVal = getSaturationWeight_0(nativeObj); + + return retVal; + } + + + // + // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) + // + + //javadoc: MergeMertens::process(src, dst, times, response) + public void process(List src, Mat dst, Mat times, Mat response) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); + + return; + } + + + // + // C++: void process(vector_Mat src, Mat& dst) + // + + //javadoc: MergeMertens::process(src, dst) + public void process(List src, Mat dst) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + process_1(nativeObj, src_mat.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void setContrastWeight(float contrast_weiht) + // + + //javadoc: MergeMertens::setContrastWeight(contrast_weiht) + public void setContrastWeight(float contrast_weiht) + { + + setContrastWeight_0(nativeObj, contrast_weiht); + + return; + } + + + // + // C++: void setExposureWeight(float exposure_weight) + // + + //javadoc: MergeMertens::setExposureWeight(exposure_weight) + public void setExposureWeight(float exposure_weight) + { + + setExposureWeight_0(nativeObj, exposure_weight); + + return; + } + + + // + // C++: void setSaturationWeight(float saturation_weight) + // + + //javadoc: MergeMertens::setSaturationWeight(saturation_weight) + public void setSaturationWeight(float saturation_weight) + { + + setSaturationWeight_0(nativeObj, saturation_weight); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: float getContrastWeight() + private static native float getContrastWeight_0(long nativeObj); + + // C++: float getExposureWeight() + private static native float getExposureWeight_0(long nativeObj); + + // C++: float getSaturationWeight() + private static native float getSaturationWeight_0(long nativeObj); + + // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) + private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); + + // C++: void process(vector_Mat src, Mat& dst) + private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj); + + // C++: void setContrastWeight(float contrast_weiht) + private static native void setContrastWeight_0(long nativeObj, float contrast_weiht); + + // C++: void setExposureWeight(float exposure_weight) + private static native void setExposureWeight_0(long nativeObj, float exposure_weight); + + // C++: void setSaturationWeight(float saturation_weight) + private static native void setSaturationWeight_0(long nativeObj, float saturation_weight); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/MergeRobertson.java b/openCVLibrary310/src/main/java/org/opencv/photo/MergeRobertson.java new file mode 100644 index 0000000..86308b6 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/MergeRobertson.java @@ -0,0 +1,63 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.utils.Converters; + +// C++: class MergeRobertson +//javadoc: MergeRobertson +public class MergeRobertson extends MergeExposures { + + protected MergeRobertson(long addr) { super(addr); } + + + // + // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) + // + + //javadoc: MergeRobertson::process(src, dst, times, response) + public void process(List src, Mat dst, Mat times, Mat response) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + process_0(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj); + + return; + } + + + // + // C++: void process(vector_Mat src, Mat& dst, Mat times) + // + + //javadoc: MergeRobertson::process(src, dst, times) + public void process(List src, Mat dst, Mat times) + { + Mat src_mat = Converters.vector_Mat_to_Mat(src); + process_1(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: void process(vector_Mat src, Mat& dst, Mat times, Mat response) + private static native void process_0(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj, long response_nativeObj); + + // C++: void process(vector_Mat src, Mat& dst, Mat times) + private static native void process_1(long nativeObj, long src_mat_nativeObj, long dst_nativeObj, long times_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/Photo.java b/openCVLibrary310/src/main/java/org/opencv/photo/Photo.java new file mode 100644 index 0000000..a76ed17 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/Photo.java @@ -0,0 +1,742 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfFloat; +import org.opencv.core.Point; +import org.opencv.utils.Converters; + +public class Photo { + + private static final int + CV_INPAINT_NS = 0, + CV_INPAINT_TELEA = 1; + + + public static final int + INPAINT_NS = 0, + INPAINT_TELEA = 1, + NORMAL_CLONE = 1, + MIXED_CLONE = 2, + MONOCHROME_TRANSFER = 3, + RECURS_FILTER = 1, + NORMCONV_FILTER = 2, + LDR_SIZE = 256; + + + // + // C++: Ptr_AlignMTB createAlignMTB(int max_bits = 6, int exclude_range = 4, bool cut = true) + // + + //javadoc: createAlignMTB(max_bits, exclude_range, cut) + public static AlignMTB createAlignMTB(int max_bits, int exclude_range, boolean cut) + { + + AlignMTB retVal = new AlignMTB(createAlignMTB_0(max_bits, exclude_range, cut)); + + return retVal; + } + + //javadoc: createAlignMTB() + public static AlignMTB createAlignMTB() + { + + AlignMTB retVal = new AlignMTB(createAlignMTB_1()); + + return retVal; + } + + + // + // C++: Ptr_CalibrateDebevec createCalibrateDebevec(int samples = 70, float lambda = 10.0f, bool random = false) + // + + //javadoc: createCalibrateDebevec(samples, lambda, random) + public static CalibrateDebevec createCalibrateDebevec(int samples, float lambda, boolean random) + { + + CalibrateDebevec retVal = new CalibrateDebevec(createCalibrateDebevec_0(samples, lambda, random)); + + return retVal; + } + + //javadoc: createCalibrateDebevec() + public static CalibrateDebevec createCalibrateDebevec() + { + + CalibrateDebevec retVal = new CalibrateDebevec(createCalibrateDebevec_1()); + + return retVal; + } + + + // + // C++: Ptr_CalibrateRobertson createCalibrateRobertson(int max_iter = 30, float threshold = 0.01f) + // + + //javadoc: createCalibrateRobertson(max_iter, threshold) + public static CalibrateRobertson createCalibrateRobertson(int max_iter, float threshold) + { + + CalibrateRobertson retVal = new CalibrateRobertson(createCalibrateRobertson_0(max_iter, threshold)); + + return retVal; + } + + //javadoc: createCalibrateRobertson() + public static CalibrateRobertson createCalibrateRobertson() + { + + CalibrateRobertson retVal = new CalibrateRobertson(createCalibrateRobertson_1()); + + return retVal; + } + + + // + // C++: Ptr_MergeDebevec createMergeDebevec() + // + + //javadoc: createMergeDebevec() + public static MergeDebevec createMergeDebevec() + { + + MergeDebevec retVal = new MergeDebevec(createMergeDebevec_0()); + + return retVal; + } + + + // + // C++: Ptr_MergeMertens createMergeMertens(float contrast_weight = 1.0f, float saturation_weight = 1.0f, float exposure_weight = 0.0f) + // + + //javadoc: createMergeMertens(contrast_weight, saturation_weight, exposure_weight) + public static MergeMertens createMergeMertens(float contrast_weight, float saturation_weight, float exposure_weight) + { + + MergeMertens retVal = new MergeMertens(createMergeMertens_0(contrast_weight, saturation_weight, exposure_weight)); + + return retVal; + } + + //javadoc: createMergeMertens() + public static MergeMertens createMergeMertens() + { + + MergeMertens retVal = new MergeMertens(createMergeMertens_1()); + + return retVal; + } + + + // + // C++: Ptr_MergeRobertson createMergeRobertson() + // + + //javadoc: createMergeRobertson() + public static MergeRobertson createMergeRobertson() + { + + MergeRobertson retVal = new MergeRobertson(createMergeRobertson_0()); + + return retVal; + } + + + // + // C++: Ptr_Tonemap createTonemap(float gamma = 1.0f) + // + + //javadoc: createTonemap(gamma) + public static Tonemap createTonemap(float gamma) + { + + Tonemap retVal = new Tonemap(createTonemap_0(gamma)); + + return retVal; + } + + //javadoc: createTonemap() + public static Tonemap createTonemap() + { + + Tonemap retVal = new Tonemap(createTonemap_1()); + + return retVal; + } + + + // + // C++: Ptr_TonemapDrago createTonemapDrago(float gamma = 1.0f, float saturation = 1.0f, float bias = 0.85f) + // + + //javadoc: createTonemapDrago(gamma, saturation, bias) + public static TonemapDrago createTonemapDrago(float gamma, float saturation, float bias) + { + + TonemapDrago retVal = new TonemapDrago(createTonemapDrago_0(gamma, saturation, bias)); + + return retVal; + } + + //javadoc: createTonemapDrago() + public static TonemapDrago createTonemapDrago() + { + + TonemapDrago retVal = new TonemapDrago(createTonemapDrago_1()); + + return retVal; + } + + + // + // C++: Ptr_TonemapDurand createTonemapDurand(float gamma = 1.0f, float contrast = 4.0f, float saturation = 1.0f, float sigma_space = 2.0f, float sigma_color = 2.0f) + // + + //javadoc: createTonemapDurand(gamma, contrast, saturation, sigma_space, sigma_color) + public static TonemapDurand createTonemapDurand(float gamma, float contrast, float saturation, float sigma_space, float sigma_color) + { + + TonemapDurand retVal = new TonemapDurand(createTonemapDurand_0(gamma, contrast, saturation, sigma_space, sigma_color)); + + return retVal; + } + + //javadoc: createTonemapDurand() + public static TonemapDurand createTonemapDurand() + { + + TonemapDurand retVal = new TonemapDurand(createTonemapDurand_1()); + + return retVal; + } + + + // + // C++: Ptr_TonemapMantiuk createTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f) + // + + //javadoc: createTonemapMantiuk(gamma, scale, saturation) + public static TonemapMantiuk createTonemapMantiuk(float gamma, float scale, float saturation) + { + + TonemapMantiuk retVal = new TonemapMantiuk(createTonemapMantiuk_0(gamma, scale, saturation)); + + return retVal; + } + + //javadoc: createTonemapMantiuk() + public static TonemapMantiuk createTonemapMantiuk() + { + + TonemapMantiuk retVal = new TonemapMantiuk(createTonemapMantiuk_1()); + + return retVal; + } + + + // + // C++: Ptr_TonemapReinhard createTonemapReinhard(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f) + // + + //javadoc: createTonemapReinhard(gamma, intensity, light_adapt, color_adapt) + public static TonemapReinhard createTonemapReinhard(float gamma, float intensity, float light_adapt, float color_adapt) + { + + TonemapReinhard retVal = new TonemapReinhard(createTonemapReinhard_0(gamma, intensity, light_adapt, color_adapt)); + + return retVal; + } + + //javadoc: createTonemapReinhard() + public static TonemapReinhard createTonemapReinhard() + { + + TonemapReinhard retVal = new TonemapReinhard(createTonemapReinhard_1()); + + return retVal; + } + + + // + // C++: void colorChange(Mat src, Mat mask, Mat& dst, float red_mul = 1.0f, float green_mul = 1.0f, float blue_mul = 1.0f) + // + + //javadoc: colorChange(src, mask, dst, red_mul, green_mul, blue_mul) + public static void colorChange(Mat src, Mat mask, Mat dst, float red_mul, float green_mul, float blue_mul) + { + + colorChange_0(src.nativeObj, mask.nativeObj, dst.nativeObj, red_mul, green_mul, blue_mul); + + return; + } + + //javadoc: colorChange(src, mask, dst) + public static void colorChange(Mat src, Mat mask, Mat dst) + { + + colorChange_1(src.nativeObj, mask.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void decolor(Mat src, Mat& grayscale, Mat& color_boost) + // + + //javadoc: decolor(src, grayscale, color_boost) + public static void decolor(Mat src, Mat grayscale, Mat color_boost) + { + + decolor_0(src.nativeObj, grayscale.nativeObj, color_boost.nativeObj); + + return; + } + + + // + // C++: void denoise_TVL1(vector_Mat observations, Mat result, double lambda = 1.0, int niters = 30) + // + + //javadoc: denoise_TVL1(observations, result, lambda, niters) + public static void denoise_TVL1(List observations, Mat result, double lambda, int niters) + { + Mat observations_mat = Converters.vector_Mat_to_Mat(observations); + denoise_TVL1_0(observations_mat.nativeObj, result.nativeObj, lambda, niters); + + return; + } + + //javadoc: denoise_TVL1(observations, result) + public static void denoise_TVL1(List observations, Mat result) + { + Mat observations_mat = Converters.vector_Mat_to_Mat(observations); + denoise_TVL1_1(observations_mat.nativeObj, result.nativeObj); + + return; + } + + + // + // C++: void detailEnhance(Mat src, Mat& dst, float sigma_s = 10, float sigma_r = 0.15f) + // + + //javadoc: detailEnhance(src, dst, sigma_s, sigma_r) + public static void detailEnhance(Mat src, Mat dst, float sigma_s, float sigma_r) + { + + detailEnhance_0(src.nativeObj, dst.nativeObj, sigma_s, sigma_r); + + return; + } + + //javadoc: detailEnhance(src, dst) + public static void detailEnhance(Mat src, Mat dst) + { + + detailEnhance_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void edgePreservingFilter(Mat src, Mat& dst, int flags = 1, float sigma_s = 60, float sigma_r = 0.4f) + // + + //javadoc: edgePreservingFilter(src, dst, flags, sigma_s, sigma_r) + public static void edgePreservingFilter(Mat src, Mat dst, int flags, float sigma_s, float sigma_r) + { + + edgePreservingFilter_0(src.nativeObj, dst.nativeObj, flags, sigma_s, sigma_r); + + return; + } + + //javadoc: edgePreservingFilter(src, dst) + public static void edgePreservingFilter(Mat src, Mat dst) + { + + edgePreservingFilter_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void fastNlMeansDenoising(Mat src, Mat& dst, float h = 3, int templateWindowSize = 7, int searchWindowSize = 21) + // + + //javadoc: fastNlMeansDenoising(src, dst, h, templateWindowSize, searchWindowSize) + public static void fastNlMeansDenoising(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize) + { + + fastNlMeansDenoising_0(src.nativeObj, dst.nativeObj, h, templateWindowSize, searchWindowSize); + + return; + } + + //javadoc: fastNlMeansDenoising(src, dst) + public static void fastNlMeansDenoising(Mat src, Mat dst) + { + + fastNlMeansDenoising_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void fastNlMeansDenoising(Mat src, Mat& dst, vector_float h, int templateWindowSize = 7, int searchWindowSize = 21, int normType = NORM_L2) + // + + //javadoc: fastNlMeansDenoising(src, dst, h, templateWindowSize, searchWindowSize, normType) + public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h, int templateWindowSize, int searchWindowSize, int normType) + { + Mat h_mat = h; + fastNlMeansDenoising_2(src.nativeObj, dst.nativeObj, h_mat.nativeObj, templateWindowSize, searchWindowSize, normType); + + return; + } + + //javadoc: fastNlMeansDenoising(src, dst, h) + public static void fastNlMeansDenoising(Mat src, Mat dst, MatOfFloat h) + { + Mat h_mat = h; + fastNlMeansDenoising_3(src.nativeObj, dst.nativeObj, h_mat.nativeObj); + + return; + } + + + // + // C++: void fastNlMeansDenoisingColored(Mat src, Mat& dst, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21) + // + + //javadoc: fastNlMeansDenoisingColored(src, dst, h, hColor, templateWindowSize, searchWindowSize) + public static void fastNlMeansDenoisingColored(Mat src, Mat dst, float h, float hColor, int templateWindowSize, int searchWindowSize) + { + + fastNlMeansDenoisingColored_0(src.nativeObj, dst.nativeObj, h, hColor, templateWindowSize, searchWindowSize); + + return; + } + + //javadoc: fastNlMeansDenoisingColored(src, dst) + public static void fastNlMeansDenoisingColored(Mat src, Mat dst) + { + + fastNlMeansDenoisingColored_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void fastNlMeansDenoisingColoredMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21) + // + + //javadoc: fastNlMeansDenoisingColoredMulti(srcImgs, dst, imgToDenoiseIndex, temporalWindowSize, h, hColor, templateWindowSize, searchWindowSize) + public static void fastNlMeansDenoisingColoredMulti(List srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize, int searchWindowSize) + { + Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs); + fastNlMeansDenoisingColoredMulti_0(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h, hColor, templateWindowSize, searchWindowSize); + + return; + } + + //javadoc: fastNlMeansDenoisingColoredMulti(srcImgs, dst, imgToDenoiseIndex, temporalWindowSize) + public static void fastNlMeansDenoisingColoredMulti(List srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize) + { + Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs); + fastNlMeansDenoisingColoredMulti_1(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize); + + return; + } + + + // + // C++: void fastNlMeansDenoisingMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, float h = 3, int templateWindowSize = 7, int searchWindowSize = 21) + // + + //javadoc: fastNlMeansDenoisingMulti(srcImgs, dst, imgToDenoiseIndex, temporalWindowSize, h, templateWindowSize, searchWindowSize) + public static void fastNlMeansDenoisingMulti(List srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize, int searchWindowSize) + { + Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs); + fastNlMeansDenoisingMulti_0(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h, templateWindowSize, searchWindowSize); + + return; + } + + //javadoc: fastNlMeansDenoisingMulti(srcImgs, dst, imgToDenoiseIndex, temporalWindowSize) + public static void fastNlMeansDenoisingMulti(List srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize) + { + Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs); + fastNlMeansDenoisingMulti_1(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize); + + return; + } + + + // + // C++: void fastNlMeansDenoisingMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, vector_float h, int templateWindowSize = 7, int searchWindowSize = 21, int normType = NORM_L2) + // + + //javadoc: fastNlMeansDenoisingMulti(srcImgs, dst, imgToDenoiseIndex, temporalWindowSize, h, templateWindowSize, searchWindowSize, normType) + public static void fastNlMeansDenoisingMulti(List srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h, int templateWindowSize, int searchWindowSize, int normType) + { + Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs); + Mat h_mat = h; + fastNlMeansDenoisingMulti_2(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h_mat.nativeObj, templateWindowSize, searchWindowSize, normType); + + return; + } + + //javadoc: fastNlMeansDenoisingMulti(srcImgs, dst, imgToDenoiseIndex, temporalWindowSize, h) + public static void fastNlMeansDenoisingMulti(List srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, MatOfFloat h) + { + Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs); + Mat h_mat = h; + fastNlMeansDenoisingMulti_3(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h_mat.nativeObj); + + return; + } + + + // + // C++: void illuminationChange(Mat src, Mat mask, Mat& dst, float alpha = 0.2f, float beta = 0.4f) + // + + //javadoc: illuminationChange(src, mask, dst, alpha, beta) + public static void illuminationChange(Mat src, Mat mask, Mat dst, float alpha, float beta) + { + + illuminationChange_0(src.nativeObj, mask.nativeObj, dst.nativeObj, alpha, beta); + + return; + } + + //javadoc: illuminationChange(src, mask, dst) + public static void illuminationChange(Mat src, Mat mask, Mat dst) + { + + illuminationChange_1(src.nativeObj, mask.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void inpaint(Mat src, Mat inpaintMask, Mat& dst, double inpaintRadius, int flags) + // + + //javadoc: inpaint(src, inpaintMask, dst, inpaintRadius, flags) + public static void inpaint(Mat src, Mat inpaintMask, Mat dst, double inpaintRadius, int flags) + { + + inpaint_0(src.nativeObj, inpaintMask.nativeObj, dst.nativeObj, inpaintRadius, flags); + + return; + } + + + // + // C++: void pencilSketch(Mat src, Mat& dst1, Mat& dst2, float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f) + // + + //javadoc: pencilSketch(src, dst1, dst2, sigma_s, sigma_r, shade_factor) + public static void pencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r, float shade_factor) + { + + pencilSketch_0(src.nativeObj, dst1.nativeObj, dst2.nativeObj, sigma_s, sigma_r, shade_factor); + + return; + } + + //javadoc: pencilSketch(src, dst1, dst2) + public static void pencilSketch(Mat src, Mat dst1, Mat dst2) + { + + pencilSketch_1(src.nativeObj, dst1.nativeObj, dst2.nativeObj); + + return; + } + + + // + // C++: void seamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat& blend, int flags) + // + + //javadoc: seamlessClone(src, dst, mask, p, blend, flags) + public static void seamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat blend, int flags) + { + + seamlessClone_0(src.nativeObj, dst.nativeObj, mask.nativeObj, p.x, p.y, blend.nativeObj, flags); + + return; + } + + + // + // C++: void stylization(Mat src, Mat& dst, float sigma_s = 60, float sigma_r = 0.45f) + // + + //javadoc: stylization(src, dst, sigma_s, sigma_r) + public static void stylization(Mat src, Mat dst, float sigma_s, float sigma_r) + { + + stylization_0(src.nativeObj, dst.nativeObj, sigma_s, sigma_r); + + return; + } + + //javadoc: stylization(src, dst) + public static void stylization(Mat src, Mat dst) + { + + stylization_1(src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void textureFlattening(Mat src, Mat mask, Mat& dst, float low_threshold = 30, float high_threshold = 45, int kernel_size = 3) + // + + //javadoc: textureFlattening(src, mask, dst, low_threshold, high_threshold, kernel_size) + public static void textureFlattening(Mat src, Mat mask, Mat dst, float low_threshold, float high_threshold, int kernel_size) + { + + textureFlattening_0(src.nativeObj, mask.nativeObj, dst.nativeObj, low_threshold, high_threshold, kernel_size); + + return; + } + + //javadoc: textureFlattening(src, mask, dst) + public static void textureFlattening(Mat src, Mat mask, Mat dst) + { + + textureFlattening_1(src.nativeObj, mask.nativeObj, dst.nativeObj); + + return; + } + + + + + // C++: Ptr_AlignMTB createAlignMTB(int max_bits = 6, int exclude_range = 4, bool cut = true) + private static native long createAlignMTB_0(int max_bits, int exclude_range, boolean cut); + private static native long createAlignMTB_1(); + + // C++: Ptr_CalibrateDebevec createCalibrateDebevec(int samples = 70, float lambda = 10.0f, bool random = false) + private static native long createCalibrateDebevec_0(int samples, float lambda, boolean random); + private static native long createCalibrateDebevec_1(); + + // C++: Ptr_CalibrateRobertson createCalibrateRobertson(int max_iter = 30, float threshold = 0.01f) + private static native long createCalibrateRobertson_0(int max_iter, float threshold); + private static native long createCalibrateRobertson_1(); + + // C++: Ptr_MergeDebevec createMergeDebevec() + private static native long createMergeDebevec_0(); + + // C++: Ptr_MergeMertens createMergeMertens(float contrast_weight = 1.0f, float saturation_weight = 1.0f, float exposure_weight = 0.0f) + private static native long createMergeMertens_0(float contrast_weight, float saturation_weight, float exposure_weight); + private static native long createMergeMertens_1(); + + // C++: Ptr_MergeRobertson createMergeRobertson() + private static native long createMergeRobertson_0(); + + // C++: Ptr_Tonemap createTonemap(float gamma = 1.0f) + private static native long createTonemap_0(float gamma); + private static native long createTonemap_1(); + + // C++: Ptr_TonemapDrago createTonemapDrago(float gamma = 1.0f, float saturation = 1.0f, float bias = 0.85f) + private static native long createTonemapDrago_0(float gamma, float saturation, float bias); + private static native long createTonemapDrago_1(); + + // C++: Ptr_TonemapDurand createTonemapDurand(float gamma = 1.0f, float contrast = 4.0f, float saturation = 1.0f, float sigma_space = 2.0f, float sigma_color = 2.0f) + private static native long createTonemapDurand_0(float gamma, float contrast, float saturation, float sigma_space, float sigma_color); + private static native long createTonemapDurand_1(); + + // C++: Ptr_TonemapMantiuk createTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f) + private static native long createTonemapMantiuk_0(float gamma, float scale, float saturation); + private static native long createTonemapMantiuk_1(); + + // C++: Ptr_TonemapReinhard createTonemapReinhard(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f) + private static native long createTonemapReinhard_0(float gamma, float intensity, float light_adapt, float color_adapt); + private static native long createTonemapReinhard_1(); + + // C++: void colorChange(Mat src, Mat mask, Mat& dst, float red_mul = 1.0f, float green_mul = 1.0f, float blue_mul = 1.0f) + private static native void colorChange_0(long src_nativeObj, long mask_nativeObj, long dst_nativeObj, float red_mul, float green_mul, float blue_mul); + private static native void colorChange_1(long src_nativeObj, long mask_nativeObj, long dst_nativeObj); + + // C++: void decolor(Mat src, Mat& grayscale, Mat& color_boost) + private static native void decolor_0(long src_nativeObj, long grayscale_nativeObj, long color_boost_nativeObj); + + // C++: void denoise_TVL1(vector_Mat observations, Mat result, double lambda = 1.0, int niters = 30) + private static native void denoise_TVL1_0(long observations_mat_nativeObj, long result_nativeObj, double lambda, int niters); + private static native void denoise_TVL1_1(long observations_mat_nativeObj, long result_nativeObj); + + // C++: void detailEnhance(Mat src, Mat& dst, float sigma_s = 10, float sigma_r = 0.15f) + private static native void detailEnhance_0(long src_nativeObj, long dst_nativeObj, float sigma_s, float sigma_r); + private static native void detailEnhance_1(long src_nativeObj, long dst_nativeObj); + + // C++: void edgePreservingFilter(Mat src, Mat& dst, int flags = 1, float sigma_s = 60, float sigma_r = 0.4f) + private static native void edgePreservingFilter_0(long src_nativeObj, long dst_nativeObj, int flags, float sigma_s, float sigma_r); + private static native void edgePreservingFilter_1(long src_nativeObj, long dst_nativeObj); + + // C++: void fastNlMeansDenoising(Mat src, Mat& dst, float h = 3, int templateWindowSize = 7, int searchWindowSize = 21) + private static native void fastNlMeansDenoising_0(long src_nativeObj, long dst_nativeObj, float h, int templateWindowSize, int searchWindowSize); + private static native void fastNlMeansDenoising_1(long src_nativeObj, long dst_nativeObj); + + // C++: void fastNlMeansDenoising(Mat src, Mat& dst, vector_float h, int templateWindowSize = 7, int searchWindowSize = 21, int normType = NORM_L2) + private static native void fastNlMeansDenoising_2(long src_nativeObj, long dst_nativeObj, long h_mat_nativeObj, int templateWindowSize, int searchWindowSize, int normType); + private static native void fastNlMeansDenoising_3(long src_nativeObj, long dst_nativeObj, long h_mat_nativeObj); + + // C++: void fastNlMeansDenoisingColored(Mat src, Mat& dst, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21) + private static native void fastNlMeansDenoisingColored_0(long src_nativeObj, long dst_nativeObj, float h, float hColor, int templateWindowSize, int searchWindowSize); + private static native void fastNlMeansDenoisingColored_1(long src_nativeObj, long dst_nativeObj); + + // C++: void fastNlMeansDenoisingColoredMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, float h = 3, float hColor = 3, int templateWindowSize = 7, int searchWindowSize = 21) + private static native void fastNlMeansDenoisingColoredMulti_0(long srcImgs_mat_nativeObj, long dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h, float hColor, int templateWindowSize, int searchWindowSize); + private static native void fastNlMeansDenoisingColoredMulti_1(long srcImgs_mat_nativeObj, long dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize); + + // C++: void fastNlMeansDenoisingMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, float h = 3, int templateWindowSize = 7, int searchWindowSize = 21) + private static native void fastNlMeansDenoisingMulti_0(long srcImgs_mat_nativeObj, long dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize, int searchWindowSize); + private static native void fastNlMeansDenoisingMulti_1(long srcImgs_mat_nativeObj, long dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize); + + // C++: void fastNlMeansDenoisingMulti(vector_Mat srcImgs, Mat& dst, int imgToDenoiseIndex, int temporalWindowSize, vector_float h, int templateWindowSize = 7, int searchWindowSize = 21, int normType = NORM_L2) + private static native void fastNlMeansDenoisingMulti_2(long srcImgs_mat_nativeObj, long dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, long h_mat_nativeObj, int templateWindowSize, int searchWindowSize, int normType); + private static native void fastNlMeansDenoisingMulti_3(long srcImgs_mat_nativeObj, long dst_nativeObj, int imgToDenoiseIndex, int temporalWindowSize, long h_mat_nativeObj); + + // C++: void illuminationChange(Mat src, Mat mask, Mat& dst, float alpha = 0.2f, float beta = 0.4f) + private static native void illuminationChange_0(long src_nativeObj, long mask_nativeObj, long dst_nativeObj, float alpha, float beta); + private static native void illuminationChange_1(long src_nativeObj, long mask_nativeObj, long dst_nativeObj); + + // C++: void inpaint(Mat src, Mat inpaintMask, Mat& dst, double inpaintRadius, int flags) + private static native void inpaint_0(long src_nativeObj, long inpaintMask_nativeObj, long dst_nativeObj, double inpaintRadius, int flags); + + // C++: void pencilSketch(Mat src, Mat& dst1, Mat& dst2, float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f) + private static native void pencilSketch_0(long src_nativeObj, long dst1_nativeObj, long dst2_nativeObj, float sigma_s, float sigma_r, float shade_factor); + private static native void pencilSketch_1(long src_nativeObj, long dst1_nativeObj, long dst2_nativeObj); + + // C++: void seamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat& blend, int flags) + private static native void seamlessClone_0(long src_nativeObj, long dst_nativeObj, long mask_nativeObj, double p_x, double p_y, long blend_nativeObj, int flags); + + // C++: void stylization(Mat src, Mat& dst, float sigma_s = 60, float sigma_r = 0.45f) + private static native void stylization_0(long src_nativeObj, long dst_nativeObj, float sigma_s, float sigma_r); + private static native void stylization_1(long src_nativeObj, long dst_nativeObj); + + // C++: void textureFlattening(Mat src, Mat mask, Mat& dst, float low_threshold = 30, float high_threshold = 45, int kernel_size = 3) + private static native void textureFlattening_0(long src_nativeObj, long mask_nativeObj, long dst_nativeObj, float low_threshold, float high_threshold, int kernel_size); + private static native void textureFlattening_1(long src_nativeObj, long mask_nativeObj, long dst_nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/Tonemap.java b/openCVLibrary310/src/main/java/org/opencv/photo/Tonemap.java new file mode 100644 index 0000000..ca58ef4 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/Tonemap.java @@ -0,0 +1,78 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; + +// C++: class Tonemap +//javadoc: Tonemap +public class Tonemap extends Algorithm { + + protected Tonemap(long addr) { super(addr); } + + + // + // C++: float getGamma() + // + + //javadoc: Tonemap::getGamma() + public float getGamma() + { + + float retVal = getGamma_0(nativeObj); + + return retVal; + } + + + // + // C++: void process(Mat src, Mat& dst) + // + + //javadoc: Tonemap::process(src, dst) + public void process(Mat src, Mat dst) + { + + process_0(nativeObj, src.nativeObj, dst.nativeObj); + + return; + } + + + // + // C++: void setGamma(float gamma) + // + + //javadoc: Tonemap::setGamma(gamma) + public void setGamma(float gamma) + { + + setGamma_0(nativeObj, gamma); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: float getGamma() + private static native float getGamma_0(long nativeObj); + + // C++: void process(Mat src, Mat& dst) + private static native void process_0(long nativeObj, long src_nativeObj, long dst_nativeObj); + + // C++: void setGamma(float gamma) + private static native void setGamma_0(long nativeObj, float gamma); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/TonemapDrago.java b/openCVLibrary310/src/main/java/org/opencv/photo/TonemapDrago.java new file mode 100644 index 0000000..32d1a9d --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/TonemapDrago.java @@ -0,0 +1,94 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + + + +// C++: class TonemapDrago +//javadoc: TonemapDrago +public class TonemapDrago extends Tonemap { + + protected TonemapDrago(long addr) { super(addr); } + + + // + // C++: float getBias() + // + + //javadoc: TonemapDrago::getBias() + public float getBias() + { + + float retVal = getBias_0(nativeObj); + + return retVal; + } + + + // + // C++: float getSaturation() + // + + //javadoc: TonemapDrago::getSaturation() + public float getSaturation() + { + + float retVal = getSaturation_0(nativeObj); + + return retVal; + } + + + // + // C++: void setBias(float bias) + // + + //javadoc: TonemapDrago::setBias(bias) + public void setBias(float bias) + { + + setBias_0(nativeObj, bias); + + return; + } + + + // + // C++: void setSaturation(float saturation) + // + + //javadoc: TonemapDrago::setSaturation(saturation) + public void setSaturation(float saturation) + { + + setSaturation_0(nativeObj, saturation); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: float getBias() + private static native float getBias_0(long nativeObj); + + // C++: float getSaturation() + private static native float getSaturation_0(long nativeObj); + + // C++: void setBias(float bias) + private static native void setBias_0(long nativeObj, float bias); + + // C++: void setSaturation(float saturation) + private static native void setSaturation_0(long nativeObj, float saturation); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/TonemapDurand.java b/openCVLibrary310/src/main/java/org/opencv/photo/TonemapDurand.java new file mode 100644 index 0000000..71e48a0 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/TonemapDurand.java @@ -0,0 +1,162 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + + + +// C++: class TonemapDurand +//javadoc: TonemapDurand +public class TonemapDurand extends Tonemap { + + protected TonemapDurand(long addr) { super(addr); } + + + // + // C++: float getContrast() + // + + //javadoc: TonemapDurand::getContrast() + public float getContrast() + { + + float retVal = getContrast_0(nativeObj); + + return retVal; + } + + + // + // C++: float getSaturation() + // + + //javadoc: TonemapDurand::getSaturation() + public float getSaturation() + { + + float retVal = getSaturation_0(nativeObj); + + return retVal; + } + + + // + // C++: float getSigmaColor() + // + + //javadoc: TonemapDurand::getSigmaColor() + public float getSigmaColor() + { + + float retVal = getSigmaColor_0(nativeObj); + + return retVal; + } + + + // + // C++: float getSigmaSpace() + // + + //javadoc: TonemapDurand::getSigmaSpace() + public float getSigmaSpace() + { + + float retVal = getSigmaSpace_0(nativeObj); + + return retVal; + } + + + // + // C++: void setContrast(float contrast) + // + + //javadoc: TonemapDurand::setContrast(contrast) + public void setContrast(float contrast) + { + + setContrast_0(nativeObj, contrast); + + return; + } + + + // + // C++: void setSaturation(float saturation) + // + + //javadoc: TonemapDurand::setSaturation(saturation) + public void setSaturation(float saturation) + { + + setSaturation_0(nativeObj, saturation); + + return; + } + + + // + // C++: void setSigmaColor(float sigma_color) + // + + //javadoc: TonemapDurand::setSigmaColor(sigma_color) + public void setSigmaColor(float sigma_color) + { + + setSigmaColor_0(nativeObj, sigma_color); + + return; + } + + + // + // C++: void setSigmaSpace(float sigma_space) + // + + //javadoc: TonemapDurand::setSigmaSpace(sigma_space) + public void setSigmaSpace(float sigma_space) + { + + setSigmaSpace_0(nativeObj, sigma_space); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: float getContrast() + private static native float getContrast_0(long nativeObj); + + // C++: float getSaturation() + private static native float getSaturation_0(long nativeObj); + + // C++: float getSigmaColor() + private static native float getSigmaColor_0(long nativeObj); + + // C++: float getSigmaSpace() + private static native float getSigmaSpace_0(long nativeObj); + + // C++: void setContrast(float contrast) + private static native void setContrast_0(long nativeObj, float contrast); + + // C++: void setSaturation(float saturation) + private static native void setSaturation_0(long nativeObj, float saturation); + + // C++: void setSigmaColor(float sigma_color) + private static native void setSigmaColor_0(long nativeObj, float sigma_color); + + // C++: void setSigmaSpace(float sigma_space) + private static native void setSigmaSpace_0(long nativeObj, float sigma_space); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/TonemapMantiuk.java b/openCVLibrary310/src/main/java/org/opencv/photo/TonemapMantiuk.java new file mode 100644 index 0000000..a626aaa --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/TonemapMantiuk.java @@ -0,0 +1,94 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + + + +// C++: class TonemapMantiuk +//javadoc: TonemapMantiuk +public class TonemapMantiuk extends Tonemap { + + protected TonemapMantiuk(long addr) { super(addr); } + + + // + // C++: float getSaturation() + // + + //javadoc: TonemapMantiuk::getSaturation() + public float getSaturation() + { + + float retVal = getSaturation_0(nativeObj); + + return retVal; + } + + + // + // C++: float getScale() + // + + //javadoc: TonemapMantiuk::getScale() + public float getScale() + { + + float retVal = getScale_0(nativeObj); + + return retVal; + } + + + // + // C++: void setSaturation(float saturation) + // + + //javadoc: TonemapMantiuk::setSaturation(saturation) + public void setSaturation(float saturation) + { + + setSaturation_0(nativeObj, saturation); + + return; + } + + + // + // C++: void setScale(float scale) + // + + //javadoc: TonemapMantiuk::setScale(scale) + public void setScale(float scale) + { + + setScale_0(nativeObj, scale); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: float getSaturation() + private static native float getSaturation_0(long nativeObj); + + // C++: float getScale() + private static native float getScale_0(long nativeObj); + + // C++: void setSaturation(float saturation) + private static native void setSaturation_0(long nativeObj, float saturation); + + // C++: void setScale(float scale) + private static native void setScale_0(long nativeObj, float scale); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/photo/TonemapReinhard.java b/openCVLibrary310/src/main/java/org/opencv/photo/TonemapReinhard.java new file mode 100644 index 0000000..340b146 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/photo/TonemapReinhard.java @@ -0,0 +1,128 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.photo; + + + +// C++: class TonemapReinhard +//javadoc: TonemapReinhard +public class TonemapReinhard extends Tonemap { + + protected TonemapReinhard(long addr) { super(addr); } + + + // + // C++: float getColorAdaptation() + // + + //javadoc: TonemapReinhard::getColorAdaptation() + public float getColorAdaptation() + { + + float retVal = getColorAdaptation_0(nativeObj); + + return retVal; + } + + + // + // C++: float getIntensity() + // + + //javadoc: TonemapReinhard::getIntensity() + public float getIntensity() + { + + float retVal = getIntensity_0(nativeObj); + + return retVal; + } + + + // + // C++: float getLightAdaptation() + // + + //javadoc: TonemapReinhard::getLightAdaptation() + public float getLightAdaptation() + { + + float retVal = getLightAdaptation_0(nativeObj); + + return retVal; + } + + + // + // C++: void setColorAdaptation(float color_adapt) + // + + //javadoc: TonemapReinhard::setColorAdaptation(color_adapt) + public void setColorAdaptation(float color_adapt) + { + + setColorAdaptation_0(nativeObj, color_adapt); + + return; + } + + + // + // C++: void setIntensity(float intensity) + // + + //javadoc: TonemapReinhard::setIntensity(intensity) + public void setIntensity(float intensity) + { + + setIntensity_0(nativeObj, intensity); + + return; + } + + + // + // C++: void setLightAdaptation(float light_adapt) + // + + //javadoc: TonemapReinhard::setLightAdaptation(light_adapt) + public void setLightAdaptation(float light_adapt) + { + + setLightAdaptation_0(nativeObj, light_adapt); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: float getColorAdaptation() + private static native float getColorAdaptation_0(long nativeObj); + + // C++: float getIntensity() + private static native float getIntensity_0(long nativeObj); + + // C++: float getLightAdaptation() + private static native float getLightAdaptation_0(long nativeObj); + + // C++: void setColorAdaptation(float color_adapt) + private static native void setColorAdaptation_0(long nativeObj, float color_adapt); + + // C++: void setIntensity(float intensity) + private static native void setIntensity_0(long nativeObj, float intensity); + + // C++: void setLightAdaptation(float light_adapt) + private static native void setLightAdaptation_0(long nativeObj, float light_adapt); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/utils/Converters.java b/openCVLibrary310/src/main/java/org/opencv/utils/Converters.java new file mode 100644 index 0000000..bd3bb64 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/utils/Converters.java @@ -0,0 +1,736 @@ +package org.opencv.utils; + +import java.util.ArrayList; +import java.util.List; + +import org.opencv.core.CvType; +import org.opencv.core.Mat; +import org.opencv.core.MatOfByte; +import org.opencv.core.MatOfDMatch; +import org.opencv.core.MatOfKeyPoint; +import org.opencv.core.MatOfPoint; +import org.opencv.core.MatOfPoint2f; +import org.opencv.core.MatOfPoint3f; +import org.opencv.core.Point; +import org.opencv.core.Point3; +import org.opencv.core.Rect; +import org.opencv.core.DMatch; +import org.opencv.core.KeyPoint; + +public class Converters { + + public static Mat vector_Point_to_Mat(List pts) { + return vector_Point_to_Mat(pts, CvType.CV_32S); + } + + public static Mat vector_Point2f_to_Mat(List pts) { + return vector_Point_to_Mat(pts, CvType.CV_32F); + } + + public static Mat vector_Point2d_to_Mat(List pts) { + return vector_Point_to_Mat(pts, CvType.CV_64F); + } + + public static Mat vector_Point_to_Mat(List pts, int typeDepth) { + Mat res; + int count = (pts != null) ? pts.size() : 0; + if (count > 0) { + switch (typeDepth) { + case CvType.CV_32S: { + res = new Mat(count, 1, CvType.CV_32SC2); + int[] buff = new int[count * 2]; + for (int i = 0; i < count; i++) { + Point p = pts.get(i); + buff[i * 2] = (int) p.x; + buff[i * 2 + 1] = (int) p.y; + } + res.put(0, 0, buff); + } + break; + + case CvType.CV_32F: { + res = new Mat(count, 1, CvType.CV_32FC2); + float[] buff = new float[count * 2]; + for (int i = 0; i < count; i++) { + Point p = pts.get(i); + buff[i * 2] = (float) p.x; + buff[i * 2 + 1] = (float) p.y; + } + res.put(0, 0, buff); + } + break; + + case CvType.CV_64F: { + res = new Mat(count, 1, CvType.CV_64FC2); + double[] buff = new double[count * 2]; + for (int i = 0; i < count; i++) { + Point p = pts.get(i); + buff[i * 2] = p.x; + buff[i * 2 + 1] = p.y; + } + res.put(0, 0, buff); + } + break; + + default: + throw new IllegalArgumentException("'typeDepth' can be CV_32S, CV_32F or CV_64F"); + } + } else { + res = new Mat(); + } + return res; + } + + public static Mat vector_Point3i_to_Mat(List pts) { + return vector_Point3_to_Mat(pts, CvType.CV_32S); + } + + public static Mat vector_Point3f_to_Mat(List pts) { + return vector_Point3_to_Mat(pts, CvType.CV_32F); + } + + public static Mat vector_Point3d_to_Mat(List pts) { + return vector_Point3_to_Mat(pts, CvType.CV_64F); + } + + public static Mat vector_Point3_to_Mat(List pts, int typeDepth) { + Mat res; + int count = (pts != null) ? pts.size() : 0; + if (count > 0) { + switch (typeDepth) { + case CvType.CV_32S: { + res = new Mat(count, 1, CvType.CV_32SC3); + int[] buff = new int[count * 3]; + for (int i = 0; i < count; i++) { + Point3 p = pts.get(i); + buff[i * 3] = (int) p.x; + buff[i * 3 + 1] = (int) p.y; + buff[i * 3 + 2] = (int) p.z; + } + res.put(0, 0, buff); + } + break; + + case CvType.CV_32F: { + res = new Mat(count, 1, CvType.CV_32FC3); + float[] buff = new float[count * 3]; + for (int i = 0; i < count; i++) { + Point3 p = pts.get(i); + buff[i * 3] = (float) p.x; + buff[i * 3 + 1] = (float) p.y; + buff[i * 3 + 2] = (float) p.z; + } + res.put(0, 0, buff); + } + break; + + case CvType.CV_64F: { + res = new Mat(count, 1, CvType.CV_64FC3); + double[] buff = new double[count * 3]; + for (int i = 0; i < count; i++) { + Point3 p = pts.get(i); + buff[i * 3] = p.x; + buff[i * 3 + 1] = p.y; + buff[i * 3 + 2] = p.z; + } + res.put(0, 0, buff); + } + break; + + default: + throw new IllegalArgumentException("'typeDepth' can be CV_32S, CV_32F or CV_64F"); + } + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_Point2f(Mat m, List pts) { + Mat_to_vector_Point(m, pts); + } + + public static void Mat_to_vector_Point2d(Mat m, List pts) { + Mat_to_vector_Point(m, pts); + } + + public static void Mat_to_vector_Point(Mat m, List pts) { + if (pts == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + int count = m.rows(); + int type = m.type(); + if (m.cols() != 1) + throw new java.lang.IllegalArgumentException("Input Mat should have one column\n" + m); + + pts.clear(); + if (type == CvType.CV_32SC2) { + int[] buff = new int[2 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + pts.add(new Point(buff[i * 2], buff[i * 2 + 1])); + } + } else if (type == CvType.CV_32FC2) { + float[] buff = new float[2 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + pts.add(new Point(buff[i * 2], buff[i * 2 + 1])); + } + } else if (type == CvType.CV_64FC2) { + double[] buff = new double[2 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + pts.add(new Point(buff[i * 2], buff[i * 2 + 1])); + } + } else { + throw new java.lang.IllegalArgumentException( + "Input Mat should be of CV_32SC2, CV_32FC2 or CV_64FC2 type\n" + m); + } + } + + public static void Mat_to_vector_Point3i(Mat m, List pts) { + Mat_to_vector_Point3(m, pts); + } + + public static void Mat_to_vector_Point3f(Mat m, List pts) { + Mat_to_vector_Point3(m, pts); + } + + public static void Mat_to_vector_Point3d(Mat m, List pts) { + Mat_to_vector_Point3(m, pts); + } + + public static void Mat_to_vector_Point3(Mat m, List pts) { + if (pts == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + int count = m.rows(); + int type = m.type(); + if (m.cols() != 1) + throw new java.lang.IllegalArgumentException("Input Mat should have one column\n" + m); + + pts.clear(); + if (type == CvType.CV_32SC3) { + int[] buff = new int[3 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + pts.add(new Point3(buff[i * 3], buff[i * 3 + 1], buff[i * 3 + 2])); + } + } else if (type == CvType.CV_32FC3) { + float[] buff = new float[3 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + pts.add(new Point3(buff[i * 3], buff[i * 3 + 1], buff[i * 3 + 2])); + } + } else if (type == CvType.CV_64FC3) { + double[] buff = new double[3 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + pts.add(new Point3(buff[i * 3], buff[i * 3 + 1], buff[i * 3 + 2])); + } + } else { + throw new java.lang.IllegalArgumentException( + "Input Mat should be of CV_32SC3, CV_32FC3 or CV_64FC3 type\n" + m); + } + } + + public static Mat vector_Mat_to_Mat(List mats) { + Mat res; + int count = (mats != null) ? mats.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_32SC2); + int[] buff = new int[count * 2]; + for (int i = 0; i < count; i++) { + long addr = mats.get(i).nativeObj; + buff[i * 2] = (int) (addr >> 32); + buff[i * 2 + 1] = (int) (addr & 0xffffffff); + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_Mat(Mat m, List mats) { + if (mats == null) + throw new java.lang.IllegalArgumentException("mats == null"); + int count = m.rows(); + if (CvType.CV_32SC2 != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_32SC2 != m.type() || m.cols()!=1\n" + m); + + mats.clear(); + int[] buff = new int[count * 2]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + long addr = (((long) buff[i * 2]) << 32) | (((long) buff[i * 2 + 1]) & 0xffffffffL); + mats.add(new Mat(addr)); + } + } + + public static Mat vector_float_to_Mat(List fs) { + Mat res; + int count = (fs != null) ? fs.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_32FC1); + float[] buff = new float[count]; + for (int i = 0; i < count; i++) { + float f = fs.get(i); + buff[i] = f; + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_float(Mat m, List fs) { + if (fs == null) + throw new java.lang.IllegalArgumentException("fs == null"); + int count = m.rows(); + if (CvType.CV_32FC1 != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_32FC1 != m.type() || m.cols()!=1\n" + m); + + fs.clear(); + float[] buff = new float[count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + fs.add(buff[i]); + } + } + + public static Mat vector_uchar_to_Mat(List bs) { + Mat res; + int count = (bs != null) ? bs.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_8UC1); + byte[] buff = new byte[count]; + for (int i = 0; i < count; i++) { + byte b = bs.get(i); + buff[i] = b; + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_uchar(Mat m, List us) { + if (us == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + int count = m.rows(); + if (CvType.CV_8UC1 != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_8UC1 != m.type() || m.cols()!=1\n" + m); + + us.clear(); + byte[] buff = new byte[count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + us.add(buff[i]); + } + } + + public static Mat vector_char_to_Mat(List bs) { + Mat res; + int count = (bs != null) ? bs.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_8SC1); + byte[] buff = new byte[count]; + for (int i = 0; i < count; i++) { + byte b = bs.get(i); + buff[i] = b; + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static Mat vector_int_to_Mat(List is) { + Mat res; + int count = (is != null) ? is.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_32SC1); + int[] buff = new int[count]; + for (int i = 0; i < count; i++) { + int v = is.get(i); + buff[i] = v; + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_int(Mat m, List is) { + if (is == null) + throw new java.lang.IllegalArgumentException("is == null"); + int count = m.rows(); + if (CvType.CV_32SC1 != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_32SC1 != m.type() || m.cols()!=1\n" + m); + + is.clear(); + int[] buff = new int[count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + is.add(buff[i]); + } + } + + public static void Mat_to_vector_char(Mat m, List bs) { + if (bs == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + int count = m.rows(); + if (CvType.CV_8SC1 != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_8SC1 != m.type() || m.cols()!=1\n" + m); + + bs.clear(); + byte[] buff = new byte[count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + bs.add(buff[i]); + } + } + + public static Mat vector_Rect_to_Mat(List rs) { + Mat res; + int count = (rs != null) ? rs.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_32SC4); + int[] buff = new int[4 * count]; + for (int i = 0; i < count; i++) { + Rect r = rs.get(i); + buff[4 * i] = r.x; + buff[4 * i + 1] = r.y; + buff[4 * i + 2] = r.width; + buff[4 * i + 3] = r.height; + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_Rect(Mat m, List rs) { + if (rs == null) + throw new java.lang.IllegalArgumentException("rs == null"); + int count = m.rows(); + if (CvType.CV_32SC4 != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_32SC4 != m.type() || m.rows()!=1\n" + m); + + rs.clear(); + int[] buff = new int[4 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + rs.add(new Rect(buff[4 * i], buff[4 * i + 1], buff[4 * i + 2], buff[4 * i + 3])); + } + } + + public static Mat vector_KeyPoint_to_Mat(List kps) { + Mat res; + int count = (kps != null) ? kps.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_64FC(7)); + double[] buff = new double[count * 7]; + for (int i = 0; i < count; i++) { + KeyPoint kp = kps.get(i); + buff[7 * i] = kp.pt.x; + buff[7 * i + 1] = kp.pt.y; + buff[7 * i + 2] = kp.size; + buff[7 * i + 3] = kp.angle; + buff[7 * i + 4] = kp.response; + buff[7 * i + 5] = kp.octave; + buff[7 * i + 6] = kp.class_id; + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_KeyPoint(Mat m, List kps) { + if (kps == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + int count = m.rows(); + if (CvType.CV_64FC(7) != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_64FC(7) != m.type() || m.cols()!=1\n" + m); + + kps.clear(); + double[] buff = new double[7 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3], + (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6])); + } + } + + // vector_vector_Point + public static Mat vector_vector_Point_to_Mat(List pts, List mats) { + Mat res; + int lCount = (pts != null) ? pts.size() : 0; + if (lCount > 0) { + for (MatOfPoint vpt : pts) + mats.add(vpt); + res = vector_Mat_to_Mat(mats); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_vector_Point(Mat m, List pts) { + if (pts == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + + if (m == null) + throw new java.lang.IllegalArgumentException("Input Mat can't be null"); + + List mats = new ArrayList(m.rows()); + Mat_to_vector_Mat(m, mats); + for (Mat mi : mats) { + MatOfPoint pt = new MatOfPoint(mi); + pts.add(pt); + mi.release(); + } + mats.clear(); + } + + // vector_vector_Point2f + public static void Mat_to_vector_vector_Point2f(Mat m, List pts) { + if (pts == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + + if (m == null) + throw new java.lang.IllegalArgumentException("Input Mat can't be null"); + + List mats = new ArrayList(m.rows()); + Mat_to_vector_Mat(m, mats); + for (Mat mi : mats) { + MatOfPoint2f pt = new MatOfPoint2f(mi); + pts.add(pt); + mi.release(); + } + mats.clear(); + } + + // vector_vector_Point2f + public static Mat vector_vector_Point2f_to_Mat(List pts, List mats) { + Mat res; + int lCount = (pts != null) ? pts.size() : 0; + if (lCount > 0) { + for (MatOfPoint2f vpt : pts) + mats.add(vpt); + res = vector_Mat_to_Mat(mats); + } else { + res = new Mat(); + } + return res; + } + + // vector_vector_Point3f + public static void Mat_to_vector_vector_Point3f(Mat m, List pts) { + if (pts == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + + if (m == null) + throw new java.lang.IllegalArgumentException("Input Mat can't be null"); + + List mats = new ArrayList(m.rows()); + Mat_to_vector_Mat(m, mats); + for (Mat mi : mats) { + MatOfPoint3f pt = new MatOfPoint3f(mi); + pts.add(pt); + mi.release(); + } + mats.clear(); + } + + // vector_vector_Point3f + public static Mat vector_vector_Point3f_to_Mat(List pts, List mats) { + Mat res; + int lCount = (pts != null) ? pts.size() : 0; + if (lCount > 0) { + for (MatOfPoint3f vpt : pts) + mats.add(vpt); + res = vector_Mat_to_Mat(mats); + } else { + res = new Mat(); + } + return res; + } + + // vector_vector_KeyPoint + public static Mat vector_vector_KeyPoint_to_Mat(List kps, List mats) { + Mat res; + int lCount = (kps != null) ? kps.size() : 0; + if (lCount > 0) { + for (MatOfKeyPoint vkp : kps) + mats.add(vkp); + res = vector_Mat_to_Mat(mats); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_vector_KeyPoint(Mat m, List kps) { + if (kps == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + + if (m == null) + throw new java.lang.IllegalArgumentException("Input Mat can't be null"); + + List mats = new ArrayList(m.rows()); + Mat_to_vector_Mat(m, mats); + for (Mat mi : mats) { + MatOfKeyPoint vkp = new MatOfKeyPoint(mi); + kps.add(vkp); + mi.release(); + } + mats.clear(); + } + + public static Mat vector_double_to_Mat(List ds) { + Mat res; + int count = (ds != null) ? ds.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_64FC1); + double[] buff = new double[count]; + for (int i = 0; i < count; i++) { + double v = ds.get(i); + buff[i] = v; + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_double(Mat m, List ds) { + if (ds == null) + throw new java.lang.IllegalArgumentException("ds == null"); + int count = m.rows(); + if (CvType.CV_64FC1 != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_64FC1 != m.type() || m.cols()!=1\n" + m); + + ds.clear(); + double[] buff = new double[count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + ds.add(buff[i]); + } + } + + public static Mat vector_DMatch_to_Mat(List matches) { + Mat res; + int count = (matches != null) ? matches.size() : 0; + if (count > 0) { + res = new Mat(count, 1, CvType.CV_64FC4); + double[] buff = new double[count * 4]; + for (int i = 0; i < count; i++) { + DMatch m = matches.get(i); + buff[4 * i] = m.queryIdx; + buff[4 * i + 1] = m.trainIdx; + buff[4 * i + 2] = m.imgIdx; + buff[4 * i + 3] = m.distance; + } + res.put(0, 0, buff); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_DMatch(Mat m, List matches) { + if (matches == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + int count = m.rows(); + if (CvType.CV_64FC4 != m.type() || m.cols() != 1) + throw new java.lang.IllegalArgumentException( + "CvType.CV_64FC4 != m.type() || m.cols()!=1\n" + m); + + matches.clear(); + double[] buff = new double[4 * count]; + m.get(0, 0, buff); + for (int i = 0; i < count; i++) { + matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3])); + } + } + + // vector_vector_DMatch + public static Mat vector_vector_DMatch_to_Mat(List lvdm, List mats) { + Mat res; + int lCount = (lvdm != null) ? lvdm.size() : 0; + if (lCount > 0) { + for (MatOfDMatch vdm : lvdm) + mats.add(vdm); + res = vector_Mat_to_Mat(mats); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_vector_DMatch(Mat m, List lvdm) { + if (lvdm == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + + if (m == null) + throw new java.lang.IllegalArgumentException("Input Mat can't be null"); + + List mats = new ArrayList(m.rows()); + Mat_to_vector_Mat(m, mats); + lvdm.clear(); + for (Mat mi : mats) { + MatOfDMatch vdm = new MatOfDMatch(mi); + lvdm.add(vdm); + mi.release(); + } + mats.clear(); + } + + // vector_vector_char + public static Mat vector_vector_char_to_Mat(List lvb, List mats) { + Mat res; + int lCount = (lvb != null) ? lvb.size() : 0; + if (lCount > 0) { + for (MatOfByte vb : lvb) + mats.add(vb); + res = vector_Mat_to_Mat(mats); + } else { + res = new Mat(); + } + return res; + } + + public static void Mat_to_vector_vector_char(Mat m, List> llb) { + if (llb == null) + throw new java.lang.IllegalArgumentException("Output List can't be null"); + + if (m == null) + throw new java.lang.IllegalArgumentException("Input Mat can't be null"); + + List mats = new ArrayList(m.rows()); + Mat_to_vector_Mat(m, mats); + for (Mat mi : mats) { + List lb = new ArrayList(); + Mat_to_vector_char(mi, lb); + llb.add(lb); + mi.release(); + } + mats.clear(); + } +} diff --git a/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractor.java b/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractor.java new file mode 100644 index 0000000..581ce66 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractor.java @@ -0,0 +1,71 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.video; + +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; + +// C++: class BackgroundSubtractor +//javadoc: BackgroundSubtractor +public class BackgroundSubtractor extends Algorithm { + + protected BackgroundSubtractor(long addr) { super(addr); } + + + // + // C++: void apply(Mat image, Mat& fgmask, double learningRate = -1) + // + + //javadoc: BackgroundSubtractor::apply(image, fgmask, learningRate) + public void apply(Mat image, Mat fgmask, double learningRate) + { + + apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate); + + return; + } + + //javadoc: BackgroundSubtractor::apply(image, fgmask) + public void apply(Mat image, Mat fgmask) + { + + apply_1(nativeObj, image.nativeObj, fgmask.nativeObj); + + return; + } + + + // + // C++: void getBackgroundImage(Mat& backgroundImage) + // + + //javadoc: BackgroundSubtractor::getBackgroundImage(backgroundImage) + public void getBackgroundImage(Mat backgroundImage) + { + + getBackgroundImage_0(nativeObj, backgroundImage.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: void apply(Mat image, Mat& fgmask, double learningRate = -1) + private static native void apply_0(long nativeObj, long image_nativeObj, long fgmask_nativeObj, double learningRate); + private static native void apply_1(long nativeObj, long image_nativeObj, long fgmask_nativeObj); + + // C++: void getBackgroundImage(Mat& backgroundImage) + private static native void getBackgroundImage_0(long nativeObj, long backgroundImage_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractorKNN.java b/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractorKNN.java new file mode 100644 index 0000000..8ac2a6d --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractorKNN.java @@ -0,0 +1,264 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.video; + + + +// C++: class BackgroundSubtractorKNN +//javadoc: BackgroundSubtractorKNN +public class BackgroundSubtractorKNN extends BackgroundSubtractor { + + protected BackgroundSubtractorKNN(long addr) { super(addr); } + + + // + // C++: bool getDetectShadows() + // + + //javadoc: BackgroundSubtractorKNN::getDetectShadows() + public boolean getDetectShadows() + { + + boolean retVal = getDetectShadows_0(nativeObj); + + return retVal; + } + + + // + // C++: double getDist2Threshold() + // + + //javadoc: BackgroundSubtractorKNN::getDist2Threshold() + public double getDist2Threshold() + { + + double retVal = getDist2Threshold_0(nativeObj); + + return retVal; + } + + + // + // C++: double getShadowThreshold() + // + + //javadoc: BackgroundSubtractorKNN::getShadowThreshold() + public double getShadowThreshold() + { + + double retVal = getShadowThreshold_0(nativeObj); + + return retVal; + } + + + // + // C++: int getHistory() + // + + //javadoc: BackgroundSubtractorKNN::getHistory() + public int getHistory() + { + + int retVal = getHistory_0(nativeObj); + + return retVal; + } + + + // + // C++: int getNSamples() + // + + //javadoc: BackgroundSubtractorKNN::getNSamples() + public int getNSamples() + { + + int retVal = getNSamples_0(nativeObj); + + return retVal; + } + + + // + // C++: int getShadowValue() + // + + //javadoc: BackgroundSubtractorKNN::getShadowValue() + public int getShadowValue() + { + + int retVal = getShadowValue_0(nativeObj); + + return retVal; + } + + + // + // C++: int getkNNSamples() + // + + //javadoc: BackgroundSubtractorKNN::getkNNSamples() + public int getkNNSamples() + { + + int retVal = getkNNSamples_0(nativeObj); + + return retVal; + } + + + // + // C++: void setDetectShadows(bool detectShadows) + // + + //javadoc: BackgroundSubtractorKNN::setDetectShadows(detectShadows) + public void setDetectShadows(boolean detectShadows) + { + + setDetectShadows_0(nativeObj, detectShadows); + + return; + } + + + // + // C++: void setDist2Threshold(double _dist2Threshold) + // + + //javadoc: BackgroundSubtractorKNN::setDist2Threshold(_dist2Threshold) + public void setDist2Threshold(double _dist2Threshold) + { + + setDist2Threshold_0(nativeObj, _dist2Threshold); + + return; + } + + + // + // C++: void setHistory(int history) + // + + //javadoc: BackgroundSubtractorKNN::setHistory(history) + public void setHistory(int history) + { + + setHistory_0(nativeObj, history); + + return; + } + + + // + // C++: void setNSamples(int _nN) + // + + //javadoc: BackgroundSubtractorKNN::setNSamples(_nN) + public void setNSamples(int _nN) + { + + setNSamples_0(nativeObj, _nN); + + return; + } + + + // + // C++: void setShadowThreshold(double threshold) + // + + //javadoc: BackgroundSubtractorKNN::setShadowThreshold(threshold) + public void setShadowThreshold(double threshold) + { + + setShadowThreshold_0(nativeObj, threshold); + + return; + } + + + // + // C++: void setShadowValue(int value) + // + + //javadoc: BackgroundSubtractorKNN::setShadowValue(value) + public void setShadowValue(int value) + { + + setShadowValue_0(nativeObj, value); + + return; + } + + + // + // C++: void setkNNSamples(int _nkNN) + // + + //javadoc: BackgroundSubtractorKNN::setkNNSamples(_nkNN) + public void setkNNSamples(int _nkNN) + { + + setkNNSamples_0(nativeObj, _nkNN); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: bool getDetectShadows() + private static native boolean getDetectShadows_0(long nativeObj); + + // C++: double getDist2Threshold() + private static native double getDist2Threshold_0(long nativeObj); + + // C++: double getShadowThreshold() + private static native double getShadowThreshold_0(long nativeObj); + + // C++: int getHistory() + private static native int getHistory_0(long nativeObj); + + // C++: int getNSamples() + private static native int getNSamples_0(long nativeObj); + + // C++: int getShadowValue() + private static native int getShadowValue_0(long nativeObj); + + // C++: int getkNNSamples() + private static native int getkNNSamples_0(long nativeObj); + + // C++: void setDetectShadows(bool detectShadows) + private static native void setDetectShadows_0(long nativeObj, boolean detectShadows); + + // C++: void setDist2Threshold(double _dist2Threshold) + private static native void setDist2Threshold_0(long nativeObj, double _dist2Threshold); + + // C++: void setHistory(int history) + private static native void setHistory_0(long nativeObj, int history); + + // C++: void setNSamples(int _nN) + private static native void setNSamples_0(long nativeObj, int _nN); + + // C++: void setShadowThreshold(double threshold) + private static native void setShadowThreshold_0(long nativeObj, double threshold); + + // C++: void setShadowValue(int value) + private static native void setShadowValue_0(long nativeObj, int value); + + // C++: void setkNNSamples(int _nkNN) + private static native void setkNNSamples_0(long nativeObj, int _nkNN); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractorMOG2.java b/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractorMOG2.java new file mode 100644 index 0000000..c46ffd9 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/video/BackgroundSubtractorMOG2.java @@ -0,0 +1,434 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.video; + + + +// C++: class BackgroundSubtractorMOG2 +//javadoc: BackgroundSubtractorMOG2 +public class BackgroundSubtractorMOG2 extends BackgroundSubtractor { + + protected BackgroundSubtractorMOG2(long addr) { super(addr); } + + + // + // C++: bool getDetectShadows() + // + + //javadoc: BackgroundSubtractorMOG2::getDetectShadows() + public boolean getDetectShadows() + { + + boolean retVal = getDetectShadows_0(nativeObj); + + return retVal; + } + + + // + // C++: double getBackgroundRatio() + // + + //javadoc: BackgroundSubtractorMOG2::getBackgroundRatio() + public double getBackgroundRatio() + { + + double retVal = getBackgroundRatio_0(nativeObj); + + return retVal; + } + + + // + // C++: double getComplexityReductionThreshold() + // + + //javadoc: BackgroundSubtractorMOG2::getComplexityReductionThreshold() + public double getComplexityReductionThreshold() + { + + double retVal = getComplexityReductionThreshold_0(nativeObj); + + return retVal; + } + + + // + // C++: double getShadowThreshold() + // + + //javadoc: BackgroundSubtractorMOG2::getShadowThreshold() + public double getShadowThreshold() + { + + double retVal = getShadowThreshold_0(nativeObj); + + return retVal; + } + + + // + // C++: double getVarInit() + // + + //javadoc: BackgroundSubtractorMOG2::getVarInit() + public double getVarInit() + { + + double retVal = getVarInit_0(nativeObj); + + return retVal; + } + + + // + // C++: double getVarMax() + // + + //javadoc: BackgroundSubtractorMOG2::getVarMax() + public double getVarMax() + { + + double retVal = getVarMax_0(nativeObj); + + return retVal; + } + + + // + // C++: double getVarMin() + // + + //javadoc: BackgroundSubtractorMOG2::getVarMin() + public double getVarMin() + { + + double retVal = getVarMin_0(nativeObj); + + return retVal; + } + + + // + // C++: double getVarThreshold() + // + + //javadoc: BackgroundSubtractorMOG2::getVarThreshold() + public double getVarThreshold() + { + + double retVal = getVarThreshold_0(nativeObj); + + return retVal; + } + + + // + // C++: double getVarThresholdGen() + // + + //javadoc: BackgroundSubtractorMOG2::getVarThresholdGen() + public double getVarThresholdGen() + { + + double retVal = getVarThresholdGen_0(nativeObj); + + return retVal; + } + + + // + // C++: int getHistory() + // + + //javadoc: BackgroundSubtractorMOG2::getHistory() + public int getHistory() + { + + int retVal = getHistory_0(nativeObj); + + return retVal; + } + + + // + // C++: int getNMixtures() + // + + //javadoc: BackgroundSubtractorMOG2::getNMixtures() + public int getNMixtures() + { + + int retVal = getNMixtures_0(nativeObj); + + return retVal; + } + + + // + // C++: int getShadowValue() + // + + //javadoc: BackgroundSubtractorMOG2::getShadowValue() + public int getShadowValue() + { + + int retVal = getShadowValue_0(nativeObj); + + return retVal; + } + + + // + // C++: void setBackgroundRatio(double ratio) + // + + //javadoc: BackgroundSubtractorMOG2::setBackgroundRatio(ratio) + public void setBackgroundRatio(double ratio) + { + + setBackgroundRatio_0(nativeObj, ratio); + + return; + } + + + // + // C++: void setComplexityReductionThreshold(double ct) + // + + //javadoc: BackgroundSubtractorMOG2::setComplexityReductionThreshold(ct) + public void setComplexityReductionThreshold(double ct) + { + + setComplexityReductionThreshold_0(nativeObj, ct); + + return; + } + + + // + // C++: void setDetectShadows(bool detectShadows) + // + + //javadoc: BackgroundSubtractorMOG2::setDetectShadows(detectShadows) + public void setDetectShadows(boolean detectShadows) + { + + setDetectShadows_0(nativeObj, detectShadows); + + return; + } + + + // + // C++: void setHistory(int history) + // + + //javadoc: BackgroundSubtractorMOG2::setHistory(history) + public void setHistory(int history) + { + + setHistory_0(nativeObj, history); + + return; + } + + + // + // C++: void setNMixtures(int nmixtures) + // + + //javadoc: BackgroundSubtractorMOG2::setNMixtures(nmixtures) + public void setNMixtures(int nmixtures) + { + + setNMixtures_0(nativeObj, nmixtures); + + return; + } + + + // + // C++: void setShadowThreshold(double threshold) + // + + //javadoc: BackgroundSubtractorMOG2::setShadowThreshold(threshold) + public void setShadowThreshold(double threshold) + { + + setShadowThreshold_0(nativeObj, threshold); + + return; + } + + + // + // C++: void setShadowValue(int value) + // + + //javadoc: BackgroundSubtractorMOG2::setShadowValue(value) + public void setShadowValue(int value) + { + + setShadowValue_0(nativeObj, value); + + return; + } + + + // + // C++: void setVarInit(double varInit) + // + + //javadoc: BackgroundSubtractorMOG2::setVarInit(varInit) + public void setVarInit(double varInit) + { + + setVarInit_0(nativeObj, varInit); + + return; + } + + + // + // C++: void setVarMax(double varMax) + // + + //javadoc: BackgroundSubtractorMOG2::setVarMax(varMax) + public void setVarMax(double varMax) + { + + setVarMax_0(nativeObj, varMax); + + return; + } + + + // + // C++: void setVarMin(double varMin) + // + + //javadoc: BackgroundSubtractorMOG2::setVarMin(varMin) + public void setVarMin(double varMin) + { + + setVarMin_0(nativeObj, varMin); + + return; + } + + + // + // C++: void setVarThreshold(double varThreshold) + // + + //javadoc: BackgroundSubtractorMOG2::setVarThreshold(varThreshold) + public void setVarThreshold(double varThreshold) + { + + setVarThreshold_0(nativeObj, varThreshold); + + return; + } + + + // + // C++: void setVarThresholdGen(double varThresholdGen) + // + + //javadoc: BackgroundSubtractorMOG2::setVarThresholdGen(varThresholdGen) + public void setVarThresholdGen(double varThresholdGen) + { + + setVarThresholdGen_0(nativeObj, varThresholdGen); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: bool getDetectShadows() + private static native boolean getDetectShadows_0(long nativeObj); + + // C++: double getBackgroundRatio() + private static native double getBackgroundRatio_0(long nativeObj); + + // C++: double getComplexityReductionThreshold() + private static native double getComplexityReductionThreshold_0(long nativeObj); + + // C++: double getShadowThreshold() + private static native double getShadowThreshold_0(long nativeObj); + + // C++: double getVarInit() + private static native double getVarInit_0(long nativeObj); + + // C++: double getVarMax() + private static native double getVarMax_0(long nativeObj); + + // C++: double getVarMin() + private static native double getVarMin_0(long nativeObj); + + // C++: double getVarThreshold() + private static native double getVarThreshold_0(long nativeObj); + + // C++: double getVarThresholdGen() + private static native double getVarThresholdGen_0(long nativeObj); + + // C++: int getHistory() + private static native int getHistory_0(long nativeObj); + + // C++: int getNMixtures() + private static native int getNMixtures_0(long nativeObj); + + // C++: int getShadowValue() + private static native int getShadowValue_0(long nativeObj); + + // C++: void setBackgroundRatio(double ratio) + private static native void setBackgroundRatio_0(long nativeObj, double ratio); + + // C++: void setComplexityReductionThreshold(double ct) + private static native void setComplexityReductionThreshold_0(long nativeObj, double ct); + + // C++: void setDetectShadows(bool detectShadows) + private static native void setDetectShadows_0(long nativeObj, boolean detectShadows); + + // C++: void setHistory(int history) + private static native void setHistory_0(long nativeObj, int history); + + // C++: void setNMixtures(int nmixtures) + private static native void setNMixtures_0(long nativeObj, int nmixtures); + + // C++: void setShadowThreshold(double threshold) + private static native void setShadowThreshold_0(long nativeObj, double threshold); + + // C++: void setShadowValue(int value) + private static native void setShadowValue_0(long nativeObj, int value); + + // C++: void setVarInit(double varInit) + private static native void setVarInit_0(long nativeObj, double varInit); + + // C++: void setVarMax(double varMax) + private static native void setVarMax_0(long nativeObj, double varMax); + + // C++: void setVarMin(double varMin) + private static native void setVarMin_0(long nativeObj, double varMin); + + // C++: void setVarThreshold(double varThreshold) + private static native void setVarThreshold_0(long nativeObj, double varThreshold); + + // C++: void setVarThresholdGen(double varThresholdGen) + private static native void setVarThresholdGen_0(long nativeObj, double varThresholdGen); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/video/DenseOpticalFlow.java b/openCVLibrary310/src/main/java/org/opencv/video/DenseOpticalFlow.java new file mode 100644 index 0000000..7639671 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/video/DenseOpticalFlow.java @@ -0,0 +1,61 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.video; + +import org.opencv.core.Algorithm; +import org.opencv.core.Mat; + +// C++: class DenseOpticalFlow +//javadoc: DenseOpticalFlow +public class DenseOpticalFlow extends Algorithm { + + protected DenseOpticalFlow(long addr) { super(addr); } + + + // + // C++: void calc(Mat I0, Mat I1, Mat& flow) + // + + //javadoc: DenseOpticalFlow::calc(I0, I1, flow) + public void calc(Mat I0, Mat I1, Mat flow) + { + + calc_0(nativeObj, I0.nativeObj, I1.nativeObj, flow.nativeObj); + + return; + } + + + // + // C++: void collectGarbage() + // + + //javadoc: DenseOpticalFlow::collectGarbage() + public void collectGarbage() + { + + collectGarbage_0(nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: void calc(Mat I0, Mat I1, Mat& flow) + private static native void calc_0(long nativeObj, long I0_nativeObj, long I1_nativeObj, long flow_nativeObj); + + // C++: void collectGarbage() + private static native void collectGarbage_0(long nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/video/DualTVL1OpticalFlow.java b/openCVLibrary310/src/main/java/org/opencv/video/DualTVL1OpticalFlow.java new file mode 100644 index 0000000..f5b0e7c --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/video/DualTVL1OpticalFlow.java @@ -0,0 +1,26 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.video; + + + +// C++: class DualTVL1OpticalFlow +//javadoc: DualTVL1OpticalFlow +public class DualTVL1OpticalFlow extends DenseOpticalFlow { + + protected DualTVL1OpticalFlow(long addr) { super(addr); } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/video/KalmanFilter.java b/openCVLibrary310/src/main/java/org/opencv/video/KalmanFilter.java new file mode 100644 index 0000000..18ccf7d --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/video/KalmanFilter.java @@ -0,0 +1,455 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.video; + +import org.opencv.core.Mat; + +// C++: class KalmanFilter +//javadoc: KalmanFilter +public class KalmanFilter { + + protected final long nativeObj; + protected KalmanFilter(long addr) { nativeObj = addr; } + + + // + // C++: KalmanFilter(int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F) + // + + //javadoc: KalmanFilter::KalmanFilter(dynamParams, measureParams, controlParams, type) + public KalmanFilter(int dynamParams, int measureParams, int controlParams, int type) + { + + nativeObj = KalmanFilter_0(dynamParams, measureParams, controlParams, type); + + return; + } + + //javadoc: KalmanFilter::KalmanFilter(dynamParams, measureParams) + public KalmanFilter(int dynamParams, int measureParams) + { + + nativeObj = KalmanFilter_1(dynamParams, measureParams); + + return; + } + + + // + // C++: KalmanFilter() + // + + //javadoc: KalmanFilter::KalmanFilter() + public KalmanFilter() + { + + nativeObj = KalmanFilter_2(); + + return; + } + + + // + // C++: Mat correct(Mat measurement) + // + + //javadoc: KalmanFilter::correct(measurement) + public Mat correct(Mat measurement) + { + + Mat retVal = new Mat(correct_0(nativeObj, measurement.nativeObj)); + + return retVal; + } + + + // + // C++: Mat predict(Mat control = Mat()) + // + + //javadoc: KalmanFilter::predict(control) + public Mat predict(Mat control) + { + + Mat retVal = new Mat(predict_0(nativeObj, control.nativeObj)); + + return retVal; + } + + //javadoc: KalmanFilter::predict() + public Mat predict() + { + + Mat retVal = new Mat(predict_1(nativeObj)); + + return retVal; + } + + + // + // C++: Mat KalmanFilter::statePre + // + + //javadoc: KalmanFilter::get_statePre() + public Mat get_statePre() + { + + Mat retVal = new Mat(get_statePre_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::statePre + // + + //javadoc: KalmanFilter::set_statePre(statePre) + public void set_statePre(Mat statePre) + { + + set_statePre_0(nativeObj, statePre.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::statePost + // + + //javadoc: KalmanFilter::get_statePost() + public Mat get_statePost() + { + + Mat retVal = new Mat(get_statePost_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::statePost + // + + //javadoc: KalmanFilter::set_statePost(statePost) + public void set_statePost(Mat statePost) + { + + set_statePost_0(nativeObj, statePost.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::transitionMatrix + // + + //javadoc: KalmanFilter::get_transitionMatrix() + public Mat get_transitionMatrix() + { + + Mat retVal = new Mat(get_transitionMatrix_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::transitionMatrix + // + + //javadoc: KalmanFilter::set_transitionMatrix(transitionMatrix) + public void set_transitionMatrix(Mat transitionMatrix) + { + + set_transitionMatrix_0(nativeObj, transitionMatrix.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::controlMatrix + // + + //javadoc: KalmanFilter::get_controlMatrix() + public Mat get_controlMatrix() + { + + Mat retVal = new Mat(get_controlMatrix_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::controlMatrix + // + + //javadoc: KalmanFilter::set_controlMatrix(controlMatrix) + public void set_controlMatrix(Mat controlMatrix) + { + + set_controlMatrix_0(nativeObj, controlMatrix.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::measurementMatrix + // + + //javadoc: KalmanFilter::get_measurementMatrix() + public Mat get_measurementMatrix() + { + + Mat retVal = new Mat(get_measurementMatrix_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::measurementMatrix + // + + //javadoc: KalmanFilter::set_measurementMatrix(measurementMatrix) + public void set_measurementMatrix(Mat measurementMatrix) + { + + set_measurementMatrix_0(nativeObj, measurementMatrix.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::processNoiseCov + // + + //javadoc: KalmanFilter::get_processNoiseCov() + public Mat get_processNoiseCov() + { + + Mat retVal = new Mat(get_processNoiseCov_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::processNoiseCov + // + + //javadoc: KalmanFilter::set_processNoiseCov(processNoiseCov) + public void set_processNoiseCov(Mat processNoiseCov) + { + + set_processNoiseCov_0(nativeObj, processNoiseCov.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::measurementNoiseCov + // + + //javadoc: KalmanFilter::get_measurementNoiseCov() + public Mat get_measurementNoiseCov() + { + + Mat retVal = new Mat(get_measurementNoiseCov_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::measurementNoiseCov + // + + //javadoc: KalmanFilter::set_measurementNoiseCov(measurementNoiseCov) + public void set_measurementNoiseCov(Mat measurementNoiseCov) + { + + set_measurementNoiseCov_0(nativeObj, measurementNoiseCov.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::errorCovPre + // + + //javadoc: KalmanFilter::get_errorCovPre() + public Mat get_errorCovPre() + { + + Mat retVal = new Mat(get_errorCovPre_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::errorCovPre + // + + //javadoc: KalmanFilter::set_errorCovPre(errorCovPre) + public void set_errorCovPre(Mat errorCovPre) + { + + set_errorCovPre_0(nativeObj, errorCovPre.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::gain + // + + //javadoc: KalmanFilter::get_gain() + public Mat get_gain() + { + + Mat retVal = new Mat(get_gain_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::gain + // + + //javadoc: KalmanFilter::set_gain(gain) + public void set_gain(Mat gain) + { + + set_gain_0(nativeObj, gain.nativeObj); + + return; + } + + + // + // C++: Mat KalmanFilter::errorCovPost + // + + //javadoc: KalmanFilter::get_errorCovPost() + public Mat get_errorCovPost() + { + + Mat retVal = new Mat(get_errorCovPost_0(nativeObj)); + + return retVal; + } + + + // + // C++: void KalmanFilter::errorCovPost + // + + //javadoc: KalmanFilter::set_errorCovPost(errorCovPost) + public void set_errorCovPost(Mat errorCovPost) + { + + set_errorCovPost_0(nativeObj, errorCovPost.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: KalmanFilter(int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F) + private static native long KalmanFilter_0(int dynamParams, int measureParams, int controlParams, int type); + private static native long KalmanFilter_1(int dynamParams, int measureParams); + + // C++: KalmanFilter() + private static native long KalmanFilter_2(); + + // C++: Mat correct(Mat measurement) + private static native long correct_0(long nativeObj, long measurement_nativeObj); + + // C++: Mat predict(Mat control = Mat()) + private static native long predict_0(long nativeObj, long control_nativeObj); + private static native long predict_1(long nativeObj); + + // C++: Mat KalmanFilter::statePre + private static native long get_statePre_0(long nativeObj); + + // C++: void KalmanFilter::statePre + private static native void set_statePre_0(long nativeObj, long statePre_nativeObj); + + // C++: Mat KalmanFilter::statePost + private static native long get_statePost_0(long nativeObj); + + // C++: void KalmanFilter::statePost + private static native void set_statePost_0(long nativeObj, long statePost_nativeObj); + + // C++: Mat KalmanFilter::transitionMatrix + private static native long get_transitionMatrix_0(long nativeObj); + + // C++: void KalmanFilter::transitionMatrix + private static native void set_transitionMatrix_0(long nativeObj, long transitionMatrix_nativeObj); + + // C++: Mat KalmanFilter::controlMatrix + private static native long get_controlMatrix_0(long nativeObj); + + // C++: void KalmanFilter::controlMatrix + private static native void set_controlMatrix_0(long nativeObj, long controlMatrix_nativeObj); + + // C++: Mat KalmanFilter::measurementMatrix + private static native long get_measurementMatrix_0(long nativeObj); + + // C++: void KalmanFilter::measurementMatrix + private static native void set_measurementMatrix_0(long nativeObj, long measurementMatrix_nativeObj); + + // C++: Mat KalmanFilter::processNoiseCov + private static native long get_processNoiseCov_0(long nativeObj); + + // C++: void KalmanFilter::processNoiseCov + private static native void set_processNoiseCov_0(long nativeObj, long processNoiseCov_nativeObj); + + // C++: Mat KalmanFilter::measurementNoiseCov + private static native long get_measurementNoiseCov_0(long nativeObj); + + // C++: void KalmanFilter::measurementNoiseCov + private static native void set_measurementNoiseCov_0(long nativeObj, long measurementNoiseCov_nativeObj); + + // C++: Mat KalmanFilter::errorCovPre + private static native long get_errorCovPre_0(long nativeObj); + + // C++: void KalmanFilter::errorCovPre + private static native void set_errorCovPre_0(long nativeObj, long errorCovPre_nativeObj); + + // C++: Mat KalmanFilter::gain + private static native long get_gain_0(long nativeObj); + + // C++: void KalmanFilter::gain + private static native void set_gain_0(long nativeObj, long gain_nativeObj); + + // C++: Mat KalmanFilter::errorCovPost + private static native long get_errorCovPost_0(long nativeObj); + + // C++: void KalmanFilter::errorCovPost + private static native void set_errorCovPost_0(long nativeObj, long errorCovPost_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/video/Video.java b/openCVLibrary310/src/main/java/org/opencv/video/Video.java new file mode 100644 index 0000000..f46f498 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/video/Video.java @@ -0,0 +1,289 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.video; + +import java.util.ArrayList; +import java.util.List; +import org.opencv.core.Mat; +import org.opencv.core.MatOfByte; +import org.opencv.core.MatOfFloat; +import org.opencv.core.MatOfPoint2f; +import org.opencv.core.Rect; +import org.opencv.core.RotatedRect; +import org.opencv.core.Size; +import org.opencv.core.TermCriteria; +import org.opencv.utils.Converters; + +public class Video { + + private static final int + CV_LKFLOW_INITIAL_GUESSES = 4, + CV_LKFLOW_GET_MIN_EIGENVALS = 8; + + + public static final int + OPTFLOW_USE_INITIAL_FLOW = 4, + OPTFLOW_LK_GET_MIN_EIGENVALS = 8, + OPTFLOW_FARNEBACK_GAUSSIAN = 256, + MOTION_TRANSLATION = 0, + MOTION_EUCLIDEAN = 1, + MOTION_AFFINE = 2, + MOTION_HOMOGRAPHY = 3; + + + // + // C++: Mat estimateRigidTransform(Mat src, Mat dst, bool fullAffine) + // + + //javadoc: estimateRigidTransform(src, dst, fullAffine) + public static Mat estimateRigidTransform(Mat src, Mat dst, boolean fullAffine) + { + + Mat retVal = new Mat(estimateRigidTransform_0(src.nativeObj, dst.nativeObj, fullAffine)); + + return retVal; + } + + + // + // C++: Ptr_BackgroundSubtractorKNN createBackgroundSubtractorKNN(int history = 500, double dist2Threshold = 400.0, bool detectShadows = true) + // + + //javadoc: createBackgroundSubtractorKNN(history, dist2Threshold, detectShadows) + public static BackgroundSubtractorKNN createBackgroundSubtractorKNN(int history, double dist2Threshold, boolean detectShadows) + { + + BackgroundSubtractorKNN retVal = new BackgroundSubtractorKNN(createBackgroundSubtractorKNN_0(history, dist2Threshold, detectShadows)); + + return retVal; + } + + //javadoc: createBackgroundSubtractorKNN() + public static BackgroundSubtractorKNN createBackgroundSubtractorKNN() + { + + BackgroundSubtractorKNN retVal = new BackgroundSubtractorKNN(createBackgroundSubtractorKNN_1()); + + return retVal; + } + + + // + // C++: Ptr_BackgroundSubtractorMOG2 createBackgroundSubtractorMOG2(int history = 500, double varThreshold = 16, bool detectShadows = true) + // + + //javadoc: createBackgroundSubtractorMOG2(history, varThreshold, detectShadows) + public static BackgroundSubtractorMOG2 createBackgroundSubtractorMOG2(int history, double varThreshold, boolean detectShadows) + { + + BackgroundSubtractorMOG2 retVal = new BackgroundSubtractorMOG2(createBackgroundSubtractorMOG2_0(history, varThreshold, detectShadows)); + + return retVal; + } + + //javadoc: createBackgroundSubtractorMOG2() + public static BackgroundSubtractorMOG2 createBackgroundSubtractorMOG2() + { + + BackgroundSubtractorMOG2 retVal = new BackgroundSubtractorMOG2(createBackgroundSubtractorMOG2_1()); + + return retVal; + } + + + // + // C++: Ptr_DualTVL1OpticalFlow createOptFlow_DualTVL1() + // + + //javadoc: createOptFlow_DualTVL1() + public static DualTVL1OpticalFlow createOptFlow_DualTVL1() + { + + DualTVL1OpticalFlow retVal = new DualTVL1OpticalFlow(createOptFlow_DualTVL1_0()); + + return retVal; + } + + + // + // C++: RotatedRect CamShift(Mat probImage, Rect& window, TermCriteria criteria) + // + + //javadoc: CamShift(probImage, window, criteria) + public static RotatedRect CamShift(Mat probImage, Rect window, TermCriteria criteria) + { + double[] window_out = new double[4]; + RotatedRect retVal = new RotatedRect(CamShift_0(probImage.nativeObj, window.x, window.y, window.width, window.height, window_out, criteria.type, criteria.maxCount, criteria.epsilon)); + if(window!=null){ window.x = (int)window_out[0]; window.y = (int)window_out[1]; window.width = (int)window_out[2]; window.height = (int)window_out[3]; } + return retVal; + } + + + // + // C++: double findTransformECC(Mat templateImage, Mat inputImage, Mat& warpMatrix, int motionType = MOTION_AFFINE, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001), Mat inputMask = Mat()) + // + + //javadoc: findTransformECC(templateImage, inputImage, warpMatrix, motionType, criteria, inputMask) + public static double findTransformECC(Mat templateImage, Mat inputImage, Mat warpMatrix, int motionType, TermCriteria criteria, Mat inputMask) + { + + double retVal = findTransformECC_0(templateImage.nativeObj, inputImage.nativeObj, warpMatrix.nativeObj, motionType, criteria.type, criteria.maxCount, criteria.epsilon, inputMask.nativeObj); + + return retVal; + } + + //javadoc: findTransformECC(templateImage, inputImage, warpMatrix, motionType) + public static double findTransformECC(Mat templateImage, Mat inputImage, Mat warpMatrix, int motionType) + { + + double retVal = findTransformECC_1(templateImage.nativeObj, inputImage.nativeObj, warpMatrix.nativeObj, motionType); + + return retVal; + } + + //javadoc: findTransformECC(templateImage, inputImage, warpMatrix) + public static double findTransformECC(Mat templateImage, Mat inputImage, Mat warpMatrix) + { + + double retVal = findTransformECC_2(templateImage.nativeObj, inputImage.nativeObj, warpMatrix.nativeObj); + + return retVal; + } + + + // + // C++: int buildOpticalFlowPyramid(Mat img, vector_Mat& pyramid, Size winSize, int maxLevel, bool withDerivatives = true, int pyrBorder = BORDER_REFLECT_101, int derivBorder = BORDER_CONSTANT, bool tryReuseInputImage = true) + // + + //javadoc: buildOpticalFlowPyramid(img, pyramid, winSize, maxLevel, withDerivatives, pyrBorder, derivBorder, tryReuseInputImage) + public static int buildOpticalFlowPyramid(Mat img, List pyramid, Size winSize, int maxLevel, boolean withDerivatives, int pyrBorder, int derivBorder, boolean tryReuseInputImage) + { + Mat pyramid_mat = new Mat(); + int retVal = buildOpticalFlowPyramid_0(img.nativeObj, pyramid_mat.nativeObj, winSize.width, winSize.height, maxLevel, withDerivatives, pyrBorder, derivBorder, tryReuseInputImage); + Converters.Mat_to_vector_Mat(pyramid_mat, pyramid); + pyramid_mat.release(); + return retVal; + } + + //javadoc: buildOpticalFlowPyramid(img, pyramid, winSize, maxLevel) + public static int buildOpticalFlowPyramid(Mat img, List pyramid, Size winSize, int maxLevel) + { + Mat pyramid_mat = new Mat(); + int retVal = buildOpticalFlowPyramid_1(img.nativeObj, pyramid_mat.nativeObj, winSize.width, winSize.height, maxLevel); + Converters.Mat_to_vector_Mat(pyramid_mat, pyramid); + pyramid_mat.release(); + return retVal; + } + + + // + // C++: int meanShift(Mat probImage, Rect& window, TermCriteria criteria) + // + + //javadoc: meanShift(probImage, window, criteria) + public static int meanShift(Mat probImage, Rect window, TermCriteria criteria) + { + double[] window_out = new double[4]; + int retVal = meanShift_0(probImage.nativeObj, window.x, window.y, window.width, window.height, window_out, criteria.type, criteria.maxCount, criteria.epsilon); + if(window!=null){ window.x = (int)window_out[0]; window.y = (int)window_out[1]; window.width = (int)window_out[2]; window.height = (int)window_out[3]; } + return retVal; + } + + + // + // C++: void calcOpticalFlowFarneback(Mat prev, Mat next, Mat& flow, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags) + // + + //javadoc: calcOpticalFlowFarneback(prev, next, flow, pyr_scale, levels, winsize, iterations, poly_n, poly_sigma, flags) + public static void calcOpticalFlowFarneback(Mat prev, Mat next, Mat flow, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags) + { + + calcOpticalFlowFarneback_0(prev.nativeObj, next.nativeObj, flow.nativeObj, pyr_scale, levels, winsize, iterations, poly_n, poly_sigma, flags); + + return; + } + + + // + // C++: void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, vector_Point2f prevPts, vector_Point2f& nextPts, vector_uchar& status, vector_float& err, Size winSize = Size(21,21), int maxLevel = 3, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), int flags = 0, double minEigThreshold = 1e-4) + // + + //javadoc: calcOpticalFlowPyrLK(prevImg, nextImg, prevPts, nextPts, status, err, winSize, maxLevel, criteria, flags, minEigThreshold) + public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint2f prevPts, MatOfPoint2f nextPts, MatOfByte status, MatOfFloat err, Size winSize, int maxLevel, TermCriteria criteria, int flags, double minEigThreshold) + { + Mat prevPts_mat = prevPts; + Mat nextPts_mat = nextPts; + Mat status_mat = status; + Mat err_mat = err; + calcOpticalFlowPyrLK_0(prevImg.nativeObj, nextImg.nativeObj, prevPts_mat.nativeObj, nextPts_mat.nativeObj, status_mat.nativeObj, err_mat.nativeObj, winSize.width, winSize.height, maxLevel, criteria.type, criteria.maxCount, criteria.epsilon, flags, minEigThreshold); + + return; + } + + //javadoc: calcOpticalFlowPyrLK(prevImg, nextImg, prevPts, nextPts, status, err, winSize, maxLevel) + public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint2f prevPts, MatOfPoint2f nextPts, MatOfByte status, MatOfFloat err, Size winSize, int maxLevel) + { + Mat prevPts_mat = prevPts; + Mat nextPts_mat = nextPts; + Mat status_mat = status; + Mat err_mat = err; + calcOpticalFlowPyrLK_1(prevImg.nativeObj, nextImg.nativeObj, prevPts_mat.nativeObj, nextPts_mat.nativeObj, status_mat.nativeObj, err_mat.nativeObj, winSize.width, winSize.height, maxLevel); + + return; + } + + //javadoc: calcOpticalFlowPyrLK(prevImg, nextImg, prevPts, nextPts, status, err) + public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint2f prevPts, MatOfPoint2f nextPts, MatOfByte status, MatOfFloat err) + { + Mat prevPts_mat = prevPts; + Mat nextPts_mat = nextPts; + Mat status_mat = status; + Mat err_mat = err; + calcOpticalFlowPyrLK_2(prevImg.nativeObj, nextImg.nativeObj, prevPts_mat.nativeObj, nextPts_mat.nativeObj, status_mat.nativeObj, err_mat.nativeObj); + + return; + } + + + + + // C++: Mat estimateRigidTransform(Mat src, Mat dst, bool fullAffine) + private static native long estimateRigidTransform_0(long src_nativeObj, long dst_nativeObj, boolean fullAffine); + + // C++: Ptr_BackgroundSubtractorKNN createBackgroundSubtractorKNN(int history = 500, double dist2Threshold = 400.0, bool detectShadows = true) + private static native long createBackgroundSubtractorKNN_0(int history, double dist2Threshold, boolean detectShadows); + private static native long createBackgroundSubtractorKNN_1(); + + // C++: Ptr_BackgroundSubtractorMOG2 createBackgroundSubtractorMOG2(int history = 500, double varThreshold = 16, bool detectShadows = true) + private static native long createBackgroundSubtractorMOG2_0(int history, double varThreshold, boolean detectShadows); + private static native long createBackgroundSubtractorMOG2_1(); + + // C++: Ptr_DualTVL1OpticalFlow createOptFlow_DualTVL1() + private static native long createOptFlow_DualTVL1_0(); + + // C++: RotatedRect CamShift(Mat probImage, Rect& window, TermCriteria criteria) + private static native double[] CamShift_0(long probImage_nativeObj, int window_x, int window_y, int window_width, int window_height, double[] window_out, int criteria_type, int criteria_maxCount, double criteria_epsilon); + + // C++: double findTransformECC(Mat templateImage, Mat inputImage, Mat& warpMatrix, int motionType = MOTION_AFFINE, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001), Mat inputMask = Mat()) + private static native double findTransformECC_0(long templateImage_nativeObj, long inputImage_nativeObj, long warpMatrix_nativeObj, int motionType, int criteria_type, int criteria_maxCount, double criteria_epsilon, long inputMask_nativeObj); + private static native double findTransformECC_1(long templateImage_nativeObj, long inputImage_nativeObj, long warpMatrix_nativeObj, int motionType); + private static native double findTransformECC_2(long templateImage_nativeObj, long inputImage_nativeObj, long warpMatrix_nativeObj); + + // C++: int buildOpticalFlowPyramid(Mat img, vector_Mat& pyramid, Size winSize, int maxLevel, bool withDerivatives = true, int pyrBorder = BORDER_REFLECT_101, int derivBorder = BORDER_CONSTANT, bool tryReuseInputImage = true) + private static native int buildOpticalFlowPyramid_0(long img_nativeObj, long pyramid_mat_nativeObj, double winSize_width, double winSize_height, int maxLevel, boolean withDerivatives, int pyrBorder, int derivBorder, boolean tryReuseInputImage); + private static native int buildOpticalFlowPyramid_1(long img_nativeObj, long pyramid_mat_nativeObj, double winSize_width, double winSize_height, int maxLevel); + + // C++: int meanShift(Mat probImage, Rect& window, TermCriteria criteria) + private static native int meanShift_0(long probImage_nativeObj, int window_x, int window_y, int window_width, int window_height, double[] window_out, int criteria_type, int criteria_maxCount, double criteria_epsilon); + + // C++: void calcOpticalFlowFarneback(Mat prev, Mat next, Mat& flow, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags) + private static native void calcOpticalFlowFarneback_0(long prev_nativeObj, long next_nativeObj, long flow_nativeObj, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags); + + // C++: void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, vector_Point2f prevPts, vector_Point2f& nextPts, vector_uchar& status, vector_float& err, Size winSize = Size(21,21), int maxLevel = 3, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), int flags = 0, double minEigThreshold = 1e-4) + private static native void calcOpticalFlowPyrLK_0(long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_mat_nativeObj, long nextPts_mat_nativeObj, long status_mat_nativeObj, long err_mat_nativeObj, double winSize_width, double winSize_height, int maxLevel, int criteria_type, int criteria_maxCount, double criteria_epsilon, int flags, double minEigThreshold); + private static native void calcOpticalFlowPyrLK_1(long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_mat_nativeObj, long nextPts_mat_nativeObj, long status_mat_nativeObj, long err_mat_nativeObj, double winSize_width, double winSize_height, int maxLevel); + private static native void calcOpticalFlowPyrLK_2(long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_mat_nativeObj, long nextPts_mat_nativeObj, long status_mat_nativeObj, long err_mat_nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/videoio/VideoCapture.java b/openCVLibrary310/src/main/java/org/opencv/videoio/VideoCapture.java new file mode 100644 index 0000000..b4100c9 --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/videoio/VideoCapture.java @@ -0,0 +1,276 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.videoio; + +import java.lang.String; +import org.opencv.core.Mat; + +// C++: class VideoCapture +//javadoc: VideoCapture +public class VideoCapture { + + protected final long nativeObj; + protected VideoCapture(long addr) { nativeObj = addr; } + + + // + // C++: VideoCapture(String filename, int apiPreference) + // + + //javadoc: VideoCapture::VideoCapture(filename, apiPreference) + public VideoCapture(String filename, int apiPreference) + { + + nativeObj = VideoCapture_0(filename, apiPreference); + + return; + } + + + // + // C++: VideoCapture(String filename) + // + + //javadoc: VideoCapture::VideoCapture(filename) + public VideoCapture(String filename) + { + + nativeObj = VideoCapture_1(filename); + + return; + } + + + // + // C++: VideoCapture(int index) + // + + //javadoc: VideoCapture::VideoCapture(index) + public VideoCapture(int index) + { + + nativeObj = VideoCapture_2(index); + + return; + } + + + // + // C++: VideoCapture() + // + + //javadoc: VideoCapture::VideoCapture() + public VideoCapture() + { + + nativeObj = VideoCapture_3(); + + return; + } + + + // + // C++: bool grab() + // + + //javadoc: VideoCapture::grab() + public boolean grab() + { + + boolean retVal = grab_0(nativeObj); + + return retVal; + } + + + // + // C++: bool isOpened() + // + + //javadoc: VideoCapture::isOpened() + public boolean isOpened() + { + + boolean retVal = isOpened_0(nativeObj); + + return retVal; + } + + + // + // C++: bool open(String filename, int apiPreference) + // + + //javadoc: VideoCapture::open(filename, apiPreference) + public boolean open(String filename, int apiPreference) + { + + boolean retVal = open_0(nativeObj, filename, apiPreference); + + return retVal; + } + + + // + // C++: bool open(String filename) + // + + //javadoc: VideoCapture::open(filename) + public boolean open(String filename) + { + + boolean retVal = open_1(nativeObj, filename); + + return retVal; + } + + + // + // C++: bool open(int index) + // + + //javadoc: VideoCapture::open(index) + public boolean open(int index) + { + + boolean retVal = open_2(nativeObj, index); + + return retVal; + } + + + // + // C++: bool read(Mat& image) + // + + //javadoc: VideoCapture::read(image) + public boolean read(Mat image) + { + + boolean retVal = read_0(nativeObj, image.nativeObj); + + return retVal; + } + + + // + // C++: bool retrieve(Mat& image, int flag = 0) + // + + //javadoc: VideoCapture::retrieve(image, flag) + public boolean retrieve(Mat image, int flag) + { + + boolean retVal = retrieve_0(nativeObj, image.nativeObj, flag); + + return retVal; + } + + //javadoc: VideoCapture::retrieve(image) + public boolean retrieve(Mat image) + { + + boolean retVal = retrieve_1(nativeObj, image.nativeObj); + + return retVal; + } + + + // + // C++: bool set(int propId, double value) + // + + //javadoc: VideoCapture::set(propId, value) + public boolean set(int propId, double value) + { + + boolean retVal = set_0(nativeObj, propId, value); + + return retVal; + } + + + // + // C++: double get(int propId) + // + + //javadoc: VideoCapture::get(propId) + public double get(int propId) + { + + double retVal = get_0(nativeObj, propId); + + return retVal; + } + + + // + // C++: void release() + // + + //javadoc: VideoCapture::release() + public void release() + { + + release_0(nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: VideoCapture(String filename, int apiPreference) + private static native long VideoCapture_0(String filename, int apiPreference); + + // C++: VideoCapture(String filename) + private static native long VideoCapture_1(String filename); + + // C++: VideoCapture(int index) + private static native long VideoCapture_2(int index); + + // C++: VideoCapture() + private static native long VideoCapture_3(); + + // C++: bool grab() + private static native boolean grab_0(long nativeObj); + + // C++: bool isOpened() + private static native boolean isOpened_0(long nativeObj); + + // C++: bool open(String filename, int apiPreference) + private static native boolean open_0(long nativeObj, String filename, int apiPreference); + + // C++: bool open(String filename) + private static native boolean open_1(long nativeObj, String filename); + + // C++: bool open(int index) + private static native boolean open_2(long nativeObj, int index); + + // C++: bool read(Mat& image) + private static native boolean read_0(long nativeObj, long image_nativeObj); + + // C++: bool retrieve(Mat& image, int flag = 0) + private static native boolean retrieve_0(long nativeObj, long image_nativeObj, int flag); + private static native boolean retrieve_1(long nativeObj, long image_nativeObj); + + // C++: bool set(int propId, double value) + private static native boolean set_0(long nativeObj, int propId, double value); + + // C++: double get(int propId) + private static native double get_0(long nativeObj, int propId); + + // C++: void release() + private static native void release_0(long nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/videoio/VideoWriter.java b/openCVLibrary310/src/main/java/org/opencv/videoio/VideoWriter.java new file mode 100644 index 0000000..2de831e --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/videoio/VideoWriter.java @@ -0,0 +1,202 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.videoio; + +import java.lang.String; +import org.opencv.core.Mat; +import org.opencv.core.Size; + +// C++: class VideoWriter +//javadoc: VideoWriter +public class VideoWriter { + + protected final long nativeObj; + protected VideoWriter(long addr) { nativeObj = addr; } + + + // + // C++: VideoWriter(String filename, int fourcc, double fps, Size frameSize, bool isColor = true) + // + + //javadoc: VideoWriter::VideoWriter(filename, fourcc, fps, frameSize, isColor) + public VideoWriter(String filename, int fourcc, double fps, Size frameSize, boolean isColor) + { + + nativeObj = VideoWriter_0(filename, fourcc, fps, frameSize.width, frameSize.height, isColor); + + return; + } + + //javadoc: VideoWriter::VideoWriter(filename, fourcc, fps, frameSize) + public VideoWriter(String filename, int fourcc, double fps, Size frameSize) + { + + nativeObj = VideoWriter_1(filename, fourcc, fps, frameSize.width, frameSize.height); + + return; + } + + + // + // C++: VideoWriter() + // + + //javadoc: VideoWriter::VideoWriter() + public VideoWriter() + { + + nativeObj = VideoWriter_2(); + + return; + } + + + // + // C++: bool isOpened() + // + + //javadoc: VideoWriter::isOpened() + public boolean isOpened() + { + + boolean retVal = isOpened_0(nativeObj); + + return retVal; + } + + + // + // C++: bool open(String filename, int fourcc, double fps, Size frameSize, bool isColor = true) + // + + //javadoc: VideoWriter::open(filename, fourcc, fps, frameSize, isColor) + public boolean open(String filename, int fourcc, double fps, Size frameSize, boolean isColor) + { + + boolean retVal = open_0(nativeObj, filename, fourcc, fps, frameSize.width, frameSize.height, isColor); + + return retVal; + } + + //javadoc: VideoWriter::open(filename, fourcc, fps, frameSize) + public boolean open(String filename, int fourcc, double fps, Size frameSize) + { + + boolean retVal = open_1(nativeObj, filename, fourcc, fps, frameSize.width, frameSize.height); + + return retVal; + } + + + // + // C++: bool set(int propId, double value) + // + + //javadoc: VideoWriter::set(propId, value) + public boolean set(int propId, double value) + { + + boolean retVal = set_0(nativeObj, propId, value); + + return retVal; + } + + + // + // C++: double get(int propId) + // + + //javadoc: VideoWriter::get(propId) + public double get(int propId) + { + + double retVal = get_0(nativeObj, propId); + + return retVal; + } + + + // + // C++: static int fourcc(char c1, char c2, char c3, char c4) + // + + //javadoc: VideoWriter::fourcc(c1, c2, c3, c4) + public static int fourcc(char c1, char c2, char c3, char c4) + { + + int retVal = fourcc_0(c1, c2, c3, c4); + + return retVal; + } + + + // + // C++: void release() + // + + //javadoc: VideoWriter::release() + public void release() + { + + release_0(nativeObj); + + return; + } + + + // + // C++: void write(Mat image) + // + + //javadoc: VideoWriter::write(image) + public void write(Mat image) + { + + write_0(nativeObj, image.nativeObj); + + return; + } + + + @Override + protected void finalize() throws Throwable { + delete(nativeObj); + } + + + + // C++: VideoWriter(String filename, int fourcc, double fps, Size frameSize, bool isColor = true) + private static native long VideoWriter_0(String filename, int fourcc, double fps, double frameSize_width, double frameSize_height, boolean isColor); + private static native long VideoWriter_1(String filename, int fourcc, double fps, double frameSize_width, double frameSize_height); + + // C++: VideoWriter() + private static native long VideoWriter_2(); + + // C++: bool isOpened() + private static native boolean isOpened_0(long nativeObj); + + // C++: bool open(String filename, int fourcc, double fps, Size frameSize, bool isColor = true) + private static native boolean open_0(long nativeObj, String filename, int fourcc, double fps, double frameSize_width, double frameSize_height, boolean isColor); + private static native boolean open_1(long nativeObj, String filename, int fourcc, double fps, double frameSize_width, double frameSize_height); + + // C++: bool set(int propId, double value) + private static native boolean set_0(long nativeObj, int propId, double value); + + // C++: double get(int propId) + private static native double get_0(long nativeObj, int propId); + + // C++: static int fourcc(char c1, char c2, char c3, char c4) + private static native int fourcc_0(char c1, char c2, char c3, char c4); + + // C++: void release() + private static native void release_0(long nativeObj); + + // C++: void write(Mat image) + private static native void write_0(long nativeObj, long image_nativeObj); + + // native support for java finalize() + private static native void delete(long nativeObj); + +} diff --git a/openCVLibrary310/src/main/java/org/opencv/videoio/Videoio.java b/openCVLibrary310/src/main/java/org/opencv/videoio/Videoio.java new file mode 100644 index 0000000..1ed65aa --- /dev/null +++ b/openCVLibrary310/src/main/java/org/opencv/videoio/Videoio.java @@ -0,0 +1,429 @@ + +// +// This file is auto-generated. Please don't modify it! +// +package org.opencv.videoio; + + + +public class Videoio { + + public static final int + CV_CAP_MSMF = 1400, + CV_CAP_ANDROID = 1000, + CV_CAP_ANDROID_BACK = CV_CAP_ANDROID+99, + CV_CAP_ANDROID_FRONT = CV_CAP_ANDROID+98, + CV_CAP_XIAPI = 1100, + CV_CAP_AVFOUNDATION = 1200, + CV_CAP_GIGANETIX = 1300, + CV_CAP_GPHOTO2 = 1700, + CV_CAP_GSTREAMER = 1800, + CV_CAP_FFMPEG = 1900, + CV_CAP_IMAGES = 2000, + CV_CAP_PROP_FRAME_WIDTH = 3, + CV_CAP_PROP_FRAME_HEIGHT = 4, + CV_CAP_PROP_ZOOM = 27, + CV_CAP_PROP_FOCUS = 28, + CV_CAP_PROP_GUID = 29, + CV_CAP_PROP_ISO_SPEED = 30, + CV_CAP_PROP_BACKLIGHT = 32, + CV_CAP_PROP_PAN = 33, + CV_CAP_PROP_TILT = 34, + CV_CAP_PROP_ROLL = 35, + CV_CAP_PROP_IRIS = 36, + CV_CAP_PROP_SETTINGS = 37, + CV_CAP_PROP_BUFFERSIZE = 38, + CV_CAP_PROP_AUTOFOCUS = 39, + CV_CAP_PROP_SAR_NUM = 40, + CV_CAP_PROP_SAR_DEN = 41, + CV_CAP_PROP_AUTOGRAB = 1024, + CV_CAP_PROP_PREVIEW_FORMAT = 1026, + CV_CAP_PROP_OPENNI2_SYNC = 110, + CV_CAP_PROP_OPENNI2_MIRROR = 111, + CV_CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, + CV_CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, + CV_CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, + CV_CAP_PROP_PVAPI_BINNINGX = 304, + CV_CAP_PROP_PVAPI_BINNINGY = 305, + CV_CAP_PROP_PVAPI_PIXELFORMAT = 306, + CV_CAP_PROP_XI_DOWNSAMPLING = 400, + CV_CAP_PROP_XI_DATA_FORMAT = 401, + CV_CAP_PROP_XI_OFFSET_X = 402, + CV_CAP_PROP_XI_OFFSET_Y = 403, + CV_CAP_PROP_XI_TRG_SOURCE = 404, + CV_CAP_PROP_XI_TRG_SOFTWARE = 405, + CV_CAP_PROP_XI_GPI_SELECTOR = 406, + CV_CAP_PROP_XI_GPI_MODE = 407, + CV_CAP_PROP_XI_GPI_LEVEL = 408, + CV_CAP_PROP_XI_GPO_SELECTOR = 409, + CV_CAP_PROP_XI_GPO_MODE = 410, + CV_CAP_PROP_XI_LED_SELECTOR = 411, + CV_CAP_PROP_XI_LED_MODE = 412, + CV_CAP_PROP_XI_MANUAL_WB = 413, + CV_CAP_PROP_XI_AUTO_WB = 414, + CV_CAP_PROP_XI_AEAG = 415, + CV_CAP_PROP_XI_EXP_PRIORITY = 416, + CV_CAP_PROP_XI_AE_MAX_LIMIT = 417, + CV_CAP_PROP_XI_AG_MAX_LIMIT = 418, + CV_CAP_PROP_XI_AEAG_LEVEL = 419, + CV_CAP_PROP_XI_TIMEOUT = 420, + CV_CAP_PROP_XI_EXPOSURE = 421, + CV_CAP_PROP_XI_EXPOSURE_BURST_COUNT = 422, + CV_CAP_PROP_XI_GAIN_SELECTOR = 423, + CV_CAP_PROP_XI_GAIN = 424, + CV_CAP_PROP_XI_DOWNSAMPLING_TYPE = 426, + CV_CAP_PROP_XI_BINNING_SELECTOR = 427, + CV_CAP_PROP_XI_BINNING_VERTICAL = 428, + CV_CAP_PROP_XI_BINNING_HORIZONTAL = 429, + CV_CAP_PROP_XI_BINNING_PATTERN = 430, + CV_CAP_PROP_XI_DECIMATION_SELECTOR = 431, + CV_CAP_PROP_XI_DECIMATION_VERTICAL = 432, + CV_CAP_PROP_XI_DECIMATION_HORIZONTAL = 433, + CV_CAP_PROP_XI_DECIMATION_PATTERN = 434, + CV_CAP_PROP_XI_IMAGE_DATA_FORMAT = 435, + CV_CAP_PROP_XI_SHUTTER_TYPE = 436, + CV_CAP_PROP_XI_SENSOR_TAPS = 437, + CV_CAP_PROP_XI_AEAG_ROI_OFFSET_X = 439, + CV_CAP_PROP_XI_AEAG_ROI_OFFSET_Y = 440, + CV_CAP_PROP_XI_AEAG_ROI_WIDTH = 441, + CV_CAP_PROP_XI_AEAG_ROI_HEIGHT = 442, + CV_CAP_PROP_XI_BPC = 445, + CV_CAP_PROP_XI_WB_KR = 448, + CV_CAP_PROP_XI_WB_KG = 449, + CV_CAP_PROP_XI_WB_KB = 450, + CV_CAP_PROP_XI_WIDTH = 451, + CV_CAP_PROP_XI_HEIGHT = 452, + CV_CAP_PROP_XI_LIMIT_BANDWIDTH = 459, + CV_CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH = 460, + CV_CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH = 461, + CV_CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH = 462, + CV_CAP_PROP_XI_OUTPUT_DATA_PACKING = 463, + CV_CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE = 464, + CV_CAP_PROP_XI_IS_COOLED = 465, + CV_CAP_PROP_XI_COOLING = 466, + CV_CAP_PROP_XI_TARGET_TEMP = 467, + CV_CAP_PROP_XI_CHIP_TEMP = 468, + CV_CAP_PROP_XI_HOUS_TEMP = 469, + CV_CAP_PROP_XI_CMS = 470, + CV_CAP_PROP_XI_APPLY_CMS = 471, + CV_CAP_PROP_XI_IMAGE_IS_COLOR = 474, + CV_CAP_PROP_XI_COLOR_FILTER_ARRAY = 475, + CV_CAP_PROP_XI_GAMMAY = 476, + CV_CAP_PROP_XI_GAMMAC = 477, + CV_CAP_PROP_XI_SHARPNESS = 478, + CV_CAP_PROP_XI_CC_MATRIX_00 = 479, + CV_CAP_PROP_XI_CC_MATRIX_01 = 480, + CV_CAP_PROP_XI_CC_MATRIX_02 = 481, + CV_CAP_PROP_XI_CC_MATRIX_03 = 482, + CV_CAP_PROP_XI_CC_MATRIX_10 = 483, + CV_CAP_PROP_XI_CC_MATRIX_11 = 484, + CV_CAP_PROP_XI_CC_MATRIX_12 = 485, + CV_CAP_PROP_XI_CC_MATRIX_13 = 486, + CV_CAP_PROP_XI_CC_MATRIX_20 = 487, + CV_CAP_PROP_XI_CC_MATRIX_21 = 488, + CV_CAP_PROP_XI_CC_MATRIX_22 = 489, + CV_CAP_PROP_XI_CC_MATRIX_23 = 490, + CV_CAP_PROP_XI_CC_MATRIX_30 = 491, + CV_CAP_PROP_XI_CC_MATRIX_31 = 492, + CV_CAP_PROP_XI_CC_MATRIX_32 = 493, + CV_CAP_PROP_XI_CC_MATRIX_33 = 494, + CV_CAP_PROP_XI_DEFAULT_CC_MATRIX = 495, + CV_CAP_PROP_XI_TRG_SELECTOR = 498, + CV_CAP_PROP_XI_ACQ_FRAME_BURST_COUNT = 499, + CV_CAP_PROP_XI_DEBOUNCE_EN = 507, + CV_CAP_PROP_XI_DEBOUNCE_T0 = 508, + CV_CAP_PROP_XI_DEBOUNCE_T1 = 509, + CV_CAP_PROP_XI_DEBOUNCE_POL = 510, + CV_CAP_PROP_XI_LENS_MODE = 511, + CV_CAP_PROP_XI_LENS_APERTURE_VALUE = 512, + CV_CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE = 513, + CV_CAP_PROP_XI_LENS_FOCUS_MOVE = 514, + CV_CAP_PROP_XI_LENS_FOCUS_DISTANCE = 515, + CV_CAP_PROP_XI_LENS_FOCAL_LENGTH = 516, + CV_CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517, + CV_CAP_PROP_XI_LENS_FEATURE = 518, + CV_CAP_PROP_XI_DEVICE_MODEL_ID = 521, + CV_CAP_PROP_XI_DEVICE_SN = 522, + CV_CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529, + CV_CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530, + CV_CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531, + CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ = 532, + CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX = 533, + CV_CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT = 534, + CV_CAP_PROP_XI_FRAMERATE = 535, + CV_CAP_PROP_XI_COUNTER_SELECTOR = 536, + CV_CAP_PROP_XI_COUNTER_VALUE = 537, + CV_CAP_PROP_XI_ACQ_TIMING_MODE = 538, + CV_CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, + CV_CAP_PROP_XI_BUFFER_POLICY = 540, + CV_CAP_PROP_XI_LUT_EN = 541, + CV_CAP_PROP_XI_LUT_INDEX = 542, + CV_CAP_PROP_XI_LUT_VALUE = 543, + CV_CAP_PROP_XI_TRG_DELAY = 544, + CV_CAP_PROP_XI_TS_RST_MODE = 545, + CV_CAP_PROP_XI_TS_RST_SOURCE = 546, + CV_CAP_PROP_XI_IS_DEVICE_EXIST = 547, + CV_CAP_PROP_XI_ACQ_BUFFER_SIZE = 548, + CV_CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT = 549, + CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE = 550, + CV_CAP_PROP_XI_BUFFERS_QUEUE_SIZE = 551, + CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT = 552, + CV_CAP_PROP_XI_RECENT_FRAME = 553, + CV_CAP_PROP_XI_DEVICE_RESET = 554, + CV_CAP_PROP_XI_COLUMN_FPN_CORRECTION = 555, + CV_CAP_PROP_XI_SENSOR_MODE = 558, + CV_CAP_PROP_XI_HDR = 559, + CV_CAP_PROP_XI_HDR_KNEEPOINT_COUNT = 560, + CV_CAP_PROP_XI_HDR_T1 = 561, + CV_CAP_PROP_XI_HDR_T2 = 562, + CV_CAP_PROP_XI_KNEEPOINT1 = 563, + CV_CAP_PROP_XI_KNEEPOINT2 = 564, + CV_CAP_PROP_XI_IMAGE_BLACK_LEVEL = 565, + CV_CAP_PROP_XI_HW_REVISION = 571, + CV_CAP_PROP_XI_DEBUG_LEVEL = 572, + CV_CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION = 573, + CV_CAP_PROP_XI_FREE_FFS_SIZE = 581, + CV_CAP_PROP_XI_USED_FFS_SIZE = 582, + CV_CAP_PROP_XI_FFS_ACCESS_KEY = 583, + CV_CAP_PROP_XI_SENSOR_FEATURE_SELECTOR = 585, + CV_CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586, + CV_CAP_PROP_ANDROID_FLASH_MODE = 8001, + CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002, + CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003, + CV_CAP_PROP_ANDROID_ANTIBANDING = 8004, + CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005, + CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006, + CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007, + CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008, + CV_CAP_PROP_ANDROID_EXPOSE_LOCK = 8009, + CV_CAP_PROP_ANDROID_WHITEBALANCE_LOCK = 8010, + CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001, + CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002, + CV_CAP_PROP_IOS_DEVICE_FLASH = 9003, + CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004, + CV_CAP_PROP_IOS_DEVICE_TORCH = 9005, + CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001, + CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002, + CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003, + CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004, + CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005, + CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006, + CV_CAP_PROP_INTELPERC_PROFILE_COUNT = 11001, + CV_CAP_PROP_INTELPERC_PROFILE_IDX = 11002, + CV_CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003, + CV_CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004, + CV_CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005, + CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006, + CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007, + CV_CAP_MODE_BGR = 0, + CV_CAP_MODE_RGB = 1, + CV_CAP_MODE_GRAY = 2, + CV_CAP_MODE_YUYV = 3, + CV_CAP_PROP_GPHOTO2_PREVIEW = 17001, + CV_CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, + CV_CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, + CV_CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, + CV_CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, + CV_CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, + CV_CAP_PROP_SPEED = 17007, + CV_CAP_PROP_APERTURE = 17008, + CV_CAP_PROP_VIEWFINDER = 17010, + CAP_ANY = 0, + CAP_VFW = 200, + CAP_V4L = 200, + CAP_V4L2 = CAP_V4L, + CAP_FIREWARE = 300, + CAP_FIREWIRE = CAP_FIREWARE, + CAP_IEEE1394 = CAP_FIREWARE, + CAP_DC1394 = CAP_FIREWARE, + CAP_CMU1394 = CAP_FIREWARE, + CAP_QT = 500, + CAP_UNICAP = 600, + CAP_DSHOW = 700, + CAP_PVAPI = 800, + CAP_OPENNI = 900, + CAP_OPENNI_ASUS = 910, + CAP_ANDROID = 1000, + CAP_XIAPI = 1100, + CAP_AVFOUNDATION = 1200, + CAP_GIGANETIX = 1300, + CAP_MSMF = 1400, + CAP_WINRT = 1410, + CAP_INTELPERC = 1500, + CAP_OPENNI2 = 1600, + CAP_OPENNI2_ASUS = 1610, + CAP_GPHOTO2 = 1700, + CAP_GSTREAMER = 1800, + CAP_FFMPEG = 1900, + CAP_IMAGES = 2000, + CAP_PROP_POS_MSEC = 0, + CAP_PROP_POS_FRAMES = 1, + CAP_PROP_POS_AVI_RATIO = 2, + CAP_PROP_FRAME_WIDTH = 3, + CAP_PROP_FRAME_HEIGHT = 4, + CAP_PROP_FPS = 5, + CAP_PROP_FOURCC = 6, + CAP_PROP_FRAME_COUNT = 7, + CAP_PROP_FORMAT = 8, + CAP_PROP_MODE = 9, + CAP_PROP_BRIGHTNESS = 10, + CAP_PROP_CONTRAST = 11, + CAP_PROP_SATURATION = 12, + CAP_PROP_HUE = 13, + CAP_PROP_GAIN = 14, + CAP_PROP_EXPOSURE = 15, + CAP_PROP_CONVERT_RGB = 16, + CAP_PROP_WHITE_BALANCE_BLUE_U = 17, + CAP_PROP_RECTIFICATION = 18, + CAP_PROP_MONOCHROME = 19, + CAP_PROP_SHARPNESS = 20, + CAP_PROP_AUTO_EXPOSURE = 21, + CAP_PROP_GAMMA = 22, + CAP_PROP_TEMPERATURE = 23, + CAP_PROP_TRIGGER = 24, + CAP_PROP_TRIGGER_DELAY = 25, + CAP_PROP_WHITE_BALANCE_RED_V = 26, + CAP_PROP_ZOOM = 27, + CAP_PROP_FOCUS = 28, + CAP_PROP_GUID = 29, + CAP_PROP_ISO_SPEED = 30, + CAP_PROP_BACKLIGHT = 32, + CAP_PROP_PAN = 33, + CAP_PROP_TILT = 34, + CAP_PROP_ROLL = 35, + CAP_PROP_IRIS = 36, + CAP_PROP_SETTINGS = 37, + CAP_PROP_BUFFERSIZE = 38, + CAP_PROP_AUTOFOCUS = 39, + CAP_MODE_BGR = 0, + CAP_MODE_RGB = 1, + CAP_MODE_GRAY = 2, + CAP_MODE_YUYV = 3, + CAP_PROP_DC1394_OFF = -4, + CAP_PROP_DC1394_MODE_MANUAL = -3, + CAP_PROP_DC1394_MODE_AUTO = -2, + CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1, + CAP_PROP_DC1394_MAX = 31, + CAP_OPENNI_DEPTH_GENERATOR = 1 << 31, + CAP_OPENNI_IMAGE_GENERATOR = 1 << 30, + CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR, + CAP_PROP_OPENNI_OUTPUT_MODE = 100, + CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, + CAP_PROP_OPENNI_BASELINE = 102, + CAP_PROP_OPENNI_FOCAL_LENGTH = 103, + CAP_PROP_OPENNI_REGISTRATION = 104, + CAP_PROP_OPENNI_REGISTRATION_ON = CAP_PROP_OPENNI_REGISTRATION, + CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105, + CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106, + CAP_PROP_OPENNI_CIRCLE_BUFFER = 107, + CAP_PROP_OPENNI_MAX_TIME_DURATION = 108, + CAP_PROP_OPENNI_GENERATOR_PRESENT = 109, + CAP_PROP_OPENNI2_SYNC = 110, + CAP_PROP_OPENNI2_MIRROR = 111, + CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT, + CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE, + CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE, + CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH, + CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION, + CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION, + CAP_OPENNI_DEPTH_MAP = 0, + CAP_OPENNI_POINT_CLOUD_MAP = 1, + CAP_OPENNI_DISPARITY_MAP = 2, + CAP_OPENNI_DISPARITY_MAP_32F = 3, + CAP_OPENNI_VALID_DEPTH_MASK = 4, + CAP_OPENNI_BGR_IMAGE = 5, + CAP_OPENNI_GRAY_IMAGE = 6, + CAP_OPENNI_VGA_30HZ = 0, + CAP_OPENNI_SXGA_15HZ = 1, + CAP_OPENNI_SXGA_30HZ = 2, + CAP_OPENNI_QVGA_30HZ = 3, + CAP_OPENNI_QVGA_60HZ = 4, + CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200, + CAP_PROP_PVAPI_MULTICASTIP = 300, + CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, + CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, + CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, + CAP_PROP_PVAPI_BINNINGX = 304, + CAP_PROP_PVAPI_BINNINGY = 305, + CAP_PROP_PVAPI_PIXELFORMAT = 306, + CAP_PVAPI_FSTRIGMODE_FREERUN = 0, + CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1, + CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2, + CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3, + CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4, + CAP_PVAPI_DECIMATION_OFF = 1, + CAP_PVAPI_DECIMATION_2OUTOF4 = 2, + CAP_PVAPI_DECIMATION_2OUTOF8 = 4, + CAP_PVAPI_DECIMATION_2OUTOF16 = 8, + CAP_PVAPI_PIXELFORMAT_MONO8 = 1, + CAP_PVAPI_PIXELFORMAT_MONO16 = 2, + CAP_PVAPI_PIXELFORMAT_BAYER8 = 3, + CAP_PVAPI_PIXELFORMAT_BAYER16 = 4, + CAP_PVAPI_PIXELFORMAT_RGB24 = 5, + CAP_PVAPI_PIXELFORMAT_BGR24 = 6, + CAP_PVAPI_PIXELFORMAT_RGBA32 = 7, + CAP_PVAPI_PIXELFORMAT_BGRA32 = 8, + CAP_PROP_XI_DOWNSAMPLING = 400, + CAP_PROP_XI_DATA_FORMAT = 401, + CAP_PROP_XI_OFFSET_X = 402, + CAP_PROP_XI_OFFSET_Y = 403, + CAP_PROP_XI_TRG_SOURCE = 404, + CAP_PROP_XI_TRG_SOFTWARE = 405, + CAP_PROP_XI_GPI_SELECTOR = 406, + CAP_PROP_XI_GPI_MODE = 407, + CAP_PROP_XI_GPI_LEVEL = 408, + CAP_PROP_XI_GPO_SELECTOR = 409, + CAP_PROP_XI_GPO_MODE = 410, + CAP_PROP_XI_LED_SELECTOR = 411, + CAP_PROP_XI_LED_MODE = 412, + CAP_PROP_XI_MANUAL_WB = 413, + CAP_PROP_XI_AUTO_WB = 414, + CAP_PROP_XI_AEAG = 415, + CAP_PROP_XI_EXP_PRIORITY = 416, + CAP_PROP_XI_AE_MAX_LIMIT = 417, + CAP_PROP_XI_AG_MAX_LIMIT = 418, + CAP_PROP_XI_AEAG_LEVEL = 419, + CAP_PROP_XI_TIMEOUT = 420, + CAP_PROP_IOS_DEVICE_FOCUS = 9001, + CAP_PROP_IOS_DEVICE_EXPOSURE = 9002, + CAP_PROP_IOS_DEVICE_FLASH = 9003, + CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004, + CAP_PROP_IOS_DEVICE_TORCH = 9005, + CAP_PROP_GIGA_FRAME_OFFSET_X = 10001, + CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002, + CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003, + CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004, + CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005, + CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006, + CAP_PROP_INTELPERC_PROFILE_COUNT = 11001, + CAP_PROP_INTELPERC_PROFILE_IDX = 11002, + CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003, + CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004, + CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005, + CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006, + CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007, + CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29, + CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28, + CAP_INTELPERC_GENERATORS_MASK = CAP_INTELPERC_DEPTH_GENERATOR + CAP_INTELPERC_IMAGE_GENERATOR, + CAP_INTELPERC_DEPTH_MAP = 0, + CAP_INTELPERC_UVDEPTH_MAP = 1, + CAP_INTELPERC_IR_MAP = 2, + CAP_INTELPERC_IMAGE = 3, + VIDEOWRITER_PROP_QUALITY = 1, + VIDEOWRITER_PROP_FRAMEBYTES = 2, + VIDEOWRITER_PROP_NSTRIPES = 3, + CAP_PROP_GPHOTO2_PREVIEW = 17001, + CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, + CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, + CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, + CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, + CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, + CAP_PROP_SPEED = 17007, + CAP_PROP_APERTURE = 17008, + CAP_PROP_EXPOSUREPROGRAM = 17009, + CAP_PROP_VIEWFINDER = 17010; + + + + +} diff --git a/openCVLibrary310/src/main/res/values/attrs.xml b/openCVLibrary310/src/main/res/values/attrs.xml new file mode 100644 index 0000000..6902621 --- /dev/null +++ b/openCVLibrary310/src/main/res/values/attrs.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/settings.gradle b/settings.gradle index e7b4def..9baf203 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,2 @@ include ':app' +include ':openCVLibrary310'