Created
June 12, 2022 10:23
-
-
Save jason9075/9fdd241fc8da0e0c882a80fa1a3bc2e3 to your computer and use it in GitHub Desktop.
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 jobject JNICALL | |
Java_com_jason9075_myopencv_NativeLib_getInfo(JNIEnv *env, jobject thiz, jobject bitmap) { | |
Mat src; | |
bitmapToMat(env, bitmap, src, false); | |
int width = src.cols; | |
int height = src.rows; | |
// return java object | |
const char *clsPath = "com/jason9075/myopencv/ImageInfo"; | |
jclass cls = env->FindClass(clsPath); | |
jmethodID constructor = env->GetMethodID(cls, "<init>", "(II)V"); | |
return env->NewObject(cls, constructor, width, height); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment