当前位置: 首页>>代码示例>>Java>>正文


Java OpenCVLoader.initAsync方法代码示例

本文整理汇总了Java中org.opencv.android.OpenCVLoader.initAsync方法的典型用法代码示例。如果您正苦于以下问题:Java OpenCVLoader.initAsync方法的具体用法?Java OpenCVLoader.initAsync怎么用?Java OpenCVLoader.initAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opencv.android.OpenCVLoader的用法示例。


在下文中一共展示了OpenCVLoader.initAsync方法的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:TheBigBombman,项目名称:RobotIGS,代码行数: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: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例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);
    }
    init();
    CameraProcessActivity.this.processState = false;
}
 
开发者ID:Sanahm,项目名称:SudoCAM-Ku,代码行数:15,代码来源:CameraProcessActivity.java

示例11: onCreate

import org.opencv.android.OpenCVLoader; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.activity_main);

    if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CAMERA)
            != PackageManager.PERMISSION_GRANTED) {
        Log.i("permission", "request CAMERA");
        ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CAMERA}, REQUEST_CAMERA);
    }else {
        Log.i("permission", "CAMERA already granted");
        camera_granted = true;
    }
    if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)
            != PackageManager.PERMISSION_GRANTED) {
        Log.i("permission", "request EXTERNAL_STROAGE");
        ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_EXTERNAL_STROAGE);
    }else {
        Log.i("permission", "EXTERNAL_STROAGE already granted");
        read_external_storage_granted = true;
    }

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

    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.java_surface_view);
    mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
    mOpenCvCameraView.setCvCameraViewListener(this);

    Log.d("OCR", "onCreate done");

}
 
开发者ID:johnhany,项目名称:MOAAP,代码行数:35,代码来源:MainActivity.java

示例12: onResume

import org.opencv.android.OpenCVLoader; //导入方法依赖的package包/类
public void onResume ( )
 {
 	super.onResume();
 	Log.i( TAG , "Trying to load OpenCV library");
	 
if ( !OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mOpenCVCallBack ) )
{
 Log.e( TAG , "Cannot connect to OpenCV Manager");
}
 }
 
开发者ID:informramiz,项目名称:Android-Face-Recognition,代码行数:11,代码来源:HelloJni.java

示例13: onResume

import org.opencv.android.OpenCVLoader; //导入方法依赖的package包/类
@Override
protected 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);
    }
    JniManager.start();
    mOpenCvCameraView.enableView();
}
 
开发者ID:uelordi01,项目名称:Android-opencv-native-samples,代码行数:14,代码来源:MainActivity.java

示例14: 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_2_4_10, this, mLoaderCallback);
    } else {
        Log.d(TAG, "OpenCV library found inside package. Using it!");
        mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
    }
}
 
开发者ID:jocstech,项目名称:AndroidCameraSudokuSolver,代码行数:12,代码来源:ShowCameraActivity.java

示例15: onResume

import org.opencv.android.OpenCVLoader; //导入方法依赖的package包/类
@Override
protected 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_2_0, this, mLoaderCallback);
  } else {
    Log.d(TAG, "OpenCV library found inside package. Using it!");
    mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
  }
  RobotLog.vv(TAG, "onResume()");
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:13,代码来源:FtcRobotControllerActivity.java


注:本文中的org.opencv.android.OpenCVLoader.initAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。