This commit is contained in:
parent
7ba5414edf
commit
cf1cc1105f
|
|
@ -4,6 +4,14 @@
|
|||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-01-31T07:00:05.391624500Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=7CACN710010NLC" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/Opencv" />
|
||||
<option value="$PROJECT_DIR$/android-sdk-v5-uxsdk" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
|
||||
defaultConfig {
|
||||
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.opencv"
|
||||
android:versionCode="4100"
|
||||
android:versionName="4.1.0-dev">
|
||||
</manifest>
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -1,391 +0,0 @@
|
|||
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, "Installation 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, "Waiting 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 started");
|
||||
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, "Installation 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_java4.so";
|
||||
result = loadLibrary(AbsLibraryPath);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.d(TAG, "Library path \"" + Path + "\" is empty");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
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 installation 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 = "OCV/BaseLoaderCallback";
|
||||
}
|
||||
|
|
@ -1,302 +0,0 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,495 +0,0 @@
|
|||
package org.opencv.android;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.BuildConfig;
|
||||
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 final 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);
|
||||
if (BuildConfig.DEBUG)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,440 +0,0 @@
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,166 +0,0 @@
|
|||
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<String> 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<Size> 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
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 mFramesCounter;
|
||||
private double mFrequency;
|
||||
private long mprevFrameTime;
|
||||
private String mStrfps;
|
||||
Paint mPaint;
|
||||
boolean mIsInitialized = false;
|
||||
int mWidth = 0;
|
||||
int mHeight = 0;
|
||||
|
||||
public void init() {
|
||||
mFramesCounter = 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 {
|
||||
mFramesCounter++;
|
||||
if (mFramesCounter % 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
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();
|
||||
};
|
||||
|
|
@ -1,421 +0,0 @@
|
|||
package org.opencv.android;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.ImageFormat;
|
||||
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.media.Image;
|
||||
import android.media.ImageReader;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.Surface;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
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.
|
||||
*/
|
||||
|
||||
@TargetApi(21)
|
||||
public class JavaCamera2View extends CameraBridgeViewBase {
|
||||
|
||||
private static final String LOGTAG = "JavaCamera2View";
|
||||
|
||||
private ImageReader mImageReader;
|
||||
private int mPreviewFormat = ImageFormat.YUV_420_888;
|
||||
|
||||
private CameraDevice mCameraDevice;
|
||||
private CameraCaptureSession mCaptureSession;
|
||||
private CaptureRequest.Builder mPreviewRequestBuilder;
|
||||
private String mCameraID;
|
||||
private android.util.Size mPreviewSize = new android.util.Size(-1, -1);
|
||||
|
||||
private HandlerThread mBackgroundThread;
|
||||
private Handler mBackgroundHandler;
|
||||
|
||||
public JavaCamera2View(Context context, int cameraId) {
|
||||
super(context, cameraId);
|
||||
}
|
||||
|
||||
public JavaCamera2View(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
private void startBackgroundThread() {
|
||||
Log.i(LOGTAG, "startBackgroundThread");
|
||||
stopBackgroundThread();
|
||||
mBackgroundThread = new HandlerThread("OpenCVCameraBackground");
|
||||
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", e);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean initializeCamera() {
|
||||
Log.i(LOGTAG, "initializeCamera");
|
||||
CameraManager manager = (CameraManager) getContext().getSystemService(Context.CAMERA_SERVICE);
|
||||
try {
|
||||
String camList[] = manager.getCameraIdList();
|
||||
if (camList.length == 0) {
|
||||
Log.e(LOGTAG, "Error: camera isn't detected.");
|
||||
return false;
|
||||
}
|
||||
if (mCameraIndex == CameraBridgeViewBase.CAMERA_ID_ANY) {
|
||||
mCameraID = camList[0];
|
||||
} else {
|
||||
for (String cameraID : camList) {
|
||||
CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraID);
|
||||
if ((mCameraIndex == CameraBridgeViewBase.CAMERA_ID_BACK &&
|
||||
characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_BACK) ||
|
||||
(mCameraIndex == CameraBridgeViewBase.CAMERA_ID_FRONT &&
|
||||
characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT)
|
||||
) {
|
||||
mCameraID = cameraID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mCameraID != null) {
|
||||
Log.i(LOGTAG, "Opening camera: " + mCameraID);
|
||||
manager.openCamera(mCameraID, mStateCallback, mBackgroundHandler);
|
||||
} else { // make JavaCamera2View behaves in the same way as JavaCameraView
|
||||
Log.i(LOGTAG, "Trying to open camera with the value (" + mCameraIndex + ")");
|
||||
if (mCameraIndex < camList.length) {
|
||||
mCameraID = camList[mCameraIndex];
|
||||
manager.openCamera(mCameraID, mStateCallback, mBackgroundHandler);
|
||||
} else {
|
||||
// CAMERA_DISCONNECTED is used when the camera id is no longer valid
|
||||
throw new CameraAccessException(CameraAccessException.CAMERA_DISCONNECTED);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (CameraAccessException e) {
|
||||
Log.e(LOGTAG, "OpenCamera - Camera Access Exception", e);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.e(LOGTAG, "OpenCamera - Illegal Argument Exception", e);
|
||||
} catch (SecurityException e) {
|
||||
Log.e(LOGTAG, "OpenCamera - Security Exception", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private final CameraDevice.StateCallback mStateCallback = new CameraDevice.StateCallback() {
|
||||
|
||||
@Override
|
||||
public void onOpened(CameraDevice cameraDevice) {
|
||||
mCameraDevice = cameraDevice;
|
||||
createCameraPreviewSession();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisconnected(CameraDevice cameraDevice) {
|
||||
cameraDevice.close();
|
||||
mCameraDevice = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(CameraDevice cameraDevice, int error) {
|
||||
cameraDevice.close();
|
||||
mCameraDevice = null;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private void createCameraPreviewSession() {
|
||||
final int w = mPreviewSize.getWidth(), h = mPreviewSize.getHeight();
|
||||
Log.i(LOGTAG, "createCameraPreviewSession(" + w + "x" + h + ")");
|
||||
if (w < 0 || h < 0)
|
||||
return;
|
||||
try {
|
||||
if (null == mCameraDevice) {
|
||||
Log.e(LOGTAG, "createCameraPreviewSession: camera isn't opened");
|
||||
return;
|
||||
}
|
||||
if (null != mCaptureSession) {
|
||||
Log.e(LOGTAG, "createCameraPreviewSession: mCaptureSession is already started");
|
||||
return;
|
||||
}
|
||||
|
||||
mImageReader = ImageReader.newInstance(w, h, mPreviewFormat, 2);
|
||||
mImageReader.setOnImageAvailableListener(new ImageReader.OnImageAvailableListener() {
|
||||
@Override
|
||||
public void onImageAvailable(ImageReader reader) {
|
||||
Image image = reader.acquireLatestImage();
|
||||
if (image == null)
|
||||
return;
|
||||
|
||||
// sanity checks - 3 planes
|
||||
Image.Plane[] planes = image.getPlanes();
|
||||
assert (planes.length == 3);
|
||||
assert (image.getFormat() == mPreviewFormat);
|
||||
|
||||
JavaCamera2Frame tempFrame = new JavaCamera2Frame(image);
|
||||
deliverAndDrawFrame(tempFrame);
|
||||
tempFrame.release();
|
||||
image.close();
|
||||
}
|
||||
}, mBackgroundHandler);
|
||||
Surface surface = mImageReader.getSurface();
|
||||
|
||||
mPreviewRequestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
|
||||
mPreviewRequestBuilder.addTarget(surface);
|
||||
|
||||
mCameraDevice.createCaptureSession(Arrays.asList(surface),
|
||||
new CameraCaptureSession.StateCallback() {
|
||||
@Override
|
||||
public void onConfigured(CameraCaptureSession cameraCaptureSession) {
|
||||
Log.i(LOGTAG, "createCaptureSession::onConfigured");
|
||||
if (null == mCameraDevice) {
|
||||
return; // camera is already closed
|
||||
}
|
||||
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 (Exception e) {
|
||||
Log.e(LOGTAG, "createCaptureSession failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigureFailed(CameraCaptureSession cameraCaptureSession) {
|
||||
Log.e(LOGTAG, "createCameraPreviewSession failed");
|
||||
}
|
||||
},
|
||||
null
|
||||
);
|
||||
} catch (CameraAccessException e) {
|
||||
Log.e(LOGTAG, "createCameraPreviewSession", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disconnectCamera() {
|
||||
Log.i(LOGTAG, "closeCamera");
|
||||
try {
|
||||
CameraDevice c = mCameraDevice;
|
||||
mCameraDevice = null;
|
||||
if (null != mCaptureSession) {
|
||||
mCaptureSession.close();
|
||||
mCaptureSession = null;
|
||||
}
|
||||
if (null != c) {
|
||||
c.close();
|
||||
}
|
||||
if (null != mImageReader) {
|
||||
mImageReader.close();
|
||||
mImageReader = null;
|
||||
}
|
||||
} finally {
|
||||
stopBackgroundThread();
|
||||
}
|
||||
}
|
||||
|
||||
boolean calcPreviewSize(final int width, final int height) {
|
||||
Log.i(LOGTAG, "calcPreviewSize: " + width + "x" + height);
|
||||
if (mCameraID == null) {
|
||||
Log.e(LOGTAG, "Camera isn't initialized!");
|
||||
return false;
|
||||
}
|
||||
CameraManager manager = (CameraManager) 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;
|
||||
android.util.Size[] sizes = map.getOutputSizes(ImageReader.class);
|
||||
bestWidth = sizes[0].getWidth();
|
||||
bestHeight = sizes[0].getHeight();
|
||||
for (android.util.Size sz : sizes) {
|
||||
int w = sz.getWidth(), h = sz.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);
|
||||
assert(!(bestWidth == 0 || bestHeight == 0));
|
||||
if (mPreviewSize.getWidth() == bestWidth && mPreviewSize.getHeight() == bestHeight)
|
||||
return false;
|
||||
else {
|
||||
mPreviewSize = new android.util.Size(bestWidth, bestHeight);
|
||||
return true;
|
||||
}
|
||||
} catch (CameraAccessException e) {
|
||||
Log.e(LOGTAG, "calcPreviewSize - Camera Access Exception", e);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.e(LOGTAG, "calcPreviewSize - Illegal Argument Exception", e);
|
||||
} catch (SecurityException e) {
|
||||
Log.e(LOGTAG, "calcPreviewSize - Security Exception", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean connectCamera(int width, int height) {
|
||||
Log.i(LOGTAG, "setCameraPreviewSize(" + width + "x" + height + ")");
|
||||
startBackgroundThread();
|
||||
initializeCamera();
|
||||
try {
|
||||
boolean needReconfig = calcPreviewSize(width, height);
|
||||
mFrameWidth = mPreviewSize.getWidth();
|
||||
mFrameHeight = mPreviewSize.getHeight();
|
||||
|
||||
if ((getLayoutParams().width == LayoutParams.MATCH_PARENT) && (getLayoutParams().height == LayoutParams.MATCH_PARENT))
|
||||
mScale = Math.min(((float)height)/mFrameHeight, ((float)width)/mFrameWidth);
|
||||
else
|
||||
mScale = 0;
|
||||
|
||||
AllocateCache();
|
||||
|
||||
if (needReconfig) {
|
||||
if (null != mCaptureSession) {
|
||||
Log.d(LOGTAG, "closing existing previewSession");
|
||||
mCaptureSession.close();
|
||||
mCaptureSession = null;
|
||||
}
|
||||
createCameraPreviewSession();
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
throw new RuntimeException("Interrupted while setCameraPreviewSize.", e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private class JavaCamera2Frame implements CvCameraViewFrame {
|
||||
@Override
|
||||
public Mat gray() {
|
||||
Image.Plane[] planes = mImage.getPlanes();
|
||||
int w = mImage.getWidth();
|
||||
int h = mImage.getHeight();
|
||||
ByteBuffer y_plane = planes[0].getBuffer();
|
||||
mGray = new Mat(h, w, CvType.CV_8UC1, y_plane);
|
||||
return mGray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mat rgba() {
|
||||
Image.Plane[] planes = mImage.getPlanes();
|
||||
int w = mImage.getWidth();
|
||||
int h = mImage.getHeight();
|
||||
int chromaPixelStride = planes[1].getPixelStride();
|
||||
|
||||
|
||||
if (chromaPixelStride == 2) { // Chroma channels are interleaved
|
||||
assert(planes[0].getPixelStride() == 1);
|
||||
assert(planes[2].getPixelStride() == 2);
|
||||
ByteBuffer y_plane = planes[0].getBuffer();
|
||||
ByteBuffer uv_plane1 = planes[1].getBuffer();
|
||||
ByteBuffer uv_plane2 = planes[2].getBuffer();
|
||||
Mat y_mat = new Mat(h, w, CvType.CV_8UC1, y_plane);
|
||||
Mat uv_mat1 = new Mat(h / 2, w / 2, CvType.CV_8UC2, uv_plane1);
|
||||
Mat uv_mat2 = new Mat(h / 2, w / 2, CvType.CV_8UC2, uv_plane2);
|
||||
long addr_diff = uv_mat2.dataAddr() - uv_mat1.dataAddr();
|
||||
if (addr_diff > 0) {
|
||||
assert(addr_diff == 1);
|
||||
Imgproc.cvtColorTwoPlane(y_mat, uv_mat1, mRgba, Imgproc.COLOR_YUV2RGBA_NV12);
|
||||
} else {
|
||||
assert(addr_diff == -1);
|
||||
Imgproc.cvtColorTwoPlane(y_mat, uv_mat2, mRgba, Imgproc.COLOR_YUV2RGBA_NV21);
|
||||
}
|
||||
return mRgba;
|
||||
} else { // Chroma channels are not interleaved
|
||||
byte[] yuv_bytes = new byte[w*(h+h/2)];
|
||||
ByteBuffer y_plane = planes[0].getBuffer();
|
||||
ByteBuffer u_plane = planes[1].getBuffer();
|
||||
ByteBuffer v_plane = planes[2].getBuffer();
|
||||
|
||||
y_plane.get(yuv_bytes, 0, w*h);
|
||||
|
||||
int chromaRowStride = planes[1].getRowStride();
|
||||
int chromaRowPadding = chromaRowStride - w/2;
|
||||
|
||||
int offset = w*h;
|
||||
if (chromaRowPadding == 0){
|
||||
// When the row stride of the chroma channels equals their width, we can copy
|
||||
// the entire channels in one go
|
||||
u_plane.get(yuv_bytes, offset, w*h/4);
|
||||
offset += w*h/4;
|
||||
v_plane.get(yuv_bytes, offset, w*h/4);
|
||||
} else {
|
||||
// When not equal, we need to copy the channels row by row
|
||||
for (int i = 0; i < h/2; i++){
|
||||
u_plane.get(yuv_bytes, offset, w/2);
|
||||
offset += w/2;
|
||||
if (i < h/2-1){
|
||||
u_plane.position(u_plane.position() + chromaRowPadding);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < h/2; i++){
|
||||
v_plane.get(yuv_bytes, offset, w/2);
|
||||
offset += w/2;
|
||||
if (i < h/2-1){
|
||||
v_plane.position(v_plane.position() + chromaRowPadding);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Mat yuv_mat = new Mat(h+h/2, w, CvType.CV_8UC1);
|
||||
yuv_mat.put(0, 0, yuv_bytes);
|
||||
Imgproc.cvtColor(yuv_mat, mRgba, Imgproc.COLOR_YUV2RGBA_I420, 4);
|
||||
return mRgba;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public JavaCamera2Frame(Image image) {
|
||||
super();
|
||||
mImage = image;
|
||||
mRgba = new Mat();
|
||||
mGray = new Mat();
|
||||
}
|
||||
|
||||
public void release() {
|
||||
mRgba.release();
|
||||
mGray.release();
|
||||
}
|
||||
|
||||
private Image mImage;
|
||||
private Mat mRgba;
|
||||
private Mat mGray;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,379 +0,0 @@
|
|||
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.BuildConfig;
|
||||
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;
|
||||
private int mPreviewFormat = ImageFormat.NV21;
|
||||
|
||||
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<android.hardware.Camera.Size> sizes = params.getSupportedPreviewSizes();
|
||||
|
||||
if (sizes != null) {
|
||||
/* Select the size that fits surface considering maximum size allowed */
|
||||
Size frameSize = calculateCameraFrameSize(sizes, new JavaCameraSizeAccessor(), width, height);
|
||||
|
||||
/* Image format NV21 causes issues in the Android emulators */
|
||||
if (Build.FINGERPRINT.startsWith("generic")
|
||||
|| Build.FINGERPRINT.startsWith("unknown")
|
||||
|| Build.MODEL.contains("google_sdk")
|
||||
|| Build.MODEL.contains("Emulator")
|
||||
|| Build.MODEL.contains("Android SDK built for x86")
|
||||
|| Build.MANUFACTURER.contains("Genymotion")
|
||||
|| (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
|
||||
|| "google_sdk".equals(Build.PRODUCT))
|
||||
params.setPreviewFormat(ImageFormat.YV12); // "generic" or "android" = android emulator
|
||||
else
|
||||
params.setPreviewFormat(ImageFormat.NV21);
|
||||
|
||||
mPreviewFormat = params.getPreviewFormat();
|
||||
|
||||
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<String> 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, "Waiting 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) {
|
||||
if (BuildConfig.DEBUG)
|
||||
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() {
|
||||
if (mPreviewFormat == ImageFormat.NV21)
|
||||
Imgproc.cvtColor(mYuvFrameData, mRgba, Imgproc.COLOR_YUV2RGBA_NV21, 4);
|
||||
else if (mPreviewFormat == ImageFormat.YV12)
|
||||
Imgproc.cvtColor(mYuvFrameData, mRgba, Imgproc.COLOR_YUV2RGB_I420, 4); // COLOR_YUV2RGBA_YV12 produces inverted colors
|
||||
else
|
||||
throw new IllegalArgumentException("Preview Format can be NV21 or YV12");
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
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);
|
||||
};
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
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 2.4.12.
|
||||
*/
|
||||
public static final String OPENCV_VERSION_2_4_12 = "2.4.12";
|
||||
|
||||
/**
|
||||
* OpenCV Library version 2.4.13.
|
||||
*/
|
||||
public static final String OPENCV_VERSION_2_4_13 = "2.4.13";
|
||||
|
||||
/**
|
||||
* 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";
|
||||
|
||||
/**
|
||||
* OpenCV Library version 3.2.0.
|
||||
*/
|
||||
public static final String OPENCV_VERSION_3_2_0 = "3.2.0";
|
||||
|
||||
/**
|
||||
* OpenCV Library version 3.3.0.
|
||||
*/
|
||||
public static final String OPENCV_VERSION_3_3_0 = "3.3.0";
|
||||
|
||||
/**
|
||||
* OpenCV Library version 3.4.0.
|
||||
*/
|
||||
public static final String OPENCV_VERSION_3_4_0 = "3.4.0";
|
||||
|
||||
/**
|
||||
* Current OpenCV Library version
|
||||
*/
|
||||
public static final String OPENCV_VERSION = "4.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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
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_java4");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static final String TAG = "OpenCV/StaticHelper";
|
||||
|
||||
private static native String getLibraryList();
|
||||
}
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
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.
|
||||
* <p>
|
||||
* This function converts an Android Bitmap image to the OpenCV Mat.
|
||||
* <br>'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
|
||||
* <br>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.
|
||||
* <br>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 IllegalArgumentException("bmp == null");
|
||||
if (mat == null)
|
||||
throw new 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.
|
||||
* <p>
|
||||
* <br>This function converts an image in the OpenCV Mat representation to the Android Bitmap.
|
||||
* <br>The input Mat object has to be of the types 'CV_8UC1' (gray-scale), 'CV_8UC3' (RGB) or 'CV_8UC4' (RGBA).
|
||||
* <br>The output Bitmap object has to be of the same size as the input Mat and of the types 'ARGB_8888' or 'RGB_565'.
|
||||
* <br>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 IllegalArgumentException("mat == null");
|
||||
if (bmp == null)
|
||||
throw new IllegalArgumentException("bmp == null");
|
||||
nMatToBitmap2(mat.nativeObj, bmp, premultiplyAlpha);
|
||||
}
|
||||
|
||||
/**
|
||||
* Short form of the <b>matToBitmap(mat, bmp, premultiplyAlpha=false)</b>
|
||||
* @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);
|
||||
}
|
||||
|
|
@ -1,955 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.aruco;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.aruco.Board;
|
||||
import org.opencv.aruco.CharucoBoard;
|
||||
import org.opencv.aruco.DetectorParameters;
|
||||
import org.opencv.aruco.Dictionary;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.core.TermCriteria;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class Aruco
|
||||
//javadoc: Aruco
|
||||
|
||||
public class Aruco {
|
||||
|
||||
// C++: enum CornerRefineMethod
|
||||
public static final int
|
||||
CORNER_REFINE_NONE = 0,
|
||||
CORNER_REFINE_SUBPIX = 1,
|
||||
CORNER_REFINE_CONTOUR = 2,
|
||||
CORNER_REFINE_APRILTAG = 3;
|
||||
|
||||
|
||||
// C++: enum PREDEFINED_DICTIONARY_NAME
|
||||
public static final int
|
||||
DICT_4X4_50 = 0,
|
||||
DICT_4X4_100 = 0+1,
|
||||
DICT_4X4_250 = 0+2,
|
||||
DICT_4X4_1000 = 0+3,
|
||||
DICT_5X5_50 = 0+4,
|
||||
DICT_5X5_100 = 0+5,
|
||||
DICT_5X5_250 = 0+6,
|
||||
DICT_5X5_1000 = 0+7,
|
||||
DICT_6X6_50 = 0+8,
|
||||
DICT_6X6_100 = 0+9,
|
||||
DICT_6X6_250 = 0+10,
|
||||
DICT_6X6_1000 = 0+11,
|
||||
DICT_7X7_50 = 0+12,
|
||||
DICT_7X7_100 = 0+13,
|
||||
DICT_7X7_250 = 0+14,
|
||||
DICT_7X7_1000 = 0+15,
|
||||
DICT_ARUCO_ORIGINAL = 0+16,
|
||||
DICT_APRILTAG_16h5 = 0+17,
|
||||
DICT_APRILTAG_25h9 = 0+18,
|
||||
DICT_APRILTAG_36h10 = 0+19,
|
||||
DICT_APRILTAG_36h11 = 0+20;
|
||||
|
||||
//
|
||||
// C++: Ptr_Dictionary cv::aruco::generateCustomDictionary(int nMarkers, int markerSize, Ptr_Dictionary baseDictionary, int randomSeed = 0)
|
||||
//
|
||||
|
||||
//javadoc: custom_dictionary_from(nMarkers, markerSize, baseDictionary, randomSeed)
|
||||
public static Dictionary custom_dictionary_from(int nMarkers, int markerSize, Dictionary baseDictionary, int randomSeed)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(custom_dictionary_from_0(nMarkers, markerSize, baseDictionary.getNativeObjAddr(), randomSeed));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: custom_dictionary_from(nMarkers, markerSize, baseDictionary)
|
||||
public static Dictionary custom_dictionary_from(int nMarkers, int markerSize, Dictionary baseDictionary)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(custom_dictionary_from_1(nMarkers, markerSize, baseDictionary.getNativeObjAddr()));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_Dictionary cv::aruco::generateCustomDictionary(int nMarkers, int markerSize, int randomSeed = 0)
|
||||
//
|
||||
|
||||
//javadoc: custom_dictionary(nMarkers, markerSize, randomSeed)
|
||||
public static Dictionary custom_dictionary(int nMarkers, int markerSize, int randomSeed)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(custom_dictionary_0(nMarkers, markerSize, randomSeed));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: custom_dictionary(nMarkers, markerSize)
|
||||
public static Dictionary custom_dictionary(int nMarkers, int markerSize)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(custom_dictionary_1(nMarkers, markerSize));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_Dictionary cv::aruco::getPredefinedDictionary(int dict)
|
||||
//
|
||||
|
||||
//javadoc: getPredefinedDictionary(dict)
|
||||
public static Dictionary getPredefinedDictionary(int dict)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(getPredefinedDictionary_0(dict));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::aruco::estimatePoseCharucoBoard(Mat charucoCorners, Mat charucoIds, Ptr_CharucoBoard board, Mat cameraMatrix, Mat distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false)
|
||||
//
|
||||
|
||||
//javadoc: estimatePoseCharucoBoard(charucoCorners, charucoIds, board, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess)
|
||||
public static boolean estimatePoseCharucoBoard(Mat charucoCorners, Mat charucoIds, CharucoBoard board, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)
|
||||
{
|
||||
|
||||
boolean retVal = estimatePoseCharucoBoard_0(charucoCorners.nativeObj, charucoIds.nativeObj, board.getNativeObjAddr(), cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: estimatePoseCharucoBoard(charucoCorners, charucoIds, board, cameraMatrix, distCoeffs, rvec, tvec)
|
||||
public static boolean estimatePoseCharucoBoard(Mat charucoCorners, Mat charucoIds, CharucoBoard board, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)
|
||||
{
|
||||
|
||||
boolean retVal = estimatePoseCharucoBoard_1(charucoCorners.nativeObj, charucoIds.nativeObj, board.getNativeObjAddr(), cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::aruco::calibrateCameraAruco(vector_Mat corners, Mat ids, Mat counter, Ptr_Board board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
|
||||
//
|
||||
|
||||
//javadoc: calibrateCameraArucoExtended(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors, flags, criteria)
|
||||
public static double calibrateCameraArucoExtended(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags, TermCriteria criteria)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraArucoExtended_0(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.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: calibrateCameraArucoExtended(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors, flags)
|
||||
public static double calibrateCameraArucoExtended(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraArucoExtended_1(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.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: calibrateCameraArucoExtended(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors)
|
||||
public static double calibrateCameraArucoExtended(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraArucoExtended_2(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.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 cv::aruco::calibrateCameraAruco(vector_Mat corners, Mat ids, Mat counter, Ptr_Board board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs = vector_Mat(), vector_Mat& tvecs = vector_Mat(), int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
|
||||
//
|
||||
|
||||
//javadoc: calibrateCameraAruco(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags, criteria)
|
||||
public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags, TermCriteria criteria)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraAruco_0(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), 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: calibrateCameraAruco(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags)
|
||||
public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraAruco_1(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), 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: calibrateCameraAruco(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs)
|
||||
public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraAruco_2(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), 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;
|
||||
}
|
||||
|
||||
//javadoc: calibrateCameraAruco(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, rvecs)
|
||||
public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
Mat rvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraAruco_3(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
|
||||
rvecs_mat.release();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: calibrateCameraAruco(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs)
|
||||
public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
double retVal = calibrateCameraAruco_4(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::aruco::calibrateCameraCharuco(vector_Mat charucoCorners, vector_Mat charucoIds, Ptr_CharucoBoard board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
|
||||
//
|
||||
|
||||
//javadoc: calibrateCameraCharucoExtended(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors, flags, criteria)
|
||||
public static double calibrateCameraCharucoExtended(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags, TermCriteria criteria)
|
||||
{
|
||||
Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
|
||||
Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraCharucoExtended_0(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.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: calibrateCameraCharucoExtended(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors, flags)
|
||||
public static double calibrateCameraCharucoExtended(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags)
|
||||
{
|
||||
Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
|
||||
Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraCharucoExtended_1(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.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: calibrateCameraCharucoExtended(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors)
|
||||
public static double calibrateCameraCharucoExtended(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors)
|
||||
{
|
||||
Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
|
||||
Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraCharucoExtended_2(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.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 cv::aruco::calibrateCameraCharuco(vector_Mat charucoCorners, vector_Mat charucoIds, Ptr_CharucoBoard board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs = vector_Mat(), vector_Mat& tvecs = vector_Mat(), int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
|
||||
//
|
||||
|
||||
//javadoc: calibrateCameraCharuco(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags, criteria)
|
||||
public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags, TermCriteria criteria)
|
||||
{
|
||||
Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
|
||||
Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraCharuco_0(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), 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: calibrateCameraCharuco(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags)
|
||||
public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags)
|
||||
{
|
||||
Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
|
||||
Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraCharuco_1(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), 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: calibrateCameraCharuco(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs)
|
||||
public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs)
|
||||
{
|
||||
Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
|
||||
Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
|
||||
Mat rvecs_mat = new Mat();
|
||||
Mat tvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraCharuco_2(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), 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;
|
||||
}
|
||||
|
||||
//javadoc: calibrateCameraCharuco(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, rvecs)
|
||||
public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs)
|
||||
{
|
||||
Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
|
||||
Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
|
||||
Mat rvecs_mat = new Mat();
|
||||
double retVal = calibrateCameraCharuco_3(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
|
||||
rvecs_mat.release();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: calibrateCameraCharuco(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs)
|
||||
public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs)
|
||||
{
|
||||
Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
|
||||
Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
|
||||
double retVal = calibrateCameraCharuco_4(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::aruco::estimatePoseBoard(vector_Mat corners, Mat ids, Ptr_Board board, Mat cameraMatrix, Mat distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false)
|
||||
//
|
||||
|
||||
//javadoc: estimatePoseBoard(corners, ids, board, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess)
|
||||
public static int estimatePoseBoard(List<Mat> corners, Mat ids, Board board, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
int retVal = estimatePoseBoard_0(corners_mat.nativeObj, ids.nativeObj, board.getNativeObjAddr(), cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: estimatePoseBoard(corners, ids, board, cameraMatrix, distCoeffs, rvec, tvec)
|
||||
public static int estimatePoseBoard(List<Mat> corners, Mat ids, Board board, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
int retVal = estimatePoseBoard_1(corners_mat.nativeObj, ids.nativeObj, board.getNativeObjAddr(), cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::aruco::interpolateCornersCharuco(vector_Mat markerCorners, Mat markerIds, Mat image, Ptr_CharucoBoard board, Mat& charucoCorners, Mat& charucoIds, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), int minMarkers = 2)
|
||||
//
|
||||
|
||||
//javadoc: interpolateCornersCharuco(markerCorners, markerIds, image, board, charucoCorners, charucoIds, cameraMatrix, distCoeffs, minMarkers)
|
||||
public static int interpolateCornersCharuco(List<Mat> markerCorners, Mat markerIds, Mat image, CharucoBoard board, Mat charucoCorners, Mat charucoIds, Mat cameraMatrix, Mat distCoeffs, int minMarkers)
|
||||
{
|
||||
Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
|
||||
int retVal = interpolateCornersCharuco_0(markerCorners_mat.nativeObj, markerIds.nativeObj, image.nativeObj, board.getNativeObjAddr(), charucoCorners.nativeObj, charucoIds.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minMarkers);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: interpolateCornersCharuco(markerCorners, markerIds, image, board, charucoCorners, charucoIds, cameraMatrix, distCoeffs)
|
||||
public static int interpolateCornersCharuco(List<Mat> markerCorners, Mat markerIds, Mat image, CharucoBoard board, Mat charucoCorners, Mat charucoIds, Mat cameraMatrix, Mat distCoeffs)
|
||||
{
|
||||
Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
|
||||
int retVal = interpolateCornersCharuco_1(markerCorners_mat.nativeObj, markerIds.nativeObj, image.nativeObj, board.getNativeObjAddr(), charucoCorners.nativeObj, charucoIds.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: interpolateCornersCharuco(markerCorners, markerIds, image, board, charucoCorners, charucoIds, cameraMatrix)
|
||||
public static int interpolateCornersCharuco(List<Mat> markerCorners, Mat markerIds, Mat image, CharucoBoard board, Mat charucoCorners, Mat charucoIds, Mat cameraMatrix)
|
||||
{
|
||||
Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
|
||||
int retVal = interpolateCornersCharuco_2(markerCorners_mat.nativeObj, markerIds.nativeObj, image.nativeObj, board.getNativeObjAddr(), charucoCorners.nativeObj, charucoIds.nativeObj, cameraMatrix.nativeObj);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: interpolateCornersCharuco(markerCorners, markerIds, image, board, charucoCorners, charucoIds)
|
||||
public static int interpolateCornersCharuco(List<Mat> markerCorners, Mat markerIds, Mat image, CharucoBoard board, Mat charucoCorners, Mat charucoIds)
|
||||
{
|
||||
Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
|
||||
int retVal = interpolateCornersCharuco_3(markerCorners_mat.nativeObj, markerIds.nativeObj, image.nativeObj, board.getNativeObjAddr(), charucoCorners.nativeObj, charucoIds.nativeObj);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::detectCharucoDiamond(Mat image, vector_Mat markerCorners, Mat markerIds, float squareMarkerLengthRate, vector_Mat& diamondCorners, Mat& diamondIds, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat())
|
||||
//
|
||||
|
||||
//javadoc: detectCharucoDiamond(image, markerCorners, markerIds, squareMarkerLengthRate, diamondCorners, diamondIds, cameraMatrix, distCoeffs)
|
||||
public static void detectCharucoDiamond(Mat image, List<Mat> markerCorners, Mat markerIds, float squareMarkerLengthRate, List<Mat> diamondCorners, Mat diamondIds, Mat cameraMatrix, Mat distCoeffs)
|
||||
{
|
||||
Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
|
||||
Mat diamondCorners_mat = new Mat();
|
||||
detectCharucoDiamond_0(image.nativeObj, markerCorners_mat.nativeObj, markerIds.nativeObj, squareMarkerLengthRate, diamondCorners_mat.nativeObj, diamondIds.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(diamondCorners_mat, diamondCorners);
|
||||
diamondCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: detectCharucoDiamond(image, markerCorners, markerIds, squareMarkerLengthRate, diamondCorners, diamondIds, cameraMatrix)
|
||||
public static void detectCharucoDiamond(Mat image, List<Mat> markerCorners, Mat markerIds, float squareMarkerLengthRate, List<Mat> diamondCorners, Mat diamondIds, Mat cameraMatrix)
|
||||
{
|
||||
Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
|
||||
Mat diamondCorners_mat = new Mat();
|
||||
detectCharucoDiamond_1(image.nativeObj, markerCorners_mat.nativeObj, markerIds.nativeObj, squareMarkerLengthRate, diamondCorners_mat.nativeObj, diamondIds.nativeObj, cameraMatrix.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(diamondCorners_mat, diamondCorners);
|
||||
diamondCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: detectCharucoDiamond(image, markerCorners, markerIds, squareMarkerLengthRate, diamondCorners, diamondIds)
|
||||
public static void detectCharucoDiamond(Mat image, List<Mat> markerCorners, Mat markerIds, float squareMarkerLengthRate, List<Mat> diamondCorners, Mat diamondIds)
|
||||
{
|
||||
Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
|
||||
Mat diamondCorners_mat = new Mat();
|
||||
detectCharucoDiamond_2(image.nativeObj, markerCorners_mat.nativeObj, markerIds.nativeObj, squareMarkerLengthRate, diamondCorners_mat.nativeObj, diamondIds.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(diamondCorners_mat, diamondCorners);
|
||||
diamondCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::detectMarkers(Mat image, Ptr_Dictionary dictionary, vector_Mat& corners, Mat& ids, Ptr_DetectorParameters parameters = DetectorParameters::create(), vector_Mat& rejectedImgPoints = vector_Mat(), Mat cameraMatrix = Mat(), Mat distCoeff = Mat())
|
||||
//
|
||||
|
||||
//javadoc: detectMarkers(image, dictionary, corners, ids, parameters, rejectedImgPoints, cameraMatrix, distCoeff)
|
||||
public static void detectMarkers(Mat image, Dictionary dictionary, List<Mat> corners, Mat ids, DetectorParameters parameters, List<Mat> rejectedImgPoints, Mat cameraMatrix, Mat distCoeff)
|
||||
{
|
||||
Mat corners_mat = new Mat();
|
||||
Mat rejectedImgPoints_mat = new Mat();
|
||||
detectMarkers_0(image.nativeObj, dictionary.getNativeObjAddr(), corners_mat.nativeObj, ids.nativeObj, parameters.getNativeObjAddr(), rejectedImgPoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeff.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(corners_mat, corners);
|
||||
corners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedImgPoints_mat, rejectedImgPoints);
|
||||
rejectedImgPoints_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: detectMarkers(image, dictionary, corners, ids, parameters, rejectedImgPoints, cameraMatrix)
|
||||
public static void detectMarkers(Mat image, Dictionary dictionary, List<Mat> corners, Mat ids, DetectorParameters parameters, List<Mat> rejectedImgPoints, Mat cameraMatrix)
|
||||
{
|
||||
Mat corners_mat = new Mat();
|
||||
Mat rejectedImgPoints_mat = new Mat();
|
||||
detectMarkers_1(image.nativeObj, dictionary.getNativeObjAddr(), corners_mat.nativeObj, ids.nativeObj, parameters.getNativeObjAddr(), rejectedImgPoints_mat.nativeObj, cameraMatrix.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(corners_mat, corners);
|
||||
corners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedImgPoints_mat, rejectedImgPoints);
|
||||
rejectedImgPoints_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: detectMarkers(image, dictionary, corners, ids, parameters, rejectedImgPoints)
|
||||
public static void detectMarkers(Mat image, Dictionary dictionary, List<Mat> corners, Mat ids, DetectorParameters parameters, List<Mat> rejectedImgPoints)
|
||||
{
|
||||
Mat corners_mat = new Mat();
|
||||
Mat rejectedImgPoints_mat = new Mat();
|
||||
detectMarkers_2(image.nativeObj, dictionary.getNativeObjAddr(), corners_mat.nativeObj, ids.nativeObj, parameters.getNativeObjAddr(), rejectedImgPoints_mat.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(corners_mat, corners);
|
||||
corners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedImgPoints_mat, rejectedImgPoints);
|
||||
rejectedImgPoints_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: detectMarkers(image, dictionary, corners, ids, parameters)
|
||||
public static void detectMarkers(Mat image, Dictionary dictionary, List<Mat> corners, Mat ids, DetectorParameters parameters)
|
||||
{
|
||||
Mat corners_mat = new Mat();
|
||||
detectMarkers_3(image.nativeObj, dictionary.getNativeObjAddr(), corners_mat.nativeObj, ids.nativeObj, parameters.getNativeObjAddr());
|
||||
Converters.Mat_to_vector_Mat(corners_mat, corners);
|
||||
corners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: detectMarkers(image, dictionary, corners, ids)
|
||||
public static void detectMarkers(Mat image, Dictionary dictionary, List<Mat> corners, Mat ids)
|
||||
{
|
||||
Mat corners_mat = new Mat();
|
||||
detectMarkers_4(image.nativeObj, dictionary.getNativeObjAddr(), corners_mat.nativeObj, ids.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(corners_mat, corners);
|
||||
corners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::drawAxis(Mat& image, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, float length)
|
||||
//
|
||||
|
||||
//javadoc: drawAxis(image, cameraMatrix, distCoeffs, rvec, tvec, length)
|
||||
@Deprecated
|
||||
public static void drawAxis(Mat image, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, float length)
|
||||
{
|
||||
|
||||
drawAxis_0(image.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj, length);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::drawDetectedCornersCharuco(Mat& image, Mat charucoCorners, Mat charucoIds = Mat(), Scalar cornerColor = Scalar(255, 0, 0))
|
||||
//
|
||||
|
||||
//javadoc: drawDetectedCornersCharuco(image, charucoCorners, charucoIds, cornerColor)
|
||||
public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds, Scalar cornerColor)
|
||||
{
|
||||
|
||||
drawDetectedCornersCharuco_0(image.nativeObj, charucoCorners.nativeObj, charucoIds.nativeObj, cornerColor.val[0], cornerColor.val[1], cornerColor.val[2], cornerColor.val[3]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawDetectedCornersCharuco(image, charucoCorners, charucoIds)
|
||||
public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds)
|
||||
{
|
||||
|
||||
drawDetectedCornersCharuco_1(image.nativeObj, charucoCorners.nativeObj, charucoIds.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawDetectedCornersCharuco(image, charucoCorners)
|
||||
public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners)
|
||||
{
|
||||
drawDetectedCornersCharuco_2(image.nativeObj, charucoCorners.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::drawDetectedDiamonds(Mat& image, vector_Mat diamondCorners, Mat diamondIds = Mat(), Scalar borderColor = Scalar(0, 0, 255))
|
||||
//
|
||||
|
||||
//javadoc: drawDetectedDiamonds(image, diamondCorners, diamondIds, borderColor)
|
||||
public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners, Mat diamondIds, Scalar borderColor)
|
||||
{
|
||||
Mat diamondCorners_mat = Converters.vector_Mat_to_Mat(diamondCorners);
|
||||
drawDetectedDiamonds_0(image.nativeObj, diamondCorners_mat.nativeObj, diamondIds.nativeObj, borderColor.val[0], borderColor.val[1], borderColor.val[2], borderColor.val[3]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawDetectedDiamonds(image, diamondCorners, diamondIds)
|
||||
public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners, Mat diamondIds)
|
||||
{
|
||||
Mat diamondCorners_mat = Converters.vector_Mat_to_Mat(diamondCorners);
|
||||
drawDetectedDiamonds_1(image.nativeObj, diamondCorners_mat.nativeObj, diamondIds.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawDetectedDiamonds(image, diamondCorners)
|
||||
public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners)
|
||||
{
|
||||
Mat diamondCorners_mat = Converters.vector_Mat_to_Mat(diamondCorners);
|
||||
drawDetectedDiamonds_2(image.nativeObj, diamondCorners_mat.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::drawDetectedMarkers(Mat& image, vector_Mat corners, Mat ids = Mat(), Scalar borderColor = Scalar(0, 255, 0))
|
||||
//
|
||||
|
||||
//javadoc: drawDetectedMarkers(image, corners, ids, borderColor)
|
||||
public static void drawDetectedMarkers(Mat image, List<Mat> corners, Mat ids, Scalar borderColor)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
drawDetectedMarkers_0(image.nativeObj, corners_mat.nativeObj, ids.nativeObj, borderColor.val[0], borderColor.val[1], borderColor.val[2], borderColor.val[3]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawDetectedMarkers(image, corners, ids)
|
||||
public static void drawDetectedMarkers(Mat image, List<Mat> corners, Mat ids)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
drawDetectedMarkers_1(image.nativeObj, corners_mat.nativeObj, ids.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawDetectedMarkers(image, corners)
|
||||
public static void drawDetectedMarkers(Mat image, List<Mat> corners)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
drawDetectedMarkers_2(image.nativeObj, corners_mat.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::drawMarker(Ptr_Dictionary dictionary, int id, int sidePixels, Mat& img, int borderBits = 1)
|
||||
//
|
||||
|
||||
//javadoc: drawMarker(dictionary, id, sidePixels, img, borderBits)
|
||||
public static void drawMarker(Dictionary dictionary, int id, int sidePixels, Mat img, int borderBits)
|
||||
{
|
||||
|
||||
drawMarker_0(dictionary.getNativeObjAddr(), id, sidePixels, img.nativeObj, borderBits);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawMarker(dictionary, id, sidePixels, img)
|
||||
public static void drawMarker(Dictionary dictionary, int id, int sidePixels, Mat img)
|
||||
{
|
||||
|
||||
drawMarker_1(dictionary.getNativeObjAddr(), id, sidePixels, img.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::drawPlanarBoard(Ptr_Board board, Size outSize, Mat& img, int marginSize = 0, int borderBits = 1)
|
||||
//
|
||||
|
||||
//javadoc: drawPlanarBoard(board, outSize, img, marginSize, borderBits)
|
||||
public static void drawPlanarBoard(Board board, Size outSize, Mat img, int marginSize, int borderBits)
|
||||
{
|
||||
|
||||
drawPlanarBoard_0(board.getNativeObjAddr(), outSize.width, outSize.height, img.nativeObj, marginSize, borderBits);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawPlanarBoard(board, outSize, img, marginSize)
|
||||
public static void drawPlanarBoard(Board board, Size outSize, Mat img, int marginSize)
|
||||
{
|
||||
|
||||
drawPlanarBoard_1(board.getNativeObjAddr(), outSize.width, outSize.height, img.nativeObj, marginSize);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawPlanarBoard(board, outSize, img)
|
||||
public static void drawPlanarBoard(Board board, Size outSize, Mat img)
|
||||
{
|
||||
|
||||
drawPlanarBoard_2(board.getNativeObjAddr(), outSize.width, outSize.height, img.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::estimatePoseSingleMarkers(vector_Mat corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat& rvecs, Mat& tvecs, Mat& _objPoints = Mat())
|
||||
//
|
||||
|
||||
//javadoc: estimatePoseSingleMarkers(corners, markerLength, cameraMatrix, distCoeffs, rvecs, tvecs, _objPoints)
|
||||
public static void estimatePoseSingleMarkers(List<Mat> corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat rvecs, Mat tvecs, Mat _objPoints)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
estimatePoseSingleMarkers_0(corners_mat.nativeObj, markerLength, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs.nativeObj, tvecs.nativeObj, _objPoints.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: estimatePoseSingleMarkers(corners, markerLength, cameraMatrix, distCoeffs, rvecs, tvecs)
|
||||
public static void estimatePoseSingleMarkers(List<Mat> corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat rvecs, Mat tvecs)
|
||||
{
|
||||
Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
|
||||
estimatePoseSingleMarkers_1(corners_mat.nativeObj, markerLength, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs.nativeObj, tvecs.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::getBoardObjectAndImagePoints(Ptr_Board board, vector_Mat detectedCorners, Mat detectedIds, Mat& objPoints, Mat& imgPoints)
|
||||
//
|
||||
|
||||
//javadoc: getBoardObjectAndImagePoints(board, detectedCorners, detectedIds, objPoints, imgPoints)
|
||||
public static void getBoardObjectAndImagePoints(Board board, List<Mat> detectedCorners, Mat detectedIds, Mat objPoints, Mat imgPoints)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
getBoardObjectAndImagePoints_0(board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, objPoints.nativeObj, imgPoints.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::refineDetectedMarkers(Mat image, Ptr_Board board, vector_Mat& detectedCorners, Mat& detectedIds, vector_Mat& rejectedCorners, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), float minRepDistance = 10.f, float errorCorrectionRate = 3.f, bool checkAllOrders = true, Mat& recoveredIdxs = Mat(), Ptr_DetectorParameters parameters = DetectorParameters::create())
|
||||
//
|
||||
|
||||
//javadoc: refineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix, distCoeffs, minRepDistance, errorCorrectionRate, checkAllOrders, recoveredIdxs, parameters)
|
||||
public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance, float errorCorrectionRate, boolean checkAllOrders, Mat recoveredIdxs, DetectorParameters parameters)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
|
||||
refineDetectedMarkers_0(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance, errorCorrectionRate, checkAllOrders, recoveredIdxs.nativeObj, parameters.getNativeObjAddr());
|
||||
Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
|
||||
detectedCorners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
|
||||
rejectedCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: refineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix, distCoeffs, minRepDistance, errorCorrectionRate, checkAllOrders, recoveredIdxs)
|
||||
public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance, float errorCorrectionRate, boolean checkAllOrders, Mat recoveredIdxs)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
|
||||
refineDetectedMarkers_1(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance, errorCorrectionRate, checkAllOrders, recoveredIdxs.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
|
||||
detectedCorners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
|
||||
rejectedCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: refineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix, distCoeffs, minRepDistance, errorCorrectionRate, checkAllOrders)
|
||||
public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance, float errorCorrectionRate, boolean checkAllOrders)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
|
||||
refineDetectedMarkers_2(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance, errorCorrectionRate, checkAllOrders);
|
||||
Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
|
||||
detectedCorners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
|
||||
rejectedCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: refineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix, distCoeffs, minRepDistance, errorCorrectionRate)
|
||||
public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance, float errorCorrectionRate)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
|
||||
refineDetectedMarkers_3(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance, errorCorrectionRate);
|
||||
Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
|
||||
detectedCorners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
|
||||
rejectedCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: refineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix, distCoeffs, minRepDistance)
|
||||
public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
|
||||
refineDetectedMarkers_4(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance);
|
||||
Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
|
||||
detectedCorners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
|
||||
rejectedCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: refineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix, distCoeffs)
|
||||
public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
|
||||
refineDetectedMarkers_5(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
|
||||
detectedCorners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
|
||||
rejectedCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: refineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix)
|
||||
public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
|
||||
refineDetectedMarkers_6(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
|
||||
detectedCorners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
|
||||
rejectedCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: refineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners)
|
||||
public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners)
|
||||
{
|
||||
Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
|
||||
Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
|
||||
refineDetectedMarkers_7(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
|
||||
detectedCorners_mat.release();
|
||||
Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
|
||||
rejectedCorners_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// C++: Ptr_Dictionary cv::aruco::generateCustomDictionary(int nMarkers, int markerSize, Ptr_Dictionary baseDictionary, int randomSeed = 0)
|
||||
private static native long custom_dictionary_from_0(int nMarkers, int markerSize, long baseDictionary_nativeObj, int randomSeed);
|
||||
private static native long custom_dictionary_from_1(int nMarkers, int markerSize, long baseDictionary_nativeObj);
|
||||
|
||||
// C++: Ptr_Dictionary cv::aruco::generateCustomDictionary(int nMarkers, int markerSize, int randomSeed = 0)
|
||||
private static native long custom_dictionary_0(int nMarkers, int markerSize, int randomSeed);
|
||||
private static native long custom_dictionary_1(int nMarkers, int markerSize);
|
||||
|
||||
// C++: Ptr_Dictionary cv::aruco::getPredefinedDictionary(int dict)
|
||||
private static native long getPredefinedDictionary_0(int dict);
|
||||
|
||||
// C++: bool cv::aruco::estimatePoseCharucoBoard(Mat charucoCorners, Mat charucoIds, Ptr_CharucoBoard board, Mat cameraMatrix, Mat distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false)
|
||||
private static native boolean estimatePoseCharucoBoard_0(long charucoCorners_nativeObj, long charucoIds_nativeObj, long board_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvec_nativeObj, long tvec_nativeObj, boolean useExtrinsicGuess);
|
||||
private static native boolean estimatePoseCharucoBoard_1(long charucoCorners_nativeObj, long charucoIds_nativeObj, long board_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvec_nativeObj, long tvec_nativeObj);
|
||||
|
||||
// C++: double cv::aruco::calibrateCameraAruco(vector_Mat corners, Mat ids, Mat counter, Ptr_Board board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
|
||||
private static native double calibrateCameraArucoExtended_0(long corners_mat_nativeObj, long ids_nativeObj, long counter_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon);
|
||||
private static native double calibrateCameraArucoExtended_1(long corners_mat_nativeObj, long ids_nativeObj, long counter_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj, int flags);
|
||||
private static native double calibrateCameraArucoExtended_2(long corners_mat_nativeObj, long ids_nativeObj, long counter_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj);
|
||||
|
||||
// C++: double cv::aruco::calibrateCameraAruco(vector_Mat corners, Mat ids, Mat counter, Ptr_Board board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs = vector_Mat(), vector_Mat& tvecs = vector_Mat(), int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
|
||||
private static native double calibrateCameraAruco_0(long corners_mat_nativeObj, long ids_nativeObj, long counter_nativeObj, long board_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 calibrateCameraAruco_1(long corners_mat_nativeObj, long ids_nativeObj, long counter_nativeObj, long board_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 calibrateCameraAruco_2(long corners_mat_nativeObj, long ids_nativeObj, long counter_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj);
|
||||
private static native double calibrateCameraAruco_3(long corners_mat_nativeObj, long ids_nativeObj, long counter_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj);
|
||||
private static native double calibrateCameraAruco_4(long corners_mat_nativeObj, long ids_nativeObj, long counter_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj);
|
||||
|
||||
// C++: double cv::aruco::calibrateCameraCharuco(vector_Mat charucoCorners, vector_Mat charucoIds, Ptr_CharucoBoard board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
|
||||
private static native double calibrateCameraCharucoExtended_0(long charucoCorners_mat_nativeObj, long charucoIds_mat_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon);
|
||||
private static native double calibrateCameraCharucoExtended_1(long charucoCorners_mat_nativeObj, long charucoIds_mat_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj, int flags);
|
||||
private static native double calibrateCameraCharucoExtended_2(long charucoCorners_mat_nativeObj, long charucoIds_mat_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj, long stdDeviationsIntrinsics_nativeObj, long stdDeviationsExtrinsics_nativeObj, long perViewErrors_nativeObj);
|
||||
|
||||
// C++: double cv::aruco::calibrateCameraCharuco(vector_Mat charucoCorners, vector_Mat charucoIds, Ptr_CharucoBoard board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs = vector_Mat(), vector_Mat& tvecs = vector_Mat(), int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
|
||||
private static native double calibrateCameraCharuco_0(long charucoCorners_mat_nativeObj, long charucoIds_mat_nativeObj, long board_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 calibrateCameraCharuco_1(long charucoCorners_mat_nativeObj, long charucoIds_mat_nativeObj, long board_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 calibrateCameraCharuco_2(long charucoCorners_mat_nativeObj, long charucoIds_mat_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj, long tvecs_mat_nativeObj);
|
||||
private static native double calibrateCameraCharuco_3(long charucoCorners_mat_nativeObj, long charucoIds_mat_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_mat_nativeObj);
|
||||
private static native double calibrateCameraCharuco_4(long charucoCorners_mat_nativeObj, long charucoIds_mat_nativeObj, long board_nativeObj, double imageSize_width, double imageSize_height, long cameraMatrix_nativeObj, long distCoeffs_nativeObj);
|
||||
|
||||
// C++: int cv::aruco::estimatePoseBoard(vector_Mat corners, Mat ids, Ptr_Board board, Mat cameraMatrix, Mat distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false)
|
||||
private static native int estimatePoseBoard_0(long corners_mat_nativeObj, long ids_nativeObj, long board_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvec_nativeObj, long tvec_nativeObj, boolean useExtrinsicGuess);
|
||||
private static native int estimatePoseBoard_1(long corners_mat_nativeObj, long ids_nativeObj, long board_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvec_nativeObj, long tvec_nativeObj);
|
||||
|
||||
// C++: int cv::aruco::interpolateCornersCharuco(vector_Mat markerCorners, Mat markerIds, Mat image, Ptr_CharucoBoard board, Mat& charucoCorners, Mat& charucoIds, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), int minMarkers = 2)
|
||||
private static native int interpolateCornersCharuco_0(long markerCorners_mat_nativeObj, long markerIds_nativeObj, long image_nativeObj, long board_nativeObj, long charucoCorners_nativeObj, long charucoIds_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, int minMarkers);
|
||||
private static native int interpolateCornersCharuco_1(long markerCorners_mat_nativeObj, long markerIds_nativeObj, long image_nativeObj, long board_nativeObj, long charucoCorners_nativeObj, long charucoIds_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj);
|
||||
private static native int interpolateCornersCharuco_2(long markerCorners_mat_nativeObj, long markerIds_nativeObj, long image_nativeObj, long board_nativeObj, long charucoCorners_nativeObj, long charucoIds_nativeObj, long cameraMatrix_nativeObj);
|
||||
private static native int interpolateCornersCharuco_3(long markerCorners_mat_nativeObj, long markerIds_nativeObj, long image_nativeObj, long board_nativeObj, long charucoCorners_nativeObj, long charucoIds_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::detectCharucoDiamond(Mat image, vector_Mat markerCorners, Mat markerIds, float squareMarkerLengthRate, vector_Mat& diamondCorners, Mat& diamondIds, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat())
|
||||
private static native void detectCharucoDiamond_0(long image_nativeObj, long markerCorners_mat_nativeObj, long markerIds_nativeObj, float squareMarkerLengthRate, long diamondCorners_mat_nativeObj, long diamondIds_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj);
|
||||
private static native void detectCharucoDiamond_1(long image_nativeObj, long markerCorners_mat_nativeObj, long markerIds_nativeObj, float squareMarkerLengthRate, long diamondCorners_mat_nativeObj, long diamondIds_nativeObj, long cameraMatrix_nativeObj);
|
||||
private static native void detectCharucoDiamond_2(long image_nativeObj, long markerCorners_mat_nativeObj, long markerIds_nativeObj, float squareMarkerLengthRate, long diamondCorners_mat_nativeObj, long diamondIds_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::detectMarkers(Mat image, Ptr_Dictionary dictionary, vector_Mat& corners, Mat& ids, Ptr_DetectorParameters parameters = DetectorParameters::create(), vector_Mat& rejectedImgPoints = vector_Mat(), Mat cameraMatrix = Mat(), Mat distCoeff = Mat())
|
||||
private static native void detectMarkers_0(long image_nativeObj, long dictionary_nativeObj, long corners_mat_nativeObj, long ids_nativeObj, long parameters_nativeObj, long rejectedImgPoints_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeff_nativeObj);
|
||||
private static native void detectMarkers_1(long image_nativeObj, long dictionary_nativeObj, long corners_mat_nativeObj, long ids_nativeObj, long parameters_nativeObj, long rejectedImgPoints_mat_nativeObj, long cameraMatrix_nativeObj);
|
||||
private static native void detectMarkers_2(long image_nativeObj, long dictionary_nativeObj, long corners_mat_nativeObj, long ids_nativeObj, long parameters_nativeObj, long rejectedImgPoints_mat_nativeObj);
|
||||
private static native void detectMarkers_3(long image_nativeObj, long dictionary_nativeObj, long corners_mat_nativeObj, long ids_nativeObj, long parameters_nativeObj);
|
||||
private static native void detectMarkers_4(long image_nativeObj, long dictionary_nativeObj, long corners_mat_nativeObj, long ids_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::drawAxis(Mat& image, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, float length)
|
||||
private static native void drawAxis_0(long image_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvec_nativeObj, long tvec_nativeObj, float length);
|
||||
|
||||
// C++: void cv::aruco::drawDetectedCornersCharuco(Mat& image, Mat charucoCorners, Mat charucoIds = Mat(), Scalar cornerColor = Scalar(255, 0, 0))
|
||||
private static native void drawDetectedCornersCharuco_0(long image_nativeObj, long charucoCorners_nativeObj, long charucoIds_nativeObj, double cornerColor_val0, double cornerColor_val1, double cornerColor_val2, double cornerColor_val3);
|
||||
private static native void drawDetectedCornersCharuco_1(long image_nativeObj, long charucoCorners_nativeObj, long charucoIds_nativeObj);
|
||||
private static native void drawDetectedCornersCharuco_2(long image_nativeObj, long charucoCorners_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::drawDetectedDiamonds(Mat& image, vector_Mat diamondCorners, Mat diamondIds = Mat(), Scalar borderColor = Scalar(0, 0, 255))
|
||||
private static native void drawDetectedDiamonds_0(long image_nativeObj, long diamondCorners_mat_nativeObj, long diamondIds_nativeObj, double borderColor_val0, double borderColor_val1, double borderColor_val2, double borderColor_val3);
|
||||
private static native void drawDetectedDiamonds_1(long image_nativeObj, long diamondCorners_mat_nativeObj, long diamondIds_nativeObj);
|
||||
private static native void drawDetectedDiamonds_2(long image_nativeObj, long diamondCorners_mat_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::drawDetectedMarkers(Mat& image, vector_Mat corners, Mat ids = Mat(), Scalar borderColor = Scalar(0, 255, 0))
|
||||
private static native void drawDetectedMarkers_0(long image_nativeObj, long corners_mat_nativeObj, long ids_nativeObj, double borderColor_val0, double borderColor_val1, double borderColor_val2, double borderColor_val3);
|
||||
private static native void drawDetectedMarkers_1(long image_nativeObj, long corners_mat_nativeObj, long ids_nativeObj);
|
||||
private static native void drawDetectedMarkers_2(long image_nativeObj, long corners_mat_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::drawMarker(Ptr_Dictionary dictionary, int id, int sidePixels, Mat& img, int borderBits = 1)
|
||||
private static native void drawMarker_0(long dictionary_nativeObj, int id, int sidePixels, long img_nativeObj, int borderBits);
|
||||
private static native void drawMarker_1(long dictionary_nativeObj, int id, int sidePixels, long img_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::drawPlanarBoard(Ptr_Board board, Size outSize, Mat& img, int marginSize = 0, int borderBits = 1)
|
||||
private static native void drawPlanarBoard_0(long board_nativeObj, double outSize_width, double outSize_height, long img_nativeObj, int marginSize, int borderBits);
|
||||
private static native void drawPlanarBoard_1(long board_nativeObj, double outSize_width, double outSize_height, long img_nativeObj, int marginSize);
|
||||
private static native void drawPlanarBoard_2(long board_nativeObj, double outSize_width, double outSize_height, long img_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::estimatePoseSingleMarkers(vector_Mat corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat& rvecs, Mat& tvecs, Mat& _objPoints = Mat())
|
||||
private static native void estimatePoseSingleMarkers_0(long corners_mat_nativeObj, float markerLength, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_nativeObj, long tvecs_nativeObj, long _objPoints_nativeObj);
|
||||
private static native void estimatePoseSingleMarkers_1(long corners_mat_nativeObj, float markerLength, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long rvecs_nativeObj, long tvecs_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::getBoardObjectAndImagePoints(Ptr_Board board, vector_Mat detectedCorners, Mat detectedIds, Mat& objPoints, Mat& imgPoints)
|
||||
private static native void getBoardObjectAndImagePoints_0(long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long objPoints_nativeObj, long imgPoints_nativeObj);
|
||||
|
||||
// C++: void cv::aruco::refineDetectedMarkers(Mat image, Ptr_Board board, vector_Mat& detectedCorners, Mat& detectedIds, vector_Mat& rejectedCorners, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), float minRepDistance = 10.f, float errorCorrectionRate = 3.f, bool checkAllOrders = true, Mat& recoveredIdxs = Mat(), Ptr_DetectorParameters parameters = DetectorParameters::create())
|
||||
private static native void refineDetectedMarkers_0(long image_nativeObj, long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long rejectedCorners_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, float minRepDistance, float errorCorrectionRate, boolean checkAllOrders, long recoveredIdxs_nativeObj, long parameters_nativeObj);
|
||||
private static native void refineDetectedMarkers_1(long image_nativeObj, long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long rejectedCorners_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, float minRepDistance, float errorCorrectionRate, boolean checkAllOrders, long recoveredIdxs_nativeObj);
|
||||
private static native void refineDetectedMarkers_2(long image_nativeObj, long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long rejectedCorners_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, float minRepDistance, float errorCorrectionRate, boolean checkAllOrders);
|
||||
private static native void refineDetectedMarkers_3(long image_nativeObj, long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long rejectedCorners_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, float minRepDistance, float errorCorrectionRate);
|
||||
private static native void refineDetectedMarkers_4(long image_nativeObj, long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long rejectedCorners_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, float minRepDistance);
|
||||
private static native void refineDetectedMarkers_5(long image_nativeObj, long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long rejectedCorners_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj);
|
||||
private static native void refineDetectedMarkers_6(long image_nativeObj, long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long rejectedCorners_mat_nativeObj, long cameraMatrix_nativeObj);
|
||||
private static native void refineDetectedMarkers_7(long image_nativeObj, long board_nativeObj, long detectedCorners_mat_nativeObj, long detectedIds_nativeObj, long rejectedCorners_mat_nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.aruco;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.aruco.Board;
|
||||
import org.opencv.aruco.Dictionary;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfInt;
|
||||
import org.opencv.core.MatOfPoint3f;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class Board
|
||||
//javadoc: Board
|
||||
|
||||
public class Board {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected Board(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static Board __fromPtr__(long addr) { return new Board(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_Board cv::aruco::Board::create(vector_Mat objPoints, Ptr_Dictionary dictionary, Mat ids)
|
||||
//
|
||||
|
||||
//javadoc: Board::create(objPoints, dictionary, ids)
|
||||
public static Board create(List<Mat> objPoints, Dictionary dictionary, Mat ids)
|
||||
{
|
||||
Mat objPoints_mat = Converters.vector_Mat_to_Mat(objPoints);
|
||||
Board retVal = Board.__fromPtr__(create_0(objPoints_mat.nativeObj, dictionary.getNativeObjAddr(), ids.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_vector_Point3f Board::objPoints
|
||||
//
|
||||
|
||||
//javadoc: Board::get_objPoints()
|
||||
public List<MatOfPoint3f> get_objPoints()
|
||||
{
|
||||
List<MatOfPoint3f> retVal = new ArrayList<MatOfPoint3f>();
|
||||
Mat retValMat = new Mat(get_objPoints_0(nativeObj));
|
||||
Converters.Mat_to_vector_vector_Point3f(retValMat, retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_Dictionary Board::dictionary
|
||||
//
|
||||
|
||||
//javadoc: Board::get_dictionary()
|
||||
public Dictionary get_dictionary()
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(get_dictionary_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_int Board::ids
|
||||
//
|
||||
|
||||
//javadoc: Board::get_ids()
|
||||
public MatOfInt get_ids()
|
||||
{
|
||||
|
||||
MatOfInt retVal = MatOfInt.fromNativeAddr(get_ids_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_Board cv::aruco::Board::create(vector_Mat objPoints, Ptr_Dictionary dictionary, Mat ids)
|
||||
private static native long create_0(long objPoints_mat_nativeObj, long dictionary_nativeObj, long ids_nativeObj);
|
||||
|
||||
// C++: vector_vector_Point3f Board::objPoints
|
||||
private static native long get_objPoints_0(long nativeObj);
|
||||
|
||||
// C++: Ptr_Dictionary Board::dictionary
|
||||
private static native long get_dictionary_0(long nativeObj);
|
||||
|
||||
// C++: vector_int Board::ids
|
||||
private static native long get_ids_0(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.aruco;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.aruco.Board;
|
||||
import org.opencv.aruco.CharucoBoard;
|
||||
import org.opencv.aruco.Dictionary;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfPoint3f;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class CharucoBoard
|
||||
//javadoc: CharucoBoard
|
||||
|
||||
public class CharucoBoard extends Board {
|
||||
|
||||
protected CharucoBoard(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static CharucoBoard __fromPtr__(long addr) { return new CharucoBoard(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_CharucoBoard cv::aruco::CharucoBoard::create(int squaresX, int squaresY, float squareLength, float markerLength, Ptr_Dictionary dictionary)
|
||||
//
|
||||
|
||||
//javadoc: CharucoBoard::create(squaresX, squaresY, squareLength, markerLength, dictionary)
|
||||
public static CharucoBoard create(int squaresX, int squaresY, float squareLength, float markerLength, Dictionary dictionary)
|
||||
{
|
||||
|
||||
CharucoBoard retVal = CharucoBoard.__fromPtr__(create_0(squaresX, squaresY, squareLength, markerLength, dictionary.getNativeObjAddr()));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Size cv::aruco::CharucoBoard::getChessboardSize()
|
||||
//
|
||||
|
||||
//javadoc: CharucoBoard::getChessboardSize()
|
||||
public Size getChessboardSize()
|
||||
{
|
||||
|
||||
Size retVal = new Size(getChessboardSize_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: float cv::aruco::CharucoBoard::getMarkerLength()
|
||||
//
|
||||
|
||||
//javadoc: CharucoBoard::getMarkerLength()
|
||||
public float getMarkerLength()
|
||||
{
|
||||
|
||||
float retVal = getMarkerLength_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: float cv::aruco::CharucoBoard::getSquareLength()
|
||||
//
|
||||
|
||||
//javadoc: CharucoBoard::getSquareLength()
|
||||
public float getSquareLength()
|
||||
{
|
||||
|
||||
float retVal = getSquareLength_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::CharucoBoard::draw(Size outSize, Mat& img, int marginSize = 0, int borderBits = 1)
|
||||
//
|
||||
|
||||
//javadoc: CharucoBoard::draw(outSize, img, marginSize, borderBits)
|
||||
public void draw(Size outSize, Mat img, int marginSize, int borderBits)
|
||||
{
|
||||
|
||||
draw_0(nativeObj, outSize.width, outSize.height, img.nativeObj, marginSize, borderBits);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: CharucoBoard::draw(outSize, img, marginSize)
|
||||
public void draw(Size outSize, Mat img, int marginSize)
|
||||
{
|
||||
|
||||
draw_1(nativeObj, outSize.width, outSize.height, img.nativeObj, marginSize);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: CharucoBoard::draw(outSize, img)
|
||||
public void draw(Size outSize, Mat img)
|
||||
{
|
||||
|
||||
draw_2(nativeObj, outSize.width, outSize.height, img.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_Point3f CharucoBoard::chessboardCorners
|
||||
//
|
||||
|
||||
//javadoc: CharucoBoard::get_chessboardCorners()
|
||||
public MatOfPoint3f get_chessboardCorners()
|
||||
{
|
||||
|
||||
MatOfPoint3f retVal = MatOfPoint3f.fromNativeAddr(get_chessboardCorners_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_vector_int CharucoBoard::nearestMarkerIdx
|
||||
//
|
||||
|
||||
// Return type 'vector_vector_int' is not supported, skipping the function
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_vector_int CharucoBoard::nearestMarkerCorners
|
||||
//
|
||||
|
||||
// Return type 'vector_vector_int' is not supported, skipping the function
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_CharucoBoard cv::aruco::CharucoBoard::create(int squaresX, int squaresY, float squareLength, float markerLength, Ptr_Dictionary dictionary)
|
||||
private static native long create_0(int squaresX, int squaresY, float squareLength, float markerLength, long dictionary_nativeObj);
|
||||
|
||||
// C++: Size cv::aruco::CharucoBoard::getChessboardSize()
|
||||
private static native double[] getChessboardSize_0(long nativeObj);
|
||||
|
||||
// C++: float cv::aruco::CharucoBoard::getMarkerLength()
|
||||
private static native float getMarkerLength_0(long nativeObj);
|
||||
|
||||
// C++: float cv::aruco::CharucoBoard::getSquareLength()
|
||||
private static native float getSquareLength_0(long nativeObj);
|
||||
|
||||
// C++: void cv::aruco::CharucoBoard::draw(Size outSize, Mat& img, int marginSize = 0, int borderBits = 1)
|
||||
private static native void draw_0(long nativeObj, double outSize_width, double outSize_height, long img_nativeObj, int marginSize, int borderBits);
|
||||
private static native void draw_1(long nativeObj, double outSize_width, double outSize_height, long img_nativeObj, int marginSize);
|
||||
private static native void draw_2(long nativeObj, double outSize_width, double outSize_height, long img_nativeObj);
|
||||
|
||||
// C++: vector_Point3f CharucoBoard::chessboardCorners
|
||||
private static native long get_chessboardCorners_0(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,266 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.aruco;
|
||||
|
||||
import org.opencv.aruco.Dictionary;
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
// C++: class Dictionary
|
||||
//javadoc: Dictionary
|
||||
|
||||
public class Dictionary {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected Dictionary(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static Dictionary __fromPtr__(long addr) { return new Dictionary(addr); }
|
||||
|
||||
//
|
||||
// C++: static Mat cv::aruco::Dictionary::getBitsFromByteList(Mat byteList, int markerSize)
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::getBitsFromByteList(byteList, markerSize)
|
||||
public static Mat getBitsFromByteList(Mat byteList, int markerSize)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getBitsFromByteList_0(byteList.nativeObj, markerSize));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Mat cv::aruco::Dictionary::getByteListFromBits(Mat bits)
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::getByteListFromBits(bits)
|
||||
public static Mat getByteListFromBits(Mat bits)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getByteListFromBits_0(bits.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_Dictionary cv::aruco::Dictionary::create(int nMarkers, int markerSize, Ptr_Dictionary baseDictionary, int randomSeed = 0)
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::create_from(nMarkers, markerSize, baseDictionary, randomSeed)
|
||||
public static Dictionary create_from(int nMarkers, int markerSize, Dictionary baseDictionary, int randomSeed)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(create_from_0(nMarkers, markerSize, baseDictionary.getNativeObjAddr(), randomSeed));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: Dictionary::create_from(nMarkers, markerSize, baseDictionary)
|
||||
public static Dictionary create_from(int nMarkers, int markerSize, Dictionary baseDictionary)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(create_from_1(nMarkers, markerSize, baseDictionary.getNativeObjAddr()));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_Dictionary cv::aruco::Dictionary::create(int nMarkers, int markerSize, int randomSeed = 0)
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::create(nMarkers, markerSize, randomSeed)
|
||||
public static Dictionary create(int nMarkers, int markerSize, int randomSeed)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(create_0(nMarkers, markerSize, randomSeed));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: Dictionary::create(nMarkers, markerSize)
|
||||
public static Dictionary create(int nMarkers, int markerSize)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(create_1(nMarkers, markerSize));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_Dictionary cv::aruco::Dictionary::get(int dict)
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::get(dict)
|
||||
public static Dictionary get(int dict)
|
||||
{
|
||||
|
||||
Dictionary retVal = Dictionary.__fromPtr__(get_0(dict));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::Dictionary::drawMarker(int id, int sidePixels, Mat& _img, int borderBits = 1)
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::drawMarker(id, sidePixels, _img, borderBits)
|
||||
public void drawMarker(int id, int sidePixels, Mat _img, int borderBits)
|
||||
{
|
||||
|
||||
drawMarker_0(nativeObj, id, sidePixels, _img.nativeObj, borderBits);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Dictionary::drawMarker(id, sidePixels, _img)
|
||||
public void drawMarker(int id, int sidePixels, Mat _img)
|
||||
{
|
||||
|
||||
drawMarker_1(nativeObj, id, sidePixels, _img.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat Dictionary::bytesList
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::get_bytesList()
|
||||
public Mat get_bytesList()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(get_bytesList_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void Dictionary::bytesList
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::set_bytesList(bytesList)
|
||||
public void set_bytesList(Mat bytesList)
|
||||
{
|
||||
|
||||
set_bytesList_0(nativeObj, bytesList.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int Dictionary::markerSize
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::get_markerSize()
|
||||
public int get_markerSize()
|
||||
{
|
||||
|
||||
int retVal = get_markerSize_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void Dictionary::markerSize
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::set_markerSize(markerSize)
|
||||
public void set_markerSize(int markerSize)
|
||||
{
|
||||
|
||||
set_markerSize_0(nativeObj, markerSize);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int Dictionary::maxCorrectionBits
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::get_maxCorrectionBits()
|
||||
public int get_maxCorrectionBits()
|
||||
{
|
||||
|
||||
int retVal = get_maxCorrectionBits_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void Dictionary::maxCorrectionBits
|
||||
//
|
||||
|
||||
//javadoc: Dictionary::set_maxCorrectionBits(maxCorrectionBits)
|
||||
public void set_maxCorrectionBits(int maxCorrectionBits)
|
||||
{
|
||||
|
||||
set_maxCorrectionBits_0(nativeObj, maxCorrectionBits);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Mat cv::aruco::Dictionary::getBitsFromByteList(Mat byteList, int markerSize)
|
||||
private static native long getBitsFromByteList_0(long byteList_nativeObj, int markerSize);
|
||||
|
||||
// C++: static Mat cv::aruco::Dictionary::getByteListFromBits(Mat bits)
|
||||
private static native long getByteListFromBits_0(long bits_nativeObj);
|
||||
|
||||
// C++: static Ptr_Dictionary cv::aruco::Dictionary::create(int nMarkers, int markerSize, Ptr_Dictionary baseDictionary, int randomSeed = 0)
|
||||
private static native long create_from_0(int nMarkers, int markerSize, long baseDictionary_nativeObj, int randomSeed);
|
||||
private static native long create_from_1(int nMarkers, int markerSize, long baseDictionary_nativeObj);
|
||||
|
||||
// C++: static Ptr_Dictionary cv::aruco::Dictionary::create(int nMarkers, int markerSize, int randomSeed = 0)
|
||||
private static native long create_0(int nMarkers, int markerSize, int randomSeed);
|
||||
private static native long create_1(int nMarkers, int markerSize);
|
||||
|
||||
// C++: static Ptr_Dictionary cv::aruco::Dictionary::get(int dict)
|
||||
private static native long get_0(int dict);
|
||||
|
||||
// C++: void cv::aruco::Dictionary::drawMarker(int id, int sidePixels, Mat& _img, int borderBits = 1)
|
||||
private static native void drawMarker_0(long nativeObj, int id, int sidePixels, long _img_nativeObj, int borderBits);
|
||||
private static native void drawMarker_1(long nativeObj, int id, int sidePixels, long _img_nativeObj);
|
||||
|
||||
// C++: Mat Dictionary::bytesList
|
||||
private static native long get_bytesList_0(long nativeObj);
|
||||
|
||||
// C++: void Dictionary::bytesList
|
||||
private static native void set_bytesList_0(long nativeObj, long bytesList_nativeObj);
|
||||
|
||||
// C++: int Dictionary::markerSize
|
||||
private static native int get_markerSize_0(long nativeObj);
|
||||
|
||||
// C++: void Dictionary::markerSize
|
||||
private static native void set_markerSize_0(long nativeObj, int markerSize);
|
||||
|
||||
// C++: int Dictionary::maxCorrectionBits
|
||||
private static native int get_maxCorrectionBits_0(long nativeObj);
|
||||
|
||||
// C++: void Dictionary::maxCorrectionBits
|
||||
private static native void set_maxCorrectionBits_0(long nativeObj, int maxCorrectionBits);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.aruco;
|
||||
|
||||
import org.opencv.aruco.Board;
|
||||
import org.opencv.aruco.Dictionary;
|
||||
import org.opencv.aruco.GridBoard;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Size;
|
||||
|
||||
// C++: class GridBoard
|
||||
//javadoc: GridBoard
|
||||
|
||||
public class GridBoard extends Board {
|
||||
|
||||
protected GridBoard(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static GridBoard __fromPtr__(long addr) { return new GridBoard(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_GridBoard cv::aruco::GridBoard::create(int markersX, int markersY, float markerLength, float markerSeparation, Ptr_Dictionary dictionary, int firstMarker = 0)
|
||||
//
|
||||
|
||||
//javadoc: GridBoard::create(markersX, markersY, markerLength, markerSeparation, dictionary, firstMarker)
|
||||
public static GridBoard create(int markersX, int markersY, float markerLength, float markerSeparation, Dictionary dictionary, int firstMarker)
|
||||
{
|
||||
|
||||
GridBoard retVal = GridBoard.__fromPtr__(create_0(markersX, markersY, markerLength, markerSeparation, dictionary.getNativeObjAddr(), firstMarker));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: GridBoard::create(markersX, markersY, markerLength, markerSeparation, dictionary)
|
||||
public static GridBoard create(int markersX, int markersY, float markerLength, float markerSeparation, Dictionary dictionary)
|
||||
{
|
||||
|
||||
GridBoard retVal = GridBoard.__fromPtr__(create_1(markersX, markersY, markerLength, markerSeparation, dictionary.getNativeObjAddr()));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Size cv::aruco::GridBoard::getGridSize()
|
||||
//
|
||||
|
||||
//javadoc: GridBoard::getGridSize()
|
||||
public Size getGridSize()
|
||||
{
|
||||
|
||||
Size retVal = new Size(getGridSize_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: float cv::aruco::GridBoard::getMarkerLength()
|
||||
//
|
||||
|
||||
//javadoc: GridBoard::getMarkerLength()
|
||||
public float getMarkerLength()
|
||||
{
|
||||
|
||||
float retVal = getMarkerLength_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: float cv::aruco::GridBoard::getMarkerSeparation()
|
||||
//
|
||||
|
||||
//javadoc: GridBoard::getMarkerSeparation()
|
||||
public float getMarkerSeparation()
|
||||
{
|
||||
|
||||
float retVal = getMarkerSeparation_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::aruco::GridBoard::draw(Size outSize, Mat& img, int marginSize = 0, int borderBits = 1)
|
||||
//
|
||||
|
||||
//javadoc: GridBoard::draw(outSize, img, marginSize, borderBits)
|
||||
public void draw(Size outSize, Mat img, int marginSize, int borderBits)
|
||||
{
|
||||
|
||||
draw_0(nativeObj, outSize.width, outSize.height, img.nativeObj, marginSize, borderBits);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: GridBoard::draw(outSize, img, marginSize)
|
||||
public void draw(Size outSize, Mat img, int marginSize)
|
||||
{
|
||||
|
||||
draw_1(nativeObj, outSize.width, outSize.height, img.nativeObj, marginSize);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: GridBoard::draw(outSize, img)
|
||||
public void draw(Size outSize, Mat img)
|
||||
{
|
||||
|
||||
draw_2(nativeObj, outSize.width, outSize.height, img.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_GridBoard cv::aruco::GridBoard::create(int markersX, int markersY, float markerLength, float markerSeparation, Ptr_Dictionary dictionary, int firstMarker = 0)
|
||||
private static native long create_0(int markersX, int markersY, float markerLength, float markerSeparation, long dictionary_nativeObj, int firstMarker);
|
||||
private static native long create_1(int markersX, int markersY, float markerLength, float markerSeparation, long dictionary_nativeObj);
|
||||
|
||||
// C++: Size cv::aruco::GridBoard::getGridSize()
|
||||
private static native double[] getGridSize_0(long nativeObj);
|
||||
|
||||
// C++: float cv::aruco::GridBoard::getMarkerLength()
|
||||
private static native float getMarkerLength_0(long nativeObj);
|
||||
|
||||
// C++: float cv::aruco::GridBoard::getMarkerSeparation()
|
||||
private static native float getMarkerSeparation_0(long nativeObj);
|
||||
|
||||
// C++: void cv::aruco::GridBoard::draw(Size outSize, Mat& img, int marginSize = 0, int borderBits = 1)
|
||||
private static native void draw_0(long nativeObj, double outSize_width, double outSize_height, long img_nativeObj, int marginSize, int borderBits);
|
||||
private static native void draw_1(long nativeObj, double outSize_width, double outSize_height, long img_nativeObj, int marginSize);
|
||||
private static native void draw_2(long nativeObj, double outSize_width, double outSize_height, long img_nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,209 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bgsegm;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.video.BackgroundSubtractor;
|
||||
|
||||
// C++: class BackgroundSubtractorCNT
|
||||
//javadoc: BackgroundSubtractorCNT
|
||||
|
||||
public class BackgroundSubtractorCNT extends BackgroundSubtractor {
|
||||
|
||||
protected BackgroundSubtractorCNT(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BackgroundSubtractorCNT __fromPtr__(long addr) { return new BackgroundSubtractorCNT(addr); }
|
||||
|
||||
//
|
||||
// C++: bool cv::bgsegm::BackgroundSubtractorCNT::getIsParallel()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::getIsParallel()
|
||||
public boolean getIsParallel()
|
||||
{
|
||||
|
||||
boolean retVal = getIsParallel_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::bgsegm::BackgroundSubtractorCNT::getUseHistory()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::getUseHistory()
|
||||
public boolean getUseHistory()
|
||||
{
|
||||
|
||||
boolean retVal = getUseHistory_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorCNT::getMaxPixelStability()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::getMaxPixelStability()
|
||||
public int getMaxPixelStability()
|
||||
{
|
||||
|
||||
int retVal = getMaxPixelStability_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorCNT::getMinPixelStability()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::getMinPixelStability()
|
||||
public int getMinPixelStability()
|
||||
{
|
||||
|
||||
int retVal = getMinPixelStability_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::apply(Mat image, Mat& fgmask, double learningRate = -1)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::apply(image, fgmask, learningRate)
|
||||
public void apply(Mat image, Mat fgmask, double learningRate)
|
||||
{
|
||||
|
||||
apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::apply(image, fgmask)
|
||||
public void apply(Mat image, Mat fgmask)
|
||||
{
|
||||
|
||||
apply_1(nativeObj, image.nativeObj, fgmask.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::getBackgroundImage(Mat& backgroundImage)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::getBackgroundImage(backgroundImage)
|
||||
public void getBackgroundImage(Mat backgroundImage)
|
||||
{
|
||||
|
||||
getBackgroundImage_0(nativeObj, backgroundImage.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::setIsParallel(bool value)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::setIsParallel(value)
|
||||
public void setIsParallel(boolean value)
|
||||
{
|
||||
|
||||
setIsParallel_0(nativeObj, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::setMaxPixelStability(int value)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::setMaxPixelStability(value)
|
||||
public void setMaxPixelStability(int value)
|
||||
{
|
||||
|
||||
setMaxPixelStability_0(nativeObj, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::setMinPixelStability(int value)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::setMinPixelStability(value)
|
||||
public void setMinPixelStability(int value)
|
||||
{
|
||||
|
||||
setMinPixelStability_0(nativeObj, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::setUseHistory(bool value)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorCNT::setUseHistory(value)
|
||||
public void setUseHistory(boolean value)
|
||||
{
|
||||
|
||||
setUseHistory_0(nativeObj, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: bool cv::bgsegm::BackgroundSubtractorCNT::getIsParallel()
|
||||
private static native boolean getIsParallel_0(long nativeObj);
|
||||
|
||||
// C++: bool cv::bgsegm::BackgroundSubtractorCNT::getUseHistory()
|
||||
private static native boolean getUseHistory_0(long nativeObj);
|
||||
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorCNT::getMaxPixelStability()
|
||||
private static native int getMaxPixelStability_0(long nativeObj);
|
||||
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorCNT::getMinPixelStability()
|
||||
private static native int getMinPixelStability_0(long nativeObj);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::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 cv::bgsegm::BackgroundSubtractorCNT::getBackgroundImage(Mat& backgroundImage)
|
||||
private static native void getBackgroundImage_0(long nativeObj, long backgroundImage_nativeObj);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::setIsParallel(bool value)
|
||||
private static native void setIsParallel_0(long nativeObj, boolean value);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::setMaxPixelStability(int value)
|
||||
private static native void setMaxPixelStability_0(long nativeObj, int value);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::setMinPixelStability(int value)
|
||||
private static native void setMinPixelStability_0(long nativeObj, int value);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorCNT::setUseHistory(bool value)
|
||||
private static native void setUseHistory_0(long nativeObj, boolean value);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,368 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bgsegm;
|
||||
|
||||
import org.opencv.video.BackgroundSubtractor;
|
||||
|
||||
// C++: class BackgroundSubtractorGMG
|
||||
//javadoc: BackgroundSubtractorGMG
|
||||
|
||||
public class BackgroundSubtractorGMG extends BackgroundSubtractor {
|
||||
|
||||
protected BackgroundSubtractorGMG(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BackgroundSubtractorGMG __fromPtr__(long addr) { return new BackgroundSubtractorGMG(addr); }
|
||||
|
||||
//
|
||||
// C++: bool cv::bgsegm::BackgroundSubtractorGMG::getUpdateBackgroundModel()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getUpdateBackgroundModel()
|
||||
public boolean getUpdateBackgroundModel()
|
||||
{
|
||||
|
||||
boolean retVal = getUpdateBackgroundModel_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getBackgroundPrior()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getBackgroundPrior()
|
||||
public double getBackgroundPrior()
|
||||
{
|
||||
|
||||
double retVal = getBackgroundPrior_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getDecisionThreshold()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getDecisionThreshold()
|
||||
public double getDecisionThreshold()
|
||||
{
|
||||
|
||||
double retVal = getDecisionThreshold_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getDefaultLearningRate()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getDefaultLearningRate()
|
||||
public double getDefaultLearningRate()
|
||||
{
|
||||
|
||||
double retVal = getDefaultLearningRate_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getMaxVal()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getMaxVal()
|
||||
public double getMaxVal()
|
||||
{
|
||||
|
||||
double retVal = getMaxVal_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getMinVal()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getMinVal()
|
||||
public double getMinVal()
|
||||
{
|
||||
|
||||
double retVal = getMinVal_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorGMG::getMaxFeatures()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getMaxFeatures()
|
||||
public int getMaxFeatures()
|
||||
{
|
||||
|
||||
int retVal = getMaxFeatures_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorGMG::getNumFrames()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getNumFrames()
|
||||
public int getNumFrames()
|
||||
{
|
||||
|
||||
int retVal = getNumFrames_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorGMG::getQuantizationLevels()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getQuantizationLevels()
|
||||
public int getQuantizationLevels()
|
||||
{
|
||||
|
||||
int retVal = getQuantizationLevels_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorGMG::getSmoothingRadius()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::getSmoothingRadius()
|
||||
public int getSmoothingRadius()
|
||||
{
|
||||
|
||||
int retVal = getSmoothingRadius_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setBackgroundPrior(double bgprior)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setBackgroundPrior(bgprior)
|
||||
public void setBackgroundPrior(double bgprior)
|
||||
{
|
||||
|
||||
setBackgroundPrior_0(nativeObj, bgprior);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setDecisionThreshold(double thresh)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setDecisionThreshold(thresh)
|
||||
public void setDecisionThreshold(double thresh)
|
||||
{
|
||||
|
||||
setDecisionThreshold_0(nativeObj, thresh);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setDefaultLearningRate(double lr)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setDefaultLearningRate(lr)
|
||||
public void setDefaultLearningRate(double lr)
|
||||
{
|
||||
|
||||
setDefaultLearningRate_0(nativeObj, lr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setMaxFeatures(int maxFeatures)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setMaxFeatures(maxFeatures)
|
||||
public void setMaxFeatures(int maxFeatures)
|
||||
{
|
||||
|
||||
setMaxFeatures_0(nativeObj, maxFeatures);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setMaxVal(double val)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setMaxVal(val)
|
||||
public void setMaxVal(double val)
|
||||
{
|
||||
|
||||
setMaxVal_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setMinVal(double val)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setMinVal(val)
|
||||
public void setMinVal(double val)
|
||||
{
|
||||
|
||||
setMinVal_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setNumFrames(int nframes)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setNumFrames(nframes)
|
||||
public void setNumFrames(int nframes)
|
||||
{
|
||||
|
||||
setNumFrames_0(nativeObj, nframes);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setQuantizationLevels(int nlevels)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setQuantizationLevels(nlevels)
|
||||
public void setQuantizationLevels(int nlevels)
|
||||
{
|
||||
|
||||
setQuantizationLevels_0(nativeObj, nlevels);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setSmoothingRadius(int radius)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setSmoothingRadius(radius)
|
||||
public void setSmoothingRadius(int radius)
|
||||
{
|
||||
|
||||
setSmoothingRadius_0(nativeObj, radius);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setUpdateBackgroundModel(bool update)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGMG::setUpdateBackgroundModel(update)
|
||||
public void setUpdateBackgroundModel(boolean update)
|
||||
{
|
||||
|
||||
setUpdateBackgroundModel_0(nativeObj, update);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: bool cv::bgsegm::BackgroundSubtractorGMG::getUpdateBackgroundModel()
|
||||
private static native boolean getUpdateBackgroundModel_0(long nativeObj);
|
||||
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getBackgroundPrior()
|
||||
private static native double getBackgroundPrior_0(long nativeObj);
|
||||
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getDecisionThreshold()
|
||||
private static native double getDecisionThreshold_0(long nativeObj);
|
||||
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getDefaultLearningRate()
|
||||
private static native double getDefaultLearningRate_0(long nativeObj);
|
||||
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getMaxVal()
|
||||
private static native double getMaxVal_0(long nativeObj);
|
||||
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorGMG::getMinVal()
|
||||
private static native double getMinVal_0(long nativeObj);
|
||||
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorGMG::getMaxFeatures()
|
||||
private static native int getMaxFeatures_0(long nativeObj);
|
||||
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorGMG::getNumFrames()
|
||||
private static native int getNumFrames_0(long nativeObj);
|
||||
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorGMG::getQuantizationLevels()
|
||||
private static native int getQuantizationLevels_0(long nativeObj);
|
||||
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorGMG::getSmoothingRadius()
|
||||
private static native int getSmoothingRadius_0(long nativeObj);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setBackgroundPrior(double bgprior)
|
||||
private static native void setBackgroundPrior_0(long nativeObj, double bgprior);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setDecisionThreshold(double thresh)
|
||||
private static native void setDecisionThreshold_0(long nativeObj, double thresh);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setDefaultLearningRate(double lr)
|
||||
private static native void setDefaultLearningRate_0(long nativeObj, double lr);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setMaxFeatures(int maxFeatures)
|
||||
private static native void setMaxFeatures_0(long nativeObj, int maxFeatures);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setMaxVal(double val)
|
||||
private static native void setMaxVal_0(long nativeObj, double val);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setMinVal(double val)
|
||||
private static native void setMinVal_0(long nativeObj, double val);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setNumFrames(int nframes)
|
||||
private static native void setNumFrames_0(long nativeObj, int nframes);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setQuantizationLevels(int nlevels)
|
||||
private static native void setQuantizationLevels_0(long nativeObj, int nlevels);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setSmoothingRadius(int radius)
|
||||
private static native void setSmoothingRadius_0(long nativeObj, int radius);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGMG::setUpdateBackgroundModel(bool update)
|
||||
private static native void setUpdateBackgroundModel_0(long nativeObj, boolean update);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bgsegm;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.video.BackgroundSubtractor;
|
||||
|
||||
// C++: class BackgroundSubtractorGSOC
|
||||
//javadoc: BackgroundSubtractorGSOC
|
||||
|
||||
public class BackgroundSubtractorGSOC extends BackgroundSubtractor {
|
||||
|
||||
protected BackgroundSubtractorGSOC(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BackgroundSubtractorGSOC __fromPtr__(long addr) { return new BackgroundSubtractorGSOC(addr); }
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGSOC::apply(Mat image, Mat& fgmask, double learningRate = -1)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGSOC::apply(image, fgmask, learningRate)
|
||||
public void apply(Mat image, Mat fgmask, double learningRate)
|
||||
{
|
||||
|
||||
apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: BackgroundSubtractorGSOC::apply(image, fgmask)
|
||||
public void apply(Mat image, Mat fgmask)
|
||||
{
|
||||
|
||||
apply_1(nativeObj, image.nativeObj, fgmask.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGSOC::getBackgroundImage(Mat& backgroundImage)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorGSOC::getBackgroundImage(backgroundImage)
|
||||
public void getBackgroundImage(Mat backgroundImage)
|
||||
{
|
||||
|
||||
getBackgroundImage_0(nativeObj, backgroundImage.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorGSOC::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 cv::bgsegm::BackgroundSubtractorGSOC::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);
|
||||
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bgsegm;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.video.BackgroundSubtractor;
|
||||
|
||||
// C++: class BackgroundSubtractorLSBP
|
||||
//javadoc: BackgroundSubtractorLSBP
|
||||
|
||||
public class BackgroundSubtractorLSBP extends BackgroundSubtractor {
|
||||
|
||||
protected BackgroundSubtractorLSBP(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BackgroundSubtractorLSBP __fromPtr__(long addr) { return new BackgroundSubtractorLSBP(addr); }
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorLSBP::apply(Mat image, Mat& fgmask, double learningRate = -1)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorLSBP::apply(image, fgmask, learningRate)
|
||||
public void apply(Mat image, Mat fgmask, double learningRate)
|
||||
{
|
||||
|
||||
apply_0(nativeObj, image.nativeObj, fgmask.nativeObj, learningRate);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: BackgroundSubtractorLSBP::apply(image, fgmask)
|
||||
public void apply(Mat image, Mat fgmask)
|
||||
{
|
||||
|
||||
apply_1(nativeObj, image.nativeObj, fgmask.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorLSBP::getBackgroundImage(Mat& backgroundImage)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorLSBP::getBackgroundImage(backgroundImage)
|
||||
public void getBackgroundImage(Mat backgroundImage)
|
||||
{
|
||||
|
||||
getBackgroundImage_0(nativeObj, backgroundImage.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorLSBP::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 cv::bgsegm::BackgroundSubtractorLSBP::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);
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bgsegm;
|
||||
|
||||
|
||||
|
||||
// C++: class BackgroundSubtractorLSBPDesc
|
||||
//javadoc: BackgroundSubtractorLSBPDesc
|
||||
|
||||
public class BackgroundSubtractorLSBPDesc {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected BackgroundSubtractorLSBPDesc(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static BackgroundSubtractorLSBPDesc __fromPtr__(long addr) { return new BackgroundSubtractorLSBPDesc(addr); }
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bgsegm;
|
||||
|
||||
import org.opencv.video.BackgroundSubtractor;
|
||||
|
||||
// C++: class BackgroundSubtractorMOG
|
||||
//javadoc: BackgroundSubtractorMOG
|
||||
|
||||
public class BackgroundSubtractorMOG extends BackgroundSubtractor {
|
||||
|
||||
protected BackgroundSubtractorMOG(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BackgroundSubtractorMOG __fromPtr__(long addr) { return new BackgroundSubtractorMOG(addr); }
|
||||
|
||||
//
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorMOG::getBackgroundRatio()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorMOG::getBackgroundRatio()
|
||||
public double getBackgroundRatio()
|
||||
{
|
||||
|
||||
double retVal = getBackgroundRatio_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorMOG::getNoiseSigma()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorMOG::getNoiseSigma()
|
||||
public double getNoiseSigma()
|
||||
{
|
||||
|
||||
double retVal = getNoiseSigma_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorMOG::getHistory()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorMOG::getHistory()
|
||||
public int getHistory()
|
||||
{
|
||||
|
||||
int retVal = getHistory_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorMOG::getNMixtures()
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorMOG::getNMixtures()
|
||||
public int getNMixtures()
|
||||
{
|
||||
|
||||
int retVal = getNMixtures_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorMOG::setBackgroundRatio(double backgroundRatio)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorMOG::setBackgroundRatio(backgroundRatio)
|
||||
public void setBackgroundRatio(double backgroundRatio)
|
||||
{
|
||||
|
||||
setBackgroundRatio_0(nativeObj, backgroundRatio);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorMOG::setHistory(int nframes)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorMOG::setHistory(nframes)
|
||||
public void setHistory(int nframes)
|
||||
{
|
||||
|
||||
setHistory_0(nativeObj, nframes);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorMOG::setNMixtures(int nmix)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorMOG::setNMixtures(nmix)
|
||||
public void setNMixtures(int nmix)
|
||||
{
|
||||
|
||||
setNMixtures_0(nativeObj, nmix);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorMOG::setNoiseSigma(double noiseSigma)
|
||||
//
|
||||
|
||||
//javadoc: BackgroundSubtractorMOG::setNoiseSigma(noiseSigma)
|
||||
public void setNoiseSigma(double noiseSigma)
|
||||
{
|
||||
|
||||
setNoiseSigma_0(nativeObj, noiseSigma);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorMOG::getBackgroundRatio()
|
||||
private static native double getBackgroundRatio_0(long nativeObj);
|
||||
|
||||
// C++: double cv::bgsegm::BackgroundSubtractorMOG::getNoiseSigma()
|
||||
private static native double getNoiseSigma_0(long nativeObj);
|
||||
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorMOG::getHistory()
|
||||
private static native int getHistory_0(long nativeObj);
|
||||
|
||||
// C++: int cv::bgsegm::BackgroundSubtractorMOG::getNMixtures()
|
||||
private static native int getNMixtures_0(long nativeObj);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorMOG::setBackgroundRatio(double backgroundRatio)
|
||||
private static native void setBackgroundRatio_0(long nativeObj, double backgroundRatio);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorMOG::setHistory(int nframes)
|
||||
private static native void setHistory_0(long nativeObj, int nframes);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorMOG::setNMixtures(int nmix)
|
||||
private static native void setNMixtures_0(long nativeObj, int nmix);
|
||||
|
||||
// C++: void cv::bgsegm::BackgroundSubtractorMOG::setNoiseSigma(double noiseSigma)
|
||||
private static native void setNoiseSigma_0(long nativeObj, double noiseSigma);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,509 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bgsegm;
|
||||
|
||||
import org.opencv.bgsegm.BackgroundSubtractorCNT;
|
||||
import org.opencv.bgsegm.BackgroundSubtractorGMG;
|
||||
import org.opencv.bgsegm.BackgroundSubtractorGSOC;
|
||||
import org.opencv.bgsegm.BackgroundSubtractorLSBP;
|
||||
import org.opencv.bgsegm.BackgroundSubtractorMOG;
|
||||
import org.opencv.bgsegm.SyntheticSequenceGenerator;
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
// C++: class Bgsegm
|
||||
//javadoc: Bgsegm
|
||||
|
||||
public class Bgsegm {
|
||||
|
||||
// C++: enum LSBPCameraMotionCompensation
|
||||
public static final int
|
||||
LSBP_CAMERA_MOTION_COMPENSATION_NONE = 0,
|
||||
LSBP_CAMERA_MOTION_COMPENSATION_LK = 0+1;
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_BackgroundSubtractorCNT cv::bgsegm::createBackgroundSubtractorCNT(int minPixelStability = 15, bool useHistory = true, int maxPixelStability = 15*60, bool isParallel = true)
|
||||
//
|
||||
|
||||
//javadoc: createBackgroundSubtractorCNT(minPixelStability, useHistory, maxPixelStability, isParallel)
|
||||
public static BackgroundSubtractorCNT createBackgroundSubtractorCNT(int minPixelStability, boolean useHistory, int maxPixelStability, boolean isParallel)
|
||||
{
|
||||
|
||||
BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(createBackgroundSubtractorCNT_0(minPixelStability, useHistory, maxPixelStability, isParallel));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorCNT(minPixelStability, useHistory, maxPixelStability)
|
||||
public static BackgroundSubtractorCNT createBackgroundSubtractorCNT(int minPixelStability, boolean useHistory, int maxPixelStability)
|
||||
{
|
||||
|
||||
BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(createBackgroundSubtractorCNT_1(minPixelStability, useHistory, maxPixelStability));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorCNT(minPixelStability, useHistory)
|
||||
public static BackgroundSubtractorCNT createBackgroundSubtractorCNT(int minPixelStability, boolean useHistory)
|
||||
{
|
||||
|
||||
BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(createBackgroundSubtractorCNT_2(minPixelStability, useHistory));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorCNT(minPixelStability)
|
||||
public static BackgroundSubtractorCNT createBackgroundSubtractorCNT(int minPixelStability)
|
||||
{
|
||||
|
||||
BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(createBackgroundSubtractorCNT_3(minPixelStability));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorCNT()
|
||||
public static BackgroundSubtractorCNT createBackgroundSubtractorCNT()
|
||||
{
|
||||
|
||||
BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(createBackgroundSubtractorCNT_4());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_BackgroundSubtractorGMG cv::bgsegm::createBackgroundSubtractorGMG(int initializationFrames = 120, double decisionThreshold = 0.8)
|
||||
//
|
||||
|
||||
//javadoc: createBackgroundSubtractorGMG(initializationFrames, decisionThreshold)
|
||||
public static BackgroundSubtractorGMG createBackgroundSubtractorGMG(int initializationFrames, double decisionThreshold)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGMG retVal = BackgroundSubtractorGMG.__fromPtr__(createBackgroundSubtractorGMG_0(initializationFrames, decisionThreshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGMG(initializationFrames)
|
||||
public static BackgroundSubtractorGMG createBackgroundSubtractorGMG(int initializationFrames)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGMG retVal = BackgroundSubtractorGMG.__fromPtr__(createBackgroundSubtractorGMG_1(initializationFrames));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGMG()
|
||||
public static BackgroundSubtractorGMG createBackgroundSubtractorGMG()
|
||||
{
|
||||
|
||||
BackgroundSubtractorGMG retVal = BackgroundSubtractorGMG.__fromPtr__(createBackgroundSubtractorGMG_2());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_BackgroundSubtractorGSOC cv::bgsegm::createBackgroundSubtractorGSOC(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, float replaceRate = 0.003f, float propagationRate = 0.01f, int hitsThreshold = 32, float alpha = 0.01f, float beta = 0.0022f, float blinkingSupressionDecay = 0.1f, float blinkingSupressionMultiplier = 0.1f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f)
|
||||
//
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_0(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier, noiseRemovalThresholdFacBG)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier, float noiseRemovalThresholdFacBG)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_1(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier, noiseRemovalThresholdFacBG));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_2(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_3(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_4(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_5(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_6(mc, nSamples, replaceRate, propagationRate, hitsThreshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_7(mc, nSamples, replaceRate, propagationRate));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_8(mc, nSamples, replaceRate));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc, nSamples)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_9(mc, nSamples));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC(mc)
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc)
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_10(mc));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorGSOC()
|
||||
public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC()
|
||||
{
|
||||
|
||||
BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(createBackgroundSubtractorGSOC_11());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_BackgroundSubtractorLSBP cv::bgsegm::createBackgroundSubtractorLSBP(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, int LSBPRadius = 16, float Tlower = 2.0f, float Tupper = 32.0f, float Tinc = 1.0f, float Tdec = 0.05f, float Rscale = 10.0f, float Rincdec = 0.005f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f, int LSBPthreshold = 8, int minCount = 2)
|
||||
//
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG, LSBPthreshold, minCount)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG, int LSBPthreshold, int minCount)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_0(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG, LSBPthreshold, minCount));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG, LSBPthreshold)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG, int LSBPthreshold)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_1(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG, LSBPthreshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_2(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_3(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_4(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_5(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_6(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_7(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_8(mc, nSamples, LSBPRadius, Tlower, Tupper));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_9(mc, nSamples, LSBPRadius, Tlower));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_10(mc, nSamples, LSBPRadius));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc, nSamples)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_11(mc, nSamples));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP(mc)
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc)
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_12(mc));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorLSBP()
|
||||
public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP()
|
||||
{
|
||||
|
||||
BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(createBackgroundSubtractorLSBP_13());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_BackgroundSubtractorMOG cv::bgsegm::createBackgroundSubtractorMOG(int history = 200, int nmixtures = 5, double backgroundRatio = 0.7, double noiseSigma = 0)
|
||||
//
|
||||
|
||||
//javadoc: createBackgroundSubtractorMOG(history, nmixtures, backgroundRatio, noiseSigma)
|
||||
public static BackgroundSubtractorMOG createBackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma)
|
||||
{
|
||||
|
||||
BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(createBackgroundSubtractorMOG_0(history, nmixtures, backgroundRatio, noiseSigma));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorMOG(history, nmixtures, backgroundRatio)
|
||||
public static BackgroundSubtractorMOG createBackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio)
|
||||
{
|
||||
|
||||
BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(createBackgroundSubtractorMOG_1(history, nmixtures, backgroundRatio));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorMOG(history, nmixtures)
|
||||
public static BackgroundSubtractorMOG createBackgroundSubtractorMOG(int history, int nmixtures)
|
||||
{
|
||||
|
||||
BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(createBackgroundSubtractorMOG_2(history, nmixtures));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorMOG(history)
|
||||
public static BackgroundSubtractorMOG createBackgroundSubtractorMOG(int history)
|
||||
{
|
||||
|
||||
BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(createBackgroundSubtractorMOG_3(history));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createBackgroundSubtractorMOG()
|
||||
public static BackgroundSubtractorMOG createBackgroundSubtractorMOG()
|
||||
{
|
||||
|
||||
BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(createBackgroundSubtractorMOG_4());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_SyntheticSequenceGenerator cv::bgsegm::createSyntheticSequenceGenerator(Mat background, Mat object, double amplitude = 2.0, double wavelength = 20.0, double wavespeed = 0.2, double objspeed = 6.0)
|
||||
//
|
||||
|
||||
//javadoc: createSyntheticSequenceGenerator(background, object, amplitude, wavelength, wavespeed, objspeed)
|
||||
public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat object, double amplitude, double wavelength, double wavespeed, double objspeed)
|
||||
{
|
||||
|
||||
SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(createSyntheticSequenceGenerator_0(background.nativeObj, object.nativeObj, amplitude, wavelength, wavespeed, objspeed));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createSyntheticSequenceGenerator(background, object, amplitude, wavelength, wavespeed)
|
||||
public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat object, double amplitude, double wavelength, double wavespeed)
|
||||
{
|
||||
|
||||
SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(createSyntheticSequenceGenerator_1(background.nativeObj, object.nativeObj, amplitude, wavelength, wavespeed));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createSyntheticSequenceGenerator(background, object, amplitude, wavelength)
|
||||
public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat object, double amplitude, double wavelength)
|
||||
{
|
||||
|
||||
SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(createSyntheticSequenceGenerator_2(background.nativeObj, object.nativeObj, amplitude, wavelength));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createSyntheticSequenceGenerator(background, object, amplitude)
|
||||
public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat object, double amplitude)
|
||||
{
|
||||
|
||||
SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(createSyntheticSequenceGenerator_3(background.nativeObj, object.nativeObj, amplitude));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: createSyntheticSequenceGenerator(background, object)
|
||||
public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat object)
|
||||
{
|
||||
|
||||
SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(createSyntheticSequenceGenerator_4(background.nativeObj, object.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// C++: Ptr_BackgroundSubtractorCNT cv::bgsegm::createBackgroundSubtractorCNT(int minPixelStability = 15, bool useHistory = true, int maxPixelStability = 15*60, bool isParallel = true)
|
||||
private static native long createBackgroundSubtractorCNT_0(int minPixelStability, boolean useHistory, int maxPixelStability, boolean isParallel);
|
||||
private static native long createBackgroundSubtractorCNT_1(int minPixelStability, boolean useHistory, int maxPixelStability);
|
||||
private static native long createBackgroundSubtractorCNT_2(int minPixelStability, boolean useHistory);
|
||||
private static native long createBackgroundSubtractorCNT_3(int minPixelStability);
|
||||
private static native long createBackgroundSubtractorCNT_4();
|
||||
|
||||
// C++: Ptr_BackgroundSubtractorGMG cv::bgsegm::createBackgroundSubtractorGMG(int initializationFrames = 120, double decisionThreshold = 0.8)
|
||||
private static native long createBackgroundSubtractorGMG_0(int initializationFrames, double decisionThreshold);
|
||||
private static native long createBackgroundSubtractorGMG_1(int initializationFrames);
|
||||
private static native long createBackgroundSubtractorGMG_2();
|
||||
|
||||
// C++: Ptr_BackgroundSubtractorGSOC cv::bgsegm::createBackgroundSubtractorGSOC(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, float replaceRate = 0.003f, float propagationRate = 0.01f, int hitsThreshold = 32, float alpha = 0.01f, float beta = 0.0022f, float blinkingSupressionDecay = 0.1f, float blinkingSupressionMultiplier = 0.1f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f)
|
||||
private static native long createBackgroundSubtractorGSOC_0(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG);
|
||||
private static native long createBackgroundSubtractorGSOC_1(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier, float noiseRemovalThresholdFacBG);
|
||||
private static native long createBackgroundSubtractorGSOC_2(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier);
|
||||
private static native long createBackgroundSubtractorGSOC_3(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay);
|
||||
private static native long createBackgroundSubtractorGSOC_4(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta);
|
||||
private static native long createBackgroundSubtractorGSOC_5(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha);
|
||||
private static native long createBackgroundSubtractorGSOC_6(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold);
|
||||
private static native long createBackgroundSubtractorGSOC_7(int mc, int nSamples, float replaceRate, float propagationRate);
|
||||
private static native long createBackgroundSubtractorGSOC_8(int mc, int nSamples, float replaceRate);
|
||||
private static native long createBackgroundSubtractorGSOC_9(int mc, int nSamples);
|
||||
private static native long createBackgroundSubtractorGSOC_10(int mc);
|
||||
private static native long createBackgroundSubtractorGSOC_11();
|
||||
|
||||
// C++: Ptr_BackgroundSubtractorLSBP cv::bgsegm::createBackgroundSubtractorLSBP(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, int LSBPRadius = 16, float Tlower = 2.0f, float Tupper = 32.0f, float Tinc = 1.0f, float Tdec = 0.05f, float Rscale = 10.0f, float Rincdec = 0.005f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f, int LSBPthreshold = 8, int minCount = 2)
|
||||
private static native long createBackgroundSubtractorLSBP_0(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG, int LSBPthreshold, int minCount);
|
||||
private static native long createBackgroundSubtractorLSBP_1(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG, int LSBPthreshold);
|
||||
private static native long createBackgroundSubtractorLSBP_2(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG);
|
||||
private static native long createBackgroundSubtractorLSBP_3(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG);
|
||||
private static native long createBackgroundSubtractorLSBP_4(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec);
|
||||
private static native long createBackgroundSubtractorLSBP_5(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale);
|
||||
private static native long createBackgroundSubtractorLSBP_6(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec);
|
||||
private static native long createBackgroundSubtractorLSBP_7(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc);
|
||||
private static native long createBackgroundSubtractorLSBP_8(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper);
|
||||
private static native long createBackgroundSubtractorLSBP_9(int mc, int nSamples, int LSBPRadius, float Tlower);
|
||||
private static native long createBackgroundSubtractorLSBP_10(int mc, int nSamples, int LSBPRadius);
|
||||
private static native long createBackgroundSubtractorLSBP_11(int mc, int nSamples);
|
||||
private static native long createBackgroundSubtractorLSBP_12(int mc);
|
||||
private static native long createBackgroundSubtractorLSBP_13();
|
||||
|
||||
// C++: Ptr_BackgroundSubtractorMOG cv::bgsegm::createBackgroundSubtractorMOG(int history = 200, int nmixtures = 5, double backgroundRatio = 0.7, double noiseSigma = 0)
|
||||
private static native long createBackgroundSubtractorMOG_0(int history, int nmixtures, double backgroundRatio, double noiseSigma);
|
||||
private static native long createBackgroundSubtractorMOG_1(int history, int nmixtures, double backgroundRatio);
|
||||
private static native long createBackgroundSubtractorMOG_2(int history, int nmixtures);
|
||||
private static native long createBackgroundSubtractorMOG_3(int history);
|
||||
private static native long createBackgroundSubtractorMOG_4();
|
||||
|
||||
// C++: Ptr_SyntheticSequenceGenerator cv::bgsegm::createSyntheticSequenceGenerator(Mat background, Mat object, double amplitude = 2.0, double wavelength = 20.0, double wavespeed = 0.2, double objspeed = 6.0)
|
||||
private static native long createSyntheticSequenceGenerator_0(long background_nativeObj, long object_nativeObj, double amplitude, double wavelength, double wavespeed, double objspeed);
|
||||
private static native long createSyntheticSequenceGenerator_1(long background_nativeObj, long object_nativeObj, double amplitude, double wavelength, double wavespeed);
|
||||
private static native long createSyntheticSequenceGenerator_2(long background_nativeObj, long object_nativeObj, double amplitude, double wavelength);
|
||||
private static native long createSyntheticSequenceGenerator_3(long background_nativeObj, long object_nativeObj, double amplitude);
|
||||
private static native long createSyntheticSequenceGenerator_4(long background_nativeObj, long object_nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bgsegm;
|
||||
|
||||
import org.opencv.core.Algorithm;
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
// C++: class SyntheticSequenceGenerator
|
||||
//javadoc: SyntheticSequenceGenerator
|
||||
|
||||
public class SyntheticSequenceGenerator extends Algorithm {
|
||||
|
||||
protected SyntheticSequenceGenerator(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static SyntheticSequenceGenerator __fromPtr__(long addr) { return new SyntheticSequenceGenerator(addr); }
|
||||
|
||||
//
|
||||
// C++: cv::bgsegm::SyntheticSequenceGenerator::SyntheticSequenceGenerator(Mat background, Mat object, double amplitude, double wavelength, double wavespeed, double objspeed)
|
||||
//
|
||||
|
||||
//javadoc: SyntheticSequenceGenerator::SyntheticSequenceGenerator(background, object, amplitude, wavelength, wavespeed, objspeed)
|
||||
public SyntheticSequenceGenerator(Mat background, Mat object, double amplitude, double wavelength, double wavespeed, double objspeed)
|
||||
{
|
||||
|
||||
super( SyntheticSequenceGenerator_0(background.nativeObj, object.nativeObj, amplitude, wavelength, wavespeed, objspeed) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bgsegm::SyntheticSequenceGenerator::getNextFrame(Mat& frame, Mat& gtMask)
|
||||
//
|
||||
|
||||
//javadoc: SyntheticSequenceGenerator::getNextFrame(frame, gtMask)
|
||||
public void getNextFrame(Mat frame, Mat gtMask)
|
||||
{
|
||||
|
||||
getNextFrame_0(nativeObj, frame.nativeObj, gtMask.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: cv::bgsegm::SyntheticSequenceGenerator::SyntheticSequenceGenerator(Mat background, Mat object, double amplitude, double wavelength, double wavespeed, double objspeed)
|
||||
private static native long SyntheticSequenceGenerator_0(long background_nativeObj, long object_nativeObj, double amplitude, double wavelength, double wavespeed, double objspeed);
|
||||
|
||||
// C++: void cv::bgsegm::SyntheticSequenceGenerator::getNextFrame(Mat& frame, Mat& gtMask)
|
||||
private static native void getNextFrame_0(long nativeObj, long frame_nativeObj, long gtMask_nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bioinspired;
|
||||
|
||||
|
||||
|
||||
// C++: class Bioinspired
|
||||
//javadoc: Bioinspired
|
||||
|
||||
public class Bioinspired {
|
||||
|
||||
// C++: enum <unnamed>
|
||||
public static final int
|
||||
RETINA_COLOR_RANDOM = 0,
|
||||
RETINA_COLOR_DIAGONAL = 1,
|
||||
RETINA_COLOR_BAYER = 2;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,639 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bioinspired;
|
||||
|
||||
import java.lang.String;
|
||||
import org.opencv.bioinspired.Retina;
|
||||
import org.opencv.core.Algorithm;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Size;
|
||||
|
||||
// C++: class Retina
|
||||
//javadoc: Retina
|
||||
|
||||
public class Retina extends Algorithm {
|
||||
|
||||
protected Retina(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static Retina __fromPtr__(long addr) { return new Retina(addr); }
|
||||
|
||||
//
|
||||
// C++: Mat cv::bioinspired::Retina::getMagnoRAW()
|
||||
//
|
||||
|
||||
//javadoc: Retina::getMagnoRAW()
|
||||
public Mat getMagnoRAW()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getMagnoRAW_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::bioinspired::Retina::getParvoRAW()
|
||||
//
|
||||
|
||||
//javadoc: Retina::getParvoRAW()
|
||||
public Mat getParvoRAW()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getParvoRAW_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_Retina cv::bioinspired::Retina::create(Size inputSize, bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, bool useRetinaLogSampling = false, float reductionFactor = 1.0f, float samplingStrenght = 10.0f)
|
||||
//
|
||||
|
||||
//javadoc: Retina::create(inputSize, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght)
|
||||
public static Retina create(Size inputSize, boolean colorMode, int colorSamplingMethod, boolean useRetinaLogSampling, float reductionFactor, float samplingStrenght)
|
||||
{
|
||||
|
||||
Retina retVal = Retina.__fromPtr__(create_0(inputSize.width, inputSize.height, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: Retina::create(inputSize, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor)
|
||||
public static Retina create(Size inputSize, boolean colorMode, int colorSamplingMethod, boolean useRetinaLogSampling, float reductionFactor)
|
||||
{
|
||||
|
||||
Retina retVal = Retina.__fromPtr__(create_1(inputSize.width, inputSize.height, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: Retina::create(inputSize, colorMode, colorSamplingMethod, useRetinaLogSampling)
|
||||
public static Retina create(Size inputSize, boolean colorMode, int colorSamplingMethod, boolean useRetinaLogSampling)
|
||||
{
|
||||
|
||||
Retina retVal = Retina.__fromPtr__(create_2(inputSize.width, inputSize.height, colorMode, colorSamplingMethod, useRetinaLogSampling));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: Retina::create(inputSize, colorMode, colorSamplingMethod)
|
||||
public static Retina create(Size inputSize, boolean colorMode, int colorSamplingMethod)
|
||||
{
|
||||
|
||||
Retina retVal = Retina.__fromPtr__(create_3(inputSize.width, inputSize.height, colorMode, colorSamplingMethod));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: Retina::create(inputSize, colorMode)
|
||||
public static Retina create(Size inputSize, boolean colorMode)
|
||||
{
|
||||
|
||||
Retina retVal = Retina.__fromPtr__(create_4(inputSize.width, inputSize.height, colorMode));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_Retina cv::bioinspired::Retina::create(Size inputSize)
|
||||
//
|
||||
|
||||
//javadoc: Retina::create(inputSize)
|
||||
public static Retina create(Size inputSize)
|
||||
{
|
||||
|
||||
Retina retVal = Retina.__fromPtr__(create_5(inputSize.width, inputSize.height));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Size cv::bioinspired::Retina::getInputSize()
|
||||
//
|
||||
|
||||
//javadoc: Retina::getInputSize()
|
||||
public Size getInputSize()
|
||||
{
|
||||
|
||||
Size retVal = new Size(getInputSize_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Size cv::bioinspired::Retina::getOutputSize()
|
||||
//
|
||||
|
||||
//javadoc: Retina::getOutputSize()
|
||||
public Size getOutputSize()
|
||||
{
|
||||
|
||||
Size retVal = new Size(getOutputSize_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String cv::bioinspired::Retina::printSetup()
|
||||
//
|
||||
|
||||
//javadoc: Retina::printSetup()
|
||||
public String printSetup()
|
||||
{
|
||||
|
||||
String retVal = printSetup_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::activateContoursProcessing(bool activate)
|
||||
//
|
||||
|
||||
//javadoc: Retina::activateContoursProcessing(activate)
|
||||
public void activateContoursProcessing(boolean activate)
|
||||
{
|
||||
|
||||
activateContoursProcessing_0(nativeObj, activate);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::activateMovingContoursProcessing(bool activate)
|
||||
//
|
||||
|
||||
//javadoc: Retina::activateMovingContoursProcessing(activate)
|
||||
public void activateMovingContoursProcessing(boolean activate)
|
||||
{
|
||||
|
||||
activateMovingContoursProcessing_0(nativeObj, activate);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
|
||||
//
|
||||
|
||||
//javadoc: Retina::applyFastToneMapping(inputImage, outputToneMappedImage)
|
||||
public void applyFastToneMapping(Mat inputImage, Mat outputToneMappedImage)
|
||||
{
|
||||
|
||||
applyFastToneMapping_0(nativeObj, inputImage.nativeObj, outputToneMappedImage.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::clearBuffers()
|
||||
//
|
||||
|
||||
//javadoc: Retina::clearBuffers()
|
||||
public void clearBuffers()
|
||||
{
|
||||
|
||||
clearBuffers_0(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::getMagno(Mat& retinaOutput_magno)
|
||||
//
|
||||
|
||||
//javadoc: Retina::getMagno(retinaOutput_magno)
|
||||
public void getMagno(Mat retinaOutput_magno)
|
||||
{
|
||||
|
||||
getMagno_0(nativeObj, retinaOutput_magno.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::getMagnoRAW(Mat& retinaOutput_magno)
|
||||
//
|
||||
|
||||
//javadoc: Retina::getMagnoRAW(retinaOutput_magno)
|
||||
public void getMagnoRAW(Mat retinaOutput_magno)
|
||||
{
|
||||
|
||||
getMagnoRAW_1(nativeObj, retinaOutput_magno.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::getParvo(Mat& retinaOutput_parvo)
|
||||
//
|
||||
|
||||
//javadoc: Retina::getParvo(retinaOutput_parvo)
|
||||
public void getParvo(Mat retinaOutput_parvo)
|
||||
{
|
||||
|
||||
getParvo_0(nativeObj, retinaOutput_parvo.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::getParvoRAW(Mat& retinaOutput_parvo)
|
||||
//
|
||||
|
||||
//javadoc: Retina::getParvoRAW(retinaOutput_parvo)
|
||||
public void getParvoRAW(Mat retinaOutput_parvo)
|
||||
{
|
||||
|
||||
getParvoRAW_1(nativeObj, retinaOutput_parvo.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::run(Mat inputImage)
|
||||
//
|
||||
|
||||
//javadoc: Retina::run(inputImage)
|
||||
public void run(Mat inputImage)
|
||||
{
|
||||
|
||||
run_0(nativeObj, inputImage.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::setColorSaturation(bool saturateColors = true, float colorSaturationValue = 4.0f)
|
||||
//
|
||||
|
||||
//javadoc: Retina::setColorSaturation(saturateColors, colorSaturationValue)
|
||||
public void setColorSaturation(boolean saturateColors, float colorSaturationValue)
|
||||
{
|
||||
|
||||
setColorSaturation_0(nativeObj, saturateColors, colorSaturationValue);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setColorSaturation(saturateColors)
|
||||
public void setColorSaturation(boolean saturateColors)
|
||||
{
|
||||
|
||||
setColorSaturation_1(nativeObj, saturateColors);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setColorSaturation()
|
||||
public void setColorSaturation()
|
||||
{
|
||||
|
||||
setColorSaturation_2(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::setup(String retinaParameterFile = "", bool applyDefaultSetupOnFailure = true)
|
||||
//
|
||||
|
||||
//javadoc: Retina::setup(retinaParameterFile, applyDefaultSetupOnFailure)
|
||||
public void setup(String retinaParameterFile, boolean applyDefaultSetupOnFailure)
|
||||
{
|
||||
|
||||
setup_0(nativeObj, retinaParameterFile, applyDefaultSetupOnFailure);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setup(retinaParameterFile)
|
||||
public void setup(String retinaParameterFile)
|
||||
{
|
||||
|
||||
setup_1(nativeObj, retinaParameterFile);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setup()
|
||||
public void setup()
|
||||
{
|
||||
|
||||
setup_2(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::setupIPLMagnoChannel(bool normaliseOutput = true, float parasolCells_beta = 0.f, float parasolCells_tau = 0.f, float parasolCells_k = 7.f, float amacrinCellsTemporalCutFrequency = 1.2f, float V0CompressionParameter = 0.95f, float localAdaptintegration_tau = 0.f, float localAdaptintegration_k = 7.f)
|
||||
//
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel(normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter, localAdaptintegration_tau, localAdaptintegration_k)
|
||||
public void setupIPLMagnoChannel(boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter, float localAdaptintegration_tau, float localAdaptintegration_k)
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_0(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter, localAdaptintegration_tau, localAdaptintegration_k);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel(normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter, localAdaptintegration_tau)
|
||||
public void setupIPLMagnoChannel(boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter, float localAdaptintegration_tau)
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_1(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter, localAdaptintegration_tau);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel(normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter)
|
||||
public void setupIPLMagnoChannel(boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter)
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_2(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel(normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency)
|
||||
public void setupIPLMagnoChannel(boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency)
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_3(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel(normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k)
|
||||
public void setupIPLMagnoChannel(boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k)
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_4(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau, parasolCells_k);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel(normaliseOutput, parasolCells_beta, parasolCells_tau)
|
||||
public void setupIPLMagnoChannel(boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau)
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_5(nativeObj, normaliseOutput, parasolCells_beta, parasolCells_tau);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel(normaliseOutput, parasolCells_beta)
|
||||
public void setupIPLMagnoChannel(boolean normaliseOutput, float parasolCells_beta)
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_6(nativeObj, normaliseOutput, parasolCells_beta);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel(normaliseOutput)
|
||||
public void setupIPLMagnoChannel(boolean normaliseOutput)
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_7(nativeObj, normaliseOutput);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupIPLMagnoChannel()
|
||||
public void setupIPLMagnoChannel()
|
||||
{
|
||||
|
||||
setupIPLMagnoChannel_8(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::setupOPLandIPLParvoChannel(bool colorMode = true, bool normaliseOutput = true, float photoreceptorsLocalAdaptationSensitivity = 0.7f, float photoreceptorsTemporalConstant = 0.5f, float photoreceptorsSpatialConstant = 0.53f, float horizontalCellsGain = 0.f, float HcellsTemporalConstant = 1.f, float HcellsSpatialConstant = 7.f, float ganglionCellsSensitivity = 0.7f)
|
||||
//
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant, HcellsSpatialConstant, ganglionCellsSensitivity)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant, float HcellsSpatialConstant, float ganglionCellsSensitivity)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_0(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant, HcellsSpatialConstant, ganglionCellsSensitivity);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant, HcellsSpatialConstant)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant, float HcellsSpatialConstant)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_1(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant, HcellsSpatialConstant);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_2(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, HcellsTemporalConstant);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_3(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_4(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_5(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_6(nativeObj, colorMode, normaliseOutput, photoreceptorsLocalAdaptationSensitivity);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode, normaliseOutput)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode, boolean normaliseOutput)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_7(nativeObj, colorMode, normaliseOutput);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel(colorMode)
|
||||
public void setupOPLandIPLParvoChannel(boolean colorMode)
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_8(nativeObj, colorMode);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Retina::setupOPLandIPLParvoChannel()
|
||||
public void setupOPLandIPLParvoChannel()
|
||||
{
|
||||
|
||||
setupOPLandIPLParvoChannel_9(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::Retina::write(String fs)
|
||||
//
|
||||
|
||||
//javadoc: Retina::write(fs)
|
||||
public void write(String fs)
|
||||
{
|
||||
|
||||
write_0(nativeObj, fs);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: Mat cv::bioinspired::Retina::getMagnoRAW()
|
||||
private static native long getMagnoRAW_0(long nativeObj);
|
||||
|
||||
// C++: Mat cv::bioinspired::Retina::getParvoRAW()
|
||||
private static native long getParvoRAW_0(long nativeObj);
|
||||
|
||||
// C++: static Ptr_Retina cv::bioinspired::Retina::create(Size inputSize, bool colorMode, int colorSamplingMethod = RETINA_COLOR_BAYER, bool useRetinaLogSampling = false, float reductionFactor = 1.0f, float samplingStrenght = 10.0f)
|
||||
private static native long create_0(double inputSize_width, double inputSize_height, boolean colorMode, int colorSamplingMethod, boolean useRetinaLogSampling, float reductionFactor, float samplingStrenght);
|
||||
private static native long create_1(double inputSize_width, double inputSize_height, boolean colorMode, int colorSamplingMethod, boolean useRetinaLogSampling, float reductionFactor);
|
||||
private static native long create_2(double inputSize_width, double inputSize_height, boolean colorMode, int colorSamplingMethod, boolean useRetinaLogSampling);
|
||||
private static native long create_3(double inputSize_width, double inputSize_height, boolean colorMode, int colorSamplingMethod);
|
||||
private static native long create_4(double inputSize_width, double inputSize_height, boolean colorMode);
|
||||
|
||||
// C++: static Ptr_Retina cv::bioinspired::Retina::create(Size inputSize)
|
||||
private static native long create_5(double inputSize_width, double inputSize_height);
|
||||
|
||||
// C++: Size cv::bioinspired::Retina::getInputSize()
|
||||
private static native double[] getInputSize_0(long nativeObj);
|
||||
|
||||
// C++: Size cv::bioinspired::Retina::getOutputSize()
|
||||
private static native double[] getOutputSize_0(long nativeObj);
|
||||
|
||||
// C++: String cv::bioinspired::Retina::printSetup()
|
||||
private static native String printSetup_0(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::activateContoursProcessing(bool activate)
|
||||
private static native void activateContoursProcessing_0(long nativeObj, boolean activate);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::activateMovingContoursProcessing(bool activate)
|
||||
private static native void activateMovingContoursProcessing_0(long nativeObj, boolean activate);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
|
||||
private static native void applyFastToneMapping_0(long nativeObj, long inputImage_nativeObj, long outputToneMappedImage_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::clearBuffers()
|
||||
private static native void clearBuffers_0(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::getMagno(Mat& retinaOutput_magno)
|
||||
private static native void getMagno_0(long nativeObj, long retinaOutput_magno_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::getMagnoRAW(Mat& retinaOutput_magno)
|
||||
private static native void getMagnoRAW_1(long nativeObj, long retinaOutput_magno_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::getParvo(Mat& retinaOutput_parvo)
|
||||
private static native void getParvo_0(long nativeObj, long retinaOutput_parvo_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::getParvoRAW(Mat& retinaOutput_parvo)
|
||||
private static native void getParvoRAW_1(long nativeObj, long retinaOutput_parvo_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::run(Mat inputImage)
|
||||
private static native void run_0(long nativeObj, long inputImage_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::setColorSaturation(bool saturateColors = true, float colorSaturationValue = 4.0f)
|
||||
private static native void setColorSaturation_0(long nativeObj, boolean saturateColors, float colorSaturationValue);
|
||||
private static native void setColorSaturation_1(long nativeObj, boolean saturateColors);
|
||||
private static native void setColorSaturation_2(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::setup(String retinaParameterFile = "", bool applyDefaultSetupOnFailure = true)
|
||||
private static native void setup_0(long nativeObj, String retinaParameterFile, boolean applyDefaultSetupOnFailure);
|
||||
private static native void setup_1(long nativeObj, String retinaParameterFile);
|
||||
private static native void setup_2(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::setupIPLMagnoChannel(bool normaliseOutput = true, float parasolCells_beta = 0.f, float parasolCells_tau = 0.f, float parasolCells_k = 7.f, float amacrinCellsTemporalCutFrequency = 1.2f, float V0CompressionParameter = 0.95f, float localAdaptintegration_tau = 0.f, float localAdaptintegration_k = 7.f)
|
||||
private static native void setupIPLMagnoChannel_0(long nativeObj, boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter, float localAdaptintegration_tau, float localAdaptintegration_k);
|
||||
private static native void setupIPLMagnoChannel_1(long nativeObj, boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter, float localAdaptintegration_tau);
|
||||
private static native void setupIPLMagnoChannel_2(long nativeObj, boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency, float V0CompressionParameter);
|
||||
private static native void setupIPLMagnoChannel_3(long nativeObj, boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k, float amacrinCellsTemporalCutFrequency);
|
||||
private static native void setupIPLMagnoChannel_4(long nativeObj, boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau, float parasolCells_k);
|
||||
private static native void setupIPLMagnoChannel_5(long nativeObj, boolean normaliseOutput, float parasolCells_beta, float parasolCells_tau);
|
||||
private static native void setupIPLMagnoChannel_6(long nativeObj, boolean normaliseOutput, float parasolCells_beta);
|
||||
private static native void setupIPLMagnoChannel_7(long nativeObj, boolean normaliseOutput);
|
||||
private static native void setupIPLMagnoChannel_8(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::setupOPLandIPLParvoChannel(bool colorMode = true, bool normaliseOutput = true, float photoreceptorsLocalAdaptationSensitivity = 0.7f, float photoreceptorsTemporalConstant = 0.5f, float photoreceptorsSpatialConstant = 0.53f, float horizontalCellsGain = 0.f, float HcellsTemporalConstant = 1.f, float HcellsSpatialConstant = 7.f, float ganglionCellsSensitivity = 0.7f)
|
||||
private static native void setupOPLandIPLParvoChannel_0(long nativeObj, boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant, float HcellsSpatialConstant, float ganglionCellsSensitivity);
|
||||
private static native void setupOPLandIPLParvoChannel_1(long nativeObj, boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant, float HcellsSpatialConstant);
|
||||
private static native void setupOPLandIPLParvoChannel_2(long nativeObj, boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain, float HcellsTemporalConstant);
|
||||
private static native void setupOPLandIPLParvoChannel_3(long nativeObj, boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant, float horizontalCellsGain);
|
||||
private static native void setupOPLandIPLParvoChannel_4(long nativeObj, boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant, float photoreceptorsSpatialConstant);
|
||||
private static native void setupOPLandIPLParvoChannel_5(long nativeObj, boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity, float photoreceptorsTemporalConstant);
|
||||
private static native void setupOPLandIPLParvoChannel_6(long nativeObj, boolean colorMode, boolean normaliseOutput, float photoreceptorsLocalAdaptationSensitivity);
|
||||
private static native void setupOPLandIPLParvoChannel_7(long nativeObj, boolean colorMode, boolean normaliseOutput);
|
||||
private static native void setupOPLandIPLParvoChannel_8(long nativeObj, boolean colorMode);
|
||||
private static native void setupOPLandIPLParvoChannel_9(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::Retina::write(String fs)
|
||||
private static native void write_0(long nativeObj, String fs);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bioinspired;
|
||||
|
||||
import org.opencv.bioinspired.RetinaFastToneMapping;
|
||||
import org.opencv.core.Algorithm;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Size;
|
||||
|
||||
// C++: class RetinaFastToneMapping
|
||||
//javadoc: RetinaFastToneMapping
|
||||
|
||||
public class RetinaFastToneMapping extends Algorithm {
|
||||
|
||||
protected RetinaFastToneMapping(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static RetinaFastToneMapping __fromPtr__(long addr) { return new RetinaFastToneMapping(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_RetinaFastToneMapping cv::bioinspired::RetinaFastToneMapping::create(Size inputSize)
|
||||
//
|
||||
|
||||
//javadoc: RetinaFastToneMapping::create(inputSize)
|
||||
public static RetinaFastToneMapping create(Size inputSize)
|
||||
{
|
||||
|
||||
RetinaFastToneMapping retVal = RetinaFastToneMapping.__fromPtr__(create_0(inputSize.width, inputSize.height));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::RetinaFastToneMapping::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
|
||||
//
|
||||
|
||||
//javadoc: RetinaFastToneMapping::applyFastToneMapping(inputImage, outputToneMappedImage)
|
||||
public void applyFastToneMapping(Mat inputImage, Mat outputToneMappedImage)
|
||||
{
|
||||
|
||||
applyFastToneMapping_0(nativeObj, inputImage.nativeObj, outputToneMappedImage.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::RetinaFastToneMapping::setup(float photoreceptorsNeighborhoodRadius = 3.f, float ganglioncellsNeighborhoodRadius = 1.f, float meanLuminanceModulatorK = 1.f)
|
||||
//
|
||||
|
||||
//javadoc: RetinaFastToneMapping::setup(photoreceptorsNeighborhoodRadius, ganglioncellsNeighborhoodRadius, meanLuminanceModulatorK)
|
||||
public void setup(float photoreceptorsNeighborhoodRadius, float ganglioncellsNeighborhoodRadius, float meanLuminanceModulatorK)
|
||||
{
|
||||
|
||||
setup_0(nativeObj, photoreceptorsNeighborhoodRadius, ganglioncellsNeighborhoodRadius, meanLuminanceModulatorK);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: RetinaFastToneMapping::setup(photoreceptorsNeighborhoodRadius, ganglioncellsNeighborhoodRadius)
|
||||
public void setup(float photoreceptorsNeighborhoodRadius, float ganglioncellsNeighborhoodRadius)
|
||||
{
|
||||
|
||||
setup_1(nativeObj, photoreceptorsNeighborhoodRadius, ganglioncellsNeighborhoodRadius);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: RetinaFastToneMapping::setup(photoreceptorsNeighborhoodRadius)
|
||||
public void setup(float photoreceptorsNeighborhoodRadius)
|
||||
{
|
||||
|
||||
setup_2(nativeObj, photoreceptorsNeighborhoodRadius);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: RetinaFastToneMapping::setup()
|
||||
public void setup()
|
||||
{
|
||||
|
||||
setup_3(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_RetinaFastToneMapping cv::bioinspired::RetinaFastToneMapping::create(Size inputSize)
|
||||
private static native long create_0(double inputSize_width, double inputSize_height);
|
||||
|
||||
// C++: void cv::bioinspired::RetinaFastToneMapping::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
|
||||
private static native void applyFastToneMapping_0(long nativeObj, long inputImage_nativeObj, long outputToneMappedImage_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::RetinaFastToneMapping::setup(float photoreceptorsNeighborhoodRadius = 3.f, float ganglioncellsNeighborhoodRadius = 1.f, float meanLuminanceModulatorK = 1.f)
|
||||
private static native void setup_0(long nativeObj, float photoreceptorsNeighborhoodRadius, float ganglioncellsNeighborhoodRadius, float meanLuminanceModulatorK);
|
||||
private static native void setup_1(long nativeObj, float photoreceptorsNeighborhoodRadius, float ganglioncellsNeighborhoodRadius);
|
||||
private static native void setup_2(long nativeObj, float photoreceptorsNeighborhoodRadius);
|
||||
private static native void setup_3(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,198 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.bioinspired;
|
||||
|
||||
import java.lang.String;
|
||||
import org.opencv.bioinspired.TransientAreasSegmentationModule;
|
||||
import org.opencv.core.Algorithm;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Size;
|
||||
|
||||
// C++: class TransientAreasSegmentationModule
|
||||
//javadoc: TransientAreasSegmentationModule
|
||||
|
||||
public class TransientAreasSegmentationModule extends Algorithm {
|
||||
|
||||
protected TransientAreasSegmentationModule(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static TransientAreasSegmentationModule __fromPtr__(long addr) { return new TransientAreasSegmentationModule(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_TransientAreasSegmentationModule cv::bioinspired::TransientAreasSegmentationModule::create(Size inputSize)
|
||||
//
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::create(inputSize)
|
||||
public static TransientAreasSegmentationModule create(Size inputSize)
|
||||
{
|
||||
|
||||
TransientAreasSegmentationModule retVal = TransientAreasSegmentationModule.__fromPtr__(create_0(inputSize.width, inputSize.height));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Size cv::bioinspired::TransientAreasSegmentationModule::getSize()
|
||||
//
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::getSize()
|
||||
public Size getSize()
|
||||
{
|
||||
|
||||
Size retVal = new Size(getSize_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String cv::bioinspired::TransientAreasSegmentationModule::printSetup()
|
||||
//
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::printSetup()
|
||||
public String printSetup()
|
||||
{
|
||||
|
||||
String retVal = printSetup_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::clearAllBuffers()
|
||||
//
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::clearAllBuffers()
|
||||
public void clearAllBuffers()
|
||||
{
|
||||
|
||||
clearAllBuffers_0(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::getSegmentationPicture(Mat& transientAreas)
|
||||
//
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::getSegmentationPicture(transientAreas)
|
||||
public void getSegmentationPicture(Mat transientAreas)
|
||||
{
|
||||
|
||||
getSegmentationPicture_0(nativeObj, transientAreas.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::run(Mat inputToSegment, int channelIndex = 0)
|
||||
//
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::run(inputToSegment, channelIndex)
|
||||
public void run(Mat inputToSegment, int channelIndex)
|
||||
{
|
||||
|
||||
run_0(nativeObj, inputToSegment.nativeObj, channelIndex);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::run(inputToSegment)
|
||||
public void run(Mat inputToSegment)
|
||||
{
|
||||
|
||||
run_1(nativeObj, inputToSegment.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::setup(String segmentationParameterFile = "", bool applyDefaultSetupOnFailure = true)
|
||||
//
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::setup(segmentationParameterFile, applyDefaultSetupOnFailure)
|
||||
public void setup(String segmentationParameterFile, boolean applyDefaultSetupOnFailure)
|
||||
{
|
||||
|
||||
setup_0(nativeObj, segmentationParameterFile, applyDefaultSetupOnFailure);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::setup(segmentationParameterFile)
|
||||
public void setup(String segmentationParameterFile)
|
||||
{
|
||||
|
||||
setup_1(nativeObj, segmentationParameterFile);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::setup()
|
||||
public void setup()
|
||||
{
|
||||
|
||||
setup_2(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::write(String fs)
|
||||
//
|
||||
|
||||
//javadoc: TransientAreasSegmentationModule::write(fs)
|
||||
public void write(String fs)
|
||||
{
|
||||
|
||||
write_0(nativeObj, fs);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_TransientAreasSegmentationModule cv::bioinspired::TransientAreasSegmentationModule::create(Size inputSize)
|
||||
private static native long create_0(double inputSize_width, double inputSize_height);
|
||||
|
||||
// C++: Size cv::bioinspired::TransientAreasSegmentationModule::getSize()
|
||||
private static native double[] getSize_0(long nativeObj);
|
||||
|
||||
// C++: String cv::bioinspired::TransientAreasSegmentationModule::printSetup()
|
||||
private static native String printSetup_0(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::clearAllBuffers()
|
||||
private static native void clearAllBuffers_0(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::getSegmentationPicture(Mat& transientAreas)
|
||||
private static native void getSegmentationPicture_0(long nativeObj, long transientAreas_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::run(Mat inputToSegment, int channelIndex = 0)
|
||||
private static native void run_0(long nativeObj, long inputToSegment_nativeObj, int channelIndex);
|
||||
private static native void run_1(long nativeObj, long inputToSegment_nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::setup(String segmentationParameterFile = "", bool applyDefaultSetupOnFailure = true)
|
||||
private static native void setup_0(long nativeObj, String segmentationParameterFile, boolean applyDefaultSetupOnFailure);
|
||||
private static native void setup_1(long nativeObj, String segmentationParameterFile);
|
||||
private static native void setup_2(long nativeObj);
|
||||
|
||||
// C++: void cv::bioinspired::TransientAreasSegmentationModule::write(String fs)
|
||||
private static native void write_0(long nativeObj, String fs);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,345 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.calib3d;
|
||||
|
||||
import org.opencv.calib3d.StereoBM;
|
||||
import org.opencv.calib3d.StereoMatcher;
|
||||
import org.opencv.core.Rect;
|
||||
|
||||
// C++: class StereoBM
|
||||
//javadoc: StereoBM
|
||||
|
||||
public class StereoBM extends StereoMatcher {
|
||||
|
||||
protected StereoBM(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static StereoBM __fromPtr__(long addr) { return new StereoBM(addr); }
|
||||
|
||||
// C++: enum <unnamed>
|
||||
public static final int
|
||||
PREFILTER_NORMALIZED_RESPONSE = 0,
|
||||
PREFILTER_XSOBEL = 1;
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_StereoBM cv::StereoBM::create(int numDisparities = 0, int blockSize = 21)
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::create(numDisparities, blockSize)
|
||||
public static StereoBM create(int numDisparities, int blockSize)
|
||||
{
|
||||
|
||||
StereoBM retVal = StereoBM.__fromPtr__(create_0(numDisparities, blockSize));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoBM::create(numDisparities)
|
||||
public static StereoBM create(int numDisparities)
|
||||
{
|
||||
|
||||
StereoBM retVal = StereoBM.__fromPtr__(create_1(numDisparities));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoBM::create()
|
||||
public static StereoBM create()
|
||||
{
|
||||
|
||||
StereoBM retVal = StereoBM.__fromPtr__(create_2());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Rect cv::StereoBM::getROI1()
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::getROI1()
|
||||
public Rect getROI1()
|
||||
{
|
||||
|
||||
Rect retVal = new Rect(getROI1_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Rect cv::StereoBM::getROI2()
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::getROI2()
|
||||
public Rect getROI2()
|
||||
{
|
||||
|
||||
Rect retVal = new Rect(getROI2_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoBM::getPreFilterCap()
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::getPreFilterCap()
|
||||
public int getPreFilterCap()
|
||||
{
|
||||
|
||||
int retVal = getPreFilterCap_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoBM::getPreFilterSize()
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::getPreFilterSize()
|
||||
public int getPreFilterSize()
|
||||
{
|
||||
|
||||
int retVal = getPreFilterSize_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoBM::getPreFilterType()
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::getPreFilterType()
|
||||
public int getPreFilterType()
|
||||
{
|
||||
|
||||
int retVal = getPreFilterType_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoBM::getSmallerBlockSize()
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::getSmallerBlockSize()
|
||||
public int getSmallerBlockSize()
|
||||
{
|
||||
|
||||
int retVal = getSmallerBlockSize_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoBM::getTextureThreshold()
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::getTextureThreshold()
|
||||
public int getTextureThreshold()
|
||||
{
|
||||
|
||||
int retVal = getTextureThreshold_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoBM::getUniquenessRatio()
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::getUniquenessRatio()
|
||||
public int getUniquenessRatio()
|
||||
{
|
||||
|
||||
int retVal = getUniquenessRatio_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoBM::setPreFilterCap(int preFilterCap)
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::setPreFilterCap(preFilterCap)
|
||||
public void setPreFilterCap(int preFilterCap)
|
||||
{
|
||||
|
||||
setPreFilterCap_0(nativeObj, preFilterCap);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoBM::setPreFilterSize(int preFilterSize)
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::setPreFilterSize(preFilterSize)
|
||||
public void setPreFilterSize(int preFilterSize)
|
||||
{
|
||||
|
||||
setPreFilterSize_0(nativeObj, preFilterSize);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoBM::setPreFilterType(int preFilterType)
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::setPreFilterType(preFilterType)
|
||||
public void setPreFilterType(int preFilterType)
|
||||
{
|
||||
|
||||
setPreFilterType_0(nativeObj, preFilterType);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoBM::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 cv::StereoBM::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 cv::StereoBM::setSmallerBlockSize(int blockSize)
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::setSmallerBlockSize(blockSize)
|
||||
public void setSmallerBlockSize(int blockSize)
|
||||
{
|
||||
|
||||
setSmallerBlockSize_0(nativeObj, blockSize);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoBM::setTextureThreshold(int textureThreshold)
|
||||
//
|
||||
|
||||
//javadoc: StereoBM::setTextureThreshold(textureThreshold)
|
||||
public void setTextureThreshold(int textureThreshold)
|
||||
{
|
||||
|
||||
setTextureThreshold_0(nativeObj, textureThreshold);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoBM::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 cv::StereoBM::create(int numDisparities = 0, int blockSize = 21)
|
||||
private static native long create_0(int numDisparities, int blockSize);
|
||||
private static native long create_1(int numDisparities);
|
||||
private static native long create_2();
|
||||
|
||||
// C++: Rect cv::StereoBM::getROI1()
|
||||
private static native double[] getROI1_0(long nativeObj);
|
||||
|
||||
// C++: Rect cv::StereoBM::getROI2()
|
||||
private static native double[] getROI2_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoBM::getPreFilterCap()
|
||||
private static native int getPreFilterCap_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoBM::getPreFilterSize()
|
||||
private static native int getPreFilterSize_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoBM::getPreFilterType()
|
||||
private static native int getPreFilterType_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoBM::getSmallerBlockSize()
|
||||
private static native int getSmallerBlockSize_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoBM::getTextureThreshold()
|
||||
private static native int getTextureThreshold_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoBM::getUniquenessRatio()
|
||||
private static native int getUniquenessRatio_0(long nativeObj);
|
||||
|
||||
// C++: void cv::StereoBM::setPreFilterCap(int preFilterCap)
|
||||
private static native void setPreFilterCap_0(long nativeObj, int preFilterCap);
|
||||
|
||||
// C++: void cv::StereoBM::setPreFilterSize(int preFilterSize)
|
||||
private static native void setPreFilterSize_0(long nativeObj, int preFilterSize);
|
||||
|
||||
// C++: void cv::StereoBM::setPreFilterType(int preFilterType)
|
||||
private static native void setPreFilterType_0(long nativeObj, int preFilterType);
|
||||
|
||||
// C++: void cv::StereoBM::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 cv::StereoBM::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 cv::StereoBM::setSmallerBlockSize(int blockSize)
|
||||
private static native void setSmallerBlockSize_0(long nativeObj, int blockSize);
|
||||
|
||||
// C++: void cv::StereoBM::setTextureThreshold(int textureThreshold)
|
||||
private static native void setTextureThreshold_0(long nativeObj, int textureThreshold);
|
||||
|
||||
// C++: void cv::StereoBM::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);
|
||||
|
||||
}
|
||||
|
|
@ -1,256 +0,0 @@
|
|||
//
|
||||
// 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); }
|
||||
|
||||
// internal usage only
|
||||
public static StereoMatcher __fromPtr__(long addr) { return new StereoMatcher(addr); }
|
||||
|
||||
// C++: enum <unnamed>
|
||||
public static final int
|
||||
DISP_SHIFT = 4,
|
||||
DISP_SCALE = (1 << DISP_SHIFT);
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoMatcher::getBlockSize()
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::getBlockSize()
|
||||
public int getBlockSize()
|
||||
{
|
||||
|
||||
int retVal = getBlockSize_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoMatcher::getDisp12MaxDiff()
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::getDisp12MaxDiff()
|
||||
public int getDisp12MaxDiff()
|
||||
{
|
||||
|
||||
int retVal = getDisp12MaxDiff_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoMatcher::getMinDisparity()
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::getMinDisparity()
|
||||
public int getMinDisparity()
|
||||
{
|
||||
|
||||
int retVal = getMinDisparity_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoMatcher::getNumDisparities()
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::getNumDisparities()
|
||||
public int getNumDisparities()
|
||||
{
|
||||
|
||||
int retVal = getNumDisparities_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoMatcher::getSpeckleRange()
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::getSpeckleRange()
|
||||
public int getSpeckleRange()
|
||||
{
|
||||
|
||||
int retVal = getSpeckleRange_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoMatcher::getSpeckleWindowSize()
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::getSpeckleWindowSize()
|
||||
public int getSpeckleWindowSize()
|
||||
{
|
||||
|
||||
int retVal = getSpeckleWindowSize_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoMatcher::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 cv::StereoMatcher::setBlockSize(int blockSize)
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::setBlockSize(blockSize)
|
||||
public void setBlockSize(int blockSize)
|
||||
{
|
||||
|
||||
setBlockSize_0(nativeObj, blockSize);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoMatcher::setDisp12MaxDiff(int disp12MaxDiff)
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::setDisp12MaxDiff(disp12MaxDiff)
|
||||
public void setDisp12MaxDiff(int disp12MaxDiff)
|
||||
{
|
||||
|
||||
setDisp12MaxDiff_0(nativeObj, disp12MaxDiff);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoMatcher::setMinDisparity(int minDisparity)
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::setMinDisparity(minDisparity)
|
||||
public void setMinDisparity(int minDisparity)
|
||||
{
|
||||
|
||||
setMinDisparity_0(nativeObj, minDisparity);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoMatcher::setNumDisparities(int numDisparities)
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::setNumDisparities(numDisparities)
|
||||
public void setNumDisparities(int numDisparities)
|
||||
{
|
||||
|
||||
setNumDisparities_0(nativeObj, numDisparities);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoMatcher::setSpeckleRange(int speckleRange)
|
||||
//
|
||||
|
||||
//javadoc: StereoMatcher::setSpeckleRange(speckleRange)
|
||||
public void setSpeckleRange(int speckleRange)
|
||||
{
|
||||
|
||||
setSpeckleRange_0(nativeObj, speckleRange);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoMatcher::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 cv::StereoMatcher::getBlockSize()
|
||||
private static native int getBlockSize_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoMatcher::getDisp12MaxDiff()
|
||||
private static native int getDisp12MaxDiff_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoMatcher::getMinDisparity()
|
||||
private static native int getMinDisparity_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoMatcher::getNumDisparities()
|
||||
private static native int getNumDisparities_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoMatcher::getSpeckleRange()
|
||||
private static native int getSpeckleRange_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoMatcher::getSpeckleWindowSize()
|
||||
private static native int getSpeckleWindowSize_0(long nativeObj);
|
||||
|
||||
// C++: void cv::StereoMatcher::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 cv::StereoMatcher::setBlockSize(int blockSize)
|
||||
private static native void setBlockSize_0(long nativeObj, int blockSize);
|
||||
|
||||
// C++: void cv::StereoMatcher::setDisp12MaxDiff(int disp12MaxDiff)
|
||||
private static native void setDisp12MaxDiff_0(long nativeObj, int disp12MaxDiff);
|
||||
|
||||
// C++: void cv::StereoMatcher::setMinDisparity(int minDisparity)
|
||||
private static native void setMinDisparity_0(long nativeObj, int minDisparity);
|
||||
|
||||
// C++: void cv::StereoMatcher::setNumDisparities(int numDisparities)
|
||||
private static native void setNumDisparities_0(long nativeObj, int numDisparities);
|
||||
|
||||
// C++: void cv::StereoMatcher::setSpeckleRange(int speckleRange)
|
||||
private static native void setSpeckleRange_0(long nativeObj, int speckleRange);
|
||||
|
||||
// C++: void cv::StereoMatcher::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);
|
||||
|
||||
}
|
||||
|
|
@ -1,334 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.calib3d;
|
||||
|
||||
import org.opencv.calib3d.StereoMatcher;
|
||||
import org.opencv.calib3d.StereoSGBM;
|
||||
|
||||
// C++: class StereoSGBM
|
||||
//javadoc: StereoSGBM
|
||||
|
||||
public class StereoSGBM extends StereoMatcher {
|
||||
|
||||
protected StereoSGBM(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static StereoSGBM __fromPtr__(long addr) { return new StereoSGBM(addr); }
|
||||
|
||||
// C++: enum <unnamed>
|
||||
public static final int
|
||||
MODE_SGBM = 0,
|
||||
MODE_HH = 1,
|
||||
MODE_SGBM_3WAY = 2,
|
||||
MODE_HH4 = 3;
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_StereoSGBM cv::StereoSGBM::create(int minDisparity = 0, int numDisparities = 16, int blockSize = 3, 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 = StereoSGBM.__fromPtr__(create_0(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio, speckleWindowSize, speckleRange, mode));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio, speckleWindowSize, speckleRange)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize, int speckleRange)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_1(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio, speckleWindowSize, speckleRange));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio, speckleWindowSize)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_2(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio, speckleWindowSize));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_3(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap, uniquenessRatio));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_4(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff, preFilterCap));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_5(minDisparity, numDisparities, blockSize, P1, P2, disp12MaxDiff));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize, P1, P2)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1, int P2)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_6(minDisparity, numDisparities, blockSize, P1, P2));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize, P1)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize, int P1)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_7(minDisparity, numDisparities, blockSize, P1));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities, blockSize)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities, int blockSize)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_8(minDisparity, numDisparities, blockSize));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity, numDisparities)
|
||||
public static StereoSGBM create(int minDisparity, int numDisparities)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_9(minDisparity, numDisparities));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create(minDisparity)
|
||||
public static StereoSGBM create(int minDisparity)
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_10(minDisparity));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StereoSGBM::create()
|
||||
public static StereoSGBM create()
|
||||
{
|
||||
|
||||
StereoSGBM retVal = StereoSGBM.__fromPtr__(create_11());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoSGBM::getMode()
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::getMode()
|
||||
public int getMode()
|
||||
{
|
||||
|
||||
int retVal = getMode_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoSGBM::getP1()
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::getP1()
|
||||
public int getP1()
|
||||
{
|
||||
|
||||
int retVal = getP1_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoSGBM::getP2()
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::getP2()
|
||||
public int getP2()
|
||||
{
|
||||
|
||||
int retVal = getP2_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoSGBM::getPreFilterCap()
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::getPreFilterCap()
|
||||
public int getPreFilterCap()
|
||||
{
|
||||
|
||||
int retVal = getPreFilterCap_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::StereoSGBM::getUniquenessRatio()
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::getUniquenessRatio()
|
||||
public int getUniquenessRatio()
|
||||
{
|
||||
|
||||
int retVal = getUniquenessRatio_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoSGBM::setMode(int mode)
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::setMode(mode)
|
||||
public void setMode(int mode)
|
||||
{
|
||||
|
||||
setMode_0(nativeObj, mode);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoSGBM::setP1(int P1)
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::setP1(P1)
|
||||
public void setP1(int P1)
|
||||
{
|
||||
|
||||
setP1_0(nativeObj, P1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoSGBM::setP2(int P2)
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::setP2(P2)
|
||||
public void setP2(int P2)
|
||||
{
|
||||
|
||||
setP2_0(nativeObj, P2);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoSGBM::setPreFilterCap(int preFilterCap)
|
||||
//
|
||||
|
||||
//javadoc: StereoSGBM::setPreFilterCap(preFilterCap)
|
||||
public void setPreFilterCap(int preFilterCap)
|
||||
{
|
||||
|
||||
setPreFilterCap_0(nativeObj, preFilterCap);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::StereoSGBM::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 cv::StereoSGBM::create(int minDisparity = 0, int numDisparities = 16, int blockSize = 3, 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, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize, int speckleRange);
|
||||
private static native long create_2(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio, int speckleWindowSize);
|
||||
private static native long create_3(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap, int uniquenessRatio);
|
||||
private static native long create_4(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff, int preFilterCap);
|
||||
private static native long create_5(int minDisparity, int numDisparities, int blockSize, int P1, int P2, int disp12MaxDiff);
|
||||
private static native long create_6(int minDisparity, int numDisparities, int blockSize, int P1, int P2);
|
||||
private static native long create_7(int minDisparity, int numDisparities, int blockSize, int P1);
|
||||
private static native long create_8(int minDisparity, int numDisparities, int blockSize);
|
||||
private static native long create_9(int minDisparity, int numDisparities);
|
||||
private static native long create_10(int minDisparity);
|
||||
private static native long create_11();
|
||||
|
||||
// C++: int cv::StereoSGBM::getMode()
|
||||
private static native int getMode_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoSGBM::getP1()
|
||||
private static native int getP1_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoSGBM::getP2()
|
||||
private static native int getP2_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoSGBM::getPreFilterCap()
|
||||
private static native int getPreFilterCap_0(long nativeObj);
|
||||
|
||||
// C++: int cv::StereoSGBM::getUniquenessRatio()
|
||||
private static native int getUniquenessRatio_0(long nativeObj);
|
||||
|
||||
// C++: void cv::StereoSGBM::setMode(int mode)
|
||||
private static native void setMode_0(long nativeObj, int mode);
|
||||
|
||||
// C++: void cv::StereoSGBM::setP1(int P1)
|
||||
private static native void setP1_0(long nativeObj, int P1);
|
||||
|
||||
// C++: void cv::StereoSGBM::setP2(int P2)
|
||||
private static native void setP2_0(long nativeObj, int P2);
|
||||
|
||||
// C++: void cv::StereoSGBM::setPreFilterCap(int preFilterCap)
|
||||
private static native void setPreFilterCap_0(long nativeObj, int preFilterCap);
|
||||
|
||||
// C++: void cv::StereoSGBM::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);
|
||||
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
//
|
||||
// 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; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static Algorithm __fromPtr__(long addr) { return new Algorithm(addr); }
|
||||
|
||||
//
|
||||
// C++: String cv::Algorithm::getDefaultName()
|
||||
//
|
||||
|
||||
//javadoc: Algorithm::getDefaultName()
|
||||
public String getDefaultName()
|
||||
{
|
||||
|
||||
String retVal = getDefaultName_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::Algorithm::empty()
|
||||
//
|
||||
|
||||
//javadoc: Algorithm::empty()
|
||||
public boolean empty()
|
||||
{
|
||||
|
||||
boolean retVal = empty_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::Algorithm::clear()
|
||||
//
|
||||
|
||||
//javadoc: Algorithm::clear()
|
||||
public void clear()
|
||||
{
|
||||
|
||||
clear_0(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::Algorithm::read(FileNode fn)
|
||||
//
|
||||
|
||||
// Unknown type 'FileNode' (I), skipping the function
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::Algorithm::save(String filename)
|
||||
//
|
||||
|
||||
//javadoc: Algorithm::save(filename)
|
||||
public void save(String filename)
|
||||
{
|
||||
|
||||
save_0(nativeObj, filename);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::Algorithm::write(Ptr_FileStorage fs, String name = String())
|
||||
//
|
||||
|
||||
// Unknown type 'Ptr_FileStorage' (I), skipping the function
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: String cv::Algorithm::getDefaultName()
|
||||
private static native String getDefaultName_0(long nativeObj);
|
||||
|
||||
// C++: bool cv::Algorithm::empty()
|
||||
private static native boolean empty_0(long nativeObj);
|
||||
|
||||
// C++: void cv::Algorithm::clear()
|
||||
private static native void clear_0(long nativeObj);
|
||||
|
||||
// C++: void cv::Algorithm::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);
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,15 +0,0 @@
|
|||
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() + "]";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,150 +0,0 @@
|
|||
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_16F = 7;
|
||||
|
||||
/**
|
||||
* @deprecated please use {@link #CV_16F}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int CV_USRTYPE1 = CV_16F;
|
||||
|
||||
// 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),
|
||||
CV_16FC1 = CV_16FC(1), CV_16FC2 = CV_16FC(2), CV_16FC3 = CV_16FC(3), CV_16FC4 = CV_16FC(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 UnsupportedOperationException(
|
||||
"Channels count should be 1.." + (CV_CN_MAX - 1));
|
||||
}
|
||||
if (depth < 0 || depth >= CV_DEPTH_MAX) {
|
||||
throw new 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 CV_16FC(int ch) {
|
||||
return makeType(CV_16F, 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:
|
||||
case CV_16F:
|
||||
return 2 * channels(type);
|
||||
case CV_32S:
|
||||
case CV_32F:
|
||||
return 4 * channels(type);
|
||||
case CV_64F:
|
||||
return 8 * channels(type);
|
||||
default:
|
||||
throw new 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_16F:
|
||||
s = "CV_16F";
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException(
|
||||
"Unsupported CvType value: " + type);
|
||||
}
|
||||
|
||||
int ch = channels(type);
|
||||
if (ch <= 4)
|
||||
return s + "C" + ch;
|
||||
else
|
||||
return s + "C(" + ch + ")";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
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;
|
||||
}
|
||||
|
||||
public boolean lessThan(DMatch it) {
|
||||
return distance < it.distance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DMatch [queryIdx=" + queryIdx + ", trainIdx=" + trainIdx
|
||||
+ ", imgIdx=" + imgIdx + ", distance=" + distance + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
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 + "]";
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,98 +0,0 @@
|
|||
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 MatOfByte(int offset, int length, byte...a) {
|
||||
super();
|
||||
fromArray(offset, length, 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 void fromArray(int offset, int length, byte...a) {
|
||||
if (offset < 0)
|
||||
throw new IllegalArgumentException("offset < 0");
|
||||
if (a == null)
|
||||
throw new NullPointerException();
|
||||
if (length < 0 || length + offset > a.length)
|
||||
throw new IllegalArgumentException("invalid 'length' parameter: " + Integer.toString(length));
|
||||
if (a.length == 0)
|
||||
return;
|
||||
int num = length / _channels;
|
||||
alloc(num);
|
||||
put(0, 0, a, offset, length); //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<Byte> 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<ab.length; i++)
|
||||
a[i] = ab[i];
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public List<Byte> toList() {
|
||||
byte[] a = toArray();
|
||||
Byte ab[] = new Byte[a.length];
|
||||
for(int i=0; i<a.length; i++)
|
||||
ab[i] = a[i];
|
||||
return Arrays.asList(ab);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.DMatch;
|
||||
|
||||
public class MatOfDMatch extends Mat {
|
||||
// 32FC4
|
||||
private static final int _depth = CvType.CV_32F;
|
||||
private static final int _channels = 4;
|
||||
|
||||
public MatOfDMatch() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfDMatch(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat: " + toString());
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfDMatch fromNativeAddr(long addr) {
|
||||
return new MatOfDMatch(addr);
|
||||
}
|
||||
|
||||
public MatOfDMatch(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat: " + toString());
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfDMatch(DMatch...ap) {
|
||||
super();
|
||||
fromArray(ap);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
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<num; i++) {
|
||||
DMatch m = a[i];
|
||||
buff[_channels*i+0] = m.queryIdx;
|
||||
buff[_channels*i+1] = m.trainIdx;
|
||||
buff[_channels*i+2] = m.imgIdx;
|
||||
buff[_channels*i+3] = m.distance;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
public DMatch[] toArray() {
|
||||
int num = (int) total();
|
||||
DMatch[] a = new DMatch[num];
|
||||
if(num == 0)
|
||||
return a;
|
||||
float buff[] = new float[num * _channels];
|
||||
get(0, 0, buff); //TODO: check ret val!
|
||||
for(int i=0; i<num; i++)
|
||||
a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
|
||||
return a;
|
||||
}
|
||||
|
||||
public void fromList(List<DMatch> ldm) {
|
||||
DMatch adm[] = ldm.toArray(new DMatch[0]);
|
||||
fromArray(adm);
|
||||
}
|
||||
|
||||
public List<DMatch> toList() {
|
||||
DMatch[] adm = toArray();
|
||||
return Arrays.asList(adm);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
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<Double> 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<ab.length; i++)
|
||||
a[i] = ab[i];
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public List<Double> toList() {
|
||||
double[] a = toArray();
|
||||
Double ab[] = new Double[a.length];
|
||||
for(int i=0; i<a.length; i++)
|
||||
ab[i] = a[i];
|
||||
return Arrays.asList(ab);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class MatOfFloat extends Mat {
|
||||
// 32FC1
|
||||
private static final int _depth = CvType.CV_32F;
|
||||
private static final int _channels = 1;
|
||||
|
||||
public MatOfFloat() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfFloat(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfFloat fromNativeAddr(long addr) {
|
||||
return new MatOfFloat(addr);
|
||||
}
|
||||
|
||||
public MatOfFloat(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfFloat(float...a) {
|
||||
super();
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
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<Float> 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<ab.length; i++)
|
||||
a[i] = ab[i];
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public List<Float> toList() {
|
||||
float[] a = toArray();
|
||||
Float ab[] = new Float[a.length];
|
||||
for(int i=0; i<a.length; i++)
|
||||
ab[i] = a[i];
|
||||
return Arrays.asList(ab);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class MatOfFloat4 extends Mat {
|
||||
// 32FC4
|
||||
private static final int _depth = CvType.CV_32F;
|
||||
private static final int _channels = 4;
|
||||
|
||||
public MatOfFloat4() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfFloat4(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfFloat4 fromNativeAddr(long addr) {
|
||||
return new MatOfFloat4(addr);
|
||||
}
|
||||
|
||||
public MatOfFloat4(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfFloat4(float...a) {
|
||||
super();
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
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<Float> 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<ab.length; i++)
|
||||
a[i] = ab[i];
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public List<Float> toList() {
|
||||
float[] a = toArray();
|
||||
Float ab[] = new Float[a.length];
|
||||
for(int i=0; i<a.length; i++)
|
||||
ab[i] = a[i];
|
||||
return Arrays.asList(ab);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class MatOfFloat6 extends Mat {
|
||||
// 32FC6
|
||||
private static final int _depth = CvType.CV_32F;
|
||||
private static final int _channels = 6;
|
||||
|
||||
public MatOfFloat6() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfFloat6(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfFloat6 fromNativeAddr(long addr) {
|
||||
return new MatOfFloat6(addr);
|
||||
}
|
||||
|
||||
public MatOfFloat6(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfFloat6(float...a) {
|
||||
super();
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
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<Float> 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<ab.length; i++)
|
||||
a[i] = ab[i];
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public List<Float> toList() {
|
||||
float[] a = toArray();
|
||||
Float ab[] = new Float[a.length];
|
||||
for(int i=0; i<a.length; i++)
|
||||
ab[i] = a[i];
|
||||
return Arrays.asList(ab);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MatOfInt extends Mat {
|
||||
// 32SC1
|
||||
private static final int _depth = CvType.CV_32S;
|
||||
private static final int _channels = 1;
|
||||
|
||||
public MatOfInt() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfInt(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfInt fromNativeAddr(long addr) {
|
||||
return new MatOfInt(addr);
|
||||
}
|
||||
|
||||
public MatOfInt(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfInt(int...a) {
|
||||
super();
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
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<Integer> 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<ab.length; i++)
|
||||
a[i] = ab[i];
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public List<Integer> toList() {
|
||||
int[] a = toArray();
|
||||
Integer ab[] = new Integer[a.length];
|
||||
for(int i=0; i<a.length; i++)
|
||||
ab[i] = a[i];
|
||||
return Arrays.asList(ab);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MatOfInt4 extends Mat {
|
||||
// 32SC4
|
||||
private static final int _depth = CvType.CV_32S;
|
||||
private static final int _channels = 4;
|
||||
|
||||
public MatOfInt4() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfInt4(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfInt4 fromNativeAddr(long addr) {
|
||||
return new MatOfInt4(addr);
|
||||
}
|
||||
|
||||
public MatOfInt4(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfInt4(int...a) {
|
||||
super();
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
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<Integer> 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<ab.length; i++)
|
||||
a[i] = ab[i];
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public List<Integer> toList() {
|
||||
int[] a = toArray();
|
||||
Integer ab[] = new Integer[a.length];
|
||||
for(int i=0; i<a.length; i++)
|
||||
ab[i] = a[i];
|
||||
return Arrays.asList(ab);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.KeyPoint;
|
||||
|
||||
public class MatOfKeyPoint extends Mat {
|
||||
// 32FC7
|
||||
private static final int _depth = CvType.CV_32F;
|
||||
private static final int _channels = 7;
|
||||
|
||||
public MatOfKeyPoint() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfKeyPoint(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfKeyPoint fromNativeAddr(long addr) {
|
||||
return new MatOfKeyPoint(addr);
|
||||
}
|
||||
|
||||
public MatOfKeyPoint(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfKeyPoint(KeyPoint...a) {
|
||||
super();
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
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<num; i++) {
|
||||
KeyPoint kp = a[i];
|
||||
buff[_channels*i+0] = (float) kp.pt.x;
|
||||
buff[_channels*i+1] = (float) kp.pt.y;
|
||||
buff[_channels*i+2] = kp.size;
|
||||
buff[_channels*i+3] = kp.angle;
|
||||
buff[_channels*i+4] = kp.response;
|
||||
buff[_channels*i+5] = kp.octave;
|
||||
buff[_channels*i+6] = kp.class_id;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
public KeyPoint[] toArray() {
|
||||
int num = (int) total();
|
||||
KeyPoint[] a = new KeyPoint[num];
|
||||
if(num == 0)
|
||||
return a;
|
||||
float buff[] = new float[num * _channels];
|
||||
get(0, 0, buff); //TODO: check ret val!
|
||||
for(int i=0; i<num; i++)
|
||||
a[i] = new KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3],
|
||||
buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] );
|
||||
return a;
|
||||
}
|
||||
|
||||
public void fromList(List<KeyPoint> lkp) {
|
||||
KeyPoint akp[] = lkp.toArray(new KeyPoint[0]);
|
||||
fromArray(akp);
|
||||
}
|
||||
|
||||
public List<KeyPoint> toList() {
|
||||
KeyPoint[] akp = toArray();
|
||||
return Arrays.asList(akp);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
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<num; i++) {
|
||||
Point p = a[i];
|
||||
buff[_channels*i+0] = (int) p.x;
|
||||
buff[_channels*i+1] = (int) p.y;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
public Point[] toArray() {
|
||||
int num = (int) total();
|
||||
Point[] ap = new Point[num];
|
||||
if(num == 0)
|
||||
return ap;
|
||||
int buff[] = new int[num * _channels];
|
||||
get(0, 0, buff); //TODO: check ret val!
|
||||
for(int i=0; i<num; i++)
|
||||
ap[i] = new Point(buff[i*_channels], buff[i*_channels+1]);
|
||||
return ap;
|
||||
}
|
||||
|
||||
public void fromList(List<Point> lp) {
|
||||
Point ap[] = lp.toArray(new Point[0]);
|
||||
fromArray(ap);
|
||||
}
|
||||
|
||||
public List<Point> toList() {
|
||||
Point[] ap = toArray();
|
||||
return Arrays.asList(ap);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
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<num; i++) {
|
||||
Point p = a[i];
|
||||
buff[_channels*i+0] = (float) p.x;
|
||||
buff[_channels*i+1] = (float) p.y;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
public Point[] toArray() {
|
||||
int num = (int) total();
|
||||
Point[] ap = new Point[num];
|
||||
if(num == 0)
|
||||
return ap;
|
||||
float buff[] = new float[num * _channels];
|
||||
get(0, 0, buff); //TODO: check ret val!
|
||||
for(int i=0; i<num; i++)
|
||||
ap[i] = new Point(buff[i*_channels], buff[i*_channels+1]);
|
||||
return ap;
|
||||
}
|
||||
|
||||
public void fromList(List<Point> lp) {
|
||||
Point ap[] = lp.toArray(new Point[0]);
|
||||
fromArray(ap);
|
||||
}
|
||||
|
||||
public List<Point> toList() {
|
||||
Point[] ap = toArray();
|
||||
return Arrays.asList(ap);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
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<num; i++) {
|
||||
Point3 p = a[i];
|
||||
buff[_channels*i+0] = (int) p.x;
|
||||
buff[_channels*i+1] = (int) p.y;
|
||||
buff[_channels*i+2] = (int) p.z;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
public Point3[] toArray() {
|
||||
int num = (int) total();
|
||||
Point3[] ap = new Point3[num];
|
||||
if(num == 0)
|
||||
return ap;
|
||||
int buff[] = new int[num * _channels];
|
||||
get(0, 0, buff); //TODO: check ret val!
|
||||
for(int i=0; i<num; i++)
|
||||
ap[i] = new Point3(buff[i*_channels], buff[i*_channels+1], buff[i*_channels+2]);
|
||||
return ap;
|
||||
}
|
||||
|
||||
public void fromList(List<Point3> lp) {
|
||||
Point3 ap[] = lp.toArray(new Point3[0]);
|
||||
fromArray(ap);
|
||||
}
|
||||
|
||||
public List<Point3> toList() {
|
||||
Point3[] ap = toArray();
|
||||
return Arrays.asList(ap);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
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<num; i++) {
|
||||
Point3 p = a[i];
|
||||
buff[_channels*i+0] = (float) p.x;
|
||||
buff[_channels*i+1] = (float) p.y;
|
||||
buff[_channels*i+2] = (float) p.z;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
public Point3[] toArray() {
|
||||
int num = (int) total();
|
||||
Point3[] ap = new Point3[num];
|
||||
if(num == 0)
|
||||
return ap;
|
||||
float buff[] = new float[num * _channels];
|
||||
get(0, 0, buff); //TODO: check ret val!
|
||||
for(int i=0; i<num; i++)
|
||||
ap[i] = new Point3(buff[i*_channels], buff[i*_channels+1], buff[i*_channels+2]);
|
||||
return ap;
|
||||
}
|
||||
|
||||
public void fromList(List<Point3> lp) {
|
||||
Point3 ap[] = lp.toArray(new Point3[0]);
|
||||
fromArray(ap);
|
||||
}
|
||||
|
||||
public List<Point3> toList() {
|
||||
Point3[] ap = toArray();
|
||||
return Arrays.asList(ap);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
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<num; i++) {
|
||||
Rect r = a[i];
|
||||
buff[_channels*i+0] = (int) r.x;
|
||||
buff[_channels*i+1] = (int) r.y;
|
||||
buff[_channels*i+2] = (int) r.width;
|
||||
buff[_channels*i+3] = (int) r.height;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
|
||||
public Rect[] toArray() {
|
||||
int num = (int) total();
|
||||
Rect[] a = new Rect[num];
|
||||
if(num == 0)
|
||||
return a;
|
||||
int buff[] = new int[num * _channels];
|
||||
get(0, 0, buff); //TODO: check ret val!
|
||||
for(int i=0; i<num; i++)
|
||||
a[i] = new Rect(buff[i*_channels], buff[i*_channels+1], buff[i*_channels+2], buff[i*_channels+3]);
|
||||
return a;
|
||||
}
|
||||
public void fromList(List<Rect> lr) {
|
||||
Rect ap[] = lr.toArray(new Rect[0]);
|
||||
fromArray(ap);
|
||||
}
|
||||
|
||||
public List<Rect> toList() {
|
||||
Rect[] ar = toArray();
|
||||
return Arrays.asList(ar);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MatOfRect2d extends Mat {
|
||||
// 64FC4
|
||||
private static final int _depth = CvType.CV_64F;
|
||||
private static final int _channels = 4;
|
||||
|
||||
public MatOfRect2d() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfRect2d(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfRect2d fromNativeAddr(long addr) {
|
||||
return new MatOfRect2d(addr);
|
||||
}
|
||||
|
||||
public MatOfRect2d(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfRect2d(Rect2d...a) {
|
||||
super();
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
|
||||
}
|
||||
|
||||
public void fromArray(Rect2d...a) {
|
||||
if(a==null || a.length==0)
|
||||
return;
|
||||
int num = a.length;
|
||||
alloc(num);
|
||||
double buff[] = new double[num * _channels];
|
||||
for(int i=0; i<num; i++) {
|
||||
Rect2d r = a[i];
|
||||
buff[_channels*i+0] = (double) r.x;
|
||||
buff[_channels*i+1] = (double) r.y;
|
||||
buff[_channels*i+2] = (double) r.width;
|
||||
buff[_channels*i+3] = (double) r.height;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
|
||||
public Rect2d[] toArray() {
|
||||
int num = (int) total();
|
||||
Rect2d[] a = new Rect2d[num];
|
||||
if(num == 0)
|
||||
return a;
|
||||
double buff[] = new double[num * _channels];
|
||||
get(0, 0, buff); //TODO: check ret val!
|
||||
for(int i=0; i<num; i++)
|
||||
a[i] = new Rect2d(buff[i*_channels], buff[i*_channels+1], buff[i*_channels+2], buff[i*_channels+3]);
|
||||
return a;
|
||||
}
|
||||
public void fromList(List<Rect2d> lr) {
|
||||
Rect2d ap[] = lr.toArray(new Rect2d[0]);
|
||||
fromArray(ap);
|
||||
}
|
||||
|
||||
public List<Rect2d> toList() {
|
||||
Rect2d[] ar = toArray();
|
||||
return Arrays.asList(ar);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.core.RotatedRect;
|
||||
|
||||
|
||||
|
||||
public class MatOfRotatedRect extends Mat {
|
||||
// 32FC5
|
||||
private static final int _depth = CvType.CV_32F;
|
||||
private static final int _channels = 5;
|
||||
|
||||
public MatOfRotatedRect() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected MatOfRotatedRect(long addr) {
|
||||
super(addr);
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public static MatOfRotatedRect fromNativeAddr(long addr) {
|
||||
return new MatOfRotatedRect(addr);
|
||||
}
|
||||
|
||||
public MatOfRotatedRect(Mat m) {
|
||||
super(m, Range.all());
|
||||
if( !empty() && checkVector(_channels, _depth) < 0 )
|
||||
throw new IllegalArgumentException("Incompatible Mat");
|
||||
//FIXME: do we need release() here?
|
||||
}
|
||||
|
||||
public MatOfRotatedRect(RotatedRect...a) {
|
||||
super();
|
||||
fromArray(a);
|
||||
}
|
||||
|
||||
public void alloc(int elemNumber) {
|
||||
if(elemNumber>0)
|
||||
super.create(elemNumber, 1, CvType.makeType(_depth, _channels));
|
||||
}
|
||||
|
||||
public void fromArray(RotatedRect...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<num; i++) {
|
||||
RotatedRect r = a[i];
|
||||
buff[_channels*i+0] = (float) r.center.x;
|
||||
buff[_channels*i+1] = (float) r.center.y;
|
||||
buff[_channels*i+2] = (float) r.size.width;
|
||||
buff[_channels*i+3] = (float) r.size.height;
|
||||
buff[_channels*i+4] = (float) r.angle;
|
||||
}
|
||||
put(0, 0, buff); //TODO: check ret val!
|
||||
}
|
||||
|
||||
public RotatedRect[] toArray() {
|
||||
int num = (int) total();
|
||||
RotatedRect[] a = new RotatedRect[num];
|
||||
if(num == 0)
|
||||
return a;
|
||||
float buff[] = new float[_channels];
|
||||
for(int i=0; i<num; i++) {
|
||||
get(i, 0, buff); //TODO: check ret val!
|
||||
a[i] = new RotatedRect(new Point(buff[0],buff[1]),new Size(buff[2],buff[3]),buff[4]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
public void fromList(List<RotatedRect> lr) {
|
||||
RotatedRect ap[] = lr.toArray(new RotatedRect[0]);
|
||||
fromArray(ap);
|
||||
}
|
||||
|
||||
public List<RotatedRect> toList() {
|
||||
RotatedRect[] ar = toArray();
|
||||
return Arrays.asList(ar);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
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 + "}";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
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 + "}";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
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 + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
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 empty() {
|
||||
return width <= 0 || height <= 0;
|
||||
}
|
||||
|
||||
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 + "}";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
package org.opencv.core;
|
||||
|
||||
//javadoc:Rect2d_
|
||||
public class Rect2d {
|
||||
|
||||
public double x, y, width, height;
|
||||
|
||||
public Rect2d(double x, double y, double width, double height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public Rect2d() {
|
||||
this(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
public Rect2d(Point p1, Point p2) {
|
||||
x = (double) (p1.x < p2.x ? p1.x : p2.x);
|
||||
y = (double) (p1.y < p2.y ? p1.y : p2.y);
|
||||
width = (double) (p1.x > p2.x ? p1.x : p2.x) - x;
|
||||
height = (double) (p1.y > p2.y ? p1.y : p2.y) - y;
|
||||
}
|
||||
|
||||
public Rect2d(Point p, Size s) {
|
||||
this((double) p.x, (double) p.y, (double) s.width, (double) s.height);
|
||||
}
|
||||
|
||||
public Rect2d(double[] vals) {
|
||||
set(vals);
|
||||
}
|
||||
|
||||
public void set(double[] vals) {
|
||||
if (vals != null) {
|
||||
x = vals.length > 0 ? (double) vals[0] : 0;
|
||||
y = vals.length > 1 ? (double) vals[1] : 0;
|
||||
width = vals.length > 2 ? (double) vals[2] : 0;
|
||||
height = vals.length > 3 ? (double) vals[3] : 0;
|
||||
} else {
|
||||
x = 0;
|
||||
y = 0;
|
||||
width = 0;
|
||||
height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public Rect2d clone() {
|
||||
return new Rect2d(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 empty() {
|
||||
return width <= 0 || height <= 0;
|
||||
}
|
||||
|
||||
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 Rect2d)) return false;
|
||||
Rect2d it = (Rect2d) obj;
|
||||
return x == it.x && y == it.y && width == it.width && height == it.height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{" + x + ", " + y + ", " + width + "x" + height + "}";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
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.y = 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 + " }";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
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] + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
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 boolean empty() {
|
||||
return width <= 0 || height <= 0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
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 + "}";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.core;
|
||||
|
||||
|
||||
|
||||
// C++: class TickMeter
|
||||
//javadoc: TickMeter
|
||||
|
||||
public class TickMeter {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected TickMeter(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static TickMeter __fromPtr__(long addr) { return new TickMeter(addr); }
|
||||
|
||||
//
|
||||
// C++: cv::TickMeter::TickMeter()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::TickMeter()
|
||||
public TickMeter()
|
||||
{
|
||||
|
||||
nativeObj = TickMeter_0();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::TickMeter::getTimeMicro()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::getTimeMicro()
|
||||
public double getTimeMicro()
|
||||
{
|
||||
|
||||
double retVal = getTimeMicro_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::TickMeter::getTimeMilli()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::getTimeMilli()
|
||||
public double getTimeMilli()
|
||||
{
|
||||
|
||||
double retVal = getTimeMilli_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::TickMeter::getTimeSec()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::getTimeSec()
|
||||
public double getTimeSec()
|
||||
{
|
||||
|
||||
double retVal = getTimeSec_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int64 cv::TickMeter::getCounter()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::getCounter()
|
||||
public long getCounter()
|
||||
{
|
||||
|
||||
long retVal = getCounter_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int64 cv::TickMeter::getTimeTicks()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::getTimeTicks()
|
||||
public long getTimeTicks()
|
||||
{
|
||||
|
||||
long retVal = getTimeTicks_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::TickMeter::reset()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::reset()
|
||||
public void reset()
|
||||
{
|
||||
|
||||
reset_0(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::TickMeter::start()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::start()
|
||||
public void start()
|
||||
{
|
||||
|
||||
start_0(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::TickMeter::stop()
|
||||
//
|
||||
|
||||
//javadoc: TickMeter::stop()
|
||||
public void stop()
|
||||
{
|
||||
|
||||
stop_0(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: cv::TickMeter::TickMeter()
|
||||
private static native long TickMeter_0();
|
||||
|
||||
// C++: double cv::TickMeter::getTimeMicro()
|
||||
private static native double getTimeMicro_0(long nativeObj);
|
||||
|
||||
// C++: double cv::TickMeter::getTimeMilli()
|
||||
private static native double getTimeMilli_0(long nativeObj);
|
||||
|
||||
// C++: double cv::TickMeter::getTimeSec()
|
||||
private static native double getTimeSec_0(long nativeObj);
|
||||
|
||||
// C++: int64 cv::TickMeter::getCounter()
|
||||
private static native long getCounter_0(long nativeObj);
|
||||
|
||||
// C++: int64 cv::TickMeter::getTimeTicks()
|
||||
private static native long getTimeTicks_0(long nativeObj);
|
||||
|
||||
// C++: void cv::TickMeter::reset()
|
||||
private static native void reset_0(long nativeObj);
|
||||
|
||||
// C++: void cv::TickMeter::start()
|
||||
private static native void start_0(long nativeObj);
|
||||
|
||||
// C++: void cv::TickMeter::stop()
|
||||
private static native void stop_0(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,214 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.dnn;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
// C++: class DictValue
|
||||
//javadoc: DictValue
|
||||
|
||||
public class DictValue {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected DictValue(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static DictValue __fromPtr__(long addr) { return new DictValue(addr); }
|
||||
|
||||
//
|
||||
// C++: cv::dnn::DictValue::DictValue(String s)
|
||||
//
|
||||
|
||||
//javadoc: DictValue::DictValue(s)
|
||||
public DictValue(String s)
|
||||
{
|
||||
|
||||
nativeObj = DictValue_0(s);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: cv::dnn::DictValue::DictValue(double p)
|
||||
//
|
||||
|
||||
//javadoc: DictValue::DictValue(p)
|
||||
public DictValue(double p)
|
||||
{
|
||||
|
||||
nativeObj = DictValue_1(p);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: cv::dnn::DictValue::DictValue(int i)
|
||||
//
|
||||
|
||||
//javadoc: DictValue::DictValue(i)
|
||||
public DictValue(int i)
|
||||
{
|
||||
|
||||
nativeObj = DictValue_2(i);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String cv::dnn::DictValue::getStringValue(int idx = -1)
|
||||
//
|
||||
|
||||
//javadoc: DictValue::getStringValue(idx)
|
||||
public String getStringValue(int idx)
|
||||
{
|
||||
|
||||
String retVal = getStringValue_0(nativeObj, idx);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: DictValue::getStringValue()
|
||||
public String getStringValue()
|
||||
{
|
||||
|
||||
String retVal = getStringValue_1(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::dnn::DictValue::isInt()
|
||||
//
|
||||
|
||||
//javadoc: DictValue::isInt()
|
||||
public boolean isInt()
|
||||
{
|
||||
|
||||
boolean retVal = isInt_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::dnn::DictValue::isReal()
|
||||
//
|
||||
|
||||
//javadoc: DictValue::isReal()
|
||||
public boolean isReal()
|
||||
{
|
||||
|
||||
boolean retVal = isReal_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::dnn::DictValue::isString()
|
||||
//
|
||||
|
||||
//javadoc: DictValue::isString()
|
||||
public boolean isString()
|
||||
{
|
||||
|
||||
boolean retVal = isString_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::dnn::DictValue::getRealValue(int idx = -1)
|
||||
//
|
||||
|
||||
//javadoc: DictValue::getRealValue(idx)
|
||||
public double getRealValue(int idx)
|
||||
{
|
||||
|
||||
double retVal = getRealValue_0(nativeObj, idx);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: DictValue::getRealValue()
|
||||
public double getRealValue()
|
||||
{
|
||||
|
||||
double retVal = getRealValue_1(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::dnn::DictValue::getIntValue(int idx = -1)
|
||||
//
|
||||
|
||||
//javadoc: DictValue::getIntValue(idx)
|
||||
public int getIntValue(int idx)
|
||||
{
|
||||
|
||||
int retVal = getIntValue_0(nativeObj, idx);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: DictValue::getIntValue()
|
||||
public int getIntValue()
|
||||
{
|
||||
|
||||
int retVal = getIntValue_1(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: cv::dnn::DictValue::DictValue(String s)
|
||||
private static native long DictValue_0(String s);
|
||||
|
||||
// C++: cv::dnn::DictValue::DictValue(double p)
|
||||
private static native long DictValue_1(double p);
|
||||
|
||||
// C++: cv::dnn::DictValue::DictValue(int i)
|
||||
private static native long DictValue_2(int i);
|
||||
|
||||
// C++: String cv::dnn::DictValue::getStringValue(int idx = -1)
|
||||
private static native String getStringValue_0(long nativeObj, int idx);
|
||||
private static native String getStringValue_1(long nativeObj);
|
||||
|
||||
// C++: bool cv::dnn::DictValue::isInt()
|
||||
private static native boolean isInt_0(long nativeObj);
|
||||
|
||||
// C++: bool cv::dnn::DictValue::isReal()
|
||||
private static native boolean isReal_0(long nativeObj);
|
||||
|
||||
// C++: bool cv::dnn::DictValue::isString()
|
||||
private static native boolean isString_0(long nativeObj);
|
||||
|
||||
// C++: double cv::dnn::DictValue::getRealValue(int idx = -1)
|
||||
private static native double getRealValue_0(long nativeObj, int idx);
|
||||
private static native double getRealValue_1(long nativeObj);
|
||||
|
||||
// C++: int cv::dnn::DictValue::getIntValue(int idx = -1)
|
||||
private static native int getIntValue_0(long nativeObj, int idx);
|
||||
private static native int getIntValue_1(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,788 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.dnn;
|
||||
|
||||
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.MatOfFloat;
|
||||
import org.opencv.core.MatOfInt;
|
||||
import org.opencv.core.MatOfRect;
|
||||
import org.opencv.core.MatOfRect2d;
|
||||
import org.opencv.core.MatOfRotatedRect;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.dnn.Net;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class Dnn
|
||||
//javadoc: Dnn
|
||||
|
||||
public class Dnn {
|
||||
|
||||
// C++: enum Backend
|
||||
public static final int
|
||||
DNN_BACKEND_DEFAULT = 0,
|
||||
DNN_BACKEND_HALIDE = 1,
|
||||
DNN_BACKEND_INFERENCE_ENGINE = 2,
|
||||
DNN_BACKEND_OPENCV = 3,
|
||||
DNN_BACKEND_VKCOM = 4;
|
||||
|
||||
|
||||
// C++: enum Target
|
||||
public static final int
|
||||
DNN_TARGET_CPU = 0,
|
||||
DNN_TARGET_OPENCL = 1,
|
||||
DNN_TARGET_OPENCL_FP16 = 2,
|
||||
DNN_TARGET_MYRIAD = 3,
|
||||
DNN_TARGET_VULKAN = 4,
|
||||
DNN_TARGET_FPGA = 5;
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::dnn::blobFromImage(Mat image, double scalefactor = 1.0, Size size = Size(), Scalar mean = Scalar(), bool swapRB = false, bool crop = false, int ddepth = CV_32F)
|
||||
//
|
||||
|
||||
//javadoc: blobFromImage(image, scalefactor, size, mean, swapRB, crop, ddepth)
|
||||
public static Mat blobFromImage(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop, int ddepth)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(blobFromImage_0(image.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB, crop, ddepth));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImage(image, scalefactor, size, mean, swapRB, crop)
|
||||
public static Mat blobFromImage(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(blobFromImage_1(image.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB, crop));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImage(image, scalefactor, size, mean, swapRB)
|
||||
public static Mat blobFromImage(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(blobFromImage_2(image.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImage(image, scalefactor, size, mean)
|
||||
public static Mat blobFromImage(Mat image, double scalefactor, Size size, Scalar mean)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(blobFromImage_3(image.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImage(image, scalefactor, size)
|
||||
public static Mat blobFromImage(Mat image, double scalefactor, Size size)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(blobFromImage_4(image.nativeObj, scalefactor, size.width, size.height));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImage(image, scalefactor)
|
||||
public static Mat blobFromImage(Mat image, double scalefactor)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(blobFromImage_5(image.nativeObj, scalefactor));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImage(image)
|
||||
public static Mat blobFromImage(Mat image)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(blobFromImage_6(image.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::dnn::blobFromImages(vector_Mat images, double scalefactor = 1.0, Size size = Size(), Scalar mean = Scalar(), bool swapRB = false, bool crop = false, int ddepth = CV_32F)
|
||||
//
|
||||
|
||||
//javadoc: blobFromImages(images, scalefactor, size, mean, swapRB, crop, ddepth)
|
||||
public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop, int ddepth)
|
||||
{
|
||||
Mat images_mat = Converters.vector_Mat_to_Mat(images);
|
||||
Mat retVal = new Mat(blobFromImages_0(images_mat.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB, crop, ddepth));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImages(images, scalefactor, size, mean, swapRB, crop)
|
||||
public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop)
|
||||
{
|
||||
Mat images_mat = Converters.vector_Mat_to_Mat(images);
|
||||
Mat retVal = new Mat(blobFromImages_1(images_mat.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB, crop));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImages(images, scalefactor, size, mean, swapRB)
|
||||
public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB)
|
||||
{
|
||||
Mat images_mat = Converters.vector_Mat_to_Mat(images);
|
||||
Mat retVal = new Mat(blobFromImages_2(images_mat.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3], swapRB));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImages(images, scalefactor, size, mean)
|
||||
public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size, Scalar mean)
|
||||
{
|
||||
Mat images_mat = Converters.vector_Mat_to_Mat(images);
|
||||
Mat retVal = new Mat(blobFromImages_3(images_mat.nativeObj, scalefactor, size.width, size.height, mean.val[0], mean.val[1], mean.val[2], mean.val[3]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImages(images, scalefactor, size)
|
||||
public static Mat blobFromImages(List<Mat> images, double scalefactor, Size size)
|
||||
{
|
||||
Mat images_mat = Converters.vector_Mat_to_Mat(images);
|
||||
Mat retVal = new Mat(blobFromImages_4(images_mat.nativeObj, scalefactor, size.width, size.height));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImages(images, scalefactor)
|
||||
public static Mat blobFromImages(List<Mat> images, double scalefactor)
|
||||
{
|
||||
Mat images_mat = Converters.vector_Mat_to_Mat(images);
|
||||
Mat retVal = new Mat(blobFromImages_5(images_mat.nativeObj, scalefactor));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: blobFromImages(images)
|
||||
public static Mat blobFromImages(List<Mat> images)
|
||||
{
|
||||
Mat images_mat = Converters.vector_Mat_to_Mat(images);
|
||||
Mat retVal = new Mat(blobFromImages_6(images_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::dnn::readTensorFromONNX(String path)
|
||||
//
|
||||
|
||||
//javadoc: readTensorFromONNX(path)
|
||||
public static Mat readTensorFromONNX(String path)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(readTensorFromONNX_0(path));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::dnn::readTorchBlob(String filename, bool isBinary = true)
|
||||
//
|
||||
|
||||
//javadoc: readTorchBlob(filename, isBinary)
|
||||
public static Mat readTorchBlob(String filename, boolean isBinary)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(readTorchBlob_0(filename, isBinary));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readTorchBlob(filename)
|
||||
public static Mat readTorchBlob(String filename)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(readTorchBlob_1(filename));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNet(String framework, vector_uchar bufferModel, vector_uchar bufferConfig = std::vector<uchar>())
|
||||
//
|
||||
|
||||
//javadoc: readNet(framework, bufferModel, bufferConfig)
|
||||
public static Net readNet(String framework, MatOfByte bufferModel, MatOfByte bufferConfig)
|
||||
{
|
||||
Mat bufferModel_mat = bufferModel;
|
||||
Mat bufferConfig_mat = bufferConfig;
|
||||
Net retVal = new Net(readNet_0(framework, bufferModel_mat.nativeObj, bufferConfig_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNet(framework, bufferModel)
|
||||
public static Net readNet(String framework, MatOfByte bufferModel)
|
||||
{
|
||||
Mat bufferModel_mat = bufferModel;
|
||||
Net retVal = new Net(readNet_1(framework, bufferModel_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNet(String model, String config = "", String framework = "")
|
||||
//
|
||||
|
||||
//javadoc: readNet(model, config, framework)
|
||||
public static Net readNet(String model, String config, String framework)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNet_2(model, config, framework));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNet(model, config)
|
||||
public static Net readNet(String model, String config)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNet_3(model, config));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNet(model)
|
||||
public static Net readNet(String model)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNet_4(model));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromCaffe(String prototxt, String caffeModel = String())
|
||||
//
|
||||
|
||||
//javadoc: readNetFromCaffe(prototxt, caffeModel)
|
||||
public static Net readNetFromCaffe(String prototxt, String caffeModel)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromCaffe_0(prototxt, caffeModel));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNetFromCaffe(prototxt)
|
||||
public static Net readNetFromCaffe(String prototxt)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromCaffe_1(prototxt));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromCaffe(vector_uchar bufferProto, vector_uchar bufferModel = std::vector<uchar>())
|
||||
//
|
||||
|
||||
//javadoc: readNetFromCaffe(bufferProto, bufferModel)
|
||||
public static Net readNetFromCaffe(MatOfByte bufferProto, MatOfByte bufferModel)
|
||||
{
|
||||
Mat bufferProto_mat = bufferProto;
|
||||
Mat bufferModel_mat = bufferModel;
|
||||
Net retVal = new Net(readNetFromCaffe_2(bufferProto_mat.nativeObj, bufferModel_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNetFromCaffe(bufferProto)
|
||||
public static Net readNetFromCaffe(MatOfByte bufferProto)
|
||||
{
|
||||
Mat bufferProto_mat = bufferProto;
|
||||
Net retVal = new Net(readNetFromCaffe_3(bufferProto_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromDarknet(String cfgFile, String darknetModel = String())
|
||||
//
|
||||
|
||||
//javadoc: readNetFromDarknet(cfgFile, darknetModel)
|
||||
public static Net readNetFromDarknet(String cfgFile, String darknetModel)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromDarknet_0(cfgFile, darknetModel));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNetFromDarknet(cfgFile)
|
||||
public static Net readNetFromDarknet(String cfgFile)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromDarknet_1(cfgFile));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromDarknet(vector_uchar bufferCfg, vector_uchar bufferModel = std::vector<uchar>())
|
||||
//
|
||||
|
||||
//javadoc: readNetFromDarknet(bufferCfg, bufferModel)
|
||||
public static Net readNetFromDarknet(MatOfByte bufferCfg, MatOfByte bufferModel)
|
||||
{
|
||||
Mat bufferCfg_mat = bufferCfg;
|
||||
Mat bufferModel_mat = bufferModel;
|
||||
Net retVal = new Net(readNetFromDarknet_2(bufferCfg_mat.nativeObj, bufferModel_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNetFromDarknet(bufferCfg)
|
||||
public static Net readNetFromDarknet(MatOfByte bufferCfg)
|
||||
{
|
||||
Mat bufferCfg_mat = bufferCfg;
|
||||
Net retVal = new Net(readNetFromDarknet_3(bufferCfg_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromModelOptimizer(String xml, String bin)
|
||||
//
|
||||
|
||||
//javadoc: readNetFromModelOptimizer(xml, bin)
|
||||
public static Net readNetFromModelOptimizer(String xml, String bin)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromModelOptimizer_0(xml, bin));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromONNX(String onnxFile)
|
||||
//
|
||||
|
||||
//javadoc: readNetFromONNX(onnxFile)
|
||||
public static Net readNetFromONNX(String onnxFile)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromONNX_0(onnxFile));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromONNX(vector_uchar buffer)
|
||||
//
|
||||
|
||||
//javadoc: readNetFromONNX(buffer)
|
||||
public static Net readNetFromONNX(MatOfByte buffer)
|
||||
{
|
||||
Mat buffer_mat = buffer;
|
||||
Net retVal = new Net(readNetFromONNX_1(buffer_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromTensorflow(String model, String config = String())
|
||||
//
|
||||
|
||||
//javadoc: readNetFromTensorflow(model, config)
|
||||
public static Net readNetFromTensorflow(String model, String config)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromTensorflow_0(model, config));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNetFromTensorflow(model)
|
||||
public static Net readNetFromTensorflow(String model)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromTensorflow_1(model));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromTensorflow(vector_uchar bufferModel, vector_uchar bufferConfig = std::vector<uchar>())
|
||||
//
|
||||
|
||||
//javadoc: readNetFromTensorflow(bufferModel, bufferConfig)
|
||||
public static Net readNetFromTensorflow(MatOfByte bufferModel, MatOfByte bufferConfig)
|
||||
{
|
||||
Mat bufferModel_mat = bufferModel;
|
||||
Mat bufferConfig_mat = bufferConfig;
|
||||
Net retVal = new Net(readNetFromTensorflow_2(bufferModel_mat.nativeObj, bufferConfig_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNetFromTensorflow(bufferModel)
|
||||
public static Net readNetFromTensorflow(MatOfByte bufferModel)
|
||||
{
|
||||
Mat bufferModel_mat = bufferModel;
|
||||
Net retVal = new Net(readNetFromTensorflow_3(bufferModel_mat.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Net cv::dnn::readNetFromTorch(String model, bool isBinary = true, bool evaluate = true)
|
||||
//
|
||||
|
||||
//javadoc: readNetFromTorch(model, isBinary, evaluate)
|
||||
public static Net readNetFromTorch(String model, boolean isBinary, boolean evaluate)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromTorch_0(model, isBinary, evaluate));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNetFromTorch(model, isBinary)
|
||||
public static Net readNetFromTorch(String model, boolean isBinary)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromTorch_1(model, isBinary));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: readNetFromTorch(model)
|
||||
public static Net readNetFromTorch(String model)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readNetFromTorch_2(model));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String cv::dnn::getInferenceEngineVPUType()
|
||||
//
|
||||
|
||||
//javadoc: getInferenceEngineVPUType()
|
||||
public static String getInferenceEngineVPUType()
|
||||
{
|
||||
|
||||
String retVal = getInferenceEngineVPUType_0();
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::NMSBoxes(vector_Rect bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
|
||||
//
|
||||
|
||||
//javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta, top_k)
|
||||
public static void NMSBoxes(MatOfRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxes_0(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta, top_k);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta)
|
||||
public static void NMSBoxes(MatOfRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxes_1(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices)
|
||||
public static void NMSBoxes(MatOfRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxes_2(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::NMSBoxes(vector_Rect2d bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
|
||||
//
|
||||
|
||||
//javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta, top_k)
|
||||
public static void NMSBoxes(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxes_3(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta, top_k);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta)
|
||||
public static void NMSBoxes(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxes_4(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices)
|
||||
public static void NMSBoxes(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxes_5(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::NMSBoxes(vector_RotatedRect bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
|
||||
//
|
||||
|
||||
//javadoc: NMSBoxesRotated(bboxes, scores, score_threshold, nms_threshold, indices, eta, top_k)
|
||||
public static void NMSBoxesRotated(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxesRotated_0(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta, top_k);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: NMSBoxesRotated(bboxes, scores, score_threshold, nms_threshold, indices, eta)
|
||||
public static void NMSBoxesRotated(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxesRotated_1(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj, eta);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: NMSBoxesRotated(bboxes, scores, score_threshold, nms_threshold, indices)
|
||||
public static void NMSBoxesRotated(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices)
|
||||
{
|
||||
Mat bboxes_mat = bboxes;
|
||||
Mat scores_mat = scores;
|
||||
Mat indices_mat = indices;
|
||||
NMSBoxesRotated_2(bboxes_mat.nativeObj, scores_mat.nativeObj, score_threshold, nms_threshold, indices_mat.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::imagesFromBlob(Mat blob_, vector_Mat& images_)
|
||||
//
|
||||
|
||||
//javadoc: imagesFromBlob(blob_, images_)
|
||||
public static void imagesFromBlob(Mat blob_, List<Mat> images_)
|
||||
{
|
||||
Mat images__mat = new Mat();
|
||||
imagesFromBlob_0(blob_.nativeObj, images__mat.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(images__mat, images_);
|
||||
images__mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::resetMyriadDevice()
|
||||
//
|
||||
|
||||
//javadoc: resetMyriadDevice()
|
||||
public static void resetMyriadDevice()
|
||||
{
|
||||
|
||||
resetMyriadDevice_0();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::shrinkCaffeModel(String src, String dst, vector_String layersTypes = std::vector<String>())
|
||||
//
|
||||
|
||||
//javadoc: shrinkCaffeModel(src, dst, layersTypes)
|
||||
public static void shrinkCaffeModel(String src, String dst, List<String> layersTypes)
|
||||
{
|
||||
|
||||
shrinkCaffeModel_0(src, dst, layersTypes);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: shrinkCaffeModel(src, dst)
|
||||
public static void shrinkCaffeModel(String src, String dst)
|
||||
{
|
||||
|
||||
shrinkCaffeModel_1(src, dst);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::writeTextGraph(String model, String output)
|
||||
//
|
||||
|
||||
//javadoc: writeTextGraph(model, output)
|
||||
public static void writeTextGraph(String model, String output)
|
||||
{
|
||||
|
||||
writeTextGraph_0(model, output);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// C++: Mat cv::dnn::blobFromImage(Mat image, double scalefactor = 1.0, Size size = Size(), Scalar mean = Scalar(), bool swapRB = false, bool crop = false, int ddepth = CV_32F)
|
||||
private static native long blobFromImage_0(long image_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, boolean swapRB, boolean crop, int ddepth);
|
||||
private static native long blobFromImage_1(long image_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, boolean swapRB, boolean crop);
|
||||
private static native long blobFromImage_2(long image_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, boolean swapRB);
|
||||
private static native long blobFromImage_3(long image_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3);
|
||||
private static native long blobFromImage_4(long image_nativeObj, double scalefactor, double size_width, double size_height);
|
||||
private static native long blobFromImage_5(long image_nativeObj, double scalefactor);
|
||||
private static native long blobFromImage_6(long image_nativeObj);
|
||||
|
||||
// C++: Mat cv::dnn::blobFromImages(vector_Mat images, double scalefactor = 1.0, Size size = Size(), Scalar mean = Scalar(), bool swapRB = false, bool crop = false, int ddepth = CV_32F)
|
||||
private static native long blobFromImages_0(long images_mat_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, boolean swapRB, boolean crop, int ddepth);
|
||||
private static native long blobFromImages_1(long images_mat_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, boolean swapRB, boolean crop);
|
||||
private static native long blobFromImages_2(long images_mat_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3, boolean swapRB);
|
||||
private static native long blobFromImages_3(long images_mat_nativeObj, double scalefactor, double size_width, double size_height, double mean_val0, double mean_val1, double mean_val2, double mean_val3);
|
||||
private static native long blobFromImages_4(long images_mat_nativeObj, double scalefactor, double size_width, double size_height);
|
||||
private static native long blobFromImages_5(long images_mat_nativeObj, double scalefactor);
|
||||
private static native long blobFromImages_6(long images_mat_nativeObj);
|
||||
|
||||
// C++: Mat cv::dnn::readTensorFromONNX(String path)
|
||||
private static native long readTensorFromONNX_0(String path);
|
||||
|
||||
// C++: Mat cv::dnn::readTorchBlob(String filename, bool isBinary = true)
|
||||
private static native long readTorchBlob_0(String filename, boolean isBinary);
|
||||
private static native long readTorchBlob_1(String filename);
|
||||
|
||||
// C++: Net cv::dnn::readNet(String framework, vector_uchar bufferModel, vector_uchar bufferConfig = std::vector<uchar>())
|
||||
private static native long readNet_0(String framework, long bufferModel_mat_nativeObj, long bufferConfig_mat_nativeObj);
|
||||
private static native long readNet_1(String framework, long bufferModel_mat_nativeObj);
|
||||
|
||||
// C++: Net cv::dnn::readNet(String model, String config = "", String framework = "")
|
||||
private static native long readNet_2(String model, String config, String framework);
|
||||
private static native long readNet_3(String model, String config);
|
||||
private static native long readNet_4(String model);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromCaffe(String prototxt, String caffeModel = String())
|
||||
private static native long readNetFromCaffe_0(String prototxt, String caffeModel);
|
||||
private static native long readNetFromCaffe_1(String prototxt);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromCaffe(vector_uchar bufferProto, vector_uchar bufferModel = std::vector<uchar>())
|
||||
private static native long readNetFromCaffe_2(long bufferProto_mat_nativeObj, long bufferModel_mat_nativeObj);
|
||||
private static native long readNetFromCaffe_3(long bufferProto_mat_nativeObj);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromDarknet(String cfgFile, String darknetModel = String())
|
||||
private static native long readNetFromDarknet_0(String cfgFile, String darknetModel);
|
||||
private static native long readNetFromDarknet_1(String cfgFile);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromDarknet(vector_uchar bufferCfg, vector_uchar bufferModel = std::vector<uchar>())
|
||||
private static native long readNetFromDarknet_2(long bufferCfg_mat_nativeObj, long bufferModel_mat_nativeObj);
|
||||
private static native long readNetFromDarknet_3(long bufferCfg_mat_nativeObj);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromModelOptimizer(String xml, String bin)
|
||||
private static native long readNetFromModelOptimizer_0(String xml, String bin);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromONNX(String onnxFile)
|
||||
private static native long readNetFromONNX_0(String onnxFile);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromONNX(vector_uchar buffer)
|
||||
private static native long readNetFromONNX_1(long buffer_mat_nativeObj);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromTensorflow(String model, String config = String())
|
||||
private static native long readNetFromTensorflow_0(String model, String config);
|
||||
private static native long readNetFromTensorflow_1(String model);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromTensorflow(vector_uchar bufferModel, vector_uchar bufferConfig = std::vector<uchar>())
|
||||
private static native long readNetFromTensorflow_2(long bufferModel_mat_nativeObj, long bufferConfig_mat_nativeObj);
|
||||
private static native long readNetFromTensorflow_3(long bufferModel_mat_nativeObj);
|
||||
|
||||
// C++: Net cv::dnn::readNetFromTorch(String model, bool isBinary = true, bool evaluate = true)
|
||||
private static native long readNetFromTorch_0(String model, boolean isBinary, boolean evaluate);
|
||||
private static native long readNetFromTorch_1(String model, boolean isBinary);
|
||||
private static native long readNetFromTorch_2(String model);
|
||||
|
||||
// C++: String cv::dnn::getInferenceEngineVPUType()
|
||||
private static native String getInferenceEngineVPUType_0();
|
||||
|
||||
// C++: void cv::dnn::NMSBoxes(vector_Rect bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
|
||||
private static native void NMSBoxes_0(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj, float eta, int top_k);
|
||||
private static native void NMSBoxes_1(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj, float eta);
|
||||
private static native void NMSBoxes_2(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj);
|
||||
|
||||
// C++: void cv::dnn::NMSBoxes(vector_Rect2d bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
|
||||
private static native void NMSBoxes_3(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj, float eta, int top_k);
|
||||
private static native void NMSBoxes_4(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj, float eta);
|
||||
private static native void NMSBoxes_5(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj);
|
||||
|
||||
// C++: void cv::dnn::NMSBoxes(vector_RotatedRect bboxes, vector_float scores, float score_threshold, float nms_threshold, vector_int& indices, float eta = 1.f, int top_k = 0)
|
||||
private static native void NMSBoxesRotated_0(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj, float eta, int top_k);
|
||||
private static native void NMSBoxesRotated_1(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj, float eta);
|
||||
private static native void NMSBoxesRotated_2(long bboxes_mat_nativeObj, long scores_mat_nativeObj, float score_threshold, float nms_threshold, long indices_mat_nativeObj);
|
||||
|
||||
// C++: void cv::dnn::imagesFromBlob(Mat blob_, vector_Mat& images_)
|
||||
private static native void imagesFromBlob_0(long blob__nativeObj, long images__mat_nativeObj);
|
||||
|
||||
// C++: void cv::dnn::resetMyriadDevice()
|
||||
private static native void resetMyriadDevice_0();
|
||||
|
||||
// C++: void cv::dnn::shrinkCaffeModel(String src, String dst, vector_String layersTypes = std::vector<String>())
|
||||
private static native void shrinkCaffeModel_0(String src, String dst, List<String> layersTypes);
|
||||
private static native void shrinkCaffeModel_1(String src, String dst);
|
||||
|
||||
// C++: void cv::dnn::writeTextGraph(String model, String output)
|
||||
private static native void writeTextGraph_0(String model, String output);
|
||||
|
||||
}
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.dnn;
|
||||
|
||||
import java.lang.String;
|
||||
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 Layer
|
||||
//javadoc: Layer
|
||||
|
||||
public class Layer extends Algorithm {
|
||||
|
||||
protected Layer(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static Layer __fromPtr__(long addr) { return new Layer(addr); }
|
||||
|
||||
//
|
||||
// C++: int cv::dnn::Layer::outputNameToIndex(String outputName)
|
||||
//
|
||||
|
||||
//javadoc: Layer::outputNameToIndex(outputName)
|
||||
public int outputNameToIndex(String outputName)
|
||||
{
|
||||
|
||||
int retVal = outputNameToIndex_0(nativeObj, outputName);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Layer::finalize(vector_Mat inputs, vector_Mat& outputs)
|
||||
//
|
||||
|
||||
//javadoc: Layer::finalize(inputs, outputs)
|
||||
public void finalize(List<Mat> inputs, List<Mat> outputs)
|
||||
{
|
||||
Mat inputs_mat = Converters.vector_Mat_to_Mat(inputs);
|
||||
Mat outputs_mat = new Mat();
|
||||
finalize_0(nativeObj, inputs_mat.nativeObj, outputs_mat.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(outputs_mat, outputs);
|
||||
outputs_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Layer::run(vector_Mat inputs, vector_Mat& outputs, vector_Mat& internals)
|
||||
//
|
||||
|
||||
//javadoc: Layer::run(inputs, outputs, internals)
|
||||
@Deprecated
|
||||
public void run(List<Mat> inputs, List<Mat> outputs, List<Mat> internals)
|
||||
{
|
||||
Mat inputs_mat = Converters.vector_Mat_to_Mat(inputs);
|
||||
Mat outputs_mat = new Mat();
|
||||
Mat internals_mat = Converters.vector_Mat_to_Mat(internals);
|
||||
run_0(nativeObj, inputs_mat.nativeObj, outputs_mat.nativeObj, internals_mat.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(outputs_mat, outputs);
|
||||
outputs_mat.release();
|
||||
Converters.Mat_to_vector_Mat(internals_mat, internals);
|
||||
internals_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_Mat Layer::blobs
|
||||
//
|
||||
|
||||
//javadoc: Layer::get_blobs()
|
||||
public List<Mat> get_blobs()
|
||||
{
|
||||
List<Mat> retVal = new ArrayList<Mat>();
|
||||
Mat retValMat = new Mat(get_blobs_0(nativeObj));
|
||||
Converters.Mat_to_vector_Mat(retValMat, retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void Layer::blobs
|
||||
//
|
||||
|
||||
//javadoc: Layer::set_blobs(blobs)
|
||||
public void set_blobs(List<Mat> blobs)
|
||||
{
|
||||
Mat blobs_mat = Converters.vector_Mat_to_Mat(blobs);
|
||||
set_blobs_0(nativeObj, blobs_mat.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String Layer::name
|
||||
//
|
||||
|
||||
//javadoc: Layer::get_name()
|
||||
public String get_name()
|
||||
{
|
||||
|
||||
String retVal = get_name_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String Layer::type
|
||||
//
|
||||
|
||||
//javadoc: Layer::get_type()
|
||||
public String get_type()
|
||||
{
|
||||
|
||||
String retVal = get_type_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int Layer::preferableTarget
|
||||
//
|
||||
|
||||
//javadoc: Layer::get_preferableTarget()
|
||||
public int get_preferableTarget()
|
||||
{
|
||||
|
||||
int retVal = get_preferableTarget_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: int cv::dnn::Layer::outputNameToIndex(String outputName)
|
||||
private static native int outputNameToIndex_0(long nativeObj, String outputName);
|
||||
|
||||
// C++: void cv::dnn::Layer::finalize(vector_Mat inputs, vector_Mat& outputs)
|
||||
private static native void finalize_0(long nativeObj, long inputs_mat_nativeObj, long outputs_mat_nativeObj);
|
||||
|
||||
// C++: void cv::dnn::Layer::run(vector_Mat inputs, vector_Mat& outputs, vector_Mat& internals)
|
||||
private static native void run_0(long nativeObj, long inputs_mat_nativeObj, long outputs_mat_nativeObj, long internals_mat_nativeObj);
|
||||
|
||||
// C++: vector_Mat Layer::blobs
|
||||
private static native long get_blobs_0(long nativeObj);
|
||||
|
||||
// C++: void Layer::blobs
|
||||
private static native void set_blobs_0(long nativeObj, long blobs_mat_nativeObj);
|
||||
|
||||
// C++: String Layer::name
|
||||
private static native String get_name_0(long nativeObj);
|
||||
|
||||
// C++: String Layer::type
|
||||
private static native String get_type_0(long nativeObj);
|
||||
|
||||
// C++: int Layer::preferableTarget
|
||||
private static native int get_preferableTarget_0(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,684 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.dnn;
|
||||
|
||||
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.dnn.DictValue;
|
||||
import org.opencv.dnn.Layer;
|
||||
import org.opencv.dnn.Net;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class Net
|
||||
//javadoc: Net
|
||||
|
||||
public class Net {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected Net(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static Net __fromPtr__(long addr) { return new Net(addr); }
|
||||
|
||||
//
|
||||
// C++: cv::dnn::Net::Net()
|
||||
//
|
||||
|
||||
//javadoc: Net::Net()
|
||||
public Net()
|
||||
{
|
||||
|
||||
nativeObj = Net_0();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: AsyncMat cv::dnn::Net::forwardAsync(String outputName = String())
|
||||
//
|
||||
|
||||
// Return type 'AsyncMat' is not supported, skipping the function
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::dnn::Net::forward(String outputName = String())
|
||||
//
|
||||
|
||||
//javadoc: Net::forward(outputName)
|
||||
public Mat forward(String outputName)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(forward_0(nativeObj, outputName));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: Net::forward()
|
||||
public Mat forward()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(forward_1(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::dnn::Net::getParam(LayerId layer, int numParam = 0)
|
||||
//
|
||||
|
||||
//javadoc: Net::getParam(layer, numParam)
|
||||
public Mat getParam(DictValue layer, int numParam)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getParam_0(nativeObj, layer.getNativeObjAddr(), numParam));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: Net::getParam(layer)
|
||||
public Mat getParam(DictValue layer)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getParam_1(nativeObj, layer.getNativeObjAddr()));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Net cv::dnn::Net::readFromModelOptimizer(String xml, String bin)
|
||||
//
|
||||
|
||||
//javadoc: Net::readFromModelOptimizer(xml, bin)
|
||||
public static Net readFromModelOptimizer(String xml, String bin)
|
||||
{
|
||||
|
||||
Net retVal = new Net(readFromModelOptimizer_0(xml, bin));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_Layer cv::dnn::Net::getLayer(LayerId layerId)
|
||||
//
|
||||
|
||||
//javadoc: Net::getLayer(layerId)
|
||||
public Layer getLayer(DictValue layerId)
|
||||
{
|
||||
|
||||
Layer retVal = Layer.__fromPtr__(getLayer_0(nativeObj, layerId.getNativeObjAddr()));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String cv::dnn::Net::dump()
|
||||
//
|
||||
|
||||
//javadoc: Net::dump()
|
||||
public String dump()
|
||||
{
|
||||
|
||||
String retVal = dump_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::dnn::Net::empty()
|
||||
//
|
||||
|
||||
//javadoc: Net::empty()
|
||||
public boolean empty()
|
||||
{
|
||||
|
||||
boolean retVal = empty_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::dnn::Net::getLayerId(String layer)
|
||||
//
|
||||
|
||||
//javadoc: Net::getLayerId(layer)
|
||||
public int getLayerId(String layer)
|
||||
{
|
||||
|
||||
int retVal = getLayerId_0(nativeObj, layer);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::dnn::Net::getLayersCount(String layerType)
|
||||
//
|
||||
|
||||
//javadoc: Net::getLayersCount(layerType)
|
||||
public int getLayersCount(String layerType)
|
||||
{
|
||||
|
||||
int retVal = getLayersCount_0(nativeObj, layerType);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int64 cv::dnn::Net::getFLOPS(MatShape netInputShape)
|
||||
//
|
||||
|
||||
//javadoc: Net::getFLOPS(netInputShape)
|
||||
public long getFLOPS(MatOfInt netInputShape)
|
||||
{
|
||||
Mat netInputShape_mat = netInputShape;
|
||||
long retVal = getFLOPS_0(nativeObj, netInputShape_mat.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int64 cv::dnn::Net::getFLOPS(int layerId, MatShape netInputShape)
|
||||
//
|
||||
|
||||
//javadoc: Net::getFLOPS(layerId, netInputShape)
|
||||
public long getFLOPS(int layerId, MatOfInt netInputShape)
|
||||
{
|
||||
Mat netInputShape_mat = netInputShape;
|
||||
long retVal = getFLOPS_1(nativeObj, layerId, netInputShape_mat.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int64 cv::dnn::Net::getFLOPS(int layerId, vector_MatShape netInputShapes)
|
||||
//
|
||||
|
||||
//javadoc: Net::getFLOPS(layerId, netInputShapes)
|
||||
public long getFLOPS(int layerId, List<MatOfInt> netInputShapes)
|
||||
{
|
||||
|
||||
long retVal = getFLOPS_2(nativeObj, layerId, netInputShapes);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int64 cv::dnn::Net::getFLOPS(vector_MatShape netInputShapes)
|
||||
//
|
||||
|
||||
//javadoc: Net::getFLOPS(netInputShapes)
|
||||
public long getFLOPS(List<MatOfInt> netInputShapes)
|
||||
{
|
||||
|
||||
long retVal = getFLOPS_3(nativeObj, netInputShapes);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int64 cv::dnn::Net::getPerfProfile(vector_double& timings)
|
||||
//
|
||||
|
||||
//javadoc: Net::getPerfProfile(timings)
|
||||
public long getPerfProfile(MatOfDouble timings)
|
||||
{
|
||||
Mat timings_mat = timings;
|
||||
long retVal = getPerfProfile_0(nativeObj, timings_mat.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_String cv::dnn::Net::getLayerNames()
|
||||
//
|
||||
|
||||
//javadoc: Net::getLayerNames()
|
||||
public List<String> getLayerNames()
|
||||
{
|
||||
|
||||
List<String> retVal = getLayerNames_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_String cv::dnn::Net::getUnconnectedOutLayersNames()
|
||||
//
|
||||
|
||||
//javadoc: Net::getUnconnectedOutLayersNames()
|
||||
public List<String> getUnconnectedOutLayersNames()
|
||||
{
|
||||
|
||||
List<String> retVal = getUnconnectedOutLayersNames_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_int cv::dnn::Net::getUnconnectedOutLayers()
|
||||
//
|
||||
|
||||
//javadoc: Net::getUnconnectedOutLayers()
|
||||
public MatOfInt getUnconnectedOutLayers()
|
||||
{
|
||||
|
||||
MatOfInt retVal = MatOfInt.fromNativeAddr(getUnconnectedOutLayers_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::connect(String outPin, String inpPin)
|
||||
//
|
||||
|
||||
//javadoc: Net::connect(outPin, inpPin)
|
||||
public void connect(String outPin, String inpPin)
|
||||
{
|
||||
|
||||
connect_0(nativeObj, outPin, inpPin);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::dumpToFile(String path)
|
||||
//
|
||||
|
||||
//javadoc: Net::dumpToFile(path)
|
||||
public void dumpToFile(String path)
|
||||
{
|
||||
|
||||
dumpToFile_0(nativeObj, path);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::enableFusion(bool fusion)
|
||||
//
|
||||
|
||||
//javadoc: Net::enableFusion(fusion)
|
||||
public void enableFusion(boolean fusion)
|
||||
{
|
||||
|
||||
enableFusion_0(nativeObj, fusion);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::forward(vector_Mat& outputBlobs, String outputName = String())
|
||||
//
|
||||
|
||||
//javadoc: Net::forward(outputBlobs, outputName)
|
||||
public void forward(List<Mat> outputBlobs, String outputName)
|
||||
{
|
||||
Mat outputBlobs_mat = new Mat();
|
||||
forward_2(nativeObj, outputBlobs_mat.nativeObj, outputName);
|
||||
Converters.Mat_to_vector_Mat(outputBlobs_mat, outputBlobs);
|
||||
outputBlobs_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Net::forward(outputBlobs)
|
||||
public void forward(List<Mat> outputBlobs)
|
||||
{
|
||||
Mat outputBlobs_mat = new Mat();
|
||||
forward_3(nativeObj, outputBlobs_mat.nativeObj);
|
||||
Converters.Mat_to_vector_Mat(outputBlobs_mat, outputBlobs);
|
||||
outputBlobs_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::forward(vector_Mat& outputBlobs, vector_String outBlobNames)
|
||||
//
|
||||
|
||||
//javadoc: Net::forward(outputBlobs, outBlobNames)
|
||||
public void forward(List<Mat> outputBlobs, List<String> outBlobNames)
|
||||
{
|
||||
Mat outputBlobs_mat = new Mat();
|
||||
forward_4(nativeObj, outputBlobs_mat.nativeObj, outBlobNames);
|
||||
Converters.Mat_to_vector_Mat(outputBlobs_mat, outputBlobs);
|
||||
outputBlobs_mat.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::forward(vector_vector_Mat& outputBlobs, vector_String outBlobNames)
|
||||
//
|
||||
|
||||
// Unknown type 'vector_vector_Mat' (O), skipping the function
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::getLayerTypes(vector_String& layersTypes)
|
||||
//
|
||||
|
||||
//javadoc: Net::getLayerTypes(layersTypes)
|
||||
public void getLayerTypes(List<String> layersTypes)
|
||||
{
|
||||
|
||||
getLayerTypes_0(nativeObj, layersTypes);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::getLayersShapes(MatShape netInputShape, vector_int& layersIds, vector_vector_MatShape& inLayersShapes, vector_vector_MatShape& outLayersShapes)
|
||||
//
|
||||
|
||||
// Unknown type 'vector_vector_MatShape' (O), skipping the function
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::getLayersShapes(vector_MatShape netInputShapes, vector_int& layersIds, vector_vector_MatShape& inLayersShapes, vector_vector_MatShape& outLayersShapes)
|
||||
//
|
||||
|
||||
// Unknown type 'vector_vector_MatShape' (O), skipping the function
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::getMemoryConsumption(MatShape netInputShape, size_t& weights, size_t& blobs)
|
||||
//
|
||||
|
||||
//javadoc: Net::getMemoryConsumption(netInputShape, weights, blobs)
|
||||
public void getMemoryConsumption(MatOfInt netInputShape, long[] weights, long[] blobs)
|
||||
{
|
||||
Mat netInputShape_mat = netInputShape;
|
||||
double[] weights_out = new double[1];
|
||||
double[] blobs_out = new double[1];
|
||||
getMemoryConsumption_0(nativeObj, netInputShape_mat.nativeObj, weights_out, blobs_out);
|
||||
if(weights!=null) weights[0] = (long)weights_out[0];
|
||||
if(blobs!=null) blobs[0] = (long)blobs_out[0];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::getMemoryConsumption(int layerId, MatShape netInputShape, size_t& weights, size_t& blobs)
|
||||
//
|
||||
|
||||
//javadoc: Net::getMemoryConsumption(layerId, netInputShape, weights, blobs)
|
||||
public void getMemoryConsumption(int layerId, MatOfInt netInputShape, long[] weights, long[] blobs)
|
||||
{
|
||||
Mat netInputShape_mat = netInputShape;
|
||||
double[] weights_out = new double[1];
|
||||
double[] blobs_out = new double[1];
|
||||
getMemoryConsumption_1(nativeObj, layerId, netInputShape_mat.nativeObj, weights_out, blobs_out);
|
||||
if(weights!=null) weights[0] = (long)weights_out[0];
|
||||
if(blobs!=null) blobs[0] = (long)blobs_out[0];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::getMemoryConsumption(int layerId, vector_MatShape netInputShapes, size_t& weights, size_t& blobs)
|
||||
//
|
||||
|
||||
//javadoc: Net::getMemoryConsumption(layerId, netInputShapes, weights, blobs)
|
||||
public void getMemoryConsumption(int layerId, List<MatOfInt> netInputShapes, long[] weights, long[] blobs)
|
||||
{
|
||||
double[] weights_out = new double[1];
|
||||
double[] blobs_out = new double[1];
|
||||
getMemoryConsumption_2(nativeObj, layerId, netInputShapes, weights_out, blobs_out);
|
||||
if(weights!=null) weights[0] = (long)weights_out[0];
|
||||
if(blobs!=null) blobs[0] = (long)blobs_out[0];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::setHalideScheduler(String scheduler)
|
||||
//
|
||||
|
||||
//javadoc: Net::setHalideScheduler(scheduler)
|
||||
public void setHalideScheduler(String scheduler)
|
||||
{
|
||||
|
||||
setHalideScheduler_0(nativeObj, scheduler);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::setInput(Mat blob, String name = "", double scalefactor = 1.0, Scalar mean = Scalar())
|
||||
//
|
||||
|
||||
//javadoc: Net::setInput(blob, name, scalefactor, mean)
|
||||
public void setInput(Mat blob, String name, double scalefactor, Scalar mean)
|
||||
{
|
||||
|
||||
setInput_0(nativeObj, blob.nativeObj, name, scalefactor, mean.val[0], mean.val[1], mean.val[2], mean.val[3]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Net::setInput(blob, name, scalefactor)
|
||||
public void setInput(Mat blob, String name, double scalefactor)
|
||||
{
|
||||
|
||||
setInput_1(nativeObj, blob.nativeObj, name, scalefactor);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Net::setInput(blob, name)
|
||||
public void setInput(Mat blob, String name)
|
||||
{
|
||||
|
||||
setInput_2(nativeObj, blob.nativeObj, name);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: Net::setInput(blob)
|
||||
public void setInput(Mat blob)
|
||||
{
|
||||
|
||||
setInput_3(nativeObj, blob.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::setInputsNames(vector_String inputBlobNames)
|
||||
//
|
||||
|
||||
//javadoc: Net::setInputsNames(inputBlobNames)
|
||||
public void setInputsNames(List<String> inputBlobNames)
|
||||
{
|
||||
|
||||
setInputsNames_0(nativeObj, inputBlobNames);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::setParam(LayerId layer, int numParam, Mat blob)
|
||||
//
|
||||
|
||||
//javadoc: Net::setParam(layer, numParam, blob)
|
||||
public void setParam(DictValue layer, int numParam, Mat blob)
|
||||
{
|
||||
|
||||
setParam_0(nativeObj, layer.getNativeObjAddr(), numParam, blob.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::setPreferableBackend(int backendId)
|
||||
//
|
||||
|
||||
//javadoc: Net::setPreferableBackend(backendId)
|
||||
public void setPreferableBackend(int backendId)
|
||||
{
|
||||
|
||||
setPreferableBackend_0(nativeObj, backendId);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::dnn::Net::setPreferableTarget(int targetId)
|
||||
//
|
||||
|
||||
//javadoc: Net::setPreferableTarget(targetId)
|
||||
public void setPreferableTarget(int targetId)
|
||||
{
|
||||
|
||||
setPreferableTarget_0(nativeObj, targetId);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: cv::dnn::Net::Net()
|
||||
private static native long Net_0();
|
||||
|
||||
// C++: Mat cv::dnn::Net::forward(String outputName = String())
|
||||
private static native long forward_0(long nativeObj, String outputName);
|
||||
private static native long forward_1(long nativeObj);
|
||||
|
||||
// C++: Mat cv::dnn::Net::getParam(LayerId layer, int numParam = 0)
|
||||
private static native long getParam_0(long nativeObj, long layer_nativeObj, int numParam);
|
||||
private static native long getParam_1(long nativeObj, long layer_nativeObj);
|
||||
|
||||
// C++: static Net cv::dnn::Net::readFromModelOptimizer(String xml, String bin)
|
||||
private static native long readFromModelOptimizer_0(String xml, String bin);
|
||||
|
||||
// C++: Ptr_Layer cv::dnn::Net::getLayer(LayerId layerId)
|
||||
private static native long getLayer_0(long nativeObj, long layerId_nativeObj);
|
||||
|
||||
// C++: String cv::dnn::Net::dump()
|
||||
private static native String dump_0(long nativeObj);
|
||||
|
||||
// C++: bool cv::dnn::Net::empty()
|
||||
private static native boolean empty_0(long nativeObj);
|
||||
|
||||
// C++: int cv::dnn::Net::getLayerId(String layer)
|
||||
private static native int getLayerId_0(long nativeObj, String layer);
|
||||
|
||||
// C++: int cv::dnn::Net::getLayersCount(String layerType)
|
||||
private static native int getLayersCount_0(long nativeObj, String layerType);
|
||||
|
||||
// C++: int64 cv::dnn::Net::getFLOPS(MatShape netInputShape)
|
||||
private static native long getFLOPS_0(long nativeObj, long netInputShape_mat_nativeObj);
|
||||
|
||||
// C++: int64 cv::dnn::Net::getFLOPS(int layerId, MatShape netInputShape)
|
||||
private static native long getFLOPS_1(long nativeObj, int layerId, long netInputShape_mat_nativeObj);
|
||||
|
||||
// C++: int64 cv::dnn::Net::getFLOPS(int layerId, vector_MatShape netInputShapes)
|
||||
private static native long getFLOPS_2(long nativeObj, int layerId, List<MatOfInt> netInputShapes);
|
||||
|
||||
// C++: int64 cv::dnn::Net::getFLOPS(vector_MatShape netInputShapes)
|
||||
private static native long getFLOPS_3(long nativeObj, List<MatOfInt> netInputShapes);
|
||||
|
||||
// C++: int64 cv::dnn::Net::getPerfProfile(vector_double& timings)
|
||||
private static native long getPerfProfile_0(long nativeObj, long timings_mat_nativeObj);
|
||||
|
||||
// C++: vector_String cv::dnn::Net::getLayerNames()
|
||||
private static native List<String> getLayerNames_0(long nativeObj);
|
||||
|
||||
// C++: vector_String cv::dnn::Net::getUnconnectedOutLayersNames()
|
||||
private static native List<String> getUnconnectedOutLayersNames_0(long nativeObj);
|
||||
|
||||
// C++: vector_int cv::dnn::Net::getUnconnectedOutLayers()
|
||||
private static native long getUnconnectedOutLayers_0(long nativeObj);
|
||||
|
||||
// C++: void cv::dnn::Net::connect(String outPin, String inpPin)
|
||||
private static native void connect_0(long nativeObj, String outPin, String inpPin);
|
||||
|
||||
// C++: void cv::dnn::Net::dumpToFile(String path)
|
||||
private static native void dumpToFile_0(long nativeObj, String path);
|
||||
|
||||
// C++: void cv::dnn::Net::enableFusion(bool fusion)
|
||||
private static native void enableFusion_0(long nativeObj, boolean fusion);
|
||||
|
||||
// C++: void cv::dnn::Net::forward(vector_Mat& outputBlobs, String outputName = String())
|
||||
private static native void forward_2(long nativeObj, long outputBlobs_mat_nativeObj, String outputName);
|
||||
private static native void forward_3(long nativeObj, long outputBlobs_mat_nativeObj);
|
||||
|
||||
// C++: void cv::dnn::Net::forward(vector_Mat& outputBlobs, vector_String outBlobNames)
|
||||
private static native void forward_4(long nativeObj, long outputBlobs_mat_nativeObj, List<String> outBlobNames);
|
||||
|
||||
// C++: void cv::dnn::Net::getLayerTypes(vector_String& layersTypes)
|
||||
private static native void getLayerTypes_0(long nativeObj, List<String> layersTypes);
|
||||
|
||||
// C++: void cv::dnn::Net::getMemoryConsumption(MatShape netInputShape, size_t& weights, size_t& blobs)
|
||||
private static native void getMemoryConsumption_0(long nativeObj, long netInputShape_mat_nativeObj, double[] weights_out, double[] blobs_out);
|
||||
|
||||
// C++: void cv::dnn::Net::getMemoryConsumption(int layerId, MatShape netInputShape, size_t& weights, size_t& blobs)
|
||||
private static native void getMemoryConsumption_1(long nativeObj, int layerId, long netInputShape_mat_nativeObj, double[] weights_out, double[] blobs_out);
|
||||
|
||||
// C++: void cv::dnn::Net::getMemoryConsumption(int layerId, vector_MatShape netInputShapes, size_t& weights, size_t& blobs)
|
||||
private static native void getMemoryConsumption_2(long nativeObj, int layerId, List<MatOfInt> netInputShapes, double[] weights_out, double[] blobs_out);
|
||||
|
||||
// C++: void cv::dnn::Net::setHalideScheduler(String scheduler)
|
||||
private static native void setHalideScheduler_0(long nativeObj, String scheduler);
|
||||
|
||||
// C++: void cv::dnn::Net::setInput(Mat blob, String name = "", double scalefactor = 1.0, Scalar mean = Scalar())
|
||||
private static native void setInput_0(long nativeObj, long blob_nativeObj, String name, double scalefactor, double mean_val0, double mean_val1, double mean_val2, double mean_val3);
|
||||
private static native void setInput_1(long nativeObj, long blob_nativeObj, String name, double scalefactor);
|
||||
private static native void setInput_2(long nativeObj, long blob_nativeObj, String name);
|
||||
private static native void setInput_3(long nativeObj, long blob_nativeObj);
|
||||
|
||||
// C++: void cv::dnn::Net::setInputsNames(vector_String inputBlobNames)
|
||||
private static native void setInputsNames_0(long nativeObj, List<String> inputBlobNames);
|
||||
|
||||
// C++: void cv::dnn::Net::setParam(LayerId layer, int numParam, Mat blob)
|
||||
private static native void setParam_0(long nativeObj, long layer_nativeObj, int numParam, long blob_nativeObj);
|
||||
|
||||
// C++: void cv::dnn::Net::setPreferableBackend(int backendId)
|
||||
private static native void setPreferableBackend_0(long nativeObj, int backendId);
|
||||
|
||||
// C++: void cv::dnn::Net::setPreferableTarget(int targetId)
|
||||
private static native void setPreferableTarget_0(long nativeObj, int targetId);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import org.opencv.core.Algorithm;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.face.BIF;
|
||||
|
||||
// C++: class BIF
|
||||
//javadoc: BIF
|
||||
|
||||
public class BIF extends Algorithm {
|
||||
|
||||
protected BIF(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BIF __fromPtr__(long addr) { return new BIF(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_BIF cv::face::BIF::create(int num_bands = 8, int num_rotations = 12)
|
||||
//
|
||||
|
||||
//javadoc: BIF::create(num_bands, num_rotations)
|
||||
public static BIF create(int num_bands, int num_rotations)
|
||||
{
|
||||
|
||||
BIF retVal = BIF.__fromPtr__(create_0(num_bands, num_rotations));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: BIF::create(num_bands)
|
||||
public static BIF create(int num_bands)
|
||||
{
|
||||
|
||||
BIF retVal = BIF.__fromPtr__(create_1(num_bands));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: BIF::create()
|
||||
public static BIF create()
|
||||
{
|
||||
|
||||
BIF retVal = BIF.__fromPtr__(create_2());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::BIF::getNumBands()
|
||||
//
|
||||
|
||||
//javadoc: BIF::getNumBands()
|
||||
public int getNumBands()
|
||||
{
|
||||
|
||||
int retVal = getNumBands_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::BIF::getNumRotations()
|
||||
//
|
||||
|
||||
//javadoc: BIF::getNumRotations()
|
||||
public int getNumRotations()
|
||||
{
|
||||
|
||||
int retVal = getNumRotations_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::BIF::compute(Mat image, Mat& features)
|
||||
//
|
||||
|
||||
//javadoc: BIF::compute(image, features)
|
||||
public void compute(Mat image, Mat features)
|
||||
{
|
||||
|
||||
compute_0(nativeObj, image.nativeObj, features.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_BIF cv::face::BIF::create(int num_bands = 8, int num_rotations = 12)
|
||||
private static native long create_0(int num_bands, int num_rotations);
|
||||
private static native long create_1(int num_bands);
|
||||
private static native long create_2();
|
||||
|
||||
// C++: int cv::face::BIF::getNumBands()
|
||||
private static native int getNumBands_0(long nativeObj);
|
||||
|
||||
// C++: int cv::face::BIF::getNumRotations()
|
||||
private static native int getNumRotations_0(long nativeObj);
|
||||
|
||||
// C++: void cv::face::BIF::compute(Mat image, Mat& features)
|
||||
private static native void compute_0(long nativeObj, long image_nativeObj, long features_nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,185 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.face.FaceRecognizer;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class BasicFaceRecognizer
|
||||
//javadoc: BasicFaceRecognizer
|
||||
|
||||
public class BasicFaceRecognizer extends FaceRecognizer {
|
||||
|
||||
protected BasicFaceRecognizer(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BasicFaceRecognizer __fromPtr__(long addr) { return new BasicFaceRecognizer(addr); }
|
||||
|
||||
//
|
||||
// C++: Mat cv::face::BasicFaceRecognizer::getEigenValues()
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::getEigenValues()
|
||||
public Mat getEigenValues()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getEigenValues_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::face::BasicFaceRecognizer::getEigenVectors()
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::getEigenVectors()
|
||||
public Mat getEigenVectors()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getEigenVectors_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::face::BasicFaceRecognizer::getLabels()
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::getLabels()
|
||||
public Mat getLabels()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getLabels_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::face::BasicFaceRecognizer::getMean()
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::getMean()
|
||||
public Mat getMean()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getMean_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::face::BasicFaceRecognizer::getThreshold()
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::getThreshold()
|
||||
public double getThreshold()
|
||||
{
|
||||
|
||||
double retVal = getThreshold_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::BasicFaceRecognizer::getNumComponents()
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::getNumComponents()
|
||||
public int getNumComponents()
|
||||
{
|
||||
|
||||
int retVal = getNumComponents_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_Mat cv::face::BasicFaceRecognizer::getProjections()
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::getProjections()
|
||||
public List<Mat> getProjections()
|
||||
{
|
||||
List<Mat> retVal = new ArrayList<Mat>();
|
||||
Mat retValMat = new Mat(getProjections_0(nativeObj));
|
||||
Converters.Mat_to_vector_Mat(retValMat, retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::BasicFaceRecognizer::setNumComponents(int val)
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::setNumComponents(val)
|
||||
public void setNumComponents(int val)
|
||||
{
|
||||
|
||||
setNumComponents_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::BasicFaceRecognizer::setThreshold(double val)
|
||||
//
|
||||
|
||||
//javadoc: BasicFaceRecognizer::setThreshold(val)
|
||||
public void setThreshold(double val)
|
||||
{
|
||||
|
||||
setThreshold_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: Mat cv::face::BasicFaceRecognizer::getEigenValues()
|
||||
private static native long getEigenValues_0(long nativeObj);
|
||||
|
||||
// C++: Mat cv::face::BasicFaceRecognizer::getEigenVectors()
|
||||
private static native long getEigenVectors_0(long nativeObj);
|
||||
|
||||
// C++: Mat cv::face::BasicFaceRecognizer::getLabels()
|
||||
private static native long getLabels_0(long nativeObj);
|
||||
|
||||
// C++: Mat cv::face::BasicFaceRecognizer::getMean()
|
||||
private static native long getMean_0(long nativeObj);
|
||||
|
||||
// C++: double cv::face::BasicFaceRecognizer::getThreshold()
|
||||
private static native double getThreshold_0(long nativeObj);
|
||||
|
||||
// C++: int cv::face::BasicFaceRecognizer::getNumComponents()
|
||||
private static native int getNumComponents_0(long nativeObj);
|
||||
|
||||
// C++: vector_Mat cv::face::BasicFaceRecognizer::getProjections()
|
||||
private static native long getProjections_0(long nativeObj);
|
||||
|
||||
// C++: void cv::face::BasicFaceRecognizer::setNumComponents(int val)
|
||||
private static native void setNumComponents_0(long nativeObj, int val);
|
||||
|
||||
// C++: void cv::face::BasicFaceRecognizer::setThreshold(double val)
|
||||
private static native void setThreshold_0(long nativeObj, double val);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import org.opencv.face.BasicFaceRecognizer;
|
||||
import org.opencv.face.EigenFaceRecognizer;
|
||||
|
||||
// C++: class EigenFaceRecognizer
|
||||
//javadoc: EigenFaceRecognizer
|
||||
|
||||
public class EigenFaceRecognizer extends BasicFaceRecognizer {
|
||||
|
||||
protected EigenFaceRecognizer(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static EigenFaceRecognizer __fromPtr__(long addr) { return new EigenFaceRecognizer(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_EigenFaceRecognizer cv::face::EigenFaceRecognizer::create(int num_components = 0, double threshold = DBL_MAX)
|
||||
//
|
||||
|
||||
//javadoc: EigenFaceRecognizer::create(num_components, threshold)
|
||||
public static EigenFaceRecognizer create(int num_components, double threshold)
|
||||
{
|
||||
|
||||
EigenFaceRecognizer retVal = EigenFaceRecognizer.__fromPtr__(create_0(num_components, threshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: EigenFaceRecognizer::create(num_components)
|
||||
public static EigenFaceRecognizer create(int num_components)
|
||||
{
|
||||
|
||||
EigenFaceRecognizer retVal = EigenFaceRecognizer.__fromPtr__(create_1(num_components));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: EigenFaceRecognizer::create()
|
||||
public static EigenFaceRecognizer create()
|
||||
{
|
||||
|
||||
EigenFaceRecognizer retVal = EigenFaceRecognizer.__fromPtr__(create_2());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_EigenFaceRecognizer cv::face::EigenFaceRecognizer::create(int num_components = 0, double threshold = DBL_MAX)
|
||||
private static native long create_0(int num_components, double threshold);
|
||||
private static native long create_1(int num_components);
|
||||
private static native long create_2();
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,243 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import java.lang.String;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfPoint2f;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.face.Facemark;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class Face
|
||||
//javadoc: Face
|
||||
|
||||
public class Face {
|
||||
|
||||
//
|
||||
// C++: Ptr_Facemark cv::face::createFacemarkAAM()
|
||||
//
|
||||
|
||||
//javadoc: createFacemarkAAM()
|
||||
public static Facemark createFacemarkAAM()
|
||||
{
|
||||
|
||||
Facemark retVal = Facemark.__fromPtr__(createFacemarkAAM_0());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_Facemark cv::face::createFacemarkKazemi()
|
||||
//
|
||||
|
||||
//javadoc: createFacemarkKazemi()
|
||||
public static Facemark createFacemarkKazemi()
|
||||
{
|
||||
|
||||
Facemark retVal = Facemark.__fromPtr__(createFacemarkKazemi_0());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Ptr_Facemark cv::face::createFacemarkLBF()
|
||||
//
|
||||
|
||||
//javadoc: createFacemarkLBF()
|
||||
public static Facemark createFacemarkLBF()
|
||||
{
|
||||
|
||||
Facemark retVal = Facemark.__fromPtr__(createFacemarkLBF_0());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::face::getFacesHAAR(Mat image, Mat& faces, String face_cascade_name)
|
||||
//
|
||||
|
||||
//javadoc: getFacesHAAR(image, faces, face_cascade_name)
|
||||
public static boolean getFacesHAAR(Mat image, Mat faces, String face_cascade_name)
|
||||
{
|
||||
|
||||
boolean retVal = getFacesHAAR_0(image.nativeObj, faces.nativeObj, face_cascade_name);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::face::loadDatasetList(String imageList, String annotationList, vector_String images, vector_String annotations)
|
||||
//
|
||||
|
||||
//javadoc: loadDatasetList(imageList, annotationList, images, annotations)
|
||||
public static boolean loadDatasetList(String imageList, String annotationList, List<String> images, List<String> annotations)
|
||||
{
|
||||
|
||||
boolean retVal = loadDatasetList_0(imageList, annotationList, images, annotations);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::face::loadFacePoints(String filename, Mat& points, float offset = 0.0f)
|
||||
//
|
||||
|
||||
//javadoc: loadFacePoints(filename, points, offset)
|
||||
public static boolean loadFacePoints(String filename, Mat points, float offset)
|
||||
{
|
||||
|
||||
boolean retVal = loadFacePoints_0(filename, points.nativeObj, offset);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: loadFacePoints(filename, points)
|
||||
public static boolean loadFacePoints(String filename, Mat points)
|
||||
{
|
||||
|
||||
boolean retVal = loadFacePoints_1(filename, points.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::face::loadTrainingData(String filename, vector_String images, Mat& facePoints, char delim = ' ', float offset = 0.0f)
|
||||
//
|
||||
|
||||
//javadoc: loadTrainingData(filename, images, facePoints, delim, offset)
|
||||
public static boolean loadTrainingData(String filename, List<String> images, Mat facePoints, char delim, float offset)
|
||||
{
|
||||
|
||||
boolean retVal = loadTrainingData_0(filename, images, facePoints.nativeObj, delim, offset);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: loadTrainingData(filename, images, facePoints, delim)
|
||||
public static boolean loadTrainingData(String filename, List<String> images, Mat facePoints, char delim)
|
||||
{
|
||||
|
||||
boolean retVal = loadTrainingData_1(filename, images, facePoints.nativeObj, delim);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: loadTrainingData(filename, images, facePoints)
|
||||
public static boolean loadTrainingData(String filename, List<String> images, Mat facePoints)
|
||||
{
|
||||
|
||||
boolean retVal = loadTrainingData_2(filename, images, facePoints.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::face::loadTrainingData(String imageList, String groundTruth, vector_String images, Mat& facePoints, float offset = 0.0f)
|
||||
//
|
||||
|
||||
//javadoc: loadTrainingData(imageList, groundTruth, images, facePoints, offset)
|
||||
public static boolean loadTrainingData(String imageList, String groundTruth, List<String> images, Mat facePoints, float offset)
|
||||
{
|
||||
|
||||
boolean retVal = loadTrainingData_3(imageList, groundTruth, images, facePoints.nativeObj, offset);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: loadTrainingData(imageList, groundTruth, images, facePoints)
|
||||
public static boolean loadTrainingData(String imageList, String groundTruth, List<String> images, Mat facePoints)
|
||||
{
|
||||
|
||||
boolean retVal = loadTrainingData_4(imageList, groundTruth, images, facePoints.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::face::loadTrainingData(vector_String filename, vector_vector_Point2f trainlandmarks, vector_String trainimages)
|
||||
//
|
||||
|
||||
//javadoc: loadTrainingData(filename, trainlandmarks, trainimages)
|
||||
public static boolean loadTrainingData(List<String> filename, List<MatOfPoint2f> trainlandmarks, List<String> trainimages)
|
||||
{
|
||||
List<Mat> trainlandmarks_tmplm = new ArrayList<Mat>((trainlandmarks != null) ? trainlandmarks.size() : 0);
|
||||
Mat trainlandmarks_mat = Converters.vector_vector_Point2f_to_Mat(trainlandmarks, trainlandmarks_tmplm);
|
||||
boolean retVal = loadTrainingData_5(filename, trainlandmarks_mat.nativeObj, trainimages);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::drawFacemarks(Mat& image, Mat points, Scalar color = Scalar(255,0,0))
|
||||
//
|
||||
|
||||
//javadoc: drawFacemarks(image, points, color)
|
||||
public static void drawFacemarks(Mat image, Mat points, Scalar color)
|
||||
{
|
||||
|
||||
drawFacemarks_0(image.nativeObj, points.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: drawFacemarks(image, points)
|
||||
public static void drawFacemarks(Mat image, Mat points)
|
||||
{
|
||||
|
||||
drawFacemarks_1(image.nativeObj, points.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// C++: Ptr_Facemark cv::face::createFacemarkAAM()
|
||||
private static native long createFacemarkAAM_0();
|
||||
|
||||
// C++: Ptr_Facemark cv::face::createFacemarkKazemi()
|
||||
private static native long createFacemarkKazemi_0();
|
||||
|
||||
// C++: Ptr_Facemark cv::face::createFacemarkLBF()
|
||||
private static native long createFacemarkLBF_0();
|
||||
|
||||
// C++: bool cv::face::getFacesHAAR(Mat image, Mat& faces, String face_cascade_name)
|
||||
private static native boolean getFacesHAAR_0(long image_nativeObj, long faces_nativeObj, String face_cascade_name);
|
||||
|
||||
// C++: bool cv::face::loadDatasetList(String imageList, String annotationList, vector_String images, vector_String annotations)
|
||||
private static native boolean loadDatasetList_0(String imageList, String annotationList, List<String> images, List<String> annotations);
|
||||
|
||||
// C++: bool cv::face::loadFacePoints(String filename, Mat& points, float offset = 0.0f)
|
||||
private static native boolean loadFacePoints_0(String filename, long points_nativeObj, float offset);
|
||||
private static native boolean loadFacePoints_1(String filename, long points_nativeObj);
|
||||
|
||||
// C++: bool cv::face::loadTrainingData(String filename, vector_String images, Mat& facePoints, char delim = ' ', float offset = 0.0f)
|
||||
private static native boolean loadTrainingData_0(String filename, List<String> images, long facePoints_nativeObj, char delim, float offset);
|
||||
private static native boolean loadTrainingData_1(String filename, List<String> images, long facePoints_nativeObj, char delim);
|
||||
private static native boolean loadTrainingData_2(String filename, List<String> images, long facePoints_nativeObj);
|
||||
|
||||
// C++: bool cv::face::loadTrainingData(String imageList, String groundTruth, vector_String images, Mat& facePoints, float offset = 0.0f)
|
||||
private static native boolean loadTrainingData_3(String imageList, String groundTruth, List<String> images, long facePoints_nativeObj, float offset);
|
||||
private static native boolean loadTrainingData_4(String imageList, String groundTruth, List<String> images, long facePoints_nativeObj);
|
||||
|
||||
// C++: bool cv::face::loadTrainingData(vector_String filename, vector_vector_Point2f trainlandmarks, vector_String trainimages)
|
||||
private static native boolean loadTrainingData_5(List<String> filename, long trainlandmarks_mat_nativeObj, List<String> trainimages);
|
||||
|
||||
// C++: void cv::face::drawFacemarks(Mat& image, Mat points, Scalar color = Scalar(255,0,0))
|
||||
private static native void drawFacemarks_0(long image_nativeObj, long points_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3);
|
||||
private static native void drawFacemarks_1(long image_nativeObj, long points_nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,207 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import java.lang.String;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.core.Algorithm;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfInt;
|
||||
import org.opencv.face.PredictCollector;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class FaceRecognizer
|
||||
//javadoc: FaceRecognizer
|
||||
|
||||
public class FaceRecognizer extends Algorithm {
|
||||
|
||||
protected FaceRecognizer(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static FaceRecognizer __fromPtr__(long addr) { return new FaceRecognizer(addr); }
|
||||
|
||||
//
|
||||
// C++: String cv::face::FaceRecognizer::getLabelInfo(int label)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::getLabelInfo(label)
|
||||
public String getLabelInfo(int label)
|
||||
{
|
||||
|
||||
String retVal = getLabelInfo_0(nativeObj, label);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::FaceRecognizer::predict(Mat src)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::predict_label(src)
|
||||
public int predict_label(Mat src)
|
||||
{
|
||||
|
||||
int retVal = predict_label_0(nativeObj, src.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_int cv::face::FaceRecognizer::getLabelsByString(String str)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::getLabelsByString(str)
|
||||
public MatOfInt getLabelsByString(String str)
|
||||
{
|
||||
|
||||
MatOfInt retVal = MatOfInt.fromNativeAddr(getLabelsByString_0(nativeObj, str));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::FaceRecognizer::predict(Mat src, Ptr_PredictCollector collector)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::predict_collect(src, collector)
|
||||
public void predict_collect(Mat src, PredictCollector collector)
|
||||
{
|
||||
|
||||
predict_collect_0(nativeObj, src.nativeObj, collector.getNativeObjAddr());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::FaceRecognizer::predict(Mat src, int& label, double& confidence)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::predict(src, label, confidence)
|
||||
public void predict(Mat src, int[] label, double[] confidence)
|
||||
{
|
||||
double[] label_out = new double[1];
|
||||
double[] confidence_out = new double[1];
|
||||
predict_0(nativeObj, src.nativeObj, label_out, confidence_out);
|
||||
if(label!=null) label[0] = (int)label_out[0];
|
||||
if(confidence!=null) confidence[0] = (double)confidence_out[0];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::FaceRecognizer::read(String filename)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::read(filename)
|
||||
public void read(String filename)
|
||||
{
|
||||
|
||||
read_0(nativeObj, filename);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::FaceRecognizer::setLabelInfo(int label, String strInfo)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::setLabelInfo(label, strInfo)
|
||||
public void setLabelInfo(int label, String strInfo)
|
||||
{
|
||||
|
||||
setLabelInfo_0(nativeObj, label, strInfo);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::FaceRecognizer::train(vector_Mat src, Mat labels)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::train(src, labels)
|
||||
public void train(List<Mat> src, Mat labels)
|
||||
{
|
||||
Mat src_mat = Converters.vector_Mat_to_Mat(src);
|
||||
train_0(nativeObj, src_mat.nativeObj, labels.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::FaceRecognizer::update(vector_Mat src, Mat labels)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::update(src, labels)
|
||||
public void update(List<Mat> src, Mat labels)
|
||||
{
|
||||
Mat src_mat = Converters.vector_Mat_to_Mat(src);
|
||||
update_0(nativeObj, src_mat.nativeObj, labels.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::FaceRecognizer::write(String filename)
|
||||
//
|
||||
|
||||
//javadoc: FaceRecognizer::write(filename)
|
||||
public void write(String filename)
|
||||
{
|
||||
|
||||
write_0(nativeObj, filename);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: String cv::face::FaceRecognizer::getLabelInfo(int label)
|
||||
private static native String getLabelInfo_0(long nativeObj, int label);
|
||||
|
||||
// C++: int cv::face::FaceRecognizer::predict(Mat src)
|
||||
private static native int predict_label_0(long nativeObj, long src_nativeObj);
|
||||
|
||||
// C++: vector_int cv::face::FaceRecognizer::getLabelsByString(String str)
|
||||
private static native long getLabelsByString_0(long nativeObj, String str);
|
||||
|
||||
// C++: void cv::face::FaceRecognizer::predict(Mat src, Ptr_PredictCollector collector)
|
||||
private static native void predict_collect_0(long nativeObj, long src_nativeObj, long collector_nativeObj);
|
||||
|
||||
// C++: void cv::face::FaceRecognizer::predict(Mat src, int& label, double& confidence)
|
||||
private static native void predict_0(long nativeObj, long src_nativeObj, double[] label_out, double[] confidence_out);
|
||||
|
||||
// C++: void cv::face::FaceRecognizer::read(String filename)
|
||||
private static native void read_0(long nativeObj, String filename);
|
||||
|
||||
// C++: void cv::face::FaceRecognizer::setLabelInfo(int label, String strInfo)
|
||||
private static native void setLabelInfo_0(long nativeObj, int label, String strInfo);
|
||||
|
||||
// C++: void cv::face::FaceRecognizer::train(vector_Mat src, Mat labels)
|
||||
private static native void train_0(long nativeObj, long src_mat_nativeObj, long labels_nativeObj);
|
||||
|
||||
// C++: void cv::face::FaceRecognizer::update(vector_Mat src, Mat labels)
|
||||
private static native void update_0(long nativeObj, long src_mat_nativeObj, long labels_nativeObj);
|
||||
|
||||
// C++: void cv::face::FaceRecognizer::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);
|
||||
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import java.lang.String;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.core.Algorithm;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfPoint2f;
|
||||
import org.opencv.core.MatOfRect;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class Facemark
|
||||
//javadoc: Facemark
|
||||
|
||||
public class Facemark extends Algorithm {
|
||||
|
||||
protected Facemark(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static Facemark __fromPtr__(long addr) { return new Facemark(addr); }
|
||||
|
||||
//
|
||||
// C++: bool cv::face::Facemark::fit(Mat image, vector_Rect faces, vector_vector_Point2f& landmarks)
|
||||
//
|
||||
|
||||
//javadoc: Facemark::fit(image, faces, landmarks)
|
||||
public boolean fit(Mat image, MatOfRect faces, List<MatOfPoint2f> landmarks)
|
||||
{
|
||||
Mat faces_mat = faces;
|
||||
Mat landmarks_mat = new Mat();
|
||||
boolean retVal = fit_0(nativeObj, image.nativeObj, faces_mat.nativeObj, landmarks_mat.nativeObj);
|
||||
Converters.Mat_to_vector_vector_Point2f(landmarks_mat, landmarks);
|
||||
landmarks_mat.release();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::Facemark::loadModel(String model)
|
||||
//
|
||||
|
||||
//javadoc: Facemark::loadModel(model)
|
||||
public void loadModel(String model)
|
||||
{
|
||||
|
||||
loadModel_0(nativeObj, model);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: bool cv::face::Facemark::fit(Mat image, vector_Rect faces, vector_vector_Point2f& landmarks)
|
||||
private static native boolean fit_0(long nativeObj, long image_nativeObj, long faces_mat_nativeObj, long landmarks_mat_nativeObj);
|
||||
|
||||
// C++: void cv::face::Facemark::loadModel(String model)
|
||||
private static native void loadModel_0(long nativeObj, String model);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
|
||||
|
||||
// C++: class FacemarkAAM
|
||||
//javadoc: FacemarkAAM
|
||||
|
||||
public class FacemarkAAM extends FacemarkTrain {
|
||||
|
||||
protected FacemarkAAM(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static FacemarkAAM __fromPtr__(long addr) { return new FacemarkAAM(addr); }
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
|
||||
|
||||
// C++: class FacemarkKazemi
|
||||
//javadoc: FacemarkKazemi
|
||||
|
||||
public class FacemarkKazemi extends Facemark {
|
||||
|
||||
protected FacemarkKazemi(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static FacemarkKazemi __fromPtr__(long addr) { return new FacemarkKazemi(addr); }
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
|
||||
|
||||
// C++: class FacemarkLBF
|
||||
//javadoc: FacemarkLBF
|
||||
|
||||
public class FacemarkLBF extends FacemarkTrain {
|
||||
|
||||
protected FacemarkLBF(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static FacemarkLBF __fromPtr__(long addr) { return new FacemarkLBF(addr); }
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import org.opencv.face.Facemark;
|
||||
|
||||
// C++: class FacemarkTrain
|
||||
//javadoc: FacemarkTrain
|
||||
|
||||
public class FacemarkTrain extends Facemark {
|
||||
|
||||
protected FacemarkTrain(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static FacemarkTrain __fromPtr__(long addr) { return new FacemarkTrain(addr); }
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import org.opencv.face.BasicFaceRecognizer;
|
||||
import org.opencv.face.FisherFaceRecognizer;
|
||||
|
||||
// C++: class FisherFaceRecognizer
|
||||
//javadoc: FisherFaceRecognizer
|
||||
|
||||
public class FisherFaceRecognizer extends BasicFaceRecognizer {
|
||||
|
||||
protected FisherFaceRecognizer(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static FisherFaceRecognizer __fromPtr__(long addr) { return new FisherFaceRecognizer(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_FisherFaceRecognizer cv::face::FisherFaceRecognizer::create(int num_components = 0, double threshold = DBL_MAX)
|
||||
//
|
||||
|
||||
//javadoc: FisherFaceRecognizer::create(num_components, threshold)
|
||||
public static FisherFaceRecognizer create(int num_components, double threshold)
|
||||
{
|
||||
|
||||
FisherFaceRecognizer retVal = FisherFaceRecognizer.__fromPtr__(create_0(num_components, threshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: FisherFaceRecognizer::create(num_components)
|
||||
public static FisherFaceRecognizer create(int num_components)
|
||||
{
|
||||
|
||||
FisherFaceRecognizer retVal = FisherFaceRecognizer.__fromPtr__(create_1(num_components));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: FisherFaceRecognizer::create()
|
||||
public static FisherFaceRecognizer create()
|
||||
{
|
||||
|
||||
FisherFaceRecognizer retVal = FisherFaceRecognizer.__fromPtr__(create_2());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_FisherFaceRecognizer cv::face::FisherFaceRecognizer::create(int num_components = 0, double threshold = DBL_MAX)
|
||||
private static native long create_0(int num_components, double threshold);
|
||||
private static native long create_1(int num_components);
|
||||
private static native long create_2();
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,304 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.face.FaceRecognizer;
|
||||
import org.opencv.face.LBPHFaceRecognizer;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class LBPHFaceRecognizer
|
||||
//javadoc: LBPHFaceRecognizer
|
||||
|
||||
public class LBPHFaceRecognizer extends FaceRecognizer {
|
||||
|
||||
protected LBPHFaceRecognizer(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static LBPHFaceRecognizer __fromPtr__(long addr) { return new LBPHFaceRecognizer(addr); }
|
||||
|
||||
//
|
||||
// C++: Mat cv::face::LBPHFaceRecognizer::getLabels()
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::getLabels()
|
||||
public Mat getLabels()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getLabels_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_LBPHFaceRecognizer cv::face::LBPHFaceRecognizer::create(int radius = 1, int neighbors = 8, int grid_x = 8, int grid_y = 8, double threshold = DBL_MAX)
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::create(radius, neighbors, grid_x, grid_y, threshold)
|
||||
public static LBPHFaceRecognizer create(int radius, int neighbors, int grid_x, int grid_y, double threshold)
|
||||
{
|
||||
|
||||
LBPHFaceRecognizer retVal = LBPHFaceRecognizer.__fromPtr__(create_0(radius, neighbors, grid_x, grid_y, threshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::create(radius, neighbors, grid_x, grid_y)
|
||||
public static LBPHFaceRecognizer create(int radius, int neighbors, int grid_x, int grid_y)
|
||||
{
|
||||
|
||||
LBPHFaceRecognizer retVal = LBPHFaceRecognizer.__fromPtr__(create_1(radius, neighbors, grid_x, grid_y));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::create(radius, neighbors, grid_x)
|
||||
public static LBPHFaceRecognizer create(int radius, int neighbors, int grid_x)
|
||||
{
|
||||
|
||||
LBPHFaceRecognizer retVal = LBPHFaceRecognizer.__fromPtr__(create_2(radius, neighbors, grid_x));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::create(radius, neighbors)
|
||||
public static LBPHFaceRecognizer create(int radius, int neighbors)
|
||||
{
|
||||
|
||||
LBPHFaceRecognizer retVal = LBPHFaceRecognizer.__fromPtr__(create_3(radius, neighbors));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::create(radius)
|
||||
public static LBPHFaceRecognizer create(int radius)
|
||||
{
|
||||
|
||||
LBPHFaceRecognizer retVal = LBPHFaceRecognizer.__fromPtr__(create_4(radius));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::create()
|
||||
public static LBPHFaceRecognizer create()
|
||||
{
|
||||
|
||||
LBPHFaceRecognizer retVal = LBPHFaceRecognizer.__fromPtr__(create_5());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::face::LBPHFaceRecognizer::getThreshold()
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::getThreshold()
|
||||
public double getThreshold()
|
||||
{
|
||||
|
||||
double retVal = getThreshold_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::LBPHFaceRecognizer::getGridX()
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::getGridX()
|
||||
public int getGridX()
|
||||
{
|
||||
|
||||
int retVal = getGridX_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::LBPHFaceRecognizer::getGridY()
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::getGridY()
|
||||
public int getGridY()
|
||||
{
|
||||
|
||||
int retVal = getGridY_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::LBPHFaceRecognizer::getNeighbors()
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::getNeighbors()
|
||||
public int getNeighbors()
|
||||
{
|
||||
|
||||
int retVal = getNeighbors_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::LBPHFaceRecognizer::getRadius()
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::getRadius()
|
||||
public int getRadius()
|
||||
{
|
||||
|
||||
int retVal = getRadius_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_Mat cv::face::LBPHFaceRecognizer::getHistograms()
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::getHistograms()
|
||||
public List<Mat> getHistograms()
|
||||
{
|
||||
List<Mat> retVal = new ArrayList<Mat>();
|
||||
Mat retValMat = new Mat(getHistograms_0(nativeObj));
|
||||
Converters.Mat_to_vector_Mat(retValMat, retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setGridX(int val)
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::setGridX(val)
|
||||
public void setGridX(int val)
|
||||
{
|
||||
|
||||
setGridX_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setGridY(int val)
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::setGridY(val)
|
||||
public void setGridY(int val)
|
||||
{
|
||||
|
||||
setGridY_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setNeighbors(int val)
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::setNeighbors(val)
|
||||
public void setNeighbors(int val)
|
||||
{
|
||||
|
||||
setNeighbors_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setRadius(int val)
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::setRadius(val)
|
||||
public void setRadius(int val)
|
||||
{
|
||||
|
||||
setRadius_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setThreshold(double val)
|
||||
//
|
||||
|
||||
//javadoc: LBPHFaceRecognizer::setThreshold(val)
|
||||
public void setThreshold(double val)
|
||||
{
|
||||
|
||||
setThreshold_0(nativeObj, val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: Mat cv::face::LBPHFaceRecognizer::getLabels()
|
||||
private static native long getLabels_0(long nativeObj);
|
||||
|
||||
// C++: static Ptr_LBPHFaceRecognizer cv::face::LBPHFaceRecognizer::create(int radius = 1, int neighbors = 8, int grid_x = 8, int grid_y = 8, double threshold = DBL_MAX)
|
||||
private static native long create_0(int radius, int neighbors, int grid_x, int grid_y, double threshold);
|
||||
private static native long create_1(int radius, int neighbors, int grid_x, int grid_y);
|
||||
private static native long create_2(int radius, int neighbors, int grid_x);
|
||||
private static native long create_3(int radius, int neighbors);
|
||||
private static native long create_4(int radius);
|
||||
private static native long create_5();
|
||||
|
||||
// C++: double cv::face::LBPHFaceRecognizer::getThreshold()
|
||||
private static native double getThreshold_0(long nativeObj);
|
||||
|
||||
// C++: int cv::face::LBPHFaceRecognizer::getGridX()
|
||||
private static native int getGridX_0(long nativeObj);
|
||||
|
||||
// C++: int cv::face::LBPHFaceRecognizer::getGridY()
|
||||
private static native int getGridY_0(long nativeObj);
|
||||
|
||||
// C++: int cv::face::LBPHFaceRecognizer::getNeighbors()
|
||||
private static native int getNeighbors_0(long nativeObj);
|
||||
|
||||
// C++: int cv::face::LBPHFaceRecognizer::getRadius()
|
||||
private static native int getRadius_0(long nativeObj);
|
||||
|
||||
// C++: vector_Mat cv::face::LBPHFaceRecognizer::getHistograms()
|
||||
private static native long getHistograms_0(long nativeObj);
|
||||
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setGridX(int val)
|
||||
private static native void setGridX_0(long nativeObj, int val);
|
||||
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setGridY(int val)
|
||||
private static native void setGridY_0(long nativeObj, int val);
|
||||
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setNeighbors(int val)
|
||||
private static native void setNeighbors_0(long nativeObj, int val);
|
||||
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setRadius(int val)
|
||||
private static native void setRadius_0(long nativeObj, int val);
|
||||
|
||||
// C++: void cv::face::LBPHFaceRecognizer::setThreshold(double val)
|
||||
private static native void setThreshold_0(long nativeObj, double val);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import java.lang.String;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.opencv.core.Algorithm;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.face.MACE;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class MACE
|
||||
//javadoc: MACE
|
||||
|
||||
public class MACE extends Algorithm {
|
||||
|
||||
protected MACE(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static MACE __fromPtr__(long addr) { return new MACE(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_MACE cv::face::MACE::create(int IMGSIZE = 64)
|
||||
//
|
||||
|
||||
//javadoc: MACE::create(IMGSIZE)
|
||||
public static MACE create(int IMGSIZE)
|
||||
{
|
||||
|
||||
MACE retVal = MACE.__fromPtr__(create_0(IMGSIZE));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: MACE::create()
|
||||
public static MACE create()
|
||||
{
|
||||
|
||||
MACE retVal = MACE.__fromPtr__(create_1());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_MACE cv::face::MACE::load(String filename, String objname = String())
|
||||
//
|
||||
|
||||
//javadoc: MACE::load(filename, objname)
|
||||
public static MACE load(String filename, String objname)
|
||||
{
|
||||
|
||||
MACE retVal = MACE.__fromPtr__(load_0(filename, objname));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: MACE::load(filename)
|
||||
public static MACE load(String filename)
|
||||
{
|
||||
|
||||
MACE retVal = MACE.__fromPtr__(load_1(filename));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::face::MACE::same(Mat query)
|
||||
//
|
||||
|
||||
//javadoc: MACE::same(query)
|
||||
public boolean same(Mat query)
|
||||
{
|
||||
|
||||
boolean retVal = same_0(nativeObj, query.nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::MACE::salt(String passphrase)
|
||||
//
|
||||
|
||||
//javadoc: MACE::salt(passphrase)
|
||||
public void salt(String passphrase)
|
||||
{
|
||||
|
||||
salt_0(nativeObj, passphrase);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::face::MACE::train(vector_Mat images)
|
||||
//
|
||||
|
||||
//javadoc: MACE::train(images)
|
||||
public void train(List<Mat> images)
|
||||
{
|
||||
Mat images_mat = Converters.vector_Mat_to_Mat(images);
|
||||
train_0(nativeObj, images_mat.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_MACE cv::face::MACE::create(int IMGSIZE = 64)
|
||||
private static native long create_0(int IMGSIZE);
|
||||
private static native long create_1();
|
||||
|
||||
// C++: static Ptr_MACE cv::face::MACE::load(String filename, String objname = String())
|
||||
private static native long load_0(String filename, String objname);
|
||||
private static native long load_1(String filename);
|
||||
|
||||
// C++: bool cv::face::MACE::same(Mat query)
|
||||
private static native boolean same_0(long nativeObj, long query_nativeObj);
|
||||
|
||||
// C++: void cv::face::MACE::salt(String passphrase)
|
||||
private static native void salt_0(long nativeObj, String passphrase);
|
||||
|
||||
// C++: void cv::face::MACE::train(vector_Mat images)
|
||||
private static native void train_0(long nativeObj, long images_mat_nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
|
||||
|
||||
// C++: class PredictCollector
|
||||
//javadoc: PredictCollector
|
||||
|
||||
public class PredictCollector {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected PredictCollector(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static PredictCollector __fromPtr__(long addr) { return new PredictCollector(addr); }
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.face;
|
||||
|
||||
import org.opencv.face.PredictCollector;
|
||||
import org.opencv.face.StandardCollector;
|
||||
|
||||
// C++: class StandardCollector
|
||||
//javadoc: StandardCollector
|
||||
|
||||
public class StandardCollector extends PredictCollector {
|
||||
|
||||
protected StandardCollector(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static StandardCollector __fromPtr__(long addr) { return new StandardCollector(addr); }
|
||||
|
||||
//
|
||||
// C++: static Ptr_StandardCollector cv::face::StandardCollector::create(double threshold = DBL_MAX)
|
||||
//
|
||||
|
||||
//javadoc: StandardCollector::create(threshold)
|
||||
public static StandardCollector create(double threshold)
|
||||
{
|
||||
|
||||
StandardCollector retVal = StandardCollector.__fromPtr__(create_0(threshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: StandardCollector::create()
|
||||
public static StandardCollector create()
|
||||
{
|
||||
|
||||
StandardCollector retVal = StandardCollector.__fromPtr__(create_1());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::face::StandardCollector::getMinDist()
|
||||
//
|
||||
|
||||
//javadoc: StandardCollector::getMinDist()
|
||||
public double getMinDist()
|
||||
{
|
||||
|
||||
double retVal = getMinDist_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::face::StandardCollector::getMinLabel()
|
||||
//
|
||||
|
||||
//javadoc: StandardCollector::getMinLabel()
|
||||
public int getMinLabel()
|
||||
{
|
||||
|
||||
int retVal = getMinLabel_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_pair_int_and_double cv::face::StandardCollector::getResults(bool sorted = false)
|
||||
//
|
||||
|
||||
// Return type 'vector_pair_int_and_double' is not supported, skipping the function
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: static Ptr_StandardCollector cv::face::StandardCollector::create(double threshold = DBL_MAX)
|
||||
private static native long create_0(double threshold);
|
||||
private static native long create_1();
|
||||
|
||||
// C++: double cv::face::StandardCollector::getMinDist()
|
||||
private static native double getMinDist_0(long nativeObj);
|
||||
|
||||
// C++: int cv::face::StandardCollector::getMinLabel()
|
||||
private static native int getMinLabel_0(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,380 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.features2d;
|
||||
|
||||
import java.lang.String;
|
||||
import org.opencv.features2d.AKAZE;
|
||||
import org.opencv.features2d.Feature2D;
|
||||
|
||||
// C++: class AKAZE
|
||||
//javadoc: AKAZE
|
||||
|
||||
public class AKAZE extends Feature2D {
|
||||
|
||||
protected AKAZE(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static AKAZE __fromPtr__(long addr) { return new AKAZE(addr); }
|
||||
|
||||
// C++: enum DescriptorType
|
||||
public static final int
|
||||
DESCRIPTOR_KAZE_UPRIGHT = 2,
|
||||
DESCRIPTOR_KAZE = 3,
|
||||
DESCRIPTOR_MLDB_UPRIGHT = 4,
|
||||
DESCRIPTOR_MLDB = 5;
|
||||
|
||||
|
||||
//
|
||||
// C++: AKAZE_DescriptorType cv::AKAZE::getDescriptorType()
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::getDescriptorType()
|
||||
public int getDescriptorType()
|
||||
{
|
||||
|
||||
int retVal = getDescriptorType_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: KAZE_DiffusivityType cv::AKAZE::getDiffusivity()
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::getDiffusivity()
|
||||
public int getDiffusivity()
|
||||
{
|
||||
|
||||
int retVal = getDiffusivity_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_AKAZE cv::AKAZE::create(AKAZE_DescriptorType descriptor_type = AKAZE::DESCRIPTOR_MLDB, int descriptor_size = 0, int descriptor_channels = 3, float threshold = 0.001f, int nOctaves = 4, int nOctaveLayers = 4, KAZE_DiffusivityType diffusivity = KAZE::DIFF_PM_G2)
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, nOctaveLayers, diffusivity)
|
||||
public static AKAZE create(int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves, int nOctaveLayers, int diffusivity)
|
||||
{
|
||||
|
||||
AKAZE retVal = AKAZE.__fromPtr__(create_0(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, nOctaveLayers, diffusivity));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, nOctaveLayers)
|
||||
public static AKAZE create(int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves, int nOctaveLayers)
|
||||
{
|
||||
|
||||
AKAZE retVal = AKAZE.__fromPtr__(create_1(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, nOctaveLayers));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves)
|
||||
public static AKAZE create(int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves)
|
||||
{
|
||||
|
||||
AKAZE retVal = AKAZE.__fromPtr__(create_2(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold)
|
||||
public static AKAZE create(int descriptor_type, int descriptor_size, int descriptor_channels, float threshold)
|
||||
{
|
||||
|
||||
AKAZE retVal = AKAZE.__fromPtr__(create_3(descriptor_type, descriptor_size, descriptor_channels, threshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels)
|
||||
public static AKAZE create(int descriptor_type, int descriptor_size, int descriptor_channels)
|
||||
{
|
||||
|
||||
AKAZE retVal = AKAZE.__fromPtr__(create_4(descriptor_type, descriptor_size, descriptor_channels));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AKAZE::create(descriptor_type, descriptor_size)
|
||||
public static AKAZE create(int descriptor_type, int descriptor_size)
|
||||
{
|
||||
|
||||
AKAZE retVal = AKAZE.__fromPtr__(create_5(descriptor_type, descriptor_size));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AKAZE::create(descriptor_type)
|
||||
public static AKAZE create(int descriptor_type)
|
||||
{
|
||||
|
||||
AKAZE retVal = AKAZE.__fromPtr__(create_6(descriptor_type));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AKAZE::create()
|
||||
public static AKAZE create()
|
||||
{
|
||||
|
||||
AKAZE retVal = AKAZE.__fromPtr__(create_7());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String cv::AKAZE::getDefaultName()
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::getDefaultName()
|
||||
public String getDefaultName()
|
||||
{
|
||||
|
||||
String retVal = getDefaultName_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: double cv::AKAZE::getThreshold()
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::getThreshold()
|
||||
public double getThreshold()
|
||||
{
|
||||
|
||||
double retVal = getThreshold_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::AKAZE::getDescriptorChannels()
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::getDescriptorChannels()
|
||||
public int getDescriptorChannels()
|
||||
{
|
||||
|
||||
int retVal = getDescriptorChannels_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::AKAZE::getDescriptorSize()
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::getDescriptorSize()
|
||||
public int getDescriptorSize()
|
||||
{
|
||||
|
||||
int retVal = getDescriptorSize_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::AKAZE::getNOctaveLayers()
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::getNOctaveLayers()
|
||||
public int getNOctaveLayers()
|
||||
{
|
||||
|
||||
int retVal = getNOctaveLayers_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::AKAZE::getNOctaves()
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::getNOctaves()
|
||||
public int getNOctaves()
|
||||
{
|
||||
|
||||
int retVal = getNOctaves_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AKAZE::setDescriptorChannels(int dch)
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::setDescriptorChannels(dch)
|
||||
public void setDescriptorChannels(int dch)
|
||||
{
|
||||
|
||||
setDescriptorChannels_0(nativeObj, dch);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AKAZE::setDescriptorSize(int dsize)
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::setDescriptorSize(dsize)
|
||||
public void setDescriptorSize(int dsize)
|
||||
{
|
||||
|
||||
setDescriptorSize_0(nativeObj, dsize);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AKAZE::setDescriptorType(AKAZE_DescriptorType dtype)
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::setDescriptorType(dtype)
|
||||
public void setDescriptorType(int dtype)
|
||||
{
|
||||
|
||||
setDescriptorType_0(nativeObj, dtype);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AKAZE::setDiffusivity(KAZE_DiffusivityType diff)
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::setDiffusivity(diff)
|
||||
public void setDiffusivity(int diff)
|
||||
{
|
||||
|
||||
setDiffusivity_0(nativeObj, diff);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AKAZE::setNOctaveLayers(int octaveLayers)
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::setNOctaveLayers(octaveLayers)
|
||||
public void setNOctaveLayers(int octaveLayers)
|
||||
{
|
||||
|
||||
setNOctaveLayers_0(nativeObj, octaveLayers);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AKAZE::setNOctaves(int octaves)
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::setNOctaves(octaves)
|
||||
public void setNOctaves(int octaves)
|
||||
{
|
||||
|
||||
setNOctaves_0(nativeObj, octaves);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AKAZE::setThreshold(double threshold)
|
||||
//
|
||||
|
||||
//javadoc: AKAZE::setThreshold(threshold)
|
||||
public void setThreshold(double threshold)
|
||||
{
|
||||
|
||||
setThreshold_0(nativeObj, threshold);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: AKAZE_DescriptorType cv::AKAZE::getDescriptorType()
|
||||
private static native int getDescriptorType_0(long nativeObj);
|
||||
|
||||
// C++: KAZE_DiffusivityType cv::AKAZE::getDiffusivity()
|
||||
private static native int getDiffusivity_0(long nativeObj);
|
||||
|
||||
// C++: static Ptr_AKAZE cv::AKAZE::create(AKAZE_DescriptorType descriptor_type = AKAZE::DESCRIPTOR_MLDB, int descriptor_size = 0, int descriptor_channels = 3, float threshold = 0.001f, int nOctaves = 4, int nOctaveLayers = 4, KAZE_DiffusivityType diffusivity = KAZE::DIFF_PM_G2)
|
||||
private static native long create_0(int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves, int nOctaveLayers, int diffusivity);
|
||||
private static native long create_1(int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves, int nOctaveLayers);
|
||||
private static native long create_2(int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves);
|
||||
private static native long create_3(int descriptor_type, int descriptor_size, int descriptor_channels, float threshold);
|
||||
private static native long create_4(int descriptor_type, int descriptor_size, int descriptor_channels);
|
||||
private static native long create_5(int descriptor_type, int descriptor_size);
|
||||
private static native long create_6(int descriptor_type);
|
||||
private static native long create_7();
|
||||
|
||||
// C++: String cv::AKAZE::getDefaultName()
|
||||
private static native String getDefaultName_0(long nativeObj);
|
||||
|
||||
// C++: double cv::AKAZE::getThreshold()
|
||||
private static native double getThreshold_0(long nativeObj);
|
||||
|
||||
// C++: int cv::AKAZE::getDescriptorChannels()
|
||||
private static native int getDescriptorChannels_0(long nativeObj);
|
||||
|
||||
// C++: int cv::AKAZE::getDescriptorSize()
|
||||
private static native int getDescriptorSize_0(long nativeObj);
|
||||
|
||||
// C++: int cv::AKAZE::getNOctaveLayers()
|
||||
private static native int getNOctaveLayers_0(long nativeObj);
|
||||
|
||||
// C++: int cv::AKAZE::getNOctaves()
|
||||
private static native int getNOctaves_0(long nativeObj);
|
||||
|
||||
// C++: void cv::AKAZE::setDescriptorChannels(int dch)
|
||||
private static native void setDescriptorChannels_0(long nativeObj, int dch);
|
||||
|
||||
// C++: void cv::AKAZE::setDescriptorSize(int dsize)
|
||||
private static native void setDescriptorSize_0(long nativeObj, int dsize);
|
||||
|
||||
// C++: void cv::AKAZE::setDescriptorType(AKAZE_DescriptorType dtype)
|
||||
private static native void setDescriptorType_0(long nativeObj, int dtype);
|
||||
|
||||
// C++: void cv::AKAZE::setDiffusivity(KAZE_DiffusivityType diff)
|
||||
private static native void setDiffusivity_0(long nativeObj, int diff);
|
||||
|
||||
// C++: void cv::AKAZE::setNOctaveLayers(int octaveLayers)
|
||||
private static native void setNOctaveLayers_0(long nativeObj, int octaveLayers);
|
||||
|
||||
// C++: void cv::AKAZE::setNOctaves(int octaves)
|
||||
private static native void setNOctaves_0(long nativeObj, int octaves);
|
||||
|
||||
// C++: void cv::AKAZE::setThreshold(double threshold)
|
||||
private static native void setThreshold_0(long nativeObj, double threshold);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,210 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.features2d;
|
||||
|
||||
import java.lang.String;
|
||||
import org.opencv.features2d.AgastFeatureDetector;
|
||||
import org.opencv.features2d.Feature2D;
|
||||
|
||||
// C++: class AgastFeatureDetector
|
||||
//javadoc: AgastFeatureDetector
|
||||
|
||||
public class AgastFeatureDetector extends Feature2D {
|
||||
|
||||
protected AgastFeatureDetector(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static AgastFeatureDetector __fromPtr__(long addr) { return new AgastFeatureDetector(addr); }
|
||||
|
||||
// C++: enum <unnamed>
|
||||
public static final int
|
||||
THRESHOLD = 10000,
|
||||
NONMAX_SUPPRESSION = 10001;
|
||||
|
||||
|
||||
// C++: enum DetectorType
|
||||
public static final int
|
||||
AGAST_5_8 = 0,
|
||||
AGAST_7_12d = 1,
|
||||
AGAST_7_12s = 2,
|
||||
OAST_9_16 = 3;
|
||||
|
||||
|
||||
//
|
||||
// C++: AgastFeatureDetector_DetectorType cv::AgastFeatureDetector::getType()
|
||||
//
|
||||
|
||||
//javadoc: AgastFeatureDetector::getType()
|
||||
public int getType()
|
||||
{
|
||||
|
||||
int retVal = getType_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_AgastFeatureDetector cv::AgastFeatureDetector::create(int threshold = 10, bool nonmaxSuppression = true, AgastFeatureDetector_DetectorType type = AgastFeatureDetector::OAST_9_16)
|
||||
//
|
||||
|
||||
//javadoc: AgastFeatureDetector::create(threshold, nonmaxSuppression, type)
|
||||
public static AgastFeatureDetector create(int threshold, boolean nonmaxSuppression, int type)
|
||||
{
|
||||
|
||||
AgastFeatureDetector retVal = AgastFeatureDetector.__fromPtr__(create_0(threshold, nonmaxSuppression, type));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AgastFeatureDetector::create(threshold, nonmaxSuppression)
|
||||
public static AgastFeatureDetector create(int threshold, boolean nonmaxSuppression)
|
||||
{
|
||||
|
||||
AgastFeatureDetector retVal = AgastFeatureDetector.__fromPtr__(create_1(threshold, nonmaxSuppression));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AgastFeatureDetector::create(threshold)
|
||||
public static AgastFeatureDetector create(int threshold)
|
||||
{
|
||||
|
||||
AgastFeatureDetector retVal = AgastFeatureDetector.__fromPtr__(create_2(threshold));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: AgastFeatureDetector::create()
|
||||
public static AgastFeatureDetector create()
|
||||
{
|
||||
|
||||
AgastFeatureDetector retVal = AgastFeatureDetector.__fromPtr__(create_3());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: String cv::AgastFeatureDetector::getDefaultName()
|
||||
//
|
||||
|
||||
//javadoc: AgastFeatureDetector::getDefaultName()
|
||||
public String getDefaultName()
|
||||
{
|
||||
|
||||
String retVal = getDefaultName_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: bool cv::AgastFeatureDetector::getNonmaxSuppression()
|
||||
//
|
||||
|
||||
//javadoc: AgastFeatureDetector::getNonmaxSuppression()
|
||||
public boolean getNonmaxSuppression()
|
||||
{
|
||||
|
||||
boolean retVal = getNonmaxSuppression_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::AgastFeatureDetector::getThreshold()
|
||||
//
|
||||
|
||||
//javadoc: AgastFeatureDetector::getThreshold()
|
||||
public int getThreshold()
|
||||
{
|
||||
|
||||
int retVal = getThreshold_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AgastFeatureDetector::setNonmaxSuppression(bool f)
|
||||
//
|
||||
|
||||
//javadoc: AgastFeatureDetector::setNonmaxSuppression(f)
|
||||
public void setNonmaxSuppression(boolean f)
|
||||
{
|
||||
|
||||
setNonmaxSuppression_0(nativeObj, f);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AgastFeatureDetector::setThreshold(int threshold)
|
||||
//
|
||||
|
||||
//javadoc: AgastFeatureDetector::setThreshold(threshold)
|
||||
public void setThreshold(int threshold)
|
||||
{
|
||||
|
||||
setThreshold_0(nativeObj, threshold);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::AgastFeatureDetector::setType(AgastFeatureDetector_DetectorType type)
|
||||
//
|
||||
|
||||
//javadoc: AgastFeatureDetector::setType(type)
|
||||
public void setType(int type)
|
||||
{
|
||||
|
||||
setType_0(nativeObj, type);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: AgastFeatureDetector_DetectorType cv::AgastFeatureDetector::getType()
|
||||
private static native int getType_0(long nativeObj);
|
||||
|
||||
// C++: static Ptr_AgastFeatureDetector cv::AgastFeatureDetector::create(int threshold = 10, bool nonmaxSuppression = true, AgastFeatureDetector_DetectorType type = AgastFeatureDetector::OAST_9_16)
|
||||
private static native long create_0(int threshold, boolean nonmaxSuppression, int type);
|
||||
private static native long create_1(int threshold, boolean nonmaxSuppression);
|
||||
private static native long create_2(int threshold);
|
||||
private static native long create_3();
|
||||
|
||||
// C++: String cv::AgastFeatureDetector::getDefaultName()
|
||||
private static native String getDefaultName_0(long nativeObj);
|
||||
|
||||
// C++: bool cv::AgastFeatureDetector::getNonmaxSuppression()
|
||||
private static native boolean getNonmaxSuppression_0(long nativeObj);
|
||||
|
||||
// C++: int cv::AgastFeatureDetector::getThreshold()
|
||||
private static native int getThreshold_0(long nativeObj);
|
||||
|
||||
// C++: void cv::AgastFeatureDetector::setNonmaxSuppression(bool f)
|
||||
private static native void setNonmaxSuppression_0(long nativeObj, boolean f);
|
||||
|
||||
// C++: void cv::AgastFeatureDetector::setThreshold(int threshold)
|
||||
private static native void setThreshold_0(long nativeObj, int threshold);
|
||||
|
||||
// C++: void cv::AgastFeatureDetector::setType(AgastFeatureDetector_DetectorType type)
|
||||
private static native void setType_0(long nativeObj, int type);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.features2d;
|
||||
|
||||
import org.opencv.features2d.BFMatcher;
|
||||
import org.opencv.features2d.DescriptorMatcher;
|
||||
|
||||
// C++: class BFMatcher
|
||||
//javadoc: BFMatcher
|
||||
|
||||
public class BFMatcher extends DescriptorMatcher {
|
||||
|
||||
protected BFMatcher(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BFMatcher __fromPtr__(long addr) { return new BFMatcher(addr); }
|
||||
|
||||
//
|
||||
// C++: cv::BFMatcher::BFMatcher(int normType = NORM_L2, bool crossCheck = false)
|
||||
//
|
||||
|
||||
//javadoc: BFMatcher::BFMatcher(normType, crossCheck)
|
||||
public BFMatcher(int normType, boolean crossCheck)
|
||||
{
|
||||
|
||||
super( BFMatcher_0(normType, crossCheck) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: BFMatcher::BFMatcher(normType)
|
||||
public BFMatcher(int normType)
|
||||
{
|
||||
|
||||
super( BFMatcher_1(normType) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: BFMatcher::BFMatcher()
|
||||
public BFMatcher()
|
||||
{
|
||||
|
||||
super( BFMatcher_2() );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: static Ptr_BFMatcher cv::BFMatcher::create(int normType = NORM_L2, bool crossCheck = false)
|
||||
//
|
||||
|
||||
//javadoc: BFMatcher::create(normType, crossCheck)
|
||||
public static BFMatcher create(int normType, boolean crossCheck)
|
||||
{
|
||||
|
||||
BFMatcher retVal = BFMatcher.__fromPtr__(create_0(normType, crossCheck));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: BFMatcher::create(normType)
|
||||
public static BFMatcher create(int normType)
|
||||
{
|
||||
|
||||
BFMatcher retVal = BFMatcher.__fromPtr__(create_1(normType));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//javadoc: BFMatcher::create()
|
||||
public static BFMatcher create()
|
||||
{
|
||||
|
||||
BFMatcher retVal = BFMatcher.__fromPtr__(create_2());
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: cv::BFMatcher::BFMatcher(int normType = NORM_L2, bool crossCheck = false)
|
||||
private static native long BFMatcher_0(int normType, boolean crossCheck);
|
||||
private static native long BFMatcher_1(int normType);
|
||||
private static native long BFMatcher_2();
|
||||
|
||||
// C++: static Ptr_BFMatcher cv::BFMatcher::create(int normType = NORM_L2, bool crossCheck = false)
|
||||
private static native long create_0(int normType, boolean crossCheck);
|
||||
private static native long create_1(int normType);
|
||||
private static native long create_2();
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
//
|
||||
// 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.MatOfKeyPoint;
|
||||
import org.opencv.utils.Converters;
|
||||
|
||||
// C++: class BOWImgDescriptorExtractor
|
||||
//javadoc: BOWImgDescriptorExtractor
|
||||
|
||||
public class BOWImgDescriptorExtractor {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected BOWImgDescriptorExtractor(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static BOWImgDescriptorExtractor __fromPtr__(long addr) { return new BOWImgDescriptorExtractor(addr); }
|
||||
|
||||
//
|
||||
// C++: cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor(Ptr_DescriptorExtractor dextractor, Ptr_DescriptorMatcher dmatcher)
|
||||
//
|
||||
|
||||
// Unknown type 'Ptr_DescriptorExtractor' (I), skipping the function
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::BOWImgDescriptorExtractor::getVocabulary()
|
||||
//
|
||||
|
||||
//javadoc: BOWImgDescriptorExtractor::getVocabulary()
|
||||
public Mat getVocabulary()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(getVocabulary_0(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::BOWImgDescriptorExtractor::descriptorSize()
|
||||
//
|
||||
|
||||
//javadoc: BOWImgDescriptorExtractor::descriptorSize()
|
||||
public int descriptorSize()
|
||||
{
|
||||
|
||||
int retVal = descriptorSize_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::BOWImgDescriptorExtractor::descriptorType()
|
||||
//
|
||||
|
||||
//javadoc: BOWImgDescriptorExtractor::descriptorType()
|
||||
public int descriptorType()
|
||||
{
|
||||
|
||||
int retVal = descriptorType_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::BOWImgDescriptorExtractor::compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor)
|
||||
//
|
||||
|
||||
//javadoc: BOWImgDescriptorExtractor::compute(image, keypoints, imgDescriptor)
|
||||
public void compute(Mat image, MatOfKeyPoint keypoints, Mat imgDescriptor)
|
||||
{
|
||||
Mat keypoints_mat = keypoints;
|
||||
compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, imgDescriptor.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::BOWImgDescriptorExtractor::setVocabulary(Mat vocabulary)
|
||||
//
|
||||
|
||||
//javadoc: BOWImgDescriptorExtractor::setVocabulary(vocabulary)
|
||||
public void setVocabulary(Mat vocabulary)
|
||||
{
|
||||
|
||||
setVocabulary_0(nativeObj, vocabulary.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: Mat cv::BOWImgDescriptorExtractor::getVocabulary()
|
||||
private static native long getVocabulary_0(long nativeObj);
|
||||
|
||||
// C++: int cv::BOWImgDescriptorExtractor::descriptorSize()
|
||||
private static native int descriptorSize_0(long nativeObj);
|
||||
|
||||
// C++: int cv::BOWImgDescriptorExtractor::descriptorType()
|
||||
private static native int descriptorType_0(long nativeObj);
|
||||
|
||||
// C++: void cv::BOWImgDescriptorExtractor::compute2(Mat image, vector_KeyPoint keypoints, Mat& imgDescriptor)
|
||||
private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long imgDescriptor_nativeObj);
|
||||
|
||||
// C++: void cv::BOWImgDescriptorExtractor::setVocabulary(Mat vocabulary)
|
||||
private static native void setVocabulary_0(long nativeObj, long vocabulary_nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
//
|
||||
// This file is auto-generated. Please don't modify it!
|
||||
//
|
||||
package org.opencv.features2d;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.TermCriteria;
|
||||
import org.opencv.features2d.BOWTrainer;
|
||||
|
||||
// C++: class BOWKMeansTrainer
|
||||
//javadoc: BOWKMeansTrainer
|
||||
|
||||
public class BOWKMeansTrainer extends BOWTrainer {
|
||||
|
||||
protected BOWKMeansTrainer(long addr) { super(addr); }
|
||||
|
||||
// internal usage only
|
||||
public static BOWKMeansTrainer __fromPtr__(long addr) { return new BOWKMeansTrainer(addr); }
|
||||
|
||||
//
|
||||
// C++: cv::BOWKMeansTrainer::BOWKMeansTrainer(int clusterCount, TermCriteria termcrit = TermCriteria(), int attempts = 3, int flags = KMEANS_PP_CENTERS)
|
||||
//
|
||||
|
||||
//javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount, termcrit, attempts, flags)
|
||||
public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit, int attempts, int flags)
|
||||
{
|
||||
|
||||
super( BOWKMeansTrainer_0(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon, attempts, flags) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount, termcrit, attempts)
|
||||
public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit, int attempts)
|
||||
{
|
||||
|
||||
super( BOWKMeansTrainer_1(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon, attempts) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount, termcrit)
|
||||
public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit)
|
||||
{
|
||||
|
||||
super( BOWKMeansTrainer_2(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//javadoc: BOWKMeansTrainer::BOWKMeansTrainer(clusterCount)
|
||||
public BOWKMeansTrainer(int clusterCount)
|
||||
{
|
||||
|
||||
super( BOWKMeansTrainer_3(clusterCount) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::BOWKMeansTrainer::cluster(Mat descriptors)
|
||||
//
|
||||
|
||||
//javadoc: BOWKMeansTrainer::cluster(descriptors)
|
||||
public Mat cluster(Mat descriptors)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(cluster_0(nativeObj, descriptors.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::BOWKMeansTrainer::cluster()
|
||||
//
|
||||
|
||||
//javadoc: BOWKMeansTrainer::cluster()
|
||||
public Mat cluster()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(cluster_1(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: cv::BOWKMeansTrainer::BOWKMeansTrainer(int clusterCount, TermCriteria termcrit = TermCriteria(), int attempts = 3, int flags = KMEANS_PP_CENTERS)
|
||||
private static native long BOWKMeansTrainer_0(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon, int attempts, int flags);
|
||||
private static native long BOWKMeansTrainer_1(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon, int attempts);
|
||||
private static native long BOWKMeansTrainer_2(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon);
|
||||
private static native long BOWKMeansTrainer_3(int clusterCount);
|
||||
|
||||
// C++: Mat cv::BOWKMeansTrainer::cluster(Mat descriptors)
|
||||
private static native long cluster_0(long nativeObj, long descriptors_nativeObj);
|
||||
|
||||
// C++: Mat cv::BOWKMeansTrainer::cluster()
|
||||
private static native long cluster_1(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
//
|
||||
// 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.utils.Converters;
|
||||
|
||||
// C++: class BOWTrainer
|
||||
//javadoc: BOWTrainer
|
||||
|
||||
public class BOWTrainer {
|
||||
|
||||
protected final long nativeObj;
|
||||
protected BOWTrainer(long addr) { nativeObj = addr; }
|
||||
|
||||
public long getNativeObjAddr() { return nativeObj; }
|
||||
|
||||
// internal usage only
|
||||
public static BOWTrainer __fromPtr__(long addr) { return new BOWTrainer(addr); }
|
||||
|
||||
//
|
||||
// C++: Mat cv::BOWTrainer::cluster(Mat descriptors)
|
||||
//
|
||||
|
||||
//javadoc: BOWTrainer::cluster(descriptors)
|
||||
public Mat cluster(Mat descriptors)
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(cluster_0(nativeObj, descriptors.nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: Mat cv::BOWTrainer::cluster()
|
||||
//
|
||||
|
||||
//javadoc: BOWTrainer::cluster()
|
||||
public Mat cluster()
|
||||
{
|
||||
|
||||
Mat retVal = new Mat(cluster_1(nativeObj));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: int cv::BOWTrainer::descriptorsCount()
|
||||
//
|
||||
|
||||
//javadoc: BOWTrainer::descriptorsCount()
|
||||
public int descriptorsCount()
|
||||
{
|
||||
|
||||
int retVal = descriptorsCount_0(nativeObj);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: vector_Mat cv::BOWTrainer::getDescriptors()
|
||||
//
|
||||
|
||||
//javadoc: BOWTrainer::getDescriptors()
|
||||
public List<Mat> getDescriptors()
|
||||
{
|
||||
List<Mat> retVal = new ArrayList<Mat>();
|
||||
Mat retValMat = new Mat(getDescriptors_0(nativeObj));
|
||||
Converters.Mat_to_vector_Mat(retValMat, retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::BOWTrainer::add(Mat descriptors)
|
||||
//
|
||||
|
||||
//javadoc: BOWTrainer::add(descriptors)
|
||||
public void add(Mat descriptors)
|
||||
{
|
||||
|
||||
add_0(nativeObj, descriptors.nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// C++: void cv::BOWTrainer::clear()
|
||||
//
|
||||
|
||||
//javadoc: BOWTrainer::clear()
|
||||
public void clear()
|
||||
{
|
||||
|
||||
clear_0(nativeObj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativeObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// C++: Mat cv::BOWTrainer::cluster(Mat descriptors)
|
||||
private static native long cluster_0(long nativeObj, long descriptors_nativeObj);
|
||||
|
||||
// C++: Mat cv::BOWTrainer::cluster()
|
||||
private static native long cluster_1(long nativeObj);
|
||||
|
||||
// C++: int cv::BOWTrainer::descriptorsCount()
|
||||
private static native int descriptorsCount_0(long nativeObj);
|
||||
|
||||
// C++: vector_Mat cv::BOWTrainer::getDescriptors()
|
||||
private static native long getDescriptors_0(long nativeObj);
|
||||
|
||||
// C++: void cv::BOWTrainer::add(Mat descriptors)
|
||||
private static native void add_0(long nativeObj, long descriptors_nativeObj);
|
||||
|
||||
// C++: void cv::BOWTrainer::clear()
|
||||
private static native void clear_0(long nativeObj);
|
||||
|
||||
// native support for java finalize()
|
||||
private static native void delete(long nativeObj);
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue