jniwrapper

Issue with writing FaceRecognizer for Java with OpenCV 2.4.8

痴心易碎 提交于 2020-01-06 10:52:09
问题 I have been given a project based around face recognition written in JavaCV to be improved. The idea was to either rewrite the program using C++ or write JNI bindings to still use Java. I did some research and according to the official website OpenCV as of version 2.4.4 has bindings for Java and Python. And so, since the official website stated so I decided to go with it. Please note I haven't programmed in C++ before nor have I written any JNI wrappers in the past. If the official website

FFmpeg: java.lang.UnsatisfiedLinkError while calling Runnable class

时光毁灭记忆、已成空白 提交于 2019-12-25 06:32:09
问题 I need to take a picture file and an audio file and create a video. I know that it's possible to do with the help of Runtime.getRuntime().exec("ffmpeg -i image.jpeg -i audio.mp3 out.avi") but only for rooted devices, so I've tried to create JNI wrapper for main() from ffmpeg.c and call it from my Activity like here: http://demo860.blogspot.com/2010/07/android-ffmpeg-dynamic-module-jni.html 1.This code is in ffmpeg.c : int m_argc = 0; char *m_pargv [30]; int dynamic_ffpmeg_main (int argc, char

JNI in C++ to read file to jbyteArray

江枫思渺然 提交于 2019-11-30 09:26:32
问题 I am writing a C++ program in UNIX to generate a shared library which will be called in java using JNI. This C++ program has to read a file in UNIX box then it will have to be converted into jbyteArray (JNI data type) so that JAVA can use it. I read the file in C++ into char* but could not convert into jbyteArray . Please help it. Code is below:: #include <iostream> #include <fstream> #include <stdio.h> #include "com_sp_dll_NativeMethods.h" // this header file was generated by java using