I would like to write a function in JNI like this:
JNIEXPORT jobject JNICALL Java_com_datumdroid_android_ocr_simple_HoughLine_nativeDetectLine
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 ...
}