This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NativeLib { | |
static { | |
System.loadLibrary("myopencv"); | |
} | |
public native String stringFromJNI(); | |
public native void toGrey(Bitmap bitmapIn, Bitmap bitmapOut); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern "C" JNIEXPORT void JNICALL | |
Java_com_jason9075_myopencv_NativeLib_toGrey( | |
JNIEnv *env, | |
jobject, | |
jobject bitmapIn, | |
jobject bitmapOut) { | |
Mat src, greyOut; | |
bitmapToMat(env, bitmapIn, src, false); | |
cvtColor(src, greyOut, CV_BGR2GRAY); | |
matToBitmap(env, greyOut, bitmapOut, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.18.1) | |
set(OpenCV_DIR "/home/jason9075/Documents/OpenCV-android-sdk/sdk/native/jni") | |
find_package(OpenCV REQUIRED) | |
project("myopencv") | |
add_library(myopencv | |
SHARED |
NewerOlder