Pass and return OpenCv Mat object with JNI

前端 未结 1 1111
粉色の甜心
粉色の甜心 2021-01-29 05:37

I would like to write a function in JNI like this:

JNIEXPORT jobject JNICALL Java_com_datumdroid_android_ocr_simple_HoughLine_nativeDetectLine

相关标签:
1条回答
  • 2021-01-29 05:49

    http://answers.opencv.org/question/12271/can-the-java-interface-pass-a-mat-to-opencvs-c/

    JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial2_Tutorial2Activity_FindFeatures(JNIEnv*, jobject, jlong  addrGray, jlong addrRgba)
    {
        Mat& mGr  = *(Mat*)addrGray;
        Mat& mRgb = *(Mat*)addrRgba;
        ... do stuff with the Mat objects ...
    }
    
    0 讨论(0)
提交回复
热议问题