简体   繁体   English

Android Studio OpenCV NDK:未指定错误,未实现该功能

[英]Android Studio OpenCV NDK: Unspecified error, The function is not implemented

I write in Android Studio on Windows.我在 Windows 上的 Android Studio 中编写。 And I use OpenCV in my native c++ code.When calling the function, I get this error in logcat:我在我的本机 C++ 代码中使用 OpenCV。调用该函数时,我在 logcat 中收到此错误:

"OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /Volumes/Linux/builds/master_pack-android/opencv/modules/highgui/src/window.cpp, line 545". "OpenCV Error: Unspecified error (该函数没有实现。用Windows、GTK+ 2.x或Carbon支持重建库。如果你在Ubuntu或Debian上,安装libgtk2.0-dev和pkg-config,然后重新运行cmake 或配置脚本)在 cvShowImage,文件 /Volumes/Linux/builds/master_pack-android/opencv/modules/highgui/src/window.cpp,第 545 行”。

I found different instructions how to do it in LInux but not any for Windows.我发现了如何在 Linux 中执行此操作的不同说明,但在 Windows 中没有任何说明。 Who knows how can I solve this problem?谁知道我该如何解决这个问题?

The error means, that I cannot use opencv's gui / windowing functions on android, since window functions work much different there, than on a desktop pc.该错误意味着,我无法在 android 上使用 opencv 的 gui / 窗口功能,因为窗口功能在那里的工作方式与在台式机上有很大不同。

This means, that I cannot use imshow() namedWindow() createTrackBar() or waitKey() , but have to use the native android equivalent这意味着,我不能使用 imshow() namedWindow() createTrackBar() 或 waitKey() ,但必须使用本机android等价物

(it's neither a windows, not a linux problem, and recompiling won't change it) (它既不是 Windows 问题,也不是 linux 问题,重新编译不会改变它)

Most likely it is that your library (build from NDK-Build) built wrongly or doesn't exist.很可能是您的库(从 NDK-Build 构建)构建错误或不存在。 Therefore, whichever OpenCV C++ Library you are accessing does not exist.因此,您访问的任何 OpenCV C++ 库都不存在。

You will need to JAVAH your java files (whichever that will be having Native C++) code and then NDK-Build the generated CPP files.您将需要 JAVAH 您的 java 文件(无论哪个将具有本机 C++)代码,然后 NDK-Build 生成的 CPP 文件。

Of course, you will require a custom Android.MK and Application.MK which OpenCV documents it at their official website at here!当然,你需要一个自定义的 Android.MK 和 Application.MK,OpenCV 在他们的官方网站上记录了它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM