當前位置: 首頁>>代碼示例>>Java>>正文


Java OpenCVLoader類代碼示例

本文整理匯總了Java中org.opencv.android.OpenCVLoader的典型用法代碼示例。如果您正苦於以下問題:Java OpenCVLoader類的具體用法?Java OpenCVLoader怎麽用?Java OpenCVLoader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OpenCVLoader類屬於org.opencv.android包,在下文中一共展示了OpenCVLoader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onResume

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
protected void onResume() {
    super.onResume();

    if (opMode == null)
        return;

    if (!OpenCVLoader.initDebug()) {
        Log.d("OpenCV", "Internal OpenCV library not found. Using OpenCV Manager for initialization");
        boolean success = OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, openCVLoaderCallback);
        if (!success)
            Log.e("OpenCV", "Asynchronous initialization failed!");
        else
            Log.d("OpenCV", "Asynchronous initialization succeeded!");
    } else {
        Log.d("OpenCV", "OpenCV library found inside package. Using it!");
        openCVLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
    }
}
 
開發者ID:ykarim,項目名稱:FTC2016,代碼行數:20,代碼來源:VisionEnabledActivity.java

示例2: onResume

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
public void onResume()
{
    super.onResume();
    if (!OpenCVLoader.initDebug()) {
        Log.d("OpenCV", "Internal OpenCV library not found. Using OpenCV Manager for initialization");
        OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback);
    } else {
        Log.d("OpenCV", "OpenCV library found inside package. Using it!");
        mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
    }

    FaceConsumer consumer = new FaceConsumer(faceProcessQueue);
    mProcessThread = new Thread(consumer);
    mProcessThread.start();
    System.out.println("faceConsumer has been started");
}
 
開發者ID:spacejake,項目名稱:android-age-estimator,代碼行數:18,代碼來源:MainActivity.java

示例3: onCreate

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    imageView = (ImageView)findViewById(R.id.image_view);

    OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_2_0, this, mOpenCVCallBack);

    if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)
            != PackageManager.PERMISSION_GRANTED) {
        Log.i("permission", "request READ_EXTERNAL_STORAGE");
        ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
                REQUEST_READ_EXTERNAL_STORAGE);
    }else {
        Log.i("permission", "READ_EXTERNAL_STORAGE already granted");
        read_external_storage_granted = true;
    }
}
 
開發者ID:johnhany,項目名稱:MOAAP,代碼行數:20,代碼來源:MainActivity.java

示例4: startCamera

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
private void startCamera()
    {
        final String funcName = "startCamera";

        if (cameraEnabled)
        {
            if (!OpenCVLoader.initDebug())
            {
                tracer.traceInfo(
                        funcName,
                        "Internal OpenCV library not found, using OpenCV Manager for initialization");
                OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, activity, loaderCallback);
            }
            else
            {
                tracer.traceInfo(funcName, "OpenCV library found inside package, use it!");
                loaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
            }
//            setCameraDisplayOrientation(activity, Camera.CameraInfo.CAMERA_FACING_FRONT);
//            cameraPreview.onResume();
        }
    }
 
開發者ID:trc492,項目名稱:FtcSamples,代碼行數:23,代碼來源:FtcTestOpenCv.java

示例5: onCreate

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mRobotConnection = new VisionRobotConnection(this);
    mRobotConnection.start();

    mPreferences = new VisionAlgorithmPreferences(this);
    mRobotConnectionBroadcastReceiver = new RobotConnectionStatusBroadcastReceiver(this, this);

    if (!OpenCVLoader.initDebug()) {
        Log.e(this.getClass().getSimpleName(), "  OpenCVLoader.initDebug(), not working.");
    } else {
        Log.d(this.getClass().getSimpleName(), "  OpenCVLoader.initDebug(), working.");
    }

    setContentView(R.layout.activity_snobot_vision_gl);

    openCamera();
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:21,代碼來源:SnobotVisionGLActivity.java

示例6: configOpenCv

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
/**
 * Config OpenCV (config callback and init OpenCV).
 * When OpenCV is ready, it starts monitoring.
 */
private void configOpenCv() {
    // OpenCV callback
    BaseLoaderCallback loaderCallback = new BaseLoaderCallback(this) {
        @Override
        public void onManagerConnected(final int status) {
            if (status == LoaderCallbackInterface.SUCCESS) {
                openCvLoaded = true;
                startMonitoring();
            } else {
                super.onManagerConnected(status);
            }
        }
    };
    // Init openCV
    OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_2_0, this, loaderCallback);
}
 
開發者ID:davidmigloz,項目名稱:go-bees,代碼行數:21,代碼來源:MonitoringService.java

示例7: onCreate

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		incremented = 0;
		facesNumber = 0;
		eyesNumber = 0;
		mouthNumber = 0;
		faceDetect = false;
		eyesDetect = false;
		mouthDetect = false;
		brightDetect = false;
		lowerLimit1 = 0;
		lowerLimit2 = 0;
		upperLimit1 = 400;
		upperLimit2 = 400;
		brightness = 0;
		
		setContentView(R.layout.main);
//		mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
		OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_6, this, mLoaderCallback);
		
	}
 
開發者ID:F4b1-,項目名稱:Pixtern-Library,代碼行數:23,代碼來源:ValidateUploadActivity.java

示例8: onResume

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
public void onResume()
{
	super.onResume();

	// Load default libopencv_java.so
	if (OpenCVLoader.initDebug())
	{
		Toast.makeText(getApplicationContext(), "Libraries Loaded!", Toast.LENGTH_SHORT).show();

		if (mLoaderCallback != null)
		{
			mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
		}
	}
	else
	{
		Toast.makeText(getApplicationContext(), "failed to load libraries", Toast.LENGTH_SHORT).show();
	}

	// Usual OpenCV Loader
	// OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback);
}
 
開發者ID:jaredsburrows,項目名稱:open-quartz,代碼行數:24,代碼來源:FdActivity.java

示例9: onResume

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
public void onResume() {
    super.onResume();
    if (!OpenCVLoader.initDebug()) {
        OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_2_0,
                this, mLoaderCallback);
    } else {
        mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
    }
}
 
開發者ID:vulovicv23,項目名稱:opencv-documentscanner-android,代碼行數:11,代碼來源:OpenCvCamera.java

示例10: onResume

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
public void onResume()
{
    super.onResume();
    if (!OpenCVLoader.initDebug()) {
        Log.d(TAG, "Internal OpenCV library not found. Using OpenCV Manager for initialization");
        OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback);
    } else {
        Log.d(TAG, "OpenCV library found inside package. Using it!");
        mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
    }
}
 
開發者ID:yippeesoft,項目名稱:NotifyTools,代碼行數:13,代碼來源:FdActivity.java

示例11: onResume

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
public boolean onResume() {
    if (!hasCamera(activity)) {
        Toast.makeText(activity,
                activity.getString(R.string.camera_unavailable_toast_message),
                Toast.LENGTH_LONG).show();
        return false;
    }
    if (camera == null) {
        camera = Camera.open(findBackFacingCamera());
        Picture = getPictureCallback();
        cameraPreview.refreshCamera(camera);
    }
    OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5, activity, mLoaderCallback);
    return true;
}
 
開發者ID:PawelTypiak,項目名稱:Checkerboard-IMU-Comparator,代碼行數:16,代碼來源:CameraInitializer.java

示例12: initializeOpenCVLibrary

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
private void initializeOpenCVLibrary() {
    if (!OpenCVLoader.initDebug()) {
        Log.e(this.getClass().getSimpleName(), "  OpenCVLoader.initDebug(), not working.");
    } else {
        Log.d(this.getClass().getSimpleName(), "  OpenCVLoader.initDebug(), working.");
    }
}
 
開發者ID:PawelTypiak,項目名稱:Checkerboard-IMU-Comparator,代碼行數:8,代碼來源:MainActivity.java

示例13: onResume

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
protected void onResume() {
    super.onResume();
    Log.e(TAG, "onResume");
    initPresenter();
    if (!OpenCVLoader.initDebug()) {
        Log.d(TAG, "Internal OpenCV library not found. Using OpenCV Manager for initialization");
        OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, presenter.getLoader(getApplicationContext(), openCvCameraView));
    } else {
        Log.d(TAG, "OpenCV library found inside package. Using it!");
        presenter.getLoader(getApplicationContext(), openCvCameraView).onManagerConnected(LoaderCallbackInterface.SUCCESS);
    }
}
 
開發者ID:raulh82vlc,項目名稱:Image-Detection-Samples,代碼行數:14,代碼來源:FDOpenCVActivity.java

示例14: init

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
protected void init() {
    addAccessibilityServiceDelegates();
    registerActivityLifecycleCallbacks();
    InputEventObserver.initGlobal(mContext);
    OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_13, mContext, new BaseLoaderCallback(mContext) {
    });
}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:8,代碼來源:AutoJs.java

示例15: onResume

import org.opencv.android.OpenCVLoader; //導入依賴的package包/類
@Override
public void onResume()
{
    super.onResume();
    if (!OpenCVLoader.initDebug()) {
        Log.d(TAG, "Internal OpenCV library not found. Using OpenCV Manager for initialization");
        OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback);
    } else {
        Log.d(TAG, "OpenCV library found inside package. Using it!");
        mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
    }
    init();
    CameraProcessActivity.this.processState = false;
}
 
開發者ID:Sanahm,項目名稱:SudoCAM-Ku,代碼行數:15,代碼來源:CameraProcessActivity.java


注:本文中的org.opencv.android.OpenCVLoader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。