Opencv interface 中的BaseLOaderCallback
来源:互联网 发布:知乎 电脑版 编辑:程序博客网 时间:2024/05/22 00:31
Base Loader Callback Interface Implementation
- class BaseLoaderCallback
Basic implementation of LoaderCallbackInterface. Logic of this implementation iswell-described by the following scheme:
Using in Java Activity
There is a very base code snippet implementing the async initialization with BaseLoaderCallback.See the “15-puzzle” OpenCV sample for details.
1 2 3 4 5 6 7 8 910111213141516171819202122232425262728293031323334
public class MyActivity extends Activity implements HelperCallbackInterface{private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) { @Override public void onManagerConnected(int status) { switch (status) { case LoaderCallbackInterface.SUCCESS: { Log.i(TAG, "OpenCV loaded successfully"); // Create and set View mView = new puzzle15View(mAppContext); setContentView(mView); } break; default: { super.onManagerConnected(status); } break; } }};/** Call on every application resume **/@Overrideprotected void onResume(){ Log.i(TAG, "Called onResume"); super.onResume(); Log.i(TAG, "Trying to load OpenCV library"); if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_4, this, mOpenCVCallBack)) { Log.e(TAG, "Cannot connect to OpenCV Manager"); }}
Using in Service
Default BaseLoaderCallback implementation treats application context asActivity and callsActivity.finish() method to exit in case of initialization failure.To override this behavior you need to overridefinish() method of BaseLoaderCallback classand implement your own finalization method.
0 0
- Opencv interface 中的BaseLOaderCallback
- BaseLoaderCallback
- C#中的interface
- C#中的interface
- Java中的Interface
- java中的interface理解
- java中的interface
- JAVA中的接口interface
- java中的interface
- java中的接口interface
- Java中的Interface
- 在.m中的@interface
- Golang中的interface
- java中的interface
- m文件中的@interface
- java中的interface接口
- go中的interface
- SV中的interface
- iOS零散知识点
- android启动过程及各个镜像间的关系
- 虚拟化平台proxmox集群和HA配置
- org.codehaus.jackson.map.JsonMappingException: No serializer found for class org.hibernate.proxy....
- mybatis从入门到精通
- Opencv interface 中的BaseLOaderCallback
- HTML,JSP DOCTYPE 的重要性
- Volley框架 以及 设置request超时时间
- ArcGIS 教程:Spatial Analyst 扩展模块中的分析
- linux进程的睡眠和唤醒
- 验证控件
- 获取选择文本内容[转]
- Spring错误:java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- Ubuntu 14.04 为 root 帐号开启 SSH 登录