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

 ̄綄美尐妖づ 提交于 2021-02-16 20:46:09

问题


I write in Android Studio on Windows. And I use OpenCV in my native c++ code.When calling the function, I get this error in 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".

I found different instructions how to do it in LInux but not any for Windows. Who knows how can I solve this problem?


回答1:


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.

This means, that I cannot use imshow() namedWindow() createTrackBar() or waitKey() , but have to use the native android equivalent

(it's neither a windows, not a linux problem, and recompiling won't change it)




回答2:


Most likely it is that your library (build from NDK-Build) built wrongly or doesn't exist. Therefore, whichever OpenCV C++ Library you are accessing does not exist.

You will need to JAVAH your java files (whichever that will be having Native C++) code and then NDK-Build the generated CPP files.

Of course, you will require a custom Android.MK and Application.MK which OpenCV documents it at their official website at here!



来源:https://stackoverflow.com/questions/35080770/android-studio-opencv-ndk-unspecified-error-the-function-is-not-implemented

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!