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

852 views Asked by At

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?

2

There are 2 answers

0
imported_lis On BEST ANSWER

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
Meaniegy On

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!