Giter Site home page Giter Site logo

Comments (5)

beraldofilippo avatar beraldofilippo commented on September 28, 2024 2

That's exactly the way JNI declarations work, if you place it into com.my.package make sure to change the declaration to Java_com_my_package_ImageUtils_convertYUV420ToARGB8888 and recompile the libs to get a working .so file.
Actually I don't think it as of being hacky, that's the (hacky) way the JNI works. :)

from dlib-android.

beraldofilippo avatar beraldofilippo commented on September 28, 2024

You should post at least the error it gives, not much I can guess from your quick description.
The only thing I can recall now is that the JNI declaration of the methods is dependent from the package, so if for example if you've changed the package you should change it accordingly into the declaration.

I remeber it gave me some headaches when I modified it.

Also, remember that everything in the project is compiled into the libpeople_det.so, as for the Android.mk file

from dlib-android.

gerardsimons avatar gerardsimons commented on September 28, 2024

Hey, thanks for your quick reply. Sorry, here is a trace for the error :

10-31 15:03:39.205 23259-23376/com.qualogy.faceverificationapp E/art: No implementation found for void com.qualogy.faceverificationapp.ImageUtils.convertYUV420ToARGB8888(byte[], byte[], byte[], int[], int, int, int, int, int, boolean) (tried Java_com_qualogy_faceverificationapp_ImageUtils_convertYUV420ToARGB8888 and Java_com_qualogy_faceverificationapp_ImageUtils_convertYUV420ToARGB8888___3B_3B_3B_3IIIIIIZ)
10-31 15:03:39.206 23259-23376/com.qualogy.faceverificationapp E/AndroidRuntime: FATAL EXCEPTION: ImageListener
                                                                                 Process: com.qualogy.faceverificationapp, PID: 23259
                                                                                 java.lang.UnsatisfiedLinkError: No implementation found for void com.qualogy.faceverificationapp.ImageUtils.convertYUV420ToARGB8888(byte[], byte[], byte[], int[], int, int, int, int, int, boolean) (tried Java_com_qualogy_faceverificationapp_ImageUtils_convertYUV420ToARGB8888 and Java_com_qualogy_faceverificationapp_ImageUtils_convertYUV420ToARGB8888___3B_3B_3B_3IIIIIIZ)
                                                                                     at com.qualogy.faceverificationapp.ImageUtils.convertYUV420ToARGB8888(Native Method)
                                                                                     at com.qualogy.faceverificationapp.OnGetImageListener.onImageAvailable(OnGetImageListener.java:308)
                                                                                     at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:648)
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                     at android.os.Looper.loop(Looper.java:148)
                                                                                     at android.os.HandlerThread.run(HandlerThread.java:61)

Your comments were useful. I am guessing that my project should either have the same package name (which I don't really like) or I should include the project directly rather than relying on the Maven repository? Or is there a way to call the methods with an explicit full method name from JNI (rather than relying on the package based prefix?)

BTW, I did an objdump of the so file, and indeed there is a symbol like this :

00000000000ce6b4 g    DF .text  00000000000001c8  Base        Java_com_tzutalin_dlibtest_ImageUtils_convertYUV420ToARGB8888

from dlib-android.

gerardsimons avatar gerardsimons commented on September 28, 2024

Oh, it already works if you just place ImageUtils in a com.tzutalin.dlibtest package, which is not so bad! Still if any other, less hacky solutions exist, I would love to know. Thanks again.

from dlib-android.

gerardsimons avatar gerardsimons commented on September 28, 2024

Haha, you are probably right. Thanks for your help @beraldofilippo !

from dlib-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.