1 / 15
文档名称:

opencv for android官方教程.docx

格式:docx   大小:200KB   页数:15页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

opencv for android官方教程.docx

上传人:老狐狸 2022/6/12 文件大小:200 KB

下载得到文件列表

opencv for android官方教程.docx

相关文档

文档介绍

文档介绍:Android Development with OpenCV
This tutorial has been created to help you use OpenCV library within your Android pable, . emulator, developer board, etc, you can install it manually using adb tool. See How to select the proper version of OpenCV Managefror details.
There is a very base code snippet implementing the async initialization. It shows basic principles. See the “15-puzzle” OpenCV sample for details.
1 public class Sample1Java extends Activity implements 2 CvCameraViewListener {
3
4 private BaseLoaderCallback mLoaderCallback = new 5 BaseLoaderCallback(this) {
***@Override
public void onManagerConnected(int status) {
switch (status) {
9
case :
10
{
11
(TAG, “OpenCV loaded successfully“);
12
();
13
} break;
14
default:
15
{
16
(status);
17
} break;
18
}
19
}
20
};
21
***@Override
public void onResume() 24 {
();
(, 27 this, mLoaderCallback);
28 }
...
}
It this case application works with OpenCV Manager in asynchronous fashion. OnManagerConnected callback will be called in UI thread, when initialization finishes. Please note, that it is not allowed to use OpenCV calls or load OpenCV-dependent native libs before invoking this callback. Load your own native libraries that depend on OpenCV after the successful OpenCV initialization. Default BaseLoaderCallback implementation treat application context as Activity and calls () method to exit in case of initialization failure. To override this behavior you need to override finish() method of BaseLoaderCallback class and implement your own finalization method.
Application Development with Static Initialization
According to this approach all OpenCV binaries are included into your application package. It is designed